iPerl ST component, symbol IPERLST_SPECIAL, etc. added to the project, ver. 2.4.260.

This commit is contained in:
Milan Hanajik 2016-04-07 15:37:49 +02:00
parent e94443ad8a
commit f901367817
23 changed files with 136 additions and 60 deletions

View File

@ -32,8 +32,12 @@ namespace Config
public const int WMsCount = 40;
public const int LineSize = 20;
public const int CompoundWMsCount = 1;
#elif IPERLST_SPECIAL
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
#endif
public static int MaxPartNr()
public static int MaxPartNr()
{
return Math.Max(WMsCount / LineSize, CompoundWMsCount);
}

View File

@ -19,7 +19,7 @@ namespace Results.Entities
public virtual double QRise { get; set; } ///![m3/h] detected Q_rise of a composed meter
public virtual double QFall { get; set; } ///![m3/h] detected Q_fall of a composed meter
public virtual bool Passed { get; set; }
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
public virtual double OrigCalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
@ -33,7 +33,7 @@ namespace Results.Entities
public virtual int Pruefindex { get; set; } /// Not mapped to DB !!! 0=unknown (saving to Oracle failed), >=1 ... pruefindex
public virtual int HydrPruefung { get; set; } /// Not mapped to DB !!!
#endif
public virtual WaterMeterData WaterMeterData { get; set; }
public virtual WaterMeterData WaterMeterData { get; set; }
public virtual Batch Batch { get; set; }
public virtual IList<MeterTestRslt> MeterTestRslts { get; set; }
@ -122,10 +122,10 @@ namespace Results.Entities
public override string ToString()
{
StringBuilder sb = new StringBuilder(80);
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
sb.AppendFormat("PCB:{0} S/N:{1} ", SerialNr, SerialNrEx);
#else
sb.AppendFormat("S/N:{0} ", SerialNr);
sb.AppendFormat("S/N:{0} ", SerialNr);
#endif
foreach (var tr in MeterTestRslts) sb.AppendFormat(" {0}:{1}%", tr.Name(), tr.Error.ToString("F2"));

View File

@ -20,12 +20,12 @@ namespace Results.Entities
public virtual double Q2_Qt { get; set; } /// [m3/h]
public virtual double Q1_Qmin { get; set; } /// [m3/h]
public virtual bool Compound { get; set; }
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
public virtual int WMTypeId { get; set; }
public virtual int WMTypeRev { get; set; }
#endif
public WaterMeterData()
public WaterMeterData()
{
}
@ -47,11 +47,11 @@ namespace Results.Entities
if (Q2_Qt != wmd.Q2_Qt) return false;
if (Q1_Qmin != wmd.Q1_Qmin) return false;
if (Compound != wmd.Compound) return false;
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
if (WMTypeId != wmd.WMTypeId) return false;
if (WMTypeRev != wmd.WMTypeRev) return false;
#endif
return true;
return true;
}

View File

@ -21,10 +21,10 @@ namespace Results.Mappings
Map(x => x.Q2_Qt);
Map(x => x.Q1_Qmin);
Map(x => x.Compound);
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
Map(x => x.WMTypeId);
Map(x => x.WMTypeRev);
#endif
}
}
}
}

View File

@ -21,7 +21,7 @@ namespace Results.Mappings
Map(x => x.QRise);
Map(x => x.QFall);
Map(x => x.Passed);
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
Map(x => x.SerialNrEx);
Map(x => x.OrigCalibFactor);
Map(x => x.CalibFactor);
@ -33,7 +33,7 @@ namespace Results.Mappings
Map(x => x.Hz2CorrectionDone);
Map(x => x.Hz2Correction);
#endif
References(x => x.WaterMeterData);
References(x => x.WaterMeterData);
References(x => x.Batch);
HasMany(x => x.MeterTestRslts)
.Cascade.All();

View File

