Possibility to reload previous results, MainSeq modified - CreateNewBatchResults() and RestoreBatchResults(), ver. 2.12.538
This commit is contained in:
@@ -270,5 +270,30 @@ namespace Results
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Batch LoadBatch(int batchNr)
|
||||||
|
{
|
||||||
|
IList<Batch> batches;
|
||||||
|
ISession session = DB.CreateSession();
|
||||||
|
if (session == null) return null;
|
||||||
|
|
||||||
|
TestDataList = session.QueryOver<TestData>().List();
|
||||||
|
ComponentsList = session.QueryOver<Components>().List();
|
||||||
|
WaterMeterDataList = session.QueryOver<WaterMeterData>().List();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
batches = session.QueryOver<Batch>()
|
||||||
|
.Where(x => (x.BatchNr == batchNr))
|
||||||
|
.List();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
log.FatalFormat("Cannot load batch #{0}: {1}", batchNr, exc.Message);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (batches.Count > 0) ? batches[0] : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ namespace TBF.BenchControl
|
|||||||
TurnPumpOnOffDone,
|
TurnPumpOnOffDone,
|
||||||
|
|
||||||
/// CheckUi events
|
/// CheckUi events
|
||||||
|
UiCmdReloadBatch,
|
||||||
UiCmdStartTest,
|
UiCmdStartTest,
|
||||||
UiCmdStartQ1,
|
UiCmdStartQ1,
|
||||||
UiCmdStartQ2,
|
UiCmdStartQ2,
|
||||||
@@ -123,9 +124,9 @@ namespace TBF.BenchControl
|
|||||||
UiCmdStop,
|
UiCmdStop,
|
||||||
UiCmdPurgeBegin,
|
UiCmdPurgeBegin,
|
||||||
UiCmdPurgeEnd,
|
UiCmdPurgeEnd,
|
||||||
UiCmdEmptyTank1,
|
UiCmdDrainTank1,
|
||||||
UiCmdEmptyTank2,
|
UiCmdDrainTank2,
|
||||||
UiCmdEmptyTank3,
|
UiCmdDrainTank3,
|
||||||
UiCmdBreak,
|
UiCmdBreak,
|
||||||
UiCmdResetResults,
|
UiCmdResetResults,
|
||||||
UiCmdAcceptResults,
|
UiCmdAcceptResults,
|
||||||
|
|||||||
@@ -77,7 +77,8 @@ namespace TBF.BenchControl.Operations
|
|||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
/// Bench Control Panel buttons
|
/// Bench Control Panel buttons
|
||||||
case UI2BenchCmd.StartTest: return Event.UiCmdStartTest;
|
case UI2BenchCmd.ReloadBatch: return Event.UiCmdReloadBatch;
|
||||||
|
case UI2BenchCmd.StartTest: return Event.UiCmdStartTest;
|
||||||
case UI2BenchCmd.StartQ1: return Event.UiCmdStartQ1;
|
case UI2BenchCmd.StartQ1: return Event.UiCmdStartQ1;
|
||||||
case UI2BenchCmd.StartQ2: return Event.UiCmdStartQ2;
|
case UI2BenchCmd.StartQ2: return Event.UiCmdStartQ2;
|
||||||
case UI2BenchCmd.StartQ3: return Event.UiCmdStartQ3;
|
case UI2BenchCmd.StartQ3: return Event.UiCmdStartQ3;
|
||||||
@@ -85,9 +86,9 @@ namespace TBF.BenchControl.Operations
|
|||||||
case UI2BenchCmd.Stop: return Event.UiCmdStop;
|
case UI2BenchCmd.Stop: return Event.UiCmdStop;
|
||||||
case UI2BenchCmd.PurgeBegin: return Event.UiCmdPurgeBegin;
|
case UI2BenchCmd.PurgeBegin: return Event.UiCmdPurgeBegin;
|
||||||
case UI2BenchCmd.PurgeEnd: return Event.UiCmdPurgeEnd;
|
case UI2BenchCmd.PurgeEnd: return Event.UiCmdPurgeEnd;
|
||||||
case UI2BenchCmd.DrainTank1: return Event.UiCmdEmptyTank1;
|
case UI2BenchCmd.DrainTank1: return Event.UiCmdDrainTank1;
|
||||||
case UI2BenchCmd.DrainTank2: return Event.UiCmdEmptyTank2;
|
case UI2BenchCmd.DrainTank2: return Event.UiCmdDrainTank2;
|
||||||
case UI2BenchCmd.DrainTank3: return Event.UiCmdEmptyTank3;
|
case UI2BenchCmd.DrainTank3: return Event.UiCmdDrainTank3;
|
||||||
case UI2BenchCmd.Break: return Event.UiCmdBreak;
|
case UI2BenchCmd.Break: return Event.UiCmdBreak;
|
||||||
case UI2BenchCmd.ResetResults: return Event.UiCmdResetResults;
|
case UI2BenchCmd.ResetResults: return Event.UiCmdResetResults;
|
||||||
case UI2BenchCmd.AcceptResults: return Event.UiCmdAcceptResults;
|
case UI2BenchCmd.AcceptResults: return Event.UiCmdAcceptResults;
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
IList<Generic.ITestParams> simultWithEvacuationParams;
|
IList<Generic.ITestParams> simultWithEvacuationParams;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
System.Windows.Forms.Form modelessDlg;
|
System.Windows.Forms.Form modelessDlg;
|
||||||
///
|
///
|
||||||
delegate void iPerlCommFormDlgt(MainSeq myRef, Generic.IComponentCfg cfg, IList<Test> tests, IList<Generic.ITestParams> multiTestParams);
|
delegate void iPerlCommFormDlgt(MainSeq myRef, Generic.IComponentCfg cfg, IList<Test> tests, IList<Generic.ITestParams> multiTestParams);
|
||||||
@@ -64,7 +65,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
log.Fatal("--------------------------------------");
|
log.Fatal("--------------------------------------");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
///
|
||||||
void CloseIPerlCommForm()
|
void CloseIPerlCommForm()
|
||||||
{
|
{
|
||||||
UiBridge.Bridge.OnCloseModelessForm(this, null);
|
UiBridge.Bridge.OnCloseModelessForm(this, null);
|
||||||
@@ -219,106 +220,46 @@ namespace TBF.BenchControl.Sequences
|
|||||||
//--------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------
|
||||||
select_procedure:
|
select_procedure:
|
||||||
|
|
||||||
/// Make sure the CycleBeginForm is closed (after an abnormal procedure/test end, etc.)
|
CloseBeginForm(); /// Make sure the CycleBeginForm is closed (after an abnormal end, etc.)
|
||||||
CloseBeginForm();
|
|
||||||
|
do
|
||||||
selection = MakeSelection(MKSelContext.ProcedureNotSelected);
|
{
|
||||||
|
selection = MakeSelection(MKSelContext.ProcedureNotSelected);
|
||||||
//--------------------------------
|
StateMachine.LoadProcedure(false);
|
||||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
}
|
||||||
StateMachine.LoadProcedure(false);
|
while (StateMachine.Procedure == null); /// Make sure a valid procedure is selected
|
||||||
if (StateMachine.Procedure == null) goto select_procedure;
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Procedure selected at this point, a new batch was started
|
/// Procedure selected at this point, a new batch was started
|
||||||
///
|
///
|
||||||
StateMachine.LoadProcedureParams(StateMachine.Procedure);
|
StateMachine.LoadProcedureParams(StateMachine.Procedure);
|
||||||
|
|
||||||
///
|
Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// Enable STOP button
|
||||||
/// Prepare new water meters
|
|
||||||
///
|
|
||||||
foreach (var wm in WaterMeters) wm.ClearData(); /// Clean water meter data
|
|
||||||
|
|
||||||
bool compound = (StateMachine.Procedure.MetersKind == MetersKind.Combined);
|
if (selection == Selection.RestoreBatch)
|
||||||
bool heatMeters = (StateMachine.Procedure.MetersKind == MetersKind.HeatMeter);
|
|
||||||
int waterMetersCount = Math.Min(WaterMeters.Count, heatMeters ? Config.Data.HeatMetersCount : (compound ? Config.Data.CompoundWMsCount : Config.Data.WMsCount));
|
|
||||||
///
|
|
||||||
Results.Entities.WaterMeterData[] waterMeterData = new Results.Entities.WaterMeterData[waterMetersCount];
|
|
||||||
///
|
|
||||||
int[] waterMeterParts = new int[waterMetersCount];
|
|
||||||
for (int wmNr = 0; wmNr < waterMetersCount; wmNr++)
|
|
||||||
{
|
{
|
||||||
int ix = compound ? (2 * wmNr) : wmNr;
|
BatchRslts = RestoreBatchResults(TBF.UiBridge.Bridge.BatchNr, /// Original batch number
|
||||||
|
Program.LocalSettings.BatchNr, /// New batch number
|
||||||
|
StateMachine.Procedure);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BatchRslts = CreateNewBatchResults(Program.LocalSettings.BatchNr, StateMachine.Procedure);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
waterMeterParts[wmNr] = Utils.PartNr(wmNr + 1, compound);
|
|
||||||
waterMeterData[wmNr] = new Results.Entities.WaterMeterData()
|
|
||||||
{
|
|
||||||
ProductName = WaterMeters[ix].ProductName,
|
|
||||||
Producer = WaterMeters[ix].Producer,
|
|
||||||
|
|
||||||
L = WaterMeters[ix].L,
|
|
||||||
DN = WaterMeters[ix].DN,
|
|
||||||
Mounting = WaterMeters[ix].Mounting,
|
|
||||||
|
|
||||||
Q4_Qmax = WaterMeters[ix].Q4_Qmax,
|
|
||||||
Q3_Qn = WaterMeters[ix].Q3_Qn,
|
|
||||||
Q2_Qt = WaterMeters[ix].Q2_Qt,
|
|
||||||
Q1_Qmin = WaterMeters[ix].Q1_Qmin,
|
|
||||||
|
|
||||||
MetrologicalClass = WaterMeters[ix].MetrologicalClass,
|
|
||||||
TemperatureClass = WaterMeters[ix].TemperatureClass,
|
|
||||||
PressureLossClass = WaterMeters[ix].PressureLossClass,
|
|
||||||
MaxAdmissiblePressure = WaterMeters[ix].MaxAdmissiblePressure,
|
|
||||||
FlowProfileSensitivityClass = WaterMeters[ix].FlowProfileSensitivityClass,
|
|
||||||
|
|
||||||
ApprovalInfo = WaterMeters[ix].ApprovalInfo,
|
|
||||||
Certificate = WaterMeters[ix].Certificate,
|
|
||||||
|
|
||||||
PulsesPerLtr = WaterMeters[ix].PulsesPerLtr,
|
|
||||||
|
|
||||||
Text1 = WaterMeters[ix].Text1,
|
|
||||||
Text2 = WaterMeters[ix].Text2,
|
|
||||||
Text3 = WaterMeters[ix].Text3,
|
|
||||||
Text4 = WaterMeters[ix].Text4,
|
|
||||||
Text5 = WaterMeters[ix].Text5,
|
|
||||||
|
|
||||||
Compound = compound,
|
|
||||||
HeatMeter = heatMeters,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (compound)
|
|
||||||
{
|
|
||||||
int auxIx = 2 * wmNr + 1;
|
|
||||||
waterMeterData[wmNr].ProducerAux = WaterMeters[auxIx].Producer;
|
|
||||||
waterMeterData[wmNr].Q3_Qn_Aux = WaterMeters[auxIx].Q3_Qn;
|
|
||||||
waterMeterData[wmNr].MetrologicalClassAux = WaterMeters[auxIx].MetrologicalClass;
|
|
||||||
waterMeterData[wmNr].ApprovalInfoAux = WaterMeters[auxIx].ApprovalInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if ORACLE_DB
|
|
||||||
BenchControl.WaterMeters.iPerl.WaterMeter iPerl = WaterMeters[wmNr] as BenchControl.WaterMeters.iPerl.WaterMeter;
|
|
||||||
if (iPerl != null)
|
|
||||||
{
|
|
||||||
waterMeterData[wmNr].WMTypeId = iPerl.WMType_ID;
|
|
||||||
waterMeterData[wmNr].WMTypeRev = iPerl.WMType_Rev;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Prepare empty results
|
|
||||||
///
|
|
||||||
BatchRslts = Results.BatchResults.NewFromProcedure(Program.LocalSettings.BatchNr,
|
|
||||||
(BenchInfo != null) ? BenchInfo.TestBenchId : 1,
|
|
||||||
Users.GlobalData.CurrentUser.UserName, Users.GlobalData.CurrentUser.Number, Program.Version,
|
|
||||||
StateMachine.Procedure, waterMeterData, waterMeterParts);
|
|
||||||
StateMachine.CycleStartTimeStamp = BatchRslts.Batch.StartTime;
|
StateMachine.CycleStartTimeStamp = BatchRslts.Batch.StartTime;
|
||||||
|
|
||||||
|
|
||||||
Bridge.OnProcedureSelected(this, new ProcedureSelectedEventArgs(StateMachine.Procedure));
|
Bridge.OnProcedureSelected(this, new ProcedureSelectedEventArgs(StateMachine.Procedure));
|
||||||
|
|
||||||
/// Display 'Cycle Begin Form'
|
///
|
||||||
if (OpenCycleBeginForm()) goto stop;
|
/// Display 'Cycle Begin Form' in case of a normal batch (not a restored batch)
|
||||||
|
///
|
||||||
|
if (selection != Selection.RestoreBatch)
|
||||||
|
{
|
||||||
|
if (OpenCycleBeginForm()) goto stop;
|
||||||
|
}
|
||||||
|
|
||||||
/// Find purge suquences
|
/// Find purge suquences
|
||||||
TransitionSequence purgeBegin = null;
|
TransitionSequence purgeBegin = null;
|
||||||
@@ -335,9 +276,11 @@ namespace TBF.BenchControl.Sequences
|
|||||||
{
|
{
|
||||||
goto assume_bench_filled;
|
goto assume_bench_filled;
|
||||||
}
|
}
|
||||||
else if (selection == Selection.Cycle && benchFilled)
|
else if ((selection == Selection.Cycle && benchFilled) || (selection == Selection.RestoreBatch))
|
||||||
{
|
{
|
||||||
//--------------------------------
|
///
|
||||||
|
/// Always ask a question in case of a restored batch
|
||||||
|
///
|
||||||
State.Create("MainSeq : Answer a question")
|
State.Create("MainSeq : Answer a question")
|
||||||
.AddOperation(new Operations.AskYesNoOp(Strings.Fill_with_water))
|
.AddOperation(new Operations.AskYesNoOp(Strings.Fill_with_water))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
@@ -417,7 +360,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
benchFilled = true;
|
benchFilled = true;
|
||||||
Bridge.Bench2UI(ButtonsEtc.ShowBenchFilled);
|
Bridge.Bench2UI(ButtonsEtc.ShowBenchFilled);
|
||||||
|
|
||||||
if (selection != Selection.PurgeBegin)
|
if (selection != Selection.PurgeBegin && selection != Selection.RestoreBatch)
|
||||||
{
|
{
|
||||||
goto cycle_or_test_selected;
|
goto cycle_or_test_selected;
|
||||||
}
|
}
|
||||||
@@ -1040,33 +983,23 @@ namespace TBF.BenchControl.Sequences
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Selection done in MakeSelection()
|
/// Return values of MakeSelection()
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum Selection
|
public enum Selection
|
||||||
{
|
{
|
||||||
/// Handled inside MakeSelection()
|
PurgeBegin,
|
||||||
None,
|
PurgeEnd,
|
||||||
DrainTank1,
|
|
||||||
DrainTank2,
|
|
||||||
DrainTank3,
|
|
||||||
CloseTank1,
|
|
||||||
CloseTank2,
|
|
||||||
CloseTank3,
|
|
||||||
CameraTest,
|
|
||||||
|
|
||||||
/// Used as return values
|
|
||||||
Cycle,
|
|
||||||
RestOfCycle,
|
|
||||||
Test,
|
|
||||||
Q1,
|
|
||||||
Q2,
|
|
||||||
Q3,
|
|
||||||
Stop,
|
|
||||||
PurgeBegin,
|
|
||||||
PurgeEnd,
|
|
||||||
Break,
|
Break,
|
||||||
SaveResults,
|
Cycle,
|
||||||
}
|
RestOfCycle,
|
||||||
|
Test,
|
||||||
|
Q1,
|
||||||
|
Q2,
|
||||||
|
Q3,
|
||||||
|
SaveResults,
|
||||||
|
RestoreBatch,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Idle loop to make a procedure or test selection.
|
/// Idle loop to make a procedure or test selection.
|
||||||
@@ -1074,14 +1007,15 @@ namespace TBF.BenchControl.Sequences
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context">Context where MakeSelection() is called</param>
|
/// <param name="context">Context where MakeSelection() is called</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Selection.Cycle
|
/// Selection.PurgeBegin
|
||||||
|
/// Selection.PurgeEnd
|
||||||
|
/// Selection.Break
|
||||||
|
/// Selection.Cycle
|
||||||
/// Selection.Test
|
/// Selection.Test
|
||||||
/// Selection.Q1
|
/// Selection.Q1
|
||||||
/// Selection.Q2
|
/// Selection.Q2
|
||||||
/// Selection.Q3
|
/// Selection.Q3
|
||||||
/// Selection.Stop
|
/// Selection.SaveResults
|
||||||
/// Selection.PurgeBegin
|
|
||||||
/// Selection.PurgeEnd
|
|
||||||
/// </returns>
|
/// </returns>
|
||||||
private Selection MakeSelection(MKSelContext context)
|
private Selection MakeSelection(MKSelContext context)
|
||||||
{
|
{
|
||||||
@@ -1096,7 +1030,6 @@ namespace TBF.BenchControl.Sequences
|
|||||||
DoubleBox mass3 = new DoubleBox();
|
DoubleBox mass3 = new DoubleBox();
|
||||||
|
|
||||||
IList<Event> e;
|
IList<Event> e;
|
||||||
Selection selection;
|
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
@@ -1130,7 +1063,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
(((StateMachine.Scale2 != null) && (StateMachine.DrainValve2 != null) && !draining2) ? ButtonsEtc.DrainTankBtn2En : 0) |
|
(((StateMachine.Scale2 != null) && (StateMachine.DrainValve2 != null) && !draining2) ? ButtonsEtc.DrainTankBtn2En : 0) |
|
||||||
(((StateMachine.Scale3 != null) && (StateMachine.DrainValve3 != null) && !draining3) ? ButtonsEtc.DrainTankBtn3En : 0));
|
(((StateMachine.Scale3 != null) && (StateMachine.DrainValve3 != null) && !draining3) ? ButtonsEtc.DrainTankBtn3En : 0));
|
||||||
|
|
||||||
selection = Selection.None;
|
|
||||||
State.Create("MainSeq : Select an activity")
|
State.Create("MainSeq : Select an activity")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation((StateMachine.Scale1 != null) ? StateMachine.Scale1.ReadMassOp(ref mass1) : null)
|
.AddOperation((StateMachine.Scale1 != null) ? StateMachine.Scale1.ReadMassOp(ref mass1) : null)
|
||||||
@@ -1141,32 +1074,42 @@ namespace TBF.BenchControl.Sequences
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (e.Contains(Event.Error)) goto error;
|
|
||||||
else if (e.Contains(Event.UiCmdStop)) selection = Selection.Stop;
|
/// Handled inside MakeSelection() inside the selection loop
|
||||||
else if (e.Contains(Event.UiCmdCameraTest)) selection = Selection.CameraTest;
|
if (e.Contains(Event.Error)) break;
|
||||||
else if (e.Contains(Event.UiCmdEmptyTank1)) selection = Selection.DrainTank1;
|
if (e.Contains(Event.UiCmdStop)) break;
|
||||||
else if (e.Contains(Event.UiCmdEmptyTank2)) selection = Selection.DrainTank2;
|
if (e.Contains(Event.UiCmdDrainTank1)) break;
|
||||||
else if (e.Contains(Event.UiCmdEmptyTank3)) selection = Selection.DrainTank3;
|
if (e.Contains(Event.UiCmdDrainTank2)) break;
|
||||||
else if (draining1 && StateMachine.Scale1.IsEmpty(mass1.Val)) selection = Selection.CloseTank1;
|
if (e.Contains(Event.UiCmdDrainTank3)) break;
|
||||||
else if (draining2 && StateMachine.Scale2.IsEmpty(mass2.Val)) selection = Selection.CloseTank2;
|
if (draining1 && StateMachine.Scale1.IsEmpty(mass1.Val)) break;
|
||||||
else if (draining3 && StateMachine.Scale3.IsEmpty(mass3.Val)) selection = Selection.CloseTank3;
|
if (draining2 && StateMachine.Scale2.IsEmpty(mass2.Val)) break;
|
||||||
else if (e.Contains(Event.UiCmdPurgeBegin)) return Selection.PurgeBegin; /// Value used to branch the code later on
|
if (draining3 && StateMachine.Scale3.IsEmpty(mass3.Val)) break;
|
||||||
else if (e.Contains(Event.UiCmdPurgeEnd)) return Selection.PurgeEnd;
|
|
||||||
else if (e.Contains(Event.UiCmdBreak) && context == MKSelContext.InsideProcedure) return Selection.Break;
|
|
||||||
else if (e.Contains(Event.UiCmdStartTest)) return Selection.Test;
|
|
||||||
else if (e.Contains(Event.UiCmdStartQ1)) return Selection.Q1;
|
|
||||||
else if (e.Contains(Event.UiCmdStartQ2)) return Selection.Q2;
|
|
||||||
else if (e.Contains(Event.UiCmdStartQ3)) return Selection.Q3;
|
|
||||||
else if (e.Contains(Event.UiCmdStartCycle)) return Selection.Cycle;
|
|
||||||
else if (e.Contains(Event.UiCmdAcceptResults)) return Selection.SaveResults;
|
|
||||||
}
|
|
||||||
while (selection == Selection.None);
|
|
||||||
|
|
||||||
if (selection == Selection.CameraTest)
|
/// Quit the selection loop and leave MakeSelection()
|
||||||
{
|
if (e.Contains(Event.UiCmdBreak) && context == MKSelContext.InsideProcedure) return Selection.Break;
|
||||||
CameraTest();
|
if (e.Contains(Event.UiCmdPurgeBegin)) return Selection.PurgeBegin;
|
||||||
}
|
if (e.Contains(Event.UiCmdPurgeEnd)) return Selection.PurgeEnd;
|
||||||
else if (selection == Selection.Stop)
|
if (e.Contains(Event.UiCmdStartCycle)) return Selection.Cycle;
|
||||||
|
if (e.Contains(Event.UiCmdStartTest)) return Selection.Test;
|
||||||
|
if (e.Contains(Event.UiCmdStartQ1)) return Selection.Q1;
|
||||||
|
if (e.Contains(Event.UiCmdStartQ2)) return Selection.Q2;
|
||||||
|
if (e.Contains(Event.UiCmdStartQ3)) return Selection.Q3;
|
||||||
|
if (e.Contains(Event.UiCmdAcceptResults)) return Selection.SaveResults;
|
||||||
|
if (e.Contains(Event.UiCmdReloadBatch)) return Selection.RestoreBatch;
|
||||||
|
}
|
||||||
|
while (true);
|
||||||
|
|
||||||
|
|
||||||
|
if (e.Contains(Event.Error))
|
||||||
|
{
|
||||||
|
///------------------------------------
|
||||||
|
Bridge.OnActivity(this, Strings.Error);
|
||||||
|
///------------------------------------
|
||||||
|
State.Create("MainSeq : ERROR state")
|
||||||
|
.EnterState();
|
||||||
|
while (true) StateMachine.WaitRunDevsRunOps(); /// Endless loop
|
||||||
|
}
|
||||||
|
else if (e.Contains(Event.UiCmdStop))
|
||||||
{
|
{
|
||||||
if (draining1 || draining2 || draining3)
|
if (draining1 || draining2 || draining3)
|
||||||
{
|
{
|
||||||
@@ -1182,12 +1125,13 @@ namespace TBF.BenchControl.Sequences
|
|||||||
while (!e.Contains(Event.ValvesSet));
|
while (!e.Contains(Event.ValvesSet));
|
||||||
draining1 = draining2 = draining3 = false;
|
draining1 = draining2 = draining3 = false;
|
||||||
}
|
}
|
||||||
selection = Selection.None;
|
|
||||||
}
|
}
|
||||||
else if ((selection == Selection.DrainTank1) && !draining1)
|
else if (e.Contains(Event.UiCmdDrainTank1) && !draining1)
|
||||||
{
|
{
|
||||||
draining1 = true;
|
draining1 = true;
|
||||||
|
///--------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||||
|
///--------------------------------------------
|
||||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||||
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||||
(draining2 ? 0 : ButtonsEtc.DrainTankBtn2En) |
|
(draining2 ? 0 : ButtonsEtc.DrainTankBtn2En) |
|
||||||
@@ -1198,10 +1142,12 @@ namespace TBF.BenchControl.Sequences
|
|||||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||||
while (!e.Contains(Event.ValvesSet));
|
while (!e.Contains(Event.ValvesSet));
|
||||||
}
|
}
|
||||||
else if ((selection == Selection.DrainTank2) && !draining2)
|
else if (e.Contains(Event.UiCmdDrainTank2) && !draining2)
|
||||||
{
|
{
|
||||||
draining2 = true;
|
draining2 = true;
|
||||||
|
///--------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||||
|
///--------------------------------------------
|
||||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||||
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||||
(draining1 ? 0 : ButtonsEtc.DrainTankBtn1En) |
|
(draining1 ? 0 : ButtonsEtc.DrainTankBtn1En) |
|
||||||
@@ -1212,10 +1158,12 @@ namespace TBF.BenchControl.Sequences
|
|||||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||||
while (!e.Contains(Event.ValvesSet));
|
while (!e.Contains(Event.ValvesSet));
|
||||||
}
|
}
|
||||||
else if ((selection == Selection.DrainTank3) && !draining3)
|
else if (e.Contains(Event.UiCmdDrainTank3) && !draining3)
|
||||||
{
|
{
|
||||||
draining3 = true;
|
draining3 = true;
|
||||||
|
///--------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||||
|
///--------------------------------------------
|
||||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||||
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||||
(draining1 ? 0 : ButtonsEtc.DrainTankBtn1En) |
|
(draining1 ? 0 : ButtonsEtc.DrainTankBtn1En) |
|
||||||
@@ -1226,7 +1174,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||||
while (!e.Contains(Event.ValvesSet));
|
while (!e.Contains(Event.ValvesSet));
|
||||||
}
|
}
|
||||||
else if (selection == Selection.CloseTank1)
|
else if (draining1 && StateMachine.Scale1.IsEmpty(mass1.Val))
|
||||||
{
|
{
|
||||||
State.Create("MainSeq : Close tank 1")
|
State.Create("MainSeq : Close tank 1")
|
||||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve1))
|
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve1))
|
||||||
@@ -1235,7 +1183,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
while (!e.Contains(Event.ValvesSet));
|
while (!e.Contains(Event.ValvesSet));
|
||||||
draining1 = false;
|
draining1 = false;
|
||||||
}
|
}
|
||||||
else if (selection == Selection.CloseTank2)
|
else if (draining2 && StateMachine.Scale2.IsEmpty(mass2.Val))
|
||||||
{
|
{
|
||||||
State.Create("MainSeq : Close tank 2")
|
State.Create("MainSeq : Close tank 2")
|
||||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve2))
|
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve2))
|
||||||
@@ -1244,7 +1192,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
while (!e.Contains(Event.ValvesSet));
|
while (!e.Contains(Event.ValvesSet));
|
||||||
draining2 = false;
|
draining2 = false;
|
||||||
}
|
}
|
||||||
else if (selection == Selection.CloseTank3)
|
else if (draining3 && StateMachine.Scale3.IsEmpty(mass3.Val))
|
||||||
{
|
{
|
||||||
State.Create("MainSeq : Close tank 3")
|
State.Create("MainSeq : Close tank 3")
|
||||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve3))
|
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve3))
|
||||||
@@ -1254,102 +1202,111 @@ namespace TBF.BenchControl.Sequences
|
|||||||
draining3 = false;
|
draining3 = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error:
|
|
||||||
Bridge.OnActivity(this, Strings.Error);
|
|
||||||
State.Create("MainSeq : ERROR state")
|
|
||||||
.EnterState();
|
|
||||||
while (true) StateMachine.WaitRunDevsRunOps();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Perform a camera test
|
|
||||||
/// </summary>
|
|
||||||
void CameraTest()
|
|
||||||
{
|
|
||||||
IList<Event> e;
|
|
||||||
|
|
||||||
camera_test:
|
/// <summary>
|
||||||
Bridge.OnActivity(this, "Camera test");
|
/// Create a new empty batch results from the procedure
|
||||||
//---------------------------------------------------------
|
/// </summary>
|
||||||
Bridge.Bench2UI(ButtonsEtc.StartTestBtnsEn | ButtonsEtc.StopBtnEn);
|
/// <param name="newBatchNr">New batch number</param>
|
||||||
State.Create("MainSeq : 1 = Grab, 2 = Live, 3 = Focus, Stop = Quit camera test")
|
/// <param name="procedure">Selected procedure</param>
|
||||||
.AddOperation(checkUiOp)
|
/// <returns>Created BatchResults</returns>
|
||||||
.EnterState();
|
Results.BatchResults CreateNewBatchResults(int newBatchNr, Procedure procedure)
|
||||||
do
|
{
|
||||||
{
|
///
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
/// Prepare new water meters
|
||||||
if (e.Contains(Event.Error)) goto error;
|
///
|
||||||
if (e.Contains(Event.UiCmdStop)) return;
|
foreach (var wm in WaterMeters) wm.ClearData(); /// Clean water meter data
|
||||||
if (e.Contains(Event.UiCmdStartQ1)) goto grab;
|
|
||||||
if (e.Contains(Event.UiCmdStartQ2)) goto live;
|
|
||||||
if (e.Contains(Event.UiCmdStartQ3)) goto focus;
|
|
||||||
}
|
|
||||||
while (true);
|
|
||||||
|
|
||||||
grab:
|
bool compound = (StateMachine.Procedure.MetersKind == MetersKind.Combined);
|
||||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
bool heatMeters = (StateMachine.Procedure.MetersKind == MetersKind.HeatMeter);
|
||||||
State.Create("MainSeq : Press 'Stop' to continue")
|
int waterMetersCount = Math.Min(WaterMeters.Count, heatMeters ? Config.Data.HeatMetersCount : (compound ? Config.Data.CompoundWMsCount : Config.Data.WMsCount));
|
||||||
.AddOperation(checkUiOp)
|
///
|
||||||
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[0].GrabImageOp() : null)
|
Results.Entities.WaterMeterData[] waterMeterData = new Results.Entities.WaterMeterData[waterMetersCount];
|
||||||
.AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[1].GrabImageOp() : null)
|
///
|
||||||
.AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[2].GrabImageOp() : null)
|
int[] waterMeterParts = new int[waterMetersCount];
|
||||||
.AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[3].GrabImageOp() : null)
|
for (int wmNr = 0; wmNr < waterMetersCount; wmNr++)
|
||||||
.AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[4].GrabImageOp() : null)
|
{
|
||||||
.AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[5].GrabImageOp() : null)
|
int ix = compound ? (2 * wmNr) : wmNr;
|
||||||
.EnterState();
|
|
||||||
do
|
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
if (e.Contains(Event.Error)) goto error;
|
|
||||||
if (e.Contains(Event.UiCmdStop)) goto camera_test;
|
|
||||||
}
|
|
||||||
while (true);
|
|
||||||
|
|
||||||
live:
|
waterMeterParts[wmNr] = Utils.PartNr(wmNr + 1, compound);
|
||||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
waterMeterData[wmNr] = new Results.Entities.WaterMeterData()
|
||||||
State.Create("MainSeq : Press 'Stop' to stop.")
|
{
|
||||||
.AddOperation(checkUiOp)
|
ProductName = WaterMeters[ix].ProductName,
|
||||||
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[0].LiveStreamOp(false) : null)
|
Producer = WaterMeters[ix].Producer,
|
||||||
.AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[1].LiveStreamOp(false) : null)
|
|
||||||
.AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[2].LiveStreamOp(false) : null)
|
|
||||||
.AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[3].LiveStreamOp(false) : null)
|
|
||||||
.AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[4].LiveStreamOp(false) : null)
|
|
||||||
.AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[5].LiveStreamOp(false) : null)
|
|
||||||
.EnterState();
|
|
||||||
do
|
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
if (e.Contains(Event.Error)) goto error;
|
|
||||||
if (e.Contains(Event.UiCmdStop)) goto camera_test;
|
|
||||||
}
|
|
||||||
while (true);
|
|
||||||
|
|
||||||
focus:
|
L = WaterMeters[ix].L,
|
||||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
DN = WaterMeters[ix].DN,
|
||||||
State.Create("MainSeq : Press 'Stop' to stop.")
|
Mounting = WaterMeters[ix].Mounting,
|
||||||
.AddOperation(checkUiOp)
|
|
||||||
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[0].LiveStreamOp(true) : null)
|
|
||||||
.AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[1].LiveStreamOp(true) : null)
|
|
||||||
.AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[2].LiveStreamOp(true) : null)
|
|
||||||
.AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[3].LiveStreamOp(true) : null)
|
|
||||||
.AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[4].LiveStreamOp(true) : null)
|
|
||||||
.AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[5].LiveStreamOp(true) : null)
|
|
||||||
.EnterState();
|
|
||||||
do
|
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
if (e.Contains(Event.Error)) goto error;
|
|
||||||
if (e.Contains(Event.UiCmdStop)) goto camera_test;
|
|
||||||
}
|
|
||||||
while (true);
|
|
||||||
|
|
||||||
error:
|
Q4_Qmax = WaterMeters[ix].Q4_Qmax,
|
||||||
Bridge.OnActivity(this, Strings.Error);
|
Q3_Qn = WaterMeters[ix].Q3_Qn,
|
||||||
State.Create("MainSeq : ERROR state")
|
Q2_Qt = WaterMeters[ix].Q2_Qt,
|
||||||
.EnterState();
|
Q1_Qmin = WaterMeters[ix].Q1_Qmin,
|
||||||
while (true) StateMachine.WaitRunDevsRunOps();
|
|
||||||
}
|
MetrologicalClass = WaterMeters[ix].MetrologicalClass,
|
||||||
|
TemperatureClass = WaterMeters[ix].TemperatureClass,
|
||||||
|
PressureLossClass = WaterMeters[ix].PressureLossClass,
|
||||||
|
MaxAdmissiblePressure = WaterMeters[ix].MaxAdmissiblePressure,
|
||||||
|
FlowProfileSensitivityClass = WaterMeters[ix].FlowProfileSensitivityClass,
|
||||||
|
|
||||||
|
ApprovalInfo = WaterMeters[ix].ApprovalInfo,
|
||||||
|
Certificate = WaterMeters[ix].Certificate,
|
||||||
|
|
||||||
|
PulsesPerLtr = WaterMeters[ix].PulsesPerLtr,
|
||||||
|
|
||||||
|
Text1 = WaterMeters[ix].Text1,
|
||||||
|
Text2 = WaterMeters[ix].Text2,
|
||||||
|
Text3 = WaterMeters[ix].Text3,
|
||||||
|
Text4 = WaterMeters[ix].Text4,
|
||||||
|
Text5 = WaterMeters[ix].Text5,
|
||||||
|
|
||||||
|
Compound = compound,
|
||||||
|
HeatMeter = heatMeters,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (compound)
|
||||||
|
{
|
||||||
|
int auxIx = 2 * wmNr + 1;
|
||||||
|
waterMeterData[wmNr].ProducerAux = WaterMeters[auxIx].Producer;
|
||||||
|
waterMeterData[wmNr].Q3_Qn_Aux = WaterMeters[auxIx].Q3_Qn;
|
||||||
|
waterMeterData[wmNr].MetrologicalClassAux = WaterMeters[auxIx].MetrologicalClass;
|
||||||
|
waterMeterData[wmNr].ApprovalInfoAux = WaterMeters[auxIx].ApprovalInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if ORACLE_DB
|
||||||
|
BenchControl.WaterMeters.iPerl.WaterMeter iPerl = WaterMeters[wmNr] as BenchControl.WaterMeters.iPerl.WaterMeter;
|
||||||
|
if (iPerl != null)
|
||||||
|
{
|
||||||
|
waterMeterData[wmNr].WMTypeId = iPerl.WMType_ID;
|
||||||
|
waterMeterData[wmNr].WMTypeRev = iPerl.WMType_Rev;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Prepare empty results
|
||||||
|
return Results.BatchResults.NewFromProcedure(newBatchNr,
|
||||||
|
(BenchInfo != null) ? BenchInfo.TestBenchId : 1,
|
||||||
|
Users.GlobalData.CurrentUser.UserName,
|
||||||
|
Users.GlobalData.CurrentUser.Number,
|
||||||
|
Program.Version,
|
||||||
|
StateMachine.Procedure,
|
||||||
|
waterMeterData,
|
||||||
|
waterMeterParts);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reload batch results from Results database given the batch number
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="oriBatchNr">Original batch number</param>
|
||||||
|
/// <param name="newBatchNr">New unique batch number</param>
|
||||||
|
/// <param name="procedure">Reloaded procedure</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Results.BatchResults RestoreBatchResults(int oriBatchNr, int newBatchNr, Procedure procedure)
|
||||||
|
{
|
||||||
|
return Results.BatchResults.FromBatch(Results.DB.LoadBatch(oriBatchNr));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CollectSimultSteps()
|
void CollectSimultSteps()
|
||||||
|
|||||||
+124
-124
@@ -28,135 +28,135 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.sendButton = new System.Windows.Forms.Button();
|
this.sendReloadButton = new System.Windows.Forms.Button();
|
||||||
this.sentCheckBox = new System.Windows.Forms.CheckBox();
|
this.sentCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
this.failedCountLabel = new System.Windows.Forms.Label();
|
this.failedCountLabel = new System.Windows.Forms.Label();
|
||||||
this.passedCountLabel = new System.Windows.Forms.Label();
|
this.passedCountLabel = new System.Windows.Forms.Label();
|
||||||
this.purchaseOrderLabel = new System.Windows.Forms.Label();
|
this.purchaseOrderLabel = new System.Windows.Forms.Label();
|
||||||
this.procedureLabel = new System.Windows.Forms.Label();
|
this.procedureLabel = new System.Windows.Forms.Label();
|
||||||
this.endTimeLabel = new System.Windows.Forms.Label();
|
this.endTimeLabel = new System.Windows.Forms.Label();
|
||||||
this.startTimeLabel = new System.Windows.Forms.Label();
|
this.startTimeLabel = new System.Windows.Forms.Label();
|
||||||
this.batchNrLabel = new System.Windows.Forms.Label();
|
this.batchNrLabel = new System.Windows.Forms.Label();
|
||||||
this.showButton = new System.Windows.Forms.Button();
|
this.showButton = new System.Windows.Forms.Button();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// sendButton
|
// sendReloadButton
|
||||||
//
|
//
|
||||||
this.sendButton.Location = new System.Drawing.Point(832, 2);
|
this.sendReloadButton.Location = new System.Drawing.Point(832, 2);
|
||||||
this.sendButton.Name = "sendButton";
|
this.sendReloadButton.Name = "sendReloadButton";
|
||||||
this.sendButton.Size = new System.Drawing.Size(104, 23);
|
this.sendReloadButton.Size = new System.Drawing.Size(104, 23);
|
||||||
this.sendButton.TabIndex = 15;
|
this.sendReloadButton.TabIndex = 15;
|
||||||
this.sendButton.Text = "Again";
|
this.sendReloadButton.Text = "Again";
|
||||||
this.sendButton.UseVisualStyleBackColor = true;
|
this.sendReloadButton.UseVisualStyleBackColor = true;
|
||||||
this.sendButton.Click += new System.EventHandler(this.sendButton_Click);
|
this.sendReloadButton.Click += new System.EventHandler(this.sendReloadButton_Click);
|
||||||
//
|
//
|
||||||
// sentCheckBox
|
// sentCheckBox
|
||||||
//
|
//
|
||||||
this.sentCheckBox.AutoSize = true;
|
this.sentCheckBox.AutoSize = true;
|
||||||
this.sentCheckBox.Location = new System.Drawing.Point(748, 6);
|
this.sentCheckBox.Location = new System.Drawing.Point(748, 6);
|
||||||
this.sentCheckBox.Name = "sentCheckBox";
|
this.sentCheckBox.Name = "sentCheckBox";
|
||||||
this.sentCheckBox.Size = new System.Drawing.Size(48, 17);
|
this.sentCheckBox.Size = new System.Drawing.Size(48, 17);
|
||||||
this.sentCheckBox.TabIndex = 14;
|
this.sentCheckBox.TabIndex = 14;
|
||||||
this.sentCheckBox.Text = "Sent";
|
this.sentCheckBox.Text = "Sent";
|
||||||
this.sentCheckBox.UseVisualStyleBackColor = true;
|
this.sentCheckBox.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// failedCountLabel
|
// failedCountLabel
|
||||||
//
|
//
|
||||||
this.failedCountLabel.AutoSize = true;
|
this.failedCountLabel.AutoSize = true;
|
||||||
this.failedCountLabel.Location = new System.Drawing.Point(681, 7);
|
this.failedCountLabel.Location = new System.Drawing.Point(681, 7);
|
||||||
this.failedCountLabel.Name = "failedCountLabel";
|
this.failedCountLabel.Name = "failedCountLabel";
|
||||||
this.failedCountLabel.Size = new System.Drawing.Size(48, 13);
|
this.failedCountLabel.Size = new System.Drawing.Size(48, 13);
|
||||||
this.failedCountLabel.TabIndex = 13;
|
this.failedCountLabel.TabIndex = 13;
|
||||||
this.failedCountLabel.Text = "failedCnt";
|
this.failedCountLabel.Text = "failedCnt";
|
||||||
//
|
//
|
||||||
// passedCountLabel
|
// passedCountLabel
|
||||||
//
|
//
|
||||||
this.passedCountLabel.AutoSize = true;
|
this.passedCountLabel.AutoSize = true;
|
||||||
this.passedCountLabel.Location = new System.Drawing.Point(590, 7);
|
this.passedCountLabel.Location = new System.Drawing.Point(590, 7);
|
||||||
this.passedCountLabel.Name = "passedCountLabel";
|
this.passedCountLabel.Name = "passedCountLabel";
|
||||||
this.passedCountLabel.Size = new System.Drawing.Size(57, 13);
|
this.passedCountLabel.Size = new System.Drawing.Size(57, 13);
|
||||||
this.passedCountLabel.TabIndex = 12;
|
this.passedCountLabel.TabIndex = 12;
|
||||||
this.passedCountLabel.Text = "passedCnt";
|
this.passedCountLabel.Text = "passedCnt";
|
||||||
//
|
//
|
||||||
// purchaseOrderLabel
|
// purchaseOrderLabel
|
||||||
//
|
//
|
||||||
this.purchaseOrderLabel.AutoSize = true;
|
this.purchaseOrderLabel.AutoSize = true;
|
||||||
this.purchaseOrderLabel.Location = new System.Drawing.Point(481, 7);
|
this.purchaseOrderLabel.Location = new System.Drawing.Point(481, 7);
|
||||||
this.purchaseOrderLabel.Name = "purchaseOrderLabel";
|
this.purchaseOrderLabel.Name = "purchaseOrderLabel";
|
||||||
this.purchaseOrderLabel.Size = new System.Drawing.Size(77, 13);
|
this.purchaseOrderLabel.Size = new System.Drawing.Size(77, 13);
|
||||||
this.purchaseOrderLabel.TabIndex = 11;
|
this.purchaseOrderLabel.TabIndex = 11;
|
||||||
this.purchaseOrderLabel.Text = "purchaseOrder";
|
this.purchaseOrderLabel.Text = "purchaseOrder";
|
||||||
//
|
//
|
||||||
// procedureLabel
|
// procedureLabel
|
||||||
//
|
//
|
||||||
this.procedureLabel.AutoSize = true;
|
this.procedureLabel.AutoSize = true;
|
||||||
this.procedureLabel.Location = new System.Drawing.Point(328, 7);
|
this.procedureLabel.Location = new System.Drawing.Point(328, 7);
|
||||||
this.procedureLabel.Name = "procedureLabel";
|
this.procedureLabel.Name = "procedureLabel";
|
||||||
this.procedureLabel.Size = new System.Drawing.Size(55, 13);
|
this.procedureLabel.Size = new System.Drawing.Size(55, 13);
|
||||||
this.procedureLabel.TabIndex = 10;
|
this.procedureLabel.TabIndex = 10;
|
||||||
this.procedureLabel.Text = "procedure";
|
this.procedureLabel.Text = "procedure";
|
||||||
//
|
//
|
||||||
// endTimeLabel
|
// endTimeLabel
|
||||||
//
|
//
|
||||||
this.endTimeLabel.AutoSize = true;
|
this.endTimeLabel.AutoSize = true;
|
||||||
this.endTimeLabel.Location = new System.Drawing.Point(185, 7);
|
this.endTimeLabel.Location = new System.Drawing.Point(185, 7);
|
||||||
this.endTimeLabel.Name = "endTimeLabel";
|
this.endTimeLabel.Name = "endTimeLabel";
|
||||||
this.endTimeLabel.Size = new System.Drawing.Size(48, 13);
|
this.endTimeLabel.Size = new System.Drawing.Size(48, 13);
|
||||||
this.endTimeLabel.TabIndex = 9;
|
this.endTimeLabel.TabIndex = 9;
|
||||||
this.endTimeLabel.Text = "endTime";
|
this.endTimeLabel.Text = "endTime";
|
||||||
//
|
//
|
||||||
// startTimeLabel
|
// startTimeLabel
|
||||||
//
|
//
|
||||||
this.startTimeLabel.AutoSize = true;
|
this.startTimeLabel.AutoSize = true;
|
||||||
this.startTimeLabel.Location = new System.Drawing.Point(54, 7);
|
this.startTimeLabel.Location = new System.Drawing.Point(54, 7);
|
||||||
this.startTimeLabel.Name = "startTimeLabel";
|
this.startTimeLabel.Name = "startTimeLabel";
|
||||||
this.startTimeLabel.Size = new System.Drawing.Size(50, 13);
|
this.startTimeLabel.Size = new System.Drawing.Size(50, 13);
|
||||||
this.startTimeLabel.TabIndex = 8;
|
this.startTimeLabel.TabIndex = 8;
|
||||||
this.startTimeLabel.Text = "startTime";
|
this.startTimeLabel.Text = "startTime";
|
||||||
//
|
//
|
||||||
// batchNrLabel
|
// batchNrLabel
|
||||||
//
|
//
|
||||||
this.batchNrLabel.AutoSize = true;
|
this.batchNrLabel.AutoSize = true;
|
||||||
this.batchNrLabel.Location = new System.Drawing.Point(3, 7);
|
this.batchNrLabel.Location = new System.Drawing.Point(3, 7);
|
||||||
this.batchNrLabel.Name = "batchNrLabel";
|
this.batchNrLabel.Name = "batchNrLabel";
|
||||||
this.batchNrLabel.Size = new System.Drawing.Size(24, 13);
|
this.batchNrLabel.Size = new System.Drawing.Size(24, 13);
|
||||||
this.batchNrLabel.TabIndex = 16;
|
this.batchNrLabel.TabIndex = 16;
|
||||||
this.batchNrLabel.Text = "bNr";
|
this.batchNrLabel.Text = "bNr";
|
||||||
//
|
//
|
||||||
// showButton
|
// showButton
|
||||||
//
|
//
|
||||||
this.showButton.Location = new System.Drawing.Point(939, 2);
|
this.showButton.Location = new System.Drawing.Point(939, 2);
|
||||||
this.showButton.Name = "showButton";
|
this.showButton.Name = "showButton";
|
||||||
this.showButton.Size = new System.Drawing.Size(104, 23);
|
this.showButton.Size = new System.Drawing.Size(104, 23);
|
||||||
this.showButton.TabIndex = 17;
|
this.showButton.TabIndex = 17;
|
||||||
this.showButton.Text = "Show";
|
this.showButton.Text = "Show";
|
||||||
this.showButton.UseVisualStyleBackColor = true;
|
this.showButton.UseVisualStyleBackColor = true;
|
||||||
this.showButton.Click += new System.EventHandler(this.showButton_Click);
|
this.showButton.Click += new System.EventHandler(this.showButton_Click);
|
||||||
//
|
//
|
||||||
// PreviousResultCtrl
|
// PreviousResultCtrl
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.Controls.Add(this.showButton);
|
this.Controls.Add(this.showButton);
|
||||||
this.Controls.Add(this.batchNrLabel);
|
this.Controls.Add(this.batchNrLabel);
|
||||||
this.Controls.Add(this.sendButton);
|
this.Controls.Add(this.sendReloadButton);
|
||||||
this.Controls.Add(this.sentCheckBox);
|
this.Controls.Add(this.sentCheckBox);
|
||||||
this.Controls.Add(this.failedCountLabel);
|
this.Controls.Add(this.failedCountLabel);
|
||||||
this.Controls.Add(this.passedCountLabel);
|
this.Controls.Add(this.passedCountLabel);
|
||||||
this.Controls.Add(this.purchaseOrderLabel);
|
this.Controls.Add(this.purchaseOrderLabel);
|
||||||
this.Controls.Add(this.procedureLabel);
|
this.Controls.Add(this.procedureLabel);
|
||||||
this.Controls.Add(this.endTimeLabel);
|
this.Controls.Add(this.endTimeLabel);
|
||||||
this.Controls.Add(this.startTimeLabel);
|
this.Controls.Add(this.startTimeLabel);
|
||||||
this.Name = "PreviousResultCtrl";
|
this.Name = "PreviousResultCtrl";
|
||||||
this.Size = new System.Drawing.Size(1048, 26);
|
this.Size = new System.Drawing.Size(1048, 26);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.Button sendButton;
|
private System.Windows.Forms.Button sendReloadButton;
|
||||||
private System.Windows.Forms.CheckBox sentCheckBox;
|
private System.Windows.Forms.CheckBox sentCheckBox;
|
||||||
private System.Windows.Forms.Label failedCountLabel;
|
private System.Windows.Forms.Label failedCountLabel;
|
||||||
private System.Windows.Forms.Label passedCountLabel;
|
private System.Windows.Forms.Label passedCountLabel;
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ namespace TBF.Forms
|
|||||||
{
|
{
|
||||||
public partial class PreviousResultCtrl : UserControl
|
public partial class PreviousResultCtrl : UserControl
|
||||||
{
|
{
|
||||||
PreviousResultsDlg parent;
|
readonly PreviousResultsDlg parent;
|
||||||
|
readonly bool reloadEn;
|
||||||
|
|
||||||
public int BatchNr;
|
public int BatchNr;
|
||||||
public DateTime StarTime;
|
public DateTime StarTime;
|
||||||
@@ -28,10 +29,12 @@ namespace TBF.Forms
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PreviousResultCtrl(PreviousResultsDlg parent, int bnr, DateTime s, DateTime e, string proc, string pOrd, int passCnt, int failCnt, bool sent)
|
public PreviousResultCtrl(PreviousResultsDlg parent, int bnr, DateTime s, DateTime e, string proc, string pOrd, int passCnt, int failCnt, bool sent, bool reloadEn)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
|
this.reloadEn = reloadEn;
|
||||||
|
|
||||||
BatchNr = bnr;
|
BatchNr = bnr;
|
||||||
StarTime = s;
|
StarTime = s;
|
||||||
EndTime = e;
|
EndTime = e;
|
||||||
@@ -52,17 +55,17 @@ namespace TBF.Forms
|
|||||||
#if MUNICH
|
#if MUNICH
|
||||||
sentCheckBox.Text = Strings.Printed;
|
sentCheckBox.Text = Strings.Printed;
|
||||||
sentCheckBox.Checked = Sent;
|
sentCheckBox.Checked = Sent;
|
||||||
sendButton.Enabled = true; /// 'Print again' function always available
|
sendReloadButton.Enabled = true; /// 'Print again' function always available
|
||||||
sendButton.Text = Strings.Print_again;
|
sendReloadButton.Text = reloadEn ? Strings.Reload : Strings.Print_again;
|
||||||
#elif ORACLE_DB
|
#elif ORACLE_DB
|
||||||
sentCheckBox.Text = Strings.Sent;
|
sentCheckBox.Text = Strings.Sent;
|
||||||
sentCheckBox.Checked = Sent;
|
sentCheckBox.Checked = Sent;
|
||||||
sendButton.Enabled = !Sent;
|
sendReloadButton.Enabled = reloadEn || !Sent;
|
||||||
sendButton.Text = Strings.Again;
|
sendReloadButton.Text = reloadEn ? Strings.Reload : Strings.Save_again;
|
||||||
#else
|
#else
|
||||||
sentCheckBox.Visible = false;
|
sentCheckBox.Visible = false;
|
||||||
sendButton.Enabled = false;
|
sendReloadButton.Enabled = false;
|
||||||
sendButton.Visible = false;
|
sendReloadButton.Visible = false;
|
||||||
#endif
|
#endif
|
||||||
showButton.Text = Strings.Show;
|
showButton.Text = Strings.Show;
|
||||||
}
|
}
|
||||||
@@ -72,16 +75,19 @@ namespace TBF.Forms
|
|||||||
this.Sent = sent;
|
this.Sent = sent;
|
||||||
#if MUNICH
|
#if MUNICH
|
||||||
sentCheckBox.Checked = sent;
|
sentCheckBox.Checked = sent;
|
||||||
sendButton.Enabled = true;
|
sendReloadButton.Enabled = true;
|
||||||
#elif ORACLE_DB
|
#elif ORACLE_DB
|
||||||
sentCheckBox.Checked = sent;
|
sentCheckBox.Checked = sent;
|
||||||
sendButton.Enabled = !sent;
|
sendReloadButton.Enabled = !sent;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendButton_Click(object sender, EventArgs e)
|
private void sendReloadButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
parent.OnSendAgain(this, new PreviousResultIdEventArgs(BatchNr));
|
if (reloadEn)
|
||||||
|
parent.OnReload(this, new PreviousResultIdEventArgs(BatchNr));
|
||||||
|
else
|
||||||
|
parent.OnSendAgain(this, new PreviousResultIdEventArgs(BatchNr));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showButton_Click(object sender, EventArgs e)
|
private void showButton_Click(object sender, EventArgs e)
|
||||||
|
|||||||
@@ -23,11 +23,13 @@ namespace TBF.Forms
|
|||||||
ISession session;
|
ISession session;
|
||||||
int currentBatchNr;
|
int currentBatchNr;
|
||||||
IList<Batch> batches;
|
IList<Batch> batches;
|
||||||
|
bool reloadEn;
|
||||||
|
|
||||||
|
|
||||||
public PreviousResultsDlg()
|
public PreviousResultsDlg(bool reloadEn)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
this.reloadEn = reloadEn;
|
||||||
currentBatchNr = Program.LocalSettings.BatchNr;
|
currentBatchNr = Program.LocalSettings.BatchNr;
|
||||||
|
|
||||||
SendAgainHandler += delegate(object sndr, PreviousResultIdEventArgs args)
|
SendAgainHandler += delegate(object sndr, PreviousResultIdEventArgs args)
|
||||||
@@ -43,6 +45,12 @@ namespace TBF.Forms
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PreviousResultsDlg()
|
||||||
|
: this(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void PreviousResultsDlg_Load(object sender, EventArgs e)
|
private void PreviousResultsDlg_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Localize();
|
Localize();
|
||||||
@@ -66,6 +74,26 @@ namespace TBF.Forms
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void OnReload(object sender, PreviousResultIdEventArgs data)
|
||||||
|
{
|
||||||
|
foreach (var batch in batches)
|
||||||
|
{
|
||||||
|
if (batch.BatchNr == data.BatchNr)
|
||||||
|
{
|
||||||
|
TBF.UiBridge.Bridge.BatchNr = batch.BatchNr;
|
||||||
|
Program.MainWnd.UpdateProcedure(batch.ProcedureName);
|
||||||
|
TBF.UiBridge.Bridge.Ui2Bench(TBF.UiBridge.UI2BenchCmd.ReloadBatch);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DialogResult = DialogResult.Cancel;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public event EventHandler<PreviousResultIdEventArgs> SendAgainHandler;
|
public event EventHandler<PreviousResultIdEventArgs> SendAgainHandler;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -74,8 +102,14 @@ namespace TBF.Forms
|
|||||||
public void OnSendAgain(object sender, PreviousResultIdEventArgs data)
|
public void OnSendAgain(object sender, PreviousResultIdEventArgs data)
|
||||||
{
|
{
|
||||||
if (SendAgainHandler == null) return;
|
if (SendAgainHandler == null) return;
|
||||||
try { SendAgainHandler(sender, data); }
|
try
|
||||||
catch (Exception e) { log.Error("SendAgainHandler(...) failed", e); }
|
{
|
||||||
|
SendAgainHandler(sender, data);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.Error("SendAgainHandler(...) failed", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DoSendAgain(object sender, PreviousResultIdEventArgs data)
|
public void DoSendAgain(object sender, PreviousResultIdEventArgs data)
|
||||||
@@ -216,7 +250,8 @@ namespace TBF.Forms
|
|||||||
b.WaterMeters[0].PurchaseOrder,
|
b.WaterMeters[0].PurchaseOrder,
|
||||||
passedCount,
|
passedCount,
|
||||||
failedCount,
|
failedCount,
|
||||||
b.RsltsSent));
|
b.RsltsSent,
|
||||||
|
reloadEn));
|
||||||
}
|
}
|
||||||
|
|
||||||
ResumeLayout();
|
ResumeLayout();
|
||||||
|
|||||||
@@ -443,21 +443,27 @@ namespace TBF
|
|||||||
|
|
||||||
private void procedureComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
private void procedureComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ProcedureName = procedureComboBox.Text;
|
UpdateProcedure(procedureComboBox.Text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateProcedure(string procedureName)
|
||||||
|
{
|
||||||
|
procedureComboBox.Text = procedureName;
|
||||||
|
ProcedureName = procedureName;
|
||||||
BenchControlPanel.ReloadTests();
|
BenchControlPanel.ReloadTests();
|
||||||
if (CurrentProcedure != null && CurrentProcedure.Description != null)
|
if (CurrentProcedure != null && CurrentProcedure.Description != null)
|
||||||
{
|
{
|
||||||
descriptionLabel.Text = CurrentProcedure.Description;
|
descriptionLabel.Text = CurrentProcedure.Description;
|
||||||
}
|
}
|
||||||
if (CurrentProcedure != null && testProgressControls != null)
|
if (CurrentProcedure != null && testProgressControls != null)
|
||||||
{
|
{
|
||||||
testProgressControls.ProcedureSelectedInUI(this, new UiBridge.ProcedureSelectedEventArgs(CurrentProcedure));
|
testProgressControls.ProcedureSelectedInUI(this, new UiBridge.ProcedureSelectedEventArgs(CurrentProcedure));
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(ProcedureName))
|
if (!string.IsNullOrEmpty(ProcedureName))
|
||||||
{
|
{
|
||||||
Program.LocalSettings.LastProcedureName = ProcedureName;
|
Program.LocalSettings.LastProcedureName = ProcedureName;
|
||||||
Program.LocalSettings.Save();
|
Program.LocalSettings.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainWnd_FormClosing(object sender, FormClosingEventArgs e)
|
private void MainWnd_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
|||||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("2.12.536.1")]
|
[assembly: AssemblyVersion("2.12.538.1")]
|
||||||
[assembly: AssemblyFileVersion("2.12.536.1")]
|
[assembly: AssemblyFileVersion("2.12.538.1")]
|
||||||
|
|||||||
+18
-9
@@ -150,15 +150,6 @@ namespace TBF.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Again.
|
|
||||||
/// </summary>
|
|
||||||
internal static string Again {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Again", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Air density [kg/m3].
|
/// Looks up a localized string similar to Air density [kg/m3].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -3228,6 +3219,15 @@ namespace TBF.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Reload.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Reload {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Reload", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to remaining time.
|
/// Looks up a localized string similar to remaining time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -3390,6 +3390,15 @@ namespace TBF.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Save again.
|
||||||
|
/// </summary>
|
||||||
|
internal static string Save_again {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Save_again", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Save column widths.
|
/// Looks up a localized string similar to Save column widths.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1164,8 +1164,8 @@
|
|||||||
<data name="Print_watermeter_results" xml:space="preserve">
|
<data name="Print_watermeter_results" xml:space="preserve">
|
||||||
<value>Tisk výsledů vodoměrů</value>
|
<value>Tisk výsledů vodoměrů</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Again" xml:space="preserve">
|
<data name="Save_again" xml:space="preserve">
|
||||||
<value>Znovu</value>
|
<value>Uložit znovu</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Previous_results" xml:space="preserve">
|
<data name="Previous_results" xml:space="preserve">
|
||||||
<value>Predešlé výsledky</value>
|
<value>Predešlé výsledky</value>
|
||||||
@@ -1275,4 +1275,10 @@
|
|||||||
<data name="Retry" xml:space="preserve">
|
<data name="Retry" xml:space="preserve">
|
||||||
<value>Zopakovat</value>
|
<value>Zopakovat</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
<data name="Reload" xml:space="preserve">
|
||||||
|
<value>Znovu otevřít</value>
|
||||||
|
</data>
|
||||||
|
<data name="Show" xml:space="preserve">
|
||||||
|
<value>Zobrazit</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
|
|||||||
@@ -1155,8 +1155,8 @@
|
|||||||
<data name="Print_watermeter_results" xml:space="preserve">
|
<data name="Print_watermeter_results" xml:space="preserve">
|
||||||
<value>Wasserzählerergebnisse drucken</value>
|
<value>Wasserzählerergebnisse drucken</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Again" xml:space="preserve">
|
<data name="Save_again" xml:space="preserve">
|
||||||
<value>Wieder</value>
|
<value>Wieder speichern</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Previous_results" xml:space="preserve">
|
<data name="Previous_results" xml:space="preserve">
|
||||||
<value>Vorherige Ergebnisse</value>
|
<value>Vorherige Ergebnisse</value>
|
||||||
|
|||||||
@@ -1363,8 +1363,8 @@
|
|||||||
<data name="Print_watermeter_results" xml:space="preserve">
|
<data name="Print_watermeter_results" xml:space="preserve">
|
||||||
<value>Print watermeter results</value>
|
<value>Print watermeter results</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Again" xml:space="preserve">
|
<data name="Save_again" xml:space="preserve">
|
||||||
<value>Again</value>
|
<value>Save again</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Sent" xml:space="preserve">
|
<data name="Sent" xml:space="preserve">
|
||||||
<value>Sent</value>
|
<value>Sent</value>
|
||||||
@@ -1714,4 +1714,4 @@
|
|||||||
<data name="Turning_direction" xml:space="preserve">
|
<data name="Turning_direction" xml:space="preserve">
|
||||||
<value>Turning direction</value>
|
<value>Turning direction</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
+25
-11
@@ -32,8 +32,9 @@ namespace TBF.Screens
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.splitContainer = new System.Windows.Forms.SplitContainer();
|
this.splitContainer = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.reloadPreviousResultsButton = new System.Windows.Forms.Button();
|
||||||
this.columnWidthsButton = new System.Windows.Forms.Button();
|
this.columnWidthsButton = new System.Windows.Forms.Button();
|
||||||
this.previousResultsButton = new System.Windows.Forms.Button();
|
this.showPreviousResultsButton = new System.Windows.Forms.Button();
|
||||||
this.configureButton = new System.Windows.Forms.Button();
|
this.configureButton = new System.Windows.Forms.Button();
|
||||||
this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
|
this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
|
||||||
@@ -54,8 +55,9 @@ namespace TBF.Screens
|
|||||||
// splitContainer.Panel1
|
// splitContainer.Panel1
|
||||||
//
|
//
|
||||||
this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control;
|
this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.splitContainer.Panel1.Controls.Add(this.reloadPreviousResultsButton);
|
||||||
this.splitContainer.Panel1.Controls.Add(this.columnWidthsButton);
|
this.splitContainer.Panel1.Controls.Add(this.columnWidthsButton);
|
||||||
this.splitContainer.Panel1.Controls.Add(this.previousResultsButton);
|
this.splitContainer.Panel1.Controls.Add(this.showPreviousResultsButton);
|
||||||
this.splitContainer.Panel1.Controls.Add(this.configureButton);
|
this.splitContainer.Panel1.Controls.Add(this.configureButton);
|
||||||
//
|
//
|
||||||
// splitContainer.Panel2
|
// splitContainer.Panel2
|
||||||
@@ -65,6 +67,17 @@ namespace TBF.Screens
|
|||||||
this.splitContainer.SplitterDistance = 42;
|
this.splitContainer.SplitterDistance = 42;
|
||||||
this.splitContainer.TabIndex = 0;
|
this.splitContainer.TabIndex = 0;
|
||||||
//
|
//
|
||||||
|
// reloadPreviousResultsButton
|
||||||
|
//
|
||||||
|
this.reloadPreviousResultsButton.Enabled = false;
|
||||||
|
this.reloadPreviousResultsButton.Location = new System.Drawing.Point(405, 10);
|
||||||
|
this.reloadPreviousResultsButton.Name = "reloadPreviousResultsButton";
|
||||||
|
this.reloadPreviousResultsButton.Size = new System.Drawing.Size(147, 30);
|
||||||
|
this.reloadPreviousResultsButton.TabIndex = 3;
|
||||||
|
this.reloadPreviousResultsButton.Text = "Reload previous results";
|
||||||
|
this.reloadPreviousResultsButton.UseVisualStyleBackColor = true;
|
||||||
|
this.reloadPreviousResultsButton.Click += new System.EventHandler(this.reloadPreviousResultsButton_Click);
|
||||||
|
//
|
||||||
// columnWidthsButton
|
// columnWidthsButton
|
||||||
//
|
//
|
||||||
this.columnWidthsButton.Location = new System.Drawing.Point(126, 10);
|
this.columnWidthsButton.Location = new System.Drawing.Point(126, 10);
|
||||||
@@ -75,15 +88,15 @@ namespace TBF.Screens
|
|||||||
this.columnWidthsButton.UseVisualStyleBackColor = true;
|
this.columnWidthsButton.UseVisualStyleBackColor = true;
|
||||||
this.columnWidthsButton.Click += new System.EventHandler(this.columnWidthsButton_Click);
|
this.columnWidthsButton.Click += new System.EventHandler(this.columnWidthsButton_Click);
|
||||||
//
|
//
|
||||||
// previousResultsButton
|
// showPreviousResultsButton
|
||||||
//
|
//
|
||||||
this.previousResultsButton.Location = new System.Drawing.Point(252, 10);
|
this.showPreviousResultsButton.Location = new System.Drawing.Point(252, 10);
|
||||||
this.previousResultsButton.Name = "previousResultsButton";
|
this.showPreviousResultsButton.Name = "showPreviousResultsButton";
|
||||||
this.previousResultsButton.Size = new System.Drawing.Size(147, 30);
|
this.showPreviousResultsButton.Size = new System.Drawing.Size(147, 30);
|
||||||
this.previousResultsButton.TabIndex = 2;
|
this.showPreviousResultsButton.TabIndex = 2;
|
||||||
this.previousResultsButton.Text = "Previous results";
|
this.showPreviousResultsButton.Text = "Show previous results";
|
||||||
this.previousResultsButton.UseVisualStyleBackColor = true;
|
this.showPreviousResultsButton.UseVisualStyleBackColor = true;
|
||||||
this.previousResultsButton.Click += new System.EventHandler(this.previousResultsButton_Click);
|
this.showPreviousResultsButton.Click += new System.EventHandler(this.showPreviousResultsButton_Click);
|
||||||
//
|
//
|
||||||
// configureButton
|
// configureButton
|
||||||
//
|
//
|
||||||
@@ -129,6 +142,7 @@ namespace TBF.Screens
|
|||||||
private System.Windows.Forms.Button configureButton;
|
private System.Windows.Forms.Button configureButton;
|
||||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
|
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
|
||||||
private System.Windows.Forms.Button columnWidthsButton;
|
private System.Windows.Forms.Button columnWidthsButton;
|
||||||
private System.Windows.Forms.Button previousResultsButton;
|
private System.Windows.Forms.Button showPreviousResultsButton;
|
||||||
|
private System.Windows.Forms.Button reloadPreviousResultsButton;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,14 @@ namespace TBF.Screens
|
|||||||
else
|
else
|
||||||
OnTestCompleted(sender, args);
|
OnTestCompleted(sender, args);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Bridge.ButtonsEtcHandler += delegate(object sndr, ButtonsEtcEventArgs args)
|
||||||
|
{
|
||||||
|
if (InvokeRequired)
|
||||||
|
Invoke(new EventHandler<ButtonsEtcEventArgs>(OnButtonsEtc), sndr, args);
|
||||||
|
else
|
||||||
|
OnButtonsEtc(sndr, args);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnProcedureSelected(object sender, ProcedureSelectedEventArgs args)
|
void OnProcedureSelected(object sender, ProcedureSelectedEventArgs args)
|
||||||
@@ -74,12 +82,17 @@ namespace TBF.Screens
|
|||||||
RedrawAll(TBF.BenchControl.Sequences.ProcessData.BatchRslts);
|
RedrawAll(TBF.BenchControl.Sequences.ProcessData.BatchRslts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnButtonsEtc(object sender, UiBridge.ButtonsEtcEventArgs args)
|
||||||
|
{
|
||||||
|
reloadPreviousResultsButton.Enabled = ((args.Flags & UiBridge.ButtonsEtc.ProcedureCmbBoxEn) != 0);
|
||||||
|
}
|
||||||
|
|
||||||
private void ResultsTabPageCtrl_Load(object sender, EventArgs e)
|
private void ResultsTabPageCtrl_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// Localization
|
// Localization
|
||||||
configureButton.Text = Strings.Configure;
|
configureButton.Text = Strings.Configure;
|
||||||
columnWidthsButton.Text = Strings.Save_column_widths;
|
columnWidthsButton.Text = Strings.Save_column_widths;
|
||||||
previousResultsButton.Text = Strings.Previous_results;
|
showPreviousResultsButton.Text = Strings.Previous_results;
|
||||||
|
|
||||||
MetersArrangement = Program.LocalSettings.ResultsConfigMeters;
|
MetersArrangement = Program.LocalSettings.ResultsConfigMeters;
|
||||||
TestsArrangement = Program.LocalSettings.ResultsConfigTests;
|
TestsArrangement = Program.LocalSettings.ResultsConfigTests;
|
||||||
@@ -143,11 +156,16 @@ namespace TBF.Screens
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clear the results
|
/// Clear the results
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void previousResultsButton_Click(object sender, EventArgs e)
|
private void showPreviousResultsButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
new TBF.Forms.PreviousResultsDlg().ShowDialog();
|
new TBF.Forms.PreviousResultsDlg().ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reloadPreviousResultsButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
new TBF.Forms.PreviousResultsDlg(true).ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
#region Redraw
|
#region Redraw
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ namespace TBF.UiBridge
|
|||||||
|
|
||||||
public static readonly Queue<UI2BenchCmd> Ui2MachineQueue;
|
public static readonly Queue<UI2BenchCmd> Ui2MachineQueue;
|
||||||
|
|
||||||
|
public static int BatchNr;
|
||||||
|
|
||||||
public static string SelectedProcedureName
|
public static string SelectedProcedureName
|
||||||
{
|
{
|
||||||
get { return Program.MainWnd.ProcedureName; }
|
get { return Program.MainWnd.ProcedureName; }
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ namespace TBF.UiBridge
|
|||||||
public enum UI2BenchCmd
|
public enum UI2BenchCmd
|
||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
|
ReloadBatch,
|
||||||
StartTest,
|
StartTest,
|
||||||
StartQ1,
|
StartQ1,
|
||||||
StartQ2,
|
StartQ2,
|
||||||
|
|||||||
Reference in New Issue
Block a user