diff --git a/TBF/BenchControl/Sequences/ProcessData.cs b/TBF/BenchControl/Sequences/ProcessData.cs index 6dca482d8..2d6e5795f 100644 --- a/TBF/BenchControl/Sequences/ProcessData.cs +++ b/TBF/BenchControl/Sequences/ProcessData.cs @@ -19,6 +19,15 @@ namespace TBF.BenchControl.Sequences public static IErrorFlags ErrorFlagsComp; public static IStatisticsMonitoring StatisticsMonitoringComp; public static Output.DB.SensusOracle.Database OracleDB; + public static Output.DB.ProductionTracing.Tracing TracingDB; + + /// + /// Safe wrappers + /// + public static int WMsCount { get { return Config.Data.WMsCount; } } + public static int LinesCount { get { return Config.Data.WMsCount / Config.Data.LineSize; } } + public static int LineSize { get { return Config.Data.LineSize; } } + public static int CompoundWMsCount { get { return Config.Data.CompoundWMsCount; } } /// /// State variables to be saved after each completed test diff --git a/TBF/BenchControl/StateMachine.cs b/TBF/BenchControl/StateMachine.cs index 5a50cc63f..cf5d70419 100644 --- a/TBF/BenchControl/StateMachine.cs +++ b/TBF/BenchControl/StateMachine.cs @@ -242,8 +242,15 @@ namespace TBF.BenchControl if ((cmpnt is Output.DB.SensusOracle.Database) && (ProcessData.OracleDB == null)) { + /// The 1st Oracle database component found --> store the reference ProcessData.OracleDB = cmpnt as Output.DB.SensusOracle.Database; } + if ((cmpnt is Output.DB.ProductionTracing.Tracing) && (ProcessData.TracingDB == null)) + { + /// The 1st production tracing database component found --> store the reference + ProcessData.TracingDB = cmpnt as Output.DB.ProductionTracing.Tracing; + } + if (cmpnt is TestMethods.iPerlCommunication.iPerlHead.IperlHead) { ProcessData.IperlHeads.Add(cmpnt as TestMethods.iPerlCommunication.iPerlHead.IperlHead); diff --git a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index 25d865e0c..48c1a7e18 100644 --- a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015-2020 Sensus Slovensko a.s. +/// Copyright (c) 2015-2021 Sensus Slovensko a.s. /// //#define VERIFY_ACTIVE_MODE //#define VERIFY_Q2_CORR_RESET @@ -388,8 +388,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication { checkBoxesEditMode = true; saveButton.Visible = true; - activityLabel.Text = Strings.Activate_Deactivate_heads; - ShuffleTextBoxes(Config.Data.WMsCount, Config.Data.LineSize); + activityLabel.Text = Strings.Optical_heads; + ShuffleTextBoxes(ProcessData.WMsCount, ProcessData.LineSize); } } @@ -494,7 +494,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication } WaterMetersCount = iperlHeads.Count; - ShuffleTextBoxes(WaterMetersCount, Config.Data.LineSize); + ShuffleTextBoxes(WaterMetersCount, ProcessData.LineSize); /// /// Prepare worker threads, 'rfidPortNrs', 'lastGroup', etc.. @@ -594,7 +594,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication } int dest = 0; - for (int l = 0; l < nrLines; l++) + for (int l = 0; l < nrLines; l++) { for (int i = 0; i < lineSize; i++) { @@ -695,33 +695,33 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication Top = (ls.iPerlCommunicationsFormTop != 0) ? ls.iPerlCommunicationsFormTop : 150; if (ls.OptoHeadsEnabled != 0) SetCheckBoxStates(ls.OptoHeadsEnabled); - if (!checkBoxesEditMode) + if (!checkBoxesEditMode) { /// Regular activity (not a checkbox edit mode invoked from TBF menu) - /// Reset opto-data indication - for (int i = 0; i < iperlHeads.Count; i++) - { + /// Reset opto-data indication + for (int i = 0; i < iperlHeads.Count; i++) + { counters[i].BackColor = OptoNokColor; - } + } - /// Set QuidoRS outputs and start the whole communication process - /// by incrementing 'currentGroup'. - /// - if (cfg.UseMuxBoards && (quido != null)) - { - quido.SetOutputs((ushort)(16 - currentGroup - 1)); + /// Set QuidoRS outputs and start the whole communication process + /// by incrementing 'currentGroup'. + /// + if (cfg.UseMuxBoards && (quido != null)) + { + quido.SetOutputs((ushort)(16 - currentGroup - 1)); Thread.Sleep(2000); - } + } - currentGroup++; + currentGroup++; - int wtId = 0; + int wtId = 0; foreach (var wt in workerThreads) { wt.Start(new Boxes.IntBox(wtId++)); /// Start worker threads !!! } - } + } } @@ -799,7 +799,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication string currentActivity = currentTestParams.Activity; /// Current activity TBF.UiBridge.TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 10, 0, 140, 0, 0, 0 }); - TBF.UiBridge.Bridge.OnTestProgress(null, new TBF.UiBridge.TestProgressEventArgs(tests[i], Config.Entities.Progress.JustStarted)); + TBF.UiBridge.Bridge.OnTestProgress(null, new TBF.UiBridge.TestProgressEventArgs(tests[i], Progress.JustStarted)); if (threadID == 0) @@ -943,7 +943,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication break; } - TBF.UiBridge.Bridge.OnTestProgress(null, new TBF.UiBridge.TestProgressEventArgs(tests[i], Config.Entities.Progress.FlowSetting)); + TBF.UiBridge.Bridge.OnTestProgress(null, new TBF.UiBridge.TestProgressEventArgs(tests[i], Progress.FlowSetting)); } if (!wmFound) @@ -957,7 +957,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication if (stopWorkerThreads) break; } /// for (int group - TBF.UiBridge.Bridge.OnTestProgress(null, new TBF.UiBridge.TestProgressEventArgs(tests[i], Config.Entities.Progress.Completed)); + TBF.UiBridge.Bridge.OnTestProgress(null, new TBF.UiBridge.TestProgressEventArgs(tests[i], Progress.Completed)); activityStep++; if (stopWorkerThreads) break; @@ -1892,10 +1892,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication { if (ihead.CommFailed) return CommErr.CommFailed; - if (TBF.BenchControl.Sequences.ProcessData.IsQ2PreCorrectionCalculated) + if (ProcessData.IsQ2PreCorrectionCalculated) { - return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, TBF.BenchControl.Sequences.ProcessData.CalculatedQ2PreCorrectionLR, - TBF.BenchControl.Sequences.ProcessData.CalculatedQ2PreCorrectionRL); + return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, ProcessData.CalculatedQ2PreCorrectionLR, + ProcessData.CalculatedQ2PreCorrectionRL); } else { @@ -1979,10 +1979,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication if (wm.Pruefindex == 1) { - if (TBF.BenchControl.Sequences.ProcessData.IsQ2PreCorrectionCalculated) + if (ProcessData.IsQ2PreCorrectionCalculated) { - return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, TBF.BenchControl.Sequences.ProcessData.CalculatedQ2PreCorrectionLR, - TBF.BenchControl.Sequences.ProcessData.CalculatedQ2PreCorrectionRL); + return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, ProcessData.CalculatedQ2PreCorrectionLR, + ProcessData.CalculatedQ2PreCorrectionRL); } else { @@ -2201,8 +2201,13 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication /// At least one of Q2 errors is out of range for Q2 correction /// Q2 error is out of range for the Q2 correction log.WarnFormat("OoR => no Q2 correction: Pos={0}, PCB#={1}, ***Q2_RL err={2}%***, ***Q2_LR err={3}%***, CalTarget={4}%, [Lo={5}%, Hi={6}%]", - ihead.Name, ihead.SerialNr, q2adjResult.Error.ToString("F2"), q2adjResult2.Error.ToString("F2"), - ihead.CalibTargetQ2.ToString("F1"), errLimitLo.ToString("F1"), errLimitHi.ToString("F1")); + ihead.Name, + ihead.SerialNr, + q2adjResult.Error.ToString("F2"), + q2adjResult2.Error.ToString("F2"), + ihead.CalibTargetQ2.ToString("F1"), + errLimitLo.ToString("F1"), + errLimitHi.ToString("F1")); ihead.Q2CorrRL = wm.Q2CorrRL; ihead.Q2CorrLR = wm.Q2CorrLR; diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 1610ecf29..fd52ebd97 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.26.1708.0")] -[assembly: AssemblyFileVersion("2.26.1708.0")] +[assembly: AssemblyVersion("2.26.1712.0")] +[assembly: AssemblyFileVersion("2.26.1712.0")]