@ -246,8 +246,8 @@ namespace ResultsBrowser
private void addOracleDataButton_Click(object sender, EventArgs e)
{
#if IPERLST
{
#if IPERLST || IPERLST_SPECIAL
if (ReportWaterMeters.Count == 0) return;
/// Oracle database connection
@ -294,7 +294,7 @@ namespace ResultsBrowser
RedrawLists();
#endif
}
}
/// <summary>
@ -324,10 +324,10 @@ namespace ResultsBrowser
{
StringBuilder sb = new StringBuilder();
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
sb.Append(wm.SerialNrEx);
#else
sb.Append(wm.SerialNr);
sb.Append(wm.SerialNr);
#endif
sb.Append(';'); sb.Append(wm.ProductName());
sb.Append(';'); sb.Append(wm.ApprovalInfo());
@ -391,10 +391,10 @@ namespace ResultsBrowser
{
StringBuilder sb = new StringBuilder();
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
sb.Append(wm.SerialNrEx);
#else
sb.Append(wm.SerialNr);
sb.Append(wm.SerialNr);
#endif
sb.Append(";\""); sb.Append(wm.SerialNr); sb.Append('"'); /// PCB number
sb.Append(";\""); sb.Append(wm.ProcedureName()); sb.Append('"'); /// Procedure name

View File

@ -138,12 +138,12 @@ namespace ResultsBrowser
{
/// Open the main application window
log.Info("Creating the main window");
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
MainWnd = new MainWnd();
log.Info("Opening the main window");
Application.Run(MainWnd);
#else
RBrowserWnd = new RBrowserWnd();
RBrowserWnd = new RBrowserWnd();
log.Info("Opening the main window");
Application.Run(RBrowserWnd);
#endif

View File

@ -226,7 +226,7 @@ namespace TBF.BenchControl.DB.SensusOracle
if (batch.WaterMeters.Count == 0) return Event.ResultsWritten;
bool anyError = false;
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
if (DBCfg.DebugLevel != DebugMode.Simulate)
{
if (WriteResultsToDatabase(connection, batch, false) == Retv.Error) anyError = true;
@ -460,8 +460,8 @@ namespace TBF.BenchControl.DB.SensusOracle
public static Retv WriteLogsToDisk(StreamWriter logger, Results.Entities.Batch batch)
{
#if IPERLST
{
#if IPERLST || IPERLST_SPECIAL
if (logger == null) return Retv.Error;
Results.Entities.WaterMeter wm0 = null;
@ -959,10 +959,10 @@ namespace TBF.BenchControl.DB.SensusOracle
}
#endif
return Retv.OK; /// OK
}
}
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
public static Retv WriteResultsToDatabase(OracleConnection conn, Results.Entities.Batch batch, bool safeMode)
{
OracleTransaction transaction = null;
@ -1238,5 +1238,5 @@ namespace TBF.BenchControl.DB.SensusOracle
return retv;
}
#endif
}
}
}

View File

