All entry forms modified to use Result.Entities.WaterMeter, EndStateAux introduced. TODO: display, saving, printing.
This commit is contained in:
parent
e14dc37060
commit
d91ca4b56b
@ -12,19 +12,19 @@ namespace Results.Entities
|
||||
public virtual string SerialNr { get; set; } /// Main s/n for compound meters, PCB Number for iPerl water meter
|
||||
public virtual string SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
|
||||
public virtual string PurchaseOrder { get; set; }
|
||||
public virtual int WMPosition { get; set; }
|
||||
public virtual string EndState { get; set; }
|
||||
public virtual int YearOfProduction { get; set; }
|
||||
public virtual int WMPosition { get; set; }
|
||||
public virtual string EndState { get; set; } /// End state (of the main water meter)
|
||||
public virtual string EndStateAux { get; set; } /// End state of the auxiliary water meter
|
||||
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 int YearOfProduction { get; set; }
|
||||
public virtual bool Passed { get; set; }
|
||||
public virtual bool Passed { get; set; }
|
||||
#if IPERLST
|
||||
public virtual double OrigCalibFactor { get; set; } /// iPerl calibration factor used during the test - Not mapped to DB !!!
|
||||
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test - Not mapped to DB !!!
|
||||
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
||||
public virtual double Q2Correction { get; set; } /// iPerl Q2 correction used during the test - Not mapped to DB !!!
|
||||
#endif
|
||||
|
||||
public virtual WaterMeterData WaterMeterData { get; set; }
|
||||
public virtual Batch Batch { get; set; }
|
||||
public virtual IList<MeterTestRslt> MeterTestRslts { get; set; }
|
||||
@ -50,6 +50,12 @@ namespace Results.Entities
|
||||
public virtual DateTime StartTime() { return Batch.StartTime; }
|
||||
public virtual DateTime EndTime() { return Batch.EndTime; }
|
||||
|
||||
///
|
||||
/// Not mapped to the database
|
||||
///
|
||||
public virtual bool Disabled { get; set; } /// true = Disabled water meters (not saved into DB)
|
||||
|
||||
|
||||
public virtual MeterTestRslt MeterTestRslt(string testName)
|
||||
{
|
||||
foreach (var tr in MeterTestRslts)
|
||||
|
||||
@ -14,11 +14,12 @@ namespace Results.Mappings
|
||||
Map(x => x.SerialNr);
|
||||
Map(x => x.SerialNrEx);
|
||||
Map(x => x.PurchaseOrder);
|
||||
Map(x => x.YearOfProduction);
|
||||
Map(x => x.WMPosition);
|
||||
Map(x => x.EndState);
|
||||
Map(x => x.EndStateAux);
|
||||
Map(x => x.QRise);
|
||||
Map(x => x.QFall);
|
||||
Map(x => x.YearOfProduction);
|
||||
Map(x => x.Passed);
|
||||
#if IPERLST
|
||||
Map(x => x.OrigCalibFactor);
|
||||
|
||||
@ -47,9 +47,9 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
double errLimLo;
|
||||
double errLimHi;
|
||||
|
||||
bool resultSaved;
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<IWaterMeter> waterMeters;
|
||||
Results.Entities.WaterMeter[] waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
@ -83,20 +83,20 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleEndFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleEnd;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -142,14 +142,14 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
///
|
||||
void OpenTestEndStatesDlg(EntryForm myRef)
|
||||
{
|
||||
string[] mainStartSateStr = new string[Config.Data.CompoundWMsCount];
|
||||
string[] auxStartSateStr = new string[Config.Data.CompoundWMsCount];
|
||||
string[] mainStartStateStr = new string[Config.Data.CompoundWMsCount];
|
||||
string[] auxStartStateStr = new string[Config.Data.CompoundWMsCount];
|
||||
for (int i = 0; i < Config.Data.CompoundWMsCount; i++)
|
||||
{
|
||||
mainStartSateStr[i] = wmStartStateStr[2 * i];
|
||||
auxStartSateStr[i] = wmStartStateStr[2 * i + 1];
|
||||
mainStartStateStr[i] = wmStartStateStr[2 * i];
|
||||
auxStartStateStr[i] = wmStartStateStr[2 * i + 1];
|
||||
}
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.CompoundWMsCount, mainStartSateStr, auxStartSateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
myRef.modelessDlg = new TestStartEndForm(Config.Data.CompoundWMsCount, mainStartStateStr, auxStartStateStr, disabled, refVolume, errLimLo, errLimHi);
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
@ -196,13 +196,13 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
{
|
||||
purchaseOrder = dlg.PurchaseOrder;
|
||||
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Count / 2); i++)
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length / 2); i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
serialNr[2 * i] = waterMeters[2 * i].SerialNr = dlg.MainSNText[i];
|
||||
serialNr[2 * i + 1] = waterMeters[2 * i + 1].SerialNr = dlg.AuxSNText[i];
|
||||
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
|
||||
serialNr[2 * i] = waterMeters[i].SerialNr = dlg.MainSNText[i];
|
||||
serialNr[2 * i + 1] = waterMeters[i].SerialNrEx = dlg.AuxSNText[i];
|
||||
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -269,21 +269,9 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="testResults">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<TestResult> testResults)
|
||||
public void UpdateTestResults(Results.BatchResults results)
|
||||
{
|
||||
foreach (var testRslt in testResults)
|
||||
{
|
||||
if (testRslt.MetersKind != MetersKind.Combined) continue;
|
||||
|
||||
testRslt.PurchaseOrder = PurchaseOrder;
|
||||
|
||||
for (int i = 0; i < testRslt.Meters.Count; i++)
|
||||
{
|
||||
testRslt.Meters[i].SerialNr = SerialNr(i);
|
||||
testRslt.Meters[i].Disabled = Disabled(i);
|
||||
testRslt.Meters[i].EndState = WMCycleEndState(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Nothing to be done
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,9 +43,9 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
|
||||
bool resultSaved;
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<IWaterMeter> wMeters;
|
||||
Results.Entities.WaterMeter[] wMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
@ -73,20 +73,20 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.wMeters = waterMeters;
|
||||
this.wMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleEndFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleEnd;
|
||||
this.wMeters = waterMeters;
|
||||
this.wMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -142,21 +142,21 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
{
|
||||
if (modelessDlg is CycleBeginningForm)
|
||||
{
|
||||
if (wMeters.Count >= 2 && wMeters[0] != null) wMeters[0].SerialNr = (modelessDlg as CycleBeginningForm).MainSNText[0];
|
||||
if (wMeters.Count >= 2 && wMeters[1] != null) wMeters[1].SerialNr = (modelessDlg as CycleBeginningForm).AuxSNText[0];
|
||||
if (wMeters.Count >= 4 && wMeters[2] != null) wMeters[2].SerialNr = (modelessDlg as CycleBeginningForm).MainSNText[1];
|
||||
if (wMeters.Count >= 4 && wMeters[3] != null) wMeters[3].SerialNr = (modelessDlg as CycleBeginningForm).AuxSNText[1];
|
||||
if (wMeters.Count >= 6 && wMeters[4] != null) wMeters[4].SerialNr = (modelessDlg as CycleBeginningForm).MainSNText[2];
|
||||
if (wMeters.Count >= 6 && wMeters[5] != null) wMeters[5].SerialNr = (modelessDlg as CycleBeginningForm).AuxSNText[2];
|
||||
if (wMeters.Length >= 1 && wMeters[0] != null) wMeters[0].SerialNr = (modelessDlg as CycleBeginningForm).MainSNText[0];
|
||||
if (wMeters.Length >= 1 && wMeters[0] != null) wMeters[0].SerialNrEx = (modelessDlg as CycleBeginningForm).AuxSNText[0];
|
||||
if (wMeters.Length >= 2 && wMeters[1] != null) wMeters[1].SerialNr = (modelessDlg as CycleBeginningForm).MainSNText[1];
|
||||
if (wMeters.Length >= 2 && wMeters[1] != null) wMeters[1].SerialNrEx = (modelessDlg as CycleBeginningForm).AuxSNText[1];
|
||||
if (wMeters.Length >= 3 && wMeters[2] != null) wMeters[2].SerialNr = (modelessDlg as CycleBeginningForm).MainSNText[2];
|
||||
if (wMeters.Length >= 3 && wMeters[2] != null) wMeters[2].SerialNrEx = (modelessDlg as CycleBeginningForm).AuxSNText[2];
|
||||
}
|
||||
else if (modelessDlg is CycleEndForm)
|
||||
{
|
||||
if (wMeters.Count >= 2 && wMeters[0] != null) wMeters[0].EndState = (modelessDlg as CycleEndForm).MainStateText[0];
|
||||
if (wMeters.Count >= 2 && wMeters[1] != null) wMeters[1].EndState = (modelessDlg as CycleEndForm).AuxStateText[0];
|
||||
if (wMeters.Count >= 4 && wMeters[2] != null) wMeters[2].EndState = (modelessDlg as CycleEndForm).MainStateText[1];
|
||||
if (wMeters.Count >= 4 && wMeters[3] != null) wMeters[3].EndState = (modelessDlg as CycleEndForm).AuxStateText[1];
|
||||
if (wMeters.Count >= 6 && wMeters[4] != null) wMeters[4].EndState = (modelessDlg as CycleEndForm).MainStateText[2];
|
||||
if (wMeters.Count >= 6 && wMeters[5] != null) wMeters[5].EndState = (modelessDlg as CycleEndForm).AuxStateText[2];
|
||||
if (wMeters.Length >= 1 && wMeters[0] != null) wMeters[0].EndState = (modelessDlg as CycleEndForm).MainStateText[0];
|
||||
if (wMeters.Length >= 1 && wMeters[0] != null) wMeters[0].EndStateAux = (modelessDlg as CycleEndForm).AuxStateText[0];
|
||||
if (wMeters.Length >= 2 && wMeters[1] != null) wMeters[1].EndState = (modelessDlg as CycleEndForm).MainStateText[1];
|
||||
if (wMeters.Length >= 2 && wMeters[1] != null) wMeters[1].EndStateAux = (modelessDlg as CycleEndForm).AuxStateText[1];
|
||||
if (wMeters.Length >= 3 && wMeters[2] != null) wMeters[2].EndState = (modelessDlg as CycleEndForm).MainStateText[2];
|
||||
if (wMeters.Length >= 3 && wMeters[2] != null) wMeters[2].EndStateAux = (modelessDlg as CycleEndForm).AuxStateText[2];
|
||||
protocolTitle = (modelessDlg as CycleEndForm).ProtocolTitle;
|
||||
}
|
||||
resultSaved = true;
|
||||
@ -182,18 +182,9 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="results">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<TestResult> results)
|
||||
public void UpdateTestResults(Results.BatchResults results)
|
||||
{
|
||||
foreach (var test in results)
|
||||
{
|
||||
if (test.MetersKind != MetersKind.Combined) continue;
|
||||
|
||||
/// Todo: Generalize !!! Now implemented for Munich = one combined meter.
|
||||
test.Meters[0].SerialNr = waterMeters[0].SerialNr;
|
||||
test.Meters[0].EndState = waterMeters[0].EndState;
|
||||
test.Meters[1].SerialNr = waterMeters[1].SerialNr;
|
||||
test.Meters[1].EndState = waterMeters[1].EndState;
|
||||
}
|
||||
/// Nothing to be done
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
|
||||
bool resultSaved;
|
||||
|
||||
IList<IWaterMeter> waterMeters;
|
||||
Results.Entities.WaterMeter[] waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
@ -73,20 +73,20 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleEndFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleEnd;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
{
|
||||
CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm);
|
||||
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Count); i++)
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
@ -158,7 +158,7 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
|
||||
protocolTitle = dlg.ProtocolTitle;
|
||||
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Count); i++)
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
@ -189,19 +189,9 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="results">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<TestResult> results)
|
||||
{
|
||||
foreach (var test in results)
|
||||
{
|
||||
if (test.MetersKind != MetersKind.Single) continue;
|
||||
|
||||
int nrMtrsToUpdate = Math.Min(waterMeters.Count, test.Meters.Count);
|
||||
for (int i = 0; i < nrMtrsToUpdate; i++)
|
||||
{
|
||||
test.Meters[i].SerialNr = waterMeters[i].SerialNr;
|
||||
test.Meters[i].EndState = waterMeters[i].EndState;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void UpdateTestResults(Results.BatchResults results)
|
||||
{
|
||||
/// Nothing to be done
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,9 +47,9 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
double errLimLo;
|
||||
double errLimHi;
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<IWaterMeter> waterMeters; /// Passesd as an argument of ShowCycleBeginFormOp/ShowCycleEndFormOp constructor
|
||||
Results.Entities.WaterMeter[] waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
@ -83,20 +83,20 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleEndFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleEnd;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
{
|
||||
purchaseOrder = dlg.PurchaseOrder;
|
||||
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Count); i++)
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
@ -200,7 +200,7 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
else if (currentOp == CurrentOp.ShowFormAtCycleEnd)
|
||||
{
|
||||
CycleEndForm dlg = (modelessDlg as CycleEndForm);
|
||||
int count = waterMeters.Count;
|
||||
int count = waterMeters.Length;
|
||||
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
@ -260,21 +260,18 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="testResults">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<TestResult> testResults)
|
||||
{
|
||||
foreach (var testRslt in testResults)
|
||||
{
|
||||
if (testRslt.MetersKind != MetersKind.Single) continue;
|
||||
public void UpdateTestResults(Results.BatchResults results)
|
||||
{
|
||||
/// Nothing to be done
|
||||
|
||||
testRslt.PurchaseOrder = PurchaseOrder;
|
||||
//for (int i = 0; i < results.WMPositionsCount; i++)
|
||||
//{
|
||||
// if (results.Batch.WaterMeters[i] == null || results.Batch.WaterMeters[i].Compound()) continue;
|
||||
|
||||
for (int i = 0; i < testRslt.Meters.Count; i++)
|
||||
{
|
||||
testRslt.Meters[i].SerialNr = SerialNr(i);
|
||||
testRslt.Meters[i].Disabled = Disabled(i);
|
||||
testRslt.Meters[i].EndState = WMCycleEndState(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
// results.Batch.WaterMeters[i].SerialNr = SerialNr(i);
|
||||
// results.Batch.WaterMeters[i].Disabled = Disabled(i);
|
||||
// results.Batch.WaterMeters[i].EndState = WMCycleEndState(i);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,9 +47,9 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
double errLimLo;
|
||||
double errLimHi;
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<IWaterMeter> waterMeters; /// Passesd as an argument of ShowCycleBeginFormOp/ShowCycleEndFormOp constructor
|
||||
Results.Entities.WaterMeter[] waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
@ -83,20 +83,20 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleEndFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleEnd;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
purchaseOrder = dlg.PurchaseOrder;
|
||||
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Count); i++)
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
@ -201,7 +201,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
else if (currentOp == CurrentOp.ShowFormAtCycleEnd)
|
||||
{
|
||||
CycleEndForm dlg = (modelessDlg as CycleEndForm);
|
||||
int count = waterMeters.Count;
|
||||
int count = waterMeters.Length;
|
||||
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
@ -257,21 +257,18 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="testResults">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<TestResult> testResults)
|
||||
{
|
||||
foreach (var testRslt in testResults)
|
||||
{
|
||||
if (testRslt.MetersKind != MetersKind.Single) continue;
|
||||
public void UpdateTestResults(Results.BatchResults results)
|
||||
{
|
||||
/// Nothing to be done
|
||||
|
||||
testRslt.PurchaseOrder = PurchaseOrder;
|
||||
//for (int i = 0; i < results.WMPositionsCount; i++)
|
||||
//{
|
||||
// if (results.Batch.WaterMeters[i] == null || results.Batch.WaterMeters[i].Compound()) continue;
|
||||
|
||||
for (int i = 0; i < testRslt.Meters.Count; i++)
|
||||
{
|
||||
testRslt.Meters[i].SerialNr = SerialNr(i);
|
||||
testRslt.Meters[i].Disabled = Disabled(i);
|
||||
testRslt.Meters[i].EndState = WMCycleEndState(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
// results.Batch.WaterMeters[i].SerialNr = SerialNr(i);
|
||||
// results.Batch.WaterMeters[i].Disabled = Disabled(i);
|
||||
// results.Batch.WaterMeters[i].EndState = WMCycleEndState(i);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,9 +47,9 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
||||
double errLimLo;
|
||||
double errLimHi;
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<IWaterMeter> waterMeters; /// Passesd as an argument of ShowCycleBeginFormOp/ShowCycleEndFormOp constructor
|
||||
Results.Entities.WaterMeter[] waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
@ -83,20 +83,20 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleEndFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleEnd;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -257,21 +257,18 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="testResults">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<TestResult> testResults)
|
||||
{
|
||||
foreach (var testRslt in testResults)
|
||||
{
|
||||
if (testRslt.MetersKind != MetersKind.Single) continue;
|
||||
public void UpdateTestResults(Results.BatchResults results)
|
||||
{
|
||||
/// Nothing to be done
|
||||
|
||||
testRslt.PurchaseOrder = PurchaseOrder;
|
||||
//for (int i = 0; i < results.WMPositionsCount; i++)
|
||||
//{
|
||||
// if (results.Batch.WaterMeters[i] == null || results.Batch.WaterMeters[i].Compound()) continue;
|
||||
|
||||
for (int i = 0; i < testRslt.Meters.Count; i++)
|
||||
{
|
||||
testRslt.Meters[i].SerialNr = SerialNr(i);
|
||||
testRslt.Meters[i].Disabled = Disabled(i);
|
||||
testRslt.Meters[i].EndState = WMCycleEndState(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
// results.Batch.WaterMeters[i].SerialNr = SerialNr(i);
|
||||
// results.Batch.WaterMeters[i].Disabled = Disabled(i);
|
||||
// results.Batch.WaterMeters[i].EndState = WMCycleEndState(i);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,9 +47,9 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
double errLimLo;
|
||||
double errLimHi;
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<IWaterMeter> waterMeters; /// Passesd as an argument of ShowCycleBeginFormOp/ShowCycleEndFormOp constructor
|
||||
Results.Entities.WaterMeter[] waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
@ -83,20 +83,20 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleEndFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleEnd;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
purchaseOrder = dlg.PurchaseOrder;
|
||||
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Count); i++)
|
||||
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++)
|
||||
{
|
||||
if (waterMeters[i] != null)
|
||||
{
|
||||
@ -201,7 +201,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
else if (currentOp == CurrentOp.ShowFormAtCycleEnd)
|
||||
{
|
||||
CycleEndForm dlg = (modelessDlg as CycleEndForm);
|
||||
int count = waterMeters.Count;
|
||||
int count = waterMeters.Length;
|
||||
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
@ -257,21 +257,18 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="testResults">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<TestResult> testResults)
|
||||
{
|
||||
foreach (var testRslt in testResults)
|
||||
{
|
||||
if (testRslt.MetersKind != MetersKind.Single) continue;
|
||||
public void UpdateTestResults(Results.BatchResults results)
|
||||
{
|
||||
/// Nothing to be done
|
||||
|
||||
testRslt.PurchaseOrder = PurchaseOrder;
|
||||
//for (int i = 0; i < results.WMPositionsCount; i++)
|
||||
//{
|
||||
// if (results.Batch.WaterMeters[i] == null || results.Batch.WaterMeters[i].Compound()) continue;
|
||||
|
||||
for (int i = 0; i < testRslt.Meters.Count; i++)
|
||||
{
|
||||
testRslt.Meters[i].SerialNr = SerialNr(i);
|
||||
testRslt.Meters[i].Disabled = Disabled(i);
|
||||
testRslt.Meters[i].EndState = WMCycleEndState(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
// results.Batch.WaterMeters[i].SerialNr = SerialNr(i);
|
||||
// results.Batch.WaterMeters[i].Disabled = Disabled(i);
|
||||
// results.Batch.WaterMeters[i].EndState = WMCycleEndState(i);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ namespace TBF.BenchControl.DataEntry.WMStates
|
||||
}
|
||||
|
||||
/// <summary> Not supported </summary>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<TestResult> results)
|
||||
public void UpdateTestResults(Results.BatchResults results)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -47,9 +47,9 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
||||
double errLimLo;
|
||||
double errLimHi;
|
||||
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
bool resultSaved; /// Set in Run() when results are saved
|
||||
|
||||
IList<IWaterMeter> waterMeters; /// Passesd as an argument of ShowCycleBeginFormOp/ShowCycleEndFormOp constructor
|
||||
Results.Entities.WaterMeter[] waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
|
||||
|
||||
public enum CurrentOp
|
||||
{
|
||||
@ -83,20 +83,20 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleBeginFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleBeginning;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> waterMeters)
|
||||
public IOperation ShowCycleEndFormOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.ShowFormAtCycleEnd;
|
||||
this.waterMeters = waterMeters;
|
||||
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="testResults">Test results to be updated with the information</param>
|
||||
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<TestResult> testResults)
|
||||
public void UpdateTestResults(Results.BatchResults results)
|
||||
{
|
||||
foreach (var testRslt in testResults)
|
||||
{
|
||||
|
||||
@ -12,8 +12,7 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// <summary>
|
||||
/// Updates test results with the information collected in watermeters.
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes with information entered in the forms</param>
|
||||
/// <param name="results">Test results to be updated with the information</param>
|
||||
void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<TestResult> results);
|
||||
/// <param name="results">Results of a batch of water meters to be updated with information from forms</param>
|
||||
void UpdateTestResults(Results.BatchResults results);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
|
||||
@ -25,8 +25,7 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// <summary>
|
||||
/// Displays form at the beginning of the cycle (usually to enter S/N).
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes to be updated by the operation</param>
|
||||
/// <returns>Operation to be used in the sequence</returns>
|
||||
IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters);
|
||||
IOperation ShowCycleBeginFormOp();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
|
||||
@ -15,8 +15,7 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// <summary>
|
||||
/// Displays form at the end of the cycle (usually to enter the end state).
|
||||
/// </summary>
|
||||
/// <param name="waterMeters">Watermetes to be updated by the operation</param>
|
||||
/// <returns>Operation to be used in the sequence</returns>
|
||||
IOperation ShowCycleEndFormOp(IList<IWaterMeter> waterMeters);
|
||||
IOperation ShowCycleEndFormOp();
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,13 +12,10 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// <summary>
|
||||
/// Prints the test cycle results, Events: Event.ResultsPrinted
|
||||
/// </summary>
|
||||
/// <param name="results">Results to print</param>
|
||||
/// <param name="batchResults">Results to print</param>
|
||||
/// <param name="title">Title of the printed protocol</param>
|
||||
/// <returns>Reference to the operation</returns>
|
||||
IOperation PrintResultsOp(IBenchInfo benchInfo,
|
||||
IList<IWaterMeter> waterMeters,
|
||||
Procedure procedure,
|
||||
IList<TestResult> results,
|
||||
string title);
|
||||
IOperation PrintResultsOp(Results.BatchResults batchResults, string title);
|
||||
|
||||
/// <summary>
|
||||
/// When true printing at the end of cycle is bypassed.
|
||||
|
||||
@ -12,11 +12,7 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// <summary>
|
||||
/// Writes the test cycle results into a file, Events: Event.ResultsWritten
|
||||
/// </summary>
|
||||
/// <param name="results">Results to write into a file</param>
|
||||
/// <returns>Reference to the operation</returns>
|
||||
IOperation WriteResultsOp(string TestBenchId,
|
||||
Procedure procedure,
|
||||
IList<IWaterMeter> waterMeters,
|
||||
IList<TestResult> results);
|
||||
IOperation WriteResultsOp(Results.BatchResults batchResults);
|
||||
}
|
||||
}
|
||||
|
||||
@ -636,7 +636,7 @@ namespace TBF.BenchControl.Sequences
|
||||
protocolTitle = (dataEntryCmpnt as IHasProtocolTitle).ProtocolTitle;
|
||||
}
|
||||
|
||||
dataEntryCmpnt.UpdateTestResults(WaterMeters, results);
|
||||
dataEntryCmpnt.UpdateTestResults(BatchRslts);
|
||||
}
|
||||
|
||||
//------------------------------------------------------
|
||||
@ -646,12 +646,11 @@ namespace TBF.BenchControl.Sequences
|
||||
State savingAndPrintingRslts = State.Create("MainSeq : Saving and printing results");
|
||||
if (writer != null)
|
||||
{
|
||||
savingAndPrintingRslts.AddOperation(writer.WriteResultsOp((BenchInfo != null) ? BenchInfo.TestBenchName : string.Empty,
|
||||
StateMachine.Procedure, WaterMeters, results));
|
||||
savingAndPrintingRslts.AddOperation(writer.WriteResultsOp(ProcessData.BatchRslts));
|
||||
}
|
||||
if (printer != null && !printer.SupressPrinting)
|
||||
{
|
||||
savingAndPrintingRslts.AddOperation(printer.PrintResultsOp(BenchInfo, WaterMeters, StateMachine.Procedure, results, protocolTitle));
|
||||
savingAndPrintingRslts.AddOperation(printer.PrintResultsOp(ProcessData.BatchRslts, protocolTitle));
|
||||
}
|
||||
savingAndPrintingRslts.AddOperation(checkUiOp).EnterState();
|
||||
do
|
||||
|
||||
@ -29,11 +29,12 @@ namespace TBF.BenchControl.Sequences
|
||||
public static double CurrentMassRaw; /// [kg]
|
||||
public static double EndMassRaw; /// [kg]
|
||||
|
||||
|
||||
public static Results.BatchResults BatchRslts;
|
||||
|
||||
|
||||
///
|
||||
/// Statistics
|
||||
/// Statistics of 'continuous' variables (temperature, pressure, flow, etc.)
|
||||
///
|
||||
public static FloatStatistics AmbientTempStat = new FloatStatistics();
|
||||
public static FloatStatistics AmbientPressureStat = new FloatStatistics();
|
||||
|
||||
@ -488,7 +488,7 @@ namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
Bridge.OnActivity(this, "Enter the water meter data");
|
||||
State.Create("MainSeq : Enter begin data")
|
||||
.AddPermanentOperation((dataEntryCmpnt as IHasCycleBeginForm).ShowCycleBeginFormOp(WaterMeters))
|
||||
.AddPermanentOperation((dataEntryCmpnt as IHasCycleBeginForm).ShowCycleBeginFormOp())
|
||||
.AddOperation(checkUiOp)
|
||||
.EnterState();
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user