Possibility to reload previous results, MainSeq modified - CreateNewBatchResults() and RestoreBatchResults(), ver. 2.12.538

This commit is contained in:
Milan Hanajik
2017-04-11 17:31:48 +02:00
parent 60f5359bd9
commit 1ccdcf9bd2
17 changed files with 512 additions and 431 deletions
+25
View File
@@ -270,5 +270,30 @@ namespace Results
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;
}
}
}
+4 -3
View File
@@ -115,6 +115,7 @@ namespace TBF.BenchControl
TurnPumpOnOffDone,
/// CheckUi events
UiCmdReloadBatch,
UiCmdStartTest,
UiCmdStartQ1,
UiCmdStartQ2,
@@ -123,9 +124,9 @@ namespace TBF.BenchControl
UiCmdStop,
UiCmdPurgeBegin,
UiCmdPurgeEnd,
UiCmdEmptyTank1,
UiCmdEmptyTank2,
UiCmdEmptyTank3,
UiCmdDrainTank1,
UiCmdDrainTank2,
UiCmdDrainTank3,
UiCmdBreak,
UiCmdResetResults,
UiCmdAcceptResults,
@@ -77,7 +77,8 @@ namespace TBF.BenchControl.Operations
switch (cmd)
{
/// 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.StartQ2: return Event.UiCmdStartQ2;
case UI2BenchCmd.StartQ3: return Event.UiCmdStartQ3;
@@ -85,9 +86,9 @@ namespace TBF.BenchControl.Operations
case UI2BenchCmd.Stop: return Event.UiCmdStop;
case UI2BenchCmd.PurgeBegin: return Event.UiCmdPurgeBegin;
case UI2BenchCmd.PurgeEnd: return Event.UiCmdPurgeEnd;
case UI2BenchCmd.DrainTank1: return Event.UiCmdEmptyTank1;
case UI2BenchCmd.DrainTank2: return Event.UiCmdEmptyTank2;
case UI2BenchCmd.DrainTank3: return Event.UiCmdEmptyTank3;
case UI2BenchCmd.DrainTank1: return Event.UiCmdDrainTank1;
case UI2BenchCmd.DrainTank2: return Event.UiCmdDrainTank2;
case UI2BenchCmd.DrainTank3: return Event.UiCmdDrainTank3;
case UI2BenchCmd.Break: return Event.UiCmdBreak;
case UI2BenchCmd.ResetResults: return Event.UiCmdResetResults;
case UI2BenchCmd.AcceptResults: return Event.UiCmdAcceptResults;
@@ -32,6 +32,7 @@ namespace TBF.BenchControl.Sequences
IList<Generic.ITestParams> simultWithEvacuationParams;
System.Windows.Forms.Form modelessDlg;
///
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("--------------------------------------");
}
}
///
void CloseIPerlCommForm()
{
UiBridge.Bridge.OnCloseModelessForm(this, null);
@@ -219,106 +220,46 @@ namespace TBF.BenchControl.Sequences
//--------------------------------------------------------------------------------------------
select_procedure:
/// Make sure the CycleBeginForm is closed (after an abnormal procedure/test end, etc.)
CloseBeginForm();
selection = MakeSelection(MKSelContext.ProcedureNotSelected);
//--------------------------------
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
StateMachine.LoadProcedure(false);
if (StateMachine.Procedure == null) goto select_procedure;
CloseBeginForm(); /// Make sure the CycleBeginForm is closed (after an abnormal end, etc.)
do
{
selection = MakeSelection(MKSelContext.ProcedureNotSelected);
StateMachine.LoadProcedure(false);
}
while (StateMachine.Procedure == null); /// Make sure a valid procedure is selected
///
/// Procedure selected at this point, a new batch was started
///
StateMachine.LoadProcedureParams(StateMachine.Procedure);
StateMachine.LoadProcedureParams(StateMachine.Procedure);
///
/// Prepare new water meters
///
foreach (var wm in WaterMeters) wm.ClearData(); /// Clean water meter data
Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// Enable STOP button
bool compound = (StateMachine.Procedure.MetersKind == MetersKind.Combined);
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++)
if (selection == Selection.RestoreBatch)
{
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;
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
TransitionSequence purgeBegin = null;
@@ -335,9 +276,11 @@ namespace TBF.BenchControl.Sequences
{
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")
.AddOperation(new Operations.AskYesNoOp(Strings.Fill_with_water))
.AddOperation(checkUiOp)
@@ -417,7 +360,7 @@ namespace TBF.BenchControl.Sequences
benchFilled = true;
Bridge.Bench2UI(ButtonsEtc.ShowBenchFilled);
if (selection != Selection.PurgeBegin)
if (selection != Selection.PurgeBegin && selection != Selection.RestoreBatch)
{
goto cycle_or_test_selected;
}
@@ -1040,33 +983,23 @@ namespace TBF.BenchControl.Sequences
}
/// <summary>
/// Selection done in MakeSelection()
/// Return values of MakeSelection()
/// </summary>
public enum Selection
{
/// Handled inside MakeSelection()
None,
DrainTank1,
DrainTank2,
DrainTank3,
CloseTank1,
CloseTank2,
CloseTank3,
CameraTest,
/// Used as return values
Cycle,
RestOfCycle,
Test,
Q1,
Q2,
Q3,
Stop,
PurgeBegin,
PurgeEnd,
public enum Selection
{
PurgeBegin,
PurgeEnd,
Break,
SaveResults,
}
Cycle,
RestOfCycle,
Test,
Q1,
Q2,
Q3,
SaveResults,
RestoreBatch,
}
/// <summary>
/// Idle loop to make a procedure or test selection.
@@ -1074,14 +1007,15 @@ namespace TBF.BenchControl.Sequences
/// </summary>
/// <param name="context">Context where MakeSelection() is called</param>
/// <returns>
/// Selection.Cycle
/// Selection.PurgeBegin
/// Selection.PurgeEnd
/// Selection.Break
/// Selection.Cycle
/// Selection.Test
/// Selection.Q1
/// Selection.Q2
/// Selection.Q3
/// Selection.Stop
/// Selection.PurgeBegin
/// Selection.PurgeEnd
/// Selection.SaveResults
/// </returns>
private Selection MakeSelection(MKSelContext context)
{
@@ -1096,7 +1030,6 @@ namespace TBF.BenchControl.Sequences
DoubleBox mass3 = new DoubleBox();
IList<Event> e;
Selection selection;
while (true)
{
@@ -1130,7 +1063,7 @@ namespace TBF.BenchControl.Sequences
(((StateMachine.Scale2 != null) && (StateMachine.DrainValve2 != null) && !draining2) ? ButtonsEtc.DrainTankBtn2En : 0) |
(((StateMachine.Scale3 != null) && (StateMachine.DrainValve3 != null) && !draining3) ? ButtonsEtc.DrainTankBtn3En : 0));
selection = Selection.None;
State.Create("MainSeq : Select an activity")
.AddOperation(checkUiOp)
.AddOperation((StateMachine.Scale1 != null) ? StateMachine.Scale1.ReadMassOp(ref mass1) : null)
@@ -1141,32 +1074,42 @@ namespace TBF.BenchControl.Sequences
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
else if (e.Contains(Event.UiCmdStop)) selection = Selection.Stop;
else if (e.Contains(Event.UiCmdCameraTest)) selection = Selection.CameraTest;
else if (e.Contains(Event.UiCmdEmptyTank1)) selection = Selection.DrainTank1;
else if (e.Contains(Event.UiCmdEmptyTank2)) selection = Selection.DrainTank2;
else if (e.Contains(Event.UiCmdEmptyTank3)) selection = Selection.DrainTank3;
else if (draining1 && StateMachine.Scale1.IsEmpty(mass1.Val)) selection = Selection.CloseTank1;
else if (draining2 && StateMachine.Scale2.IsEmpty(mass2.Val)) selection = Selection.CloseTank2;
else if (draining3 && StateMachine.Scale3.IsEmpty(mass3.Val)) selection = Selection.CloseTank3;
else if (e.Contains(Event.UiCmdPurgeBegin)) return Selection.PurgeBegin; /// Value used to branch the code later on
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);
/// Handled inside MakeSelection() inside the selection loop
if (e.Contains(Event.Error)) break;
if (e.Contains(Event.UiCmdStop)) break;
if (e.Contains(Event.UiCmdDrainTank1)) break;
if (e.Contains(Event.UiCmdDrainTank2)) break;
if (e.Contains(Event.UiCmdDrainTank3)) break;
if (draining1 && StateMachine.Scale1.IsEmpty(mass1.Val)) break;
if (draining2 && StateMachine.Scale2.IsEmpty(mass2.Val)) break;
if (draining3 && StateMachine.Scale3.IsEmpty(mass3.Val)) break;
if (selection == Selection.CameraTest)
{
CameraTest();
}
else if (selection == Selection.Stop)
/// Quit the selection loop and leave MakeSelection()
if (e.Contains(Event.UiCmdBreak) && context == MKSelContext.InsideProcedure) return Selection.Break;
if (e.Contains(Event.UiCmdPurgeBegin)) return Selection.PurgeBegin;
if (e.Contains(Event.UiCmdPurgeEnd)) return Selection.PurgeEnd;
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)
{
@@ -1182,12 +1125,13 @@ namespace TBF.BenchControl.Sequences
while (!e.Contains(Event.ValvesSet));
draining1 = draining2 = draining3 = false;
}
selection = Selection.None;
}
else if ((selection == Selection.DrainTank1) && !draining1)
else if (e.Contains(Event.UiCmdDrainTank1) && !draining1)
{
draining1 = true;
///--------------------------------------------
Bridge.OnActivity(this, Strings.Emptying_tank);
///--------------------------------------------
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
(draining2 ? 0 : ButtonsEtc.DrainTankBtn2En) |
@@ -1198,10 +1142,12 @@ namespace TBF.BenchControl.Sequences
do { e = StateMachine.WaitRunDevsRunOps(); }
while (!e.Contains(Event.ValvesSet));
}
else if ((selection == Selection.DrainTank2) && !draining2)
else if (e.Contains(Event.UiCmdDrainTank2) && !draining2)
{
draining2 = true;
///--------------------------------------------
Bridge.OnActivity(this, Strings.Emptying_tank);
///--------------------------------------------
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
(draining1 ? 0 : ButtonsEtc.DrainTankBtn1En) |
@@ -1212,10 +1158,12 @@ namespace TBF.BenchControl.Sequences
do { e = StateMachine.WaitRunDevsRunOps(); }
while (!e.Contains(Event.ValvesSet));
}
else if ((selection == Selection.DrainTank3) && !draining3)
else if (e.Contains(Event.UiCmdDrainTank3) && !draining3)
{
draining3 = true;
///--------------------------------------------
Bridge.OnActivity(this, Strings.Emptying_tank);
///--------------------------------------------
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
(draining1 ? 0 : ButtonsEtc.DrainTankBtn1En) |
@@ -1226,7 +1174,7 @@ namespace TBF.BenchControl.Sequences
do { e = StateMachine.WaitRunDevsRunOps(); }
while (!e.Contains(Event.ValvesSet));
}
else if (selection == Selection.CloseTank1)
else if (draining1 && StateMachine.Scale1.IsEmpty(mass1.Val))
{
State.Create("MainSeq : Close tank 1")
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve1))
@@ -1235,7 +1183,7 @@ namespace TBF.BenchControl.Sequences
while (!e.Contains(Event.ValvesSet));
draining1 = false;
}
else if (selection == Selection.CloseTank2)
else if (draining2 && StateMachine.Scale2.IsEmpty(mass2.Val))
{
State.Create("MainSeq : Close tank 2")
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve2))
@@ -1244,7 +1192,7 @@ namespace TBF.BenchControl.Sequences
while (!e.Contains(Event.ValvesSet));
draining2 = false;
}
else if (selection == Selection.CloseTank3)
else if (draining3 && StateMachine.Scale3.IsEmpty(mass3.Val))
{
State.Create("MainSeq : Close tank 3")
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.DrainValve3))
@@ -1254,102 +1202,111 @@ namespace TBF.BenchControl.Sequences
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:
Bridge.OnActivity(this, "Camera test");
//---------------------------------------------------------
Bridge.Bench2UI(ButtonsEtc.StartTestBtnsEn | ButtonsEtc.StopBtnEn);
State.Create("MainSeq : 1 = Grab, 2 = Live, 3 = Focus, Stop = Quit camera test")
.AddOperation(checkUiOp)
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
if (e.Contains(Event.UiCmdStop)) return;
if (e.Contains(Event.UiCmdStartQ1)) goto grab;
if (e.Contains(Event.UiCmdStartQ2)) goto live;
if (e.Contains(Event.UiCmdStartQ3)) goto focus;
}
while (true);
/// <summary>
/// Create a new empty batch results from the procedure
/// </summary>
/// <param name="newBatchNr">New batch number</param>
/// <param name="procedure">Selected procedure</param>
/// <returns>Created BatchResults</returns>
Results.BatchResults CreateNewBatchResults(int newBatchNr, Procedure procedure)
{
///
/// Prepare new water meters
///
foreach (var wm in WaterMeters) wm.ClearData(); /// Clean water meter data
grab:
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
State.Create("MainSeq : Press 'Stop' to continue")
.AddOperation(checkUiOp)
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[0].GrabImageOp() : null)
.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)
.AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[3].GrabImageOp() : null)
.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)
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
if (e.Contains(Event.UiCmdStop)) goto camera_test;
}
while (true);
bool compound = (StateMachine.Procedure.MetersKind == MetersKind.Combined);
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;
live:
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
State.Create("MainSeq : Press 'Stop' to stop.")
.AddOperation(checkUiOp)
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != DebugMode.DetectedOff)) ? Cameras[0].LiveStreamOp(false) : null)
.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);
waterMeterParts[wmNr] = Utils.PartNr(wmNr + 1, compound);
waterMeterData[wmNr] = new Results.Entities.WaterMeterData()
{
ProductName = WaterMeters[ix].ProductName,
Producer = WaterMeters[ix].Producer,
focus:
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
State.Create("MainSeq : Press 'Stop' to stop.")
.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);
L = WaterMeters[ix].L,
DN = WaterMeters[ix].DN,
Mounting = WaterMeters[ix].Mounting,
error:
Bridge.OnActivity(this, Strings.Error);
State.Create("MainSeq : ERROR state")
.EnterState();
while (true) StateMachine.WaitRunDevsRunOps();
}
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
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()
+124 -124
View File
@@ -28,135 +28,135 @@
/// </summary>
private void InitializeComponent()
{
this.sendButton = new System.Windows.Forms.Button();
this.sentCheckBox = new System.Windows.Forms.CheckBox();
this.failedCountLabel = new System.Windows.Forms.Label();
this.passedCountLabel = new System.Windows.Forms.Label();
this.purchaseOrderLabel = new System.Windows.Forms.Label();
this.procedureLabel = new System.Windows.Forms.Label();
this.endTimeLabel = new System.Windows.Forms.Label();
this.startTimeLabel = new System.Windows.Forms.Label();
this.batchNrLabel = new System.Windows.Forms.Label();
this.showButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// sendButton
//
this.sendButton.Location = new System.Drawing.Point(832, 2);
this.sendButton.Name = "sendButton";
this.sendButton.Size = new System.Drawing.Size(104, 23);
this.sendButton.TabIndex = 15;
this.sendButton.Text = "Again";
this.sendButton.UseVisualStyleBackColor = true;
this.sendButton.Click += new System.EventHandler(this.sendButton_Click);
//
// sentCheckBox
//
this.sentCheckBox.AutoSize = true;
this.sentCheckBox.Location = new System.Drawing.Point(748, 6);
this.sentCheckBox.Name = "sentCheckBox";
this.sentCheckBox.Size = new System.Drawing.Size(48, 17);
this.sentCheckBox.TabIndex = 14;
this.sentCheckBox.Text = "Sent";
this.sentCheckBox.UseVisualStyleBackColor = true;
//
// failedCountLabel
//
this.failedCountLabel.AutoSize = true;
this.failedCountLabel.Location = new System.Drawing.Point(681, 7);
this.failedCountLabel.Name = "failedCountLabel";
this.failedCountLabel.Size = new System.Drawing.Size(48, 13);
this.failedCountLabel.TabIndex = 13;
this.failedCountLabel.Text = "failedCnt";
//
// passedCountLabel
//
this.passedCountLabel.AutoSize = true;
this.passedCountLabel.Location = new System.Drawing.Point(590, 7);
this.passedCountLabel.Name = "passedCountLabel";
this.passedCountLabel.Size = new System.Drawing.Size(57, 13);
this.passedCountLabel.TabIndex = 12;
this.passedCountLabel.Text = "passedCnt";
//
// purchaseOrderLabel
//
this.purchaseOrderLabel.AutoSize = true;
this.purchaseOrderLabel.Location = new System.Drawing.Point(481, 7);
this.purchaseOrderLabel.Name = "purchaseOrderLabel";
this.purchaseOrderLabel.Size = new System.Drawing.Size(77, 13);
this.purchaseOrderLabel.TabIndex = 11;
this.purchaseOrderLabel.Text = "purchaseOrder";
//
// procedureLabel
//
this.procedureLabel.AutoSize = true;
this.procedureLabel.Location = new System.Drawing.Point(328, 7);
this.procedureLabel.Name = "procedureLabel";
this.procedureLabel.Size = new System.Drawing.Size(55, 13);
this.procedureLabel.TabIndex = 10;
this.procedureLabel.Text = "procedure";
//
// endTimeLabel
//
this.endTimeLabel.AutoSize = true;
this.endTimeLabel.Location = new System.Drawing.Point(185, 7);
this.endTimeLabel.Name = "endTimeLabel";
this.endTimeLabel.Size = new System.Drawing.Size(48, 13);
this.endTimeLabel.TabIndex = 9;
this.endTimeLabel.Text = "endTime";
//
// startTimeLabel
//
this.startTimeLabel.AutoSize = true;
this.startTimeLabel.Location = new System.Drawing.Point(54, 7);
this.startTimeLabel.Name = "startTimeLabel";
this.startTimeLabel.Size = new System.Drawing.Size(50, 13);
this.startTimeLabel.TabIndex = 8;
this.startTimeLabel.Text = "startTime";
//
// batchNrLabel
//
this.batchNrLabel.AutoSize = true;
this.batchNrLabel.Location = new System.Drawing.Point(3, 7);
this.batchNrLabel.Name = "batchNrLabel";
this.batchNrLabel.Size = new System.Drawing.Size(24, 13);
this.batchNrLabel.TabIndex = 16;
this.batchNrLabel.Text = "bNr";
//
// showButton
//
this.showButton.Location = new System.Drawing.Point(939, 2);
this.showButton.Name = "showButton";
this.showButton.Size = new System.Drawing.Size(104, 23);
this.showButton.TabIndex = 17;
this.showButton.Text = "Show";
this.showButton.UseVisualStyleBackColor = true;
this.showButton.Click += new System.EventHandler(this.showButton_Click);
//
// PreviousResultCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.showButton);
this.Controls.Add(this.batchNrLabel);
this.Controls.Add(this.sendButton);
this.Controls.Add(this.sentCheckBox);
this.Controls.Add(this.failedCountLabel);
this.Controls.Add(this.passedCountLabel);
this.Controls.Add(this.purchaseOrderLabel);
this.Controls.Add(this.procedureLabel);
this.Controls.Add(this.endTimeLabel);
this.Controls.Add(this.startTimeLabel);
this.Name = "PreviousResultCtrl";
this.Size = new System.Drawing.Size(1048, 26);
this.ResumeLayout(false);
this.PerformLayout();
this.sendReloadButton = new System.Windows.Forms.Button();
this.sentCheckBox = new System.Windows.Forms.CheckBox();
this.failedCountLabel = new System.Windows.Forms.Label();
this.passedCountLabel = new System.Windows.Forms.Label();
this.purchaseOrderLabel = new System.Windows.Forms.Label();
this.procedureLabel = new System.Windows.Forms.Label();
this.endTimeLabel = new System.Windows.Forms.Label();
this.startTimeLabel = new System.Windows.Forms.Label();
this.batchNrLabel = new System.Windows.Forms.Label();
this.showButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// sendReloadButton
//
this.sendReloadButton.Location = new System.Drawing.Point(832, 2);
this.sendReloadButton.Name = "sendReloadButton";
this.sendReloadButton.Size = new System.Drawing.Size(104, 23);
this.sendReloadButton.TabIndex = 15;
this.sendReloadButton.Text = "Again";
this.sendReloadButton.UseVisualStyleBackColor = true;
this.sendReloadButton.Click += new System.EventHandler(this.sendReloadButton_Click);
//
// sentCheckBox
//
this.sentCheckBox.AutoSize = true;
this.sentCheckBox.Location = new System.Drawing.Point(748, 6);
this.sentCheckBox.Name = "sentCheckBox";
this.sentCheckBox.Size = new System.Drawing.Size(48, 17);
this.sentCheckBox.TabIndex = 14;
this.sentCheckBox.Text = "Sent";
this.sentCheckBox.UseVisualStyleBackColor = true;
//
// failedCountLabel
//
this.failedCountLabel.AutoSize = true;
this.failedCountLabel.Location = new System.Drawing.Point(681, 7);
this.failedCountLabel.Name = "failedCountLabel";
this.failedCountLabel.Size = new System.Drawing.Size(48, 13);
this.failedCountLabel.TabIndex = 13;
this.failedCountLabel.Text = "failedCnt";
//
// passedCountLabel
//
this.passedCountLabel.AutoSize = true;
this.passedCountLabel.Location = new System.Drawing.Point(590, 7);
this.passedCountLabel.Name = "passedCountLabel";
this.passedCountLabel.Size = new System.Drawing.Size(57, 13);
this.passedCountLabel.TabIndex = 12;
this.passedCountLabel.Text = "passedCnt";
//
// purchaseOrderLabel
//
this.purchaseOrderLabel.AutoSize = true;
this.purchaseOrderLabel.Location = new System.Drawing.Point(481, 7);
this.purchaseOrderLabel.Name = "purchaseOrderLabel";
this.purchaseOrderLabel.Size = new System.Drawing.Size(77, 13);
this.purchaseOrderLabel.TabIndex = 11;
this.purchaseOrderLabel.Text = "purchaseOrder";
//
// procedureLabel
//
this.procedureLabel.AutoSize = true;
this.procedureLabel.Location = new System.Drawing.Point(328, 7);
this.procedureLabel.Name = "procedureLabel";
this.procedureLabel.Size = new System.Drawing.Size(55, 13);
this.procedureLabel.TabIndex = 10;
this.procedureLabel.Text = "procedure";
//
// endTimeLabel
//
this.endTimeLabel.AutoSize = true;
this.endTimeLabel.Location = new System.Drawing.Point(185, 7);
this.endTimeLabel.Name = "endTimeLabel";
this.endTimeLabel.Size = new System.Drawing.Size(48, 13);
this.endTimeLabel.TabIndex = 9;
this.endTimeLabel.Text = "endTime";
//
// startTimeLabel
//
this.startTimeLabel.AutoSize = true;
this.startTimeLabel.Location = new System.Drawing.Point(54, 7);
this.startTimeLabel.Name = "startTimeLabel";
this.startTimeLabel.Size = new System.Drawing.Size(50, 13);
this.startTimeLabel.TabIndex = 8;
this.startTimeLabel.Text = "startTime";
//
// batchNrLabel
//
this.batchNrLabel.AutoSize = true;
this.batchNrLabel.Location = new System.Drawing.Point(3, 7);
this.batchNrLabel.Name = "batchNrLabel";
this.batchNrLabel.Size = new System.Drawing.Size(24, 13);
this.batchNrLabel.TabIndex = 16;
this.batchNrLabel.Text = "bNr";
//
// showButton
//
this.showButton.Location = new System.Drawing.Point(939, 2);
this.showButton.Name = "showButton";
this.showButton.Size = new System.Drawing.Size(104, 23);
this.showButton.TabIndex = 17;
this.showButton.Text = "Show";
this.showButton.UseVisualStyleBackColor = true;
this.showButton.Click += new System.EventHandler(this.showButton_Click);
//
// PreviousResultCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.showButton);
this.Controls.Add(this.batchNrLabel);
this.Controls.Add(this.sendReloadButton);
this.Controls.Add(this.sentCheckBox);
this.Controls.Add(this.failedCountLabel);
this.Controls.Add(this.passedCountLabel);
this.Controls.Add(this.purchaseOrderLabel);
this.Controls.Add(this.procedureLabel);
this.Controls.Add(this.endTimeLabel);
this.Controls.Add(this.startTimeLabel);
this.Name = "PreviousResultCtrl";
this.Size = new System.Drawing.Size(1048, 26);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button sendButton;
private System.Windows.Forms.Button sendReloadButton;
private System.Windows.Forms.CheckBox sentCheckBox;
private System.Windows.Forms.Label failedCountLabel;
private System.Windows.Forms.Label passedCountLabel;
+18 -12
View File
@@ -12,7 +12,8 @@ namespace TBF.Forms
{
public partial class PreviousResultCtrl : UserControl
{
PreviousResultsDlg parent;
readonly PreviousResultsDlg parent;
readonly bool reloadEn;
public int BatchNr;
public DateTime StarTime;
@@ -28,10 +29,12 @@ namespace TBF.Forms
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.parent = parent;
this.reloadEn = reloadEn;
BatchNr = bnr;
StarTime = s;
EndTime = e;
@@ -52,17 +55,17 @@ namespace TBF.Forms
#if MUNICH
sentCheckBox.Text = Strings.Printed;
sentCheckBox.Checked = Sent;
sendButton.Enabled = true; /// 'Print again' function always available
sendButton.Text = Strings.Print_again;
sendReloadButton.Enabled = true; /// 'Print again' function always available
sendReloadButton.Text = reloadEn ? Strings.Reload : Strings.Print_again;
#elif ORACLE_DB
sentCheckBox.Text = Strings.Sent;
sentCheckBox.Checked = Sent;
sendButton.Enabled = !Sent;
sendButton.Text = Strings.Again;
sendReloadButton.Enabled = reloadEn || !Sent;
sendReloadButton.Text = reloadEn ? Strings.Reload : Strings.Save_again;
#else
sentCheckBox.Visible = false;
sendButton.Enabled = false;
sendButton.Visible = false;
sendReloadButton.Enabled = false;
sendReloadButton.Visible = false;
#endif
showButton.Text = Strings.Show;
}
@@ -72,16 +75,19 @@ namespace TBF.Forms
this.Sent = sent;
#if MUNICH
sentCheckBox.Checked = sent;
sendButton.Enabled = true;
sendReloadButton.Enabled = true;
#elif ORACLE_DB
sentCheckBox.Checked = sent;
sendButton.Enabled = !sent;
sendReloadButton.Enabled = !sent;
#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)
+39 -4
View File
@@ -23,11 +23,13 @@ namespace TBF.Forms
ISession session;
int currentBatchNr;
IList<Batch> batches;
bool reloadEn;
public PreviousResultsDlg()
public PreviousResultsDlg(bool reloadEn)
{
InitializeComponent();
this.reloadEn = reloadEn;
currentBatchNr = Program.LocalSettings.BatchNr;
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)
{
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;
/// <summary>
@@ -74,8 +102,14 @@ namespace TBF.Forms
public void OnSendAgain(object sender, PreviousResultIdEventArgs data)
{
if (SendAgainHandler == null) return;
try { SendAgainHandler(sender, data); }
catch (Exception e) { log.Error("SendAgainHandler(...) failed", e); }
try
{
SendAgainHandler(sender, data);
}
catch (Exception e)
{
log.Error("SendAgainHandler(...) failed", e);
}
}
public void DoSendAgain(object sender, PreviousResultIdEventArgs data)
@@ -216,7 +250,8 @@ namespace TBF.Forms
b.WaterMeters[0].PurchaseOrder,
passedCount,
failedCount,
b.RsltsSent));
b.RsltsSent,
reloadEn));
}
ResumeLayout();
+15 -9
View File
@@ -443,21 +443,27 @@ namespace TBF
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();
if (CurrentProcedure != null && CurrentProcedure.Description != null)
{
descriptionLabel.Text = CurrentProcedure.Description;
}
if (CurrentProcedure != null && CurrentProcedure.Description != null)
{
descriptionLabel.Text = CurrentProcedure.Description;
}
if (CurrentProcedure != null && testProgressControls != null)
{
testProgressControls.ProcedureSelectedInUI(this, new UiBridge.ProcedureSelectedEventArgs(CurrentProcedure));
}
if (!string.IsNullOrEmpty(ProcedureName))
{
Program.LocalSettings.LastProcedureName = ProcedureName;
Program.LocalSettings.Save();
}
{
Program.LocalSettings.LastProcedureName = ProcedureName;
Program.LocalSettings.Save();
}
}
private void MainWnd_FormClosing(object sender, FormClosingEventArgs e)
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.12.536.1")]
[assembly: AssemblyFileVersion("2.12.536.1")]
[assembly: AssemblyVersion("2.12.538.1")]
[assembly: AssemblyFileVersion("2.12.538.1")]
+18 -9
View File
@@ -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>
/// Looks up a localized string similar to Air density [kg/m3].
/// </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>
/// Looks up a localized string similar to remaining time.
/// </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>
/// Looks up a localized string similar to Save column widths.
/// </summary>
+9 -3
View File
@@ -1164,8 +1164,8 @@
<data name="Print_watermeter_results" xml:space="preserve">
<value>Tisk výsledů vodoměrů</value>
</data>
<data name="Again" xml:space="preserve">
<value>Znovu</value>
<data name="Save_again" xml:space="preserve">
<value>Uložit znovu</value>
</data>
<data name="Previous_results" xml:space="preserve">
<value>Predešlé výsledky</value>
@@ -1275,4 +1275,10 @@
<data name="Retry" xml:space="preserve">
<value>Zopakovat</value>
</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>
+2 -2
View File
@@ -1155,8 +1155,8 @@
<data name="Print_watermeter_results" xml:space="preserve">
<value>Wasserzählerergebnisse drucken</value>
</data>
<data name="Again" xml:space="preserve">
<value>Wieder</value>
<data name="Save_again" xml:space="preserve">
<value>Wieder speichern</value>
</data>
<data name="Previous_results" xml:space="preserve">
<value>Vorherige Ergebnisse</value>
+3 -3
View File
@@ -1363,8 +1363,8 @@
<data name="Print_watermeter_results" xml:space="preserve">
<value>Print watermeter results</value>
</data>
<data name="Again" xml:space="preserve">
<value>Again</value>
<data name="Save_again" xml:space="preserve">
<value>Save again</value>
</data>
<data name="Sent" xml:space="preserve">
<value>Sent</value>
@@ -1714,4 +1714,4 @@
<data name="Turning_direction" xml:space="preserve">
<value>Turning direction</value>
</data>
</root>
</root>
+25 -11
View File
@@ -32,8 +32,9 @@ namespace TBF.Screens
private void InitializeComponent()
{
this.splitContainer = new System.Windows.Forms.SplitContainer();
this.reloadPreviousResultsButton = 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.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
@@ -54,8 +55,9 @@ namespace TBF.Screens
// splitContainer.Panel1
//
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.previousResultsButton);
this.splitContainer.Panel1.Controls.Add(this.showPreviousResultsButton);
this.splitContainer.Panel1.Controls.Add(this.configureButton);
//
// splitContainer.Panel2
@@ -65,6 +67,17 @@ namespace TBF.Screens
this.splitContainer.SplitterDistance = 42;
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
//
this.columnWidthsButton.Location = new System.Drawing.Point(126, 10);
@@ -75,15 +88,15 @@ namespace TBF.Screens
this.columnWidthsButton.UseVisualStyleBackColor = true;
this.columnWidthsButton.Click += new System.EventHandler(this.columnWidthsButton_Click);
//
// previousResultsButton
// showPreviousResultsButton
//
this.previousResultsButton.Location = new System.Drawing.Point(252, 10);
this.previousResultsButton.Name = "previousResultsButton";
this.previousResultsButton.Size = new System.Drawing.Size(147, 30);
this.previousResultsButton.TabIndex = 2;
this.previousResultsButton.Text = "Previous results";
this.previousResultsButton.UseVisualStyleBackColor = true;
this.previousResultsButton.Click += new System.EventHandler(this.previousResultsButton_Click);
this.showPreviousResultsButton.Location = new System.Drawing.Point(252, 10);
this.showPreviousResultsButton.Name = "showPreviousResultsButton";
this.showPreviousResultsButton.Size = new System.Drawing.Size(147, 30);
this.showPreviousResultsButton.TabIndex = 2;
this.showPreviousResultsButton.Text = "Show previous results";
this.showPreviousResultsButton.UseVisualStyleBackColor = true;
this.showPreviousResultsButton.Click += new System.EventHandler(this.showPreviousResultsButton_Click);
//
// configureButton
//
@@ -129,6 +142,7 @@ namespace TBF.Screens
private System.Windows.Forms.Button configureButton;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
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
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)
@@ -74,12 +82,17 @@ namespace TBF.Screens
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)
{
// Localization
configureButton.Text = Strings.Configure;
columnWidthsButton.Text = Strings.Save_column_widths;
previousResultsButton.Text = Strings.Previous_results;
showPreviousResultsButton.Text = Strings.Previous_results;
MetersArrangement = Program.LocalSettings.ResultsConfigMeters;
TestsArrangement = Program.LocalSettings.ResultsConfigTests;
@@ -143,11 +156,16 @@ namespace TBF.Screens
/// <summary>
/// Clear the results
/// </summary>
private void previousResultsButton_Click(object sender, EventArgs e)
private void showPreviousResultsButton_Click(object sender, EventArgs e)
{
new TBF.Forms.PreviousResultsDlg().ShowDialog();
}
private void reloadPreviousResultsButton_Click(object sender, EventArgs e)
{
new TBF.Forms.PreviousResultsDlg(true).ShowDialog();
}
#region Redraw
/// <summary>
+2
View File
@@ -16,6 +16,8 @@ namespace TBF.UiBridge
public static readonly Queue<UI2BenchCmd> Ui2MachineQueue;
public static int BatchNr;
public static string SelectedProcedureName
{
get { return Program.MainWnd.ProcedureName; }
+1
View File
@@ -7,6 +7,7 @@ namespace TBF.UiBridge
public enum UI2BenchCmd
{
None = 0,
ReloadBatch,
StartTest,
StartQ1,
StartQ2,