@ -236,7 +236,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
WaterMeters.iPerl.WaterMeter iPerl = Sequences.SequenceBase.WaterMeters[wm.WMPosition - 1] as WaterMeters.iPerl.WaterMeter;
if (iPerl != null)
{
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
wm.OrigCalibFactor = iPerl.OriginalCalibFactor;
wm.CalibFactor = iPerl.CalibrationFactor;
wm.Q2ErrWOCorrection = iPerl.Q2ErrorWOCorrection;

View File

@ -16,7 +16,7 @@ namespace TBF.BenchControl.Elde
ResetShapesOfPulses = 8,
}
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || IPERLST || BADGER_VELKA_TRAT || PUCHONG_PT200
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || IPERLST || IPERLST_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_PT200
public enum StatusP : ulong
{
RefFlowMeterMask = 0x7,
@ -43,7 +43,7 @@ namespace TBF.BenchControl.Elde
ErrorPressMeter4 = 0x8000000000000,
}
#else // DN100 || MUNICH || FUZHOU150 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40
public enum StatusP : ulong
public enum StatusP : ulong
{
RefFlowMeterMask = 0x7,
TestInProgress = 0x8,

View File

@ -122,8 +122,8 @@ namespace TBF.BenchControl.Elde
// Array length is the reference flowmeters count plus one
#if DN100 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || IPERLST || MURES_PT40 || FUZHOU_40
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || IPERLST || IPERLST_SPECIAL || MURES_PT40 || FUZHOU_40
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
#elif BADGER_VELKA_TRAT
public float[] EtCalib = new float[8] { 1, 1, 1, 1, 1, 1, 1, 1 };
#endif

View File

@ -54,11 +54,11 @@ namespace TBF.BenchControl.Elde
public ulong DigitalInputs { get { return (ulong)ctrlBrdComponent.Vstupy; } }
public float AnalogInput(int adcNr0) { return ctrlBrdComponent.Analogy[adcNr0]; }
public uint AnalogInputRaw(int adcNr0, int bank) { return ctrlBrdComponent.AnalogyRaw[adcNr0, bank]; } /// bank0=RV, bank1=Temp
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
public float TotalRefVolume { get { return ctrlBrdComponent.ReferenceVolume[0]; } }
public float MassRefVolume { get { return ctrlBrdComponent.ReferenceVolume[1]; } }
#else
public float TotalRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
public float TotalRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
public float MassRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
#endif
public float VyslExt(int wmNr0, int what) { return ctrlBrdComponent.VyslExt[wmNr0, what]; }
@ -287,7 +287,7 @@ namespace TBF.BenchControl.Elde
#if DN100 || MUNICH
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
filterConstant, fmFreq[0], (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif IPERLST
#elif IPERLST || IPERLST_SPECIAL
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
filterConstant, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);

View File

@ -97,10 +97,10 @@ namespace TBF.BenchControl.Elde
public void Start()
{
controlBoard.SyncRoute();
#if IPERLST || BADGER_VELKA_TRAT
#if IPERLST || IPERLST_SPECIAL || BADGER_VELKA_TRAT
int flowMeterIdxAndDiv = flowMeterNr + 16 * diverterNr;
#else
int flowMeterIdxAndDiv = flowMeterNr;
int flowMeterIdxAndDiv = flowMeterNr;
#endif
controlBoard.SendCommand(Command.Start, flowMeterIdxAndDiv, controlBoard.Route,

View File

@ -266,7 +266,7 @@ namespace TBF.BenchControl.Sequences
Qn = WaterMeters[i].Qn,
Compound = compound,
};
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
BenchControl.WaterMeters.iPerl.WaterMeter iPerl = WaterMeters[i] as BenchControl.WaterMeters.iPerl.WaterMeter;
if (iPerl != null)
{

View File

@ -717,19 +717,19 @@ namespace TBF.BenchControl.Sequences
sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// WM Vmer - objem namerany vodomerom
sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// WM Vref - objem namerany stanicou
sb.Append(";"); sb.Append(mtrRslt.Error); /// WM Emt - chyba vodomerom nameraneho objemu
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
sb.Append(";"); sb.Append(ProcessData.BatchRslts.WaterMeters[i].CalibFactor); /// iPerl calibration factor used during the test / ...
#else
sb.Append(";"); sb.Append(" "); /// nechat prazdne
sb.Append(";"); sb.Append(" "); /// nechat prazdne
#endif
sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla
sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
sb.Append(";"); sb.Append(mtrRslt.TestTime); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
sb.Append(";"); sb.Append(mtrRslt.Passed ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
sb.Append(";"); sb.Append(mtrRslt.WaterMeter.Q2Correction.ToString("F1")); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
#else
sb.Append(";"); sb.Append(" "); /// nechat prazdne
sb.Append(";"); sb.Append(" "); /// nechat prazdne
#endif
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
sb.Append(";"); sb.Append(mtrRslt.TimestampStart); /// WM Time_start - ' ' -

View File

@ -53,12 +53,12 @@ namespace TBF.BenchControl
public static IList<IValve> CoupledValves; /// list of coupled valves
public static IList<Elde.ValveEx.Valve> ExtendedValves; /// list of extended valves
/// Time and synchronization
#if IPERLST
/// Time and synchronization
#if IPERLST || IPERLST_SPECIAL
public const int Period = 2; /// State machine period in sec.
#else
public const int Period = 1; /// State machine period in sec.
#else
public const int Period = 1; /// State machine period in sec.
#endif
static DateTime startDateTime; /// DateTime of time instance when the state machine worker thread starts

View File

@ -424,6 +424,49 @@ namespace TBF.BenchControl
const ulong EmptyValve1 = VB1;
const ulong EmptyValve2 = VB2;
const ulong Path1 = VI1;
const ulong Path2 = VI2;
const ulong Path3 = VI3;
const ulong Path4 = VI4;
const ulong Path5 = VI5;
const ulong Path6 = VI6;
#elif IPERLST_SPECIAL
const ulong VL11 = (1L << 0);
const ulong VL13 = (1L << 1);
const ulong VL15 = (1L << 2);
const ulong VL21 = (1L << 3);
const ulong VL23 = (1L << 4);
const ulong VL18 = (1L << 5);
const ulong VL28 = (1L << 6);
const ulong VZ5 = (1L << 7);
const ulong VZ6 = (1L << 8);
const ulong DIV1 = (1L << 9);
const ulong DIV2 = (1L << 10);
const ulong P1 = (1L << 11);
const ulong P2 = (1L << 12);
const ulong P3 = (1L << 13);
const ulong DIV3 = (1L << 14);
const ulong rez1 = (1L << 15);
const ulong nic1 = (1L << 16);
const ulong nic2 = (1L << 17);
const ulong VI1 = (1L << 18);
const ulong VI2 = (1L << 19);
const ulong VI3 = (1L << 20);
const ulong VI4 = (1L << 21);
const ulong VI5 = (1L << 22);
const ulong VB1 = (1L << 23);
const ulong VV12 = (1L << 24);
const ulong VV22 = (1L << 25);
const ulong VI6 = (1L << 26);
const ulong VV3 = (1L << 27);
const ulong VB2 = (1L << 28);
const ulong EmptyValve1 = VB1;
const ulong EmptyValve2 = VB2;
const ulong Path1 = VI1;
const ulong Path2 = VI2;
const ulong Path3 = VI3;
@ -448,7 +491,7 @@ namespace TBF.BenchControl
const ulong Path4 = 0;
const ulong Path5 = 0;
#endif
/// <summary>Run this device</summary>
/// <summary>Run this device</summary>
public static void RunDevice(int regulValveNo, int refFlowmtrNo, Elde.StatusP statusP)
{
TestBenchSim.regulValveNo = regulValveNo;
@ -508,12 +551,19 @@ namespace TBF.BenchControl
if (Div2sim && (RouteSim & Path4) == Path4) Mass1sim += DiffKg(Flow4sim, time);
if (Div2sim && (RouteSim & Path5) == Path5) Mass1sim += DiffKg(Flow5sim, time);
if (Div3sim && (RouteSim & Path6) == Path6) Mass2sim += DiffKg(Flow4sim, time);
#elif IPERLST_SPECIAL
if (Div1sim && (RouteSim & Path1) == Path1) Mass1sim += DiffKg(Flow1sim, time);
if (Div1sim && (RouteSim & Path2) == Path2) Mass1sim += DiffKg(Flow2sim, time);
if (Div1sim && (RouteSim & Path3) == Path3) Mass1sim += DiffKg(Flow3sim, time);
if (Div2sim && (RouteSim & Path4) == Path4) Mass1sim += DiffKg(Flow4sim, time);
if (Div2sim && (RouteSim & Path5) == Path5) Mass1sim += DiffKg(Flow5sim, time);
if (Div3sim && (RouteSim & Path6) == Path6) Mass2sim += DiffKg(Flow4sim, time);
#else
if (Div1sim && (RouteSim & Path1) == Path1) Mass1sim += DiffKg(Flow1sim, time);
if (Div2sim && (RouteSim & Path2) == Path2) Mass2sim += DiffKg(Flow2sim, time);
#endif
if ((RouteSim & EmptyValve1) == EmptyValve1) Mass1sim -= DiffKg(100.0f, time);
if ((RouteSim & EmptyValve1) == EmptyValve1) Mass1sim -= DiffKg(100.0f, time);
if (Mass1sim < 0) Mass1sim = 0;
if ((RouteSim & EmptyValve2) == EmptyValve2) Mass2sim -= DiffKg(10.0f, time);
@ -663,6 +713,25 @@ namespace TBF.BenchControl
if (toTank) { throw (new Exception()); }
break;
}
#elif IPERLST_SPECIAL
switch (regulValveNo)
{
case 1:
case 2:
case 3:
Div1sim = toTank;
break;
case 4:
case 5:
Div2sim = toTank;
break;
case 6:
Div3sim = toTank;
break;
default:
if (toTank) { throw (new Exception()); }
break;
}
#else
switch (regulValveNo)
{
@ -673,7 +742,7 @@ namespace TBF.BenchControl
break;
}
#endif
return;
return;
}

View File

@ -295,7 +295,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
meterRslt.VolumeMeter = Math.Abs(iPerl.VolumeLtrEnd - iPerl.VolumeLtrStart);
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
iPerl.VolumeLtrRef = meterRslt.VolumeRef;
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
meterRslt.WaterMeter.CalibFactor = (iPerl.CalibrationStruct != null) ? iPerl.CalibrationStruct.Calibration : 0;
meterRslt.WaterMeter.Q2Correction = iPerl.Q2CorrectionFactor;
#endif

View File

@ -525,11 +525,11 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
meterRslt.VolumeMeter = Math.Abs(iPerl.VolumeLtrEnd - iPerl.VolumeLtrStart);
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
iPerl.VolumeLtrRef = meterRslt.VolumeRef;
#if IPERLST
#if IPERLST || IPERLST_SPECIAL
meterRslt.WaterMeter.CalibFactor = (iPerl.CalibrationStruct != null) ? iPerl.CalibrationStruct.Calibration : 0;
meterRslt.WaterMeter.Q2Correction = iPerl.Q2CorrectionFactor;
#endif
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
iPerl.LastTestResult2 = iPerl.LastTestResult; /// Save shift previous test result
iPerl.LastTestResult = meterRslt; /// Save this test result
iPerl.NominalTestFlow = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
}

View File

@ -77,8 +77,8 @@ namespace TBF.Forms
foreach (var b in batches)
{
if (b.BatchNr == data.BatchNr)
{
#if IPERLST
{
#if IPERLST || IPERLST_SPECIAL
//System.IO.StreamWriter logger;
//string fname = "C:\\TBF\\Logs\\test.log";
//try { logger = new System.IO.StreamWriter(System.IO.File.Create(fname)); }
@ -109,7 +109,7 @@ namespace TBF.Forms
MessageBoxIcon.Error);
}
#endif
}
}
}
}

View File

@ -650,9 +650,12 @@ namespace TBF
#elif IPERLST
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
private TBF.Screens.ProcessTabPageCtrl48 processTabPageCtrl;
#elif IPERLST_SPECIAL
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
private TBF.Screens.ProcessTabPageCtrl6 processTabPageCtrl;
#endif
private System.Windows.Forms.ToolStripMenuItem benchTSMenuItem;
private System.Windows.Forms.ToolStripMenuItem benchTSMenuItem;
private System.Windows.Forms.ToolStripMenuItem homeTSMenuItem;
private System.Windows.Forms.ToolStripMenuItem resultsTSMenuItem;
private System.Windows.Forms.ToolStripMenuItem logsTSMenuItem;

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.5.259.1")]
[assembly: AssemblyFileVersion("2.5.259.1")]
[assembly: AssemblyVersion("2.5.260.1")]
[assembly: AssemblyFileVersion("2.5.260.1")]