(1) Modifications for WR20, WR21 (2) ProcessData.BenchInfo.TestBenchId/TextBenchName are always used by Oracle and ProductionTracing.

This commit is contained in:
Milan Hanajik 2019-10-21 10:11:11 +02:00
parent c95860dcce
commit f1147031a1
9 changed files with 36 additions and 94 deletions

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2018 Sensus Slovensko a.s.
/// Copyright (c) 2016-2019 Sensus Slovensko a.s.
///
using System;
using System.Text;
@ -30,6 +30,8 @@ namespace Results
case 10: return 38; /// WR14
case 11: return 39; /// WR18
case 12: return 40; /// WR19
case 13: return 41; /// WR20
case 14: return 42; /// WR21
default: return 0;
}
}
@ -47,6 +49,8 @@ namespace Results
case 10: return "WR14";
case 11: return "WR18";
case 12: return "WR19";
case 13: return "WR20";
case 14: return "WR21";
default: return string.Empty;
}
}

View File

@ -17,7 +17,6 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
public IComponentCfgCtrl GetControl() { return new TracingCfgCtrl(); }
public string Workplace;
public string ConnStr;
public string NetAdapter;
public bool CheckPreviousRecords;
@ -28,7 +27,6 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
MonitoringCfg()
{
ParentName = string.Empty;
Workplace = "WR10";
NetAdapter = string.Empty;
ConnStr = "SERVER=10.42.128.16; DATABASE=sledovanie2019; UID=vyroba2019; PASSWORD=qwerty; CHARSET=utf8;";
CheckPreviousRecords = true;
@ -44,9 +42,8 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
public string ToString(int i)
{
return string.Format("Name={0}, Workplace={1}, CheckPreviousRecords={2}, SaveTracingRecords={3}, ConnStr={4}",
return string.Format("Name={0}, CheckPreviousRecords={1}, SaveTracingRecords={2}, ConnStr={3}",
Name,
Workplace,
CheckPreviousRecords,
SaveTracingRecords,
ConnStr);

View File

@ -35,7 +35,14 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
public const string WorkstepName = "Test_bench";
MonitoringCfg tracingCfg;
string workplace { get { return tracingCfg.Workplace; } }
string workplace
{
get
{
TBF.BenchControl.GenericDevices.IBenchInfo benchInfo = TBF.BenchControl.Sequences.ProcessData.BenchInfo;
return (benchInfo != null) ? benchInfo.TestBenchName : "TestBench";
}
}
readonly IPAddress ipAddress;
readonly IPAddress netMask;

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
/// Copyright (c) 2018-2019 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
@ -46,7 +46,6 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
workplaceTextBox.Text = config.Workplace;
connStrTextBox.Text = config.ConnStr;
checkPreviousRecordsCheckBox.Checked = config.CheckPreviousRecords;
saveTracingRecordsCheckBox.Checked = config.SaveTracingRecords;
@ -102,7 +101,6 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
public void Unlock()
{
nameTextBox.Enabled = true;
workplaceTextBox.Enabled = true;
connStrTextBox.Enabled = true;
netAdapterComboBox.Enabled = true;
checkPreviousRecordsCheckBox.Enabled = true;
@ -126,7 +124,6 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
}
flags |= UpdateDifferent(ref config.Workplace, workplaceTextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.ConnStr, connStrTextBox.Text, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.CheckPreviousRecords, checkPreviousRecordsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.SaveTracingRecords, saveTracingRecordsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);

View File

@ -34,8 +34,6 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.workplaceTextBox = new System.Windows.Forms.TextBox();
this.workplaceLabel = new System.Windows.Forms.Label();
this.connStrTextBox = new System.Windows.Forms.TextBox();
this.connStrLabel = new System.Windows.Forms.Label();
this.saveTracingRecordsCheckBox = new System.Windows.Forms.CheckBox();
@ -47,7 +45,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(110, 41);
this.nameTextBox.Location = new System.Drawing.Point(110, 51);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
@ -55,7 +53,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(15, 44);
this.nameLabel.Location = new System.Drawing.Point(15, 54);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
@ -64,33 +62,16 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(107, 19);
this.classNameLabel.Location = new System.Drawing.Point(107, 26);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// workplaceTextBox
//
this.workplaceTextBox.Enabled = false;
this.workplaceTextBox.Location = new System.Drawing.Point(110, 67);
this.workplaceTextBox.Name = "workplaceTextBox";
this.workplaceTextBox.Size = new System.Drawing.Size(146, 20);
this.workplaceTextBox.TabIndex = 4;
//
// workplaceLabel
//
this.workplaceLabel.AutoSize = true;
this.workplaceLabel.Location = new System.Drawing.Point(15, 70);
this.workplaceLabel.Name = "workplaceLabel";
this.workplaceLabel.Size = new System.Drawing.Size(59, 13);
this.workplaceLabel.TabIndex = 3;
this.workplaceLabel.Text = "Workplace";
//
// connStrTextBox
//
this.connStrTextBox.Enabled = false;
this.connStrTextBox.Location = new System.Drawing.Point(110, 93);
this.connStrTextBox.Location = new System.Drawing.Point(110, 76);
this.connStrTextBox.Name = "connStrTextBox";
this.connStrTextBox.Size = new System.Drawing.Size(327, 20);
this.connStrTextBox.TabIndex = 6;
@ -98,7 +79,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
// connStrLabel
//
this.connStrLabel.AutoSize = true;
this.connStrLabel.Location = new System.Drawing.Point(15, 96);
this.connStrLabel.Location = new System.Drawing.Point(15, 79);
this.connStrLabel.Name = "connStrLabel";
this.connStrLabel.Size = new System.Drawing.Size(89, 13);
this.connStrLabel.TabIndex = 5;
@ -108,7 +89,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
//
this.saveTracingRecordsCheckBox.AutoSize = true;
this.saveTracingRecordsCheckBox.Enabled = false;
this.saveTracingRecordsCheckBox.Location = new System.Drawing.Point(110, 177);
this.saveTracingRecordsCheckBox.Location = new System.Drawing.Point(110, 159);
this.saveTracingRecordsCheckBox.Name = "saveTracingRecordsCheckBox";
this.saveTracingRecordsCheckBox.Size = new System.Drawing.Size(177, 17);
this.saveTracingRecordsCheckBox.TabIndex = 10;
@ -119,7 +100,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
//
this.checkPreviousRecordsCheckBox.AutoSize = true;
this.checkPreviousRecordsCheckBox.Enabled = false;
this.checkPreviousRecordsCheckBox.Location = new System.Drawing.Point(110, 154);
this.checkPreviousRecordsCheckBox.Location = new System.Drawing.Point(110, 136);
this.checkPreviousRecordsCheckBox.Name = "checkPreviousRecordsCheckBox";
this.checkPreviousRecordsCheckBox.Size = new System.Drawing.Size(138, 17);
this.checkPreviousRecordsCheckBox.TabIndex = 9;
@ -129,7 +110,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
// netAdapterLabel
//
this.netAdapterLabel.AutoSize = true;
this.netAdapterLabel.Location = new System.Drawing.Point(15, 122);
this.netAdapterLabel.Location = new System.Drawing.Point(15, 104);
this.netAdapterLabel.Name = "netAdapterLabel";
this.netAdapterLabel.Size = new System.Drawing.Size(86, 13);
this.netAdapterLabel.TabIndex = 7;
@ -138,7 +119,7 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
// netAdapterComboBox
//
this.netAdapterComboBox.FormattingEnabled = true;
this.netAdapterComboBox.Location = new System.Drawing.Point(110, 119);
this.netAdapterComboBox.Location = new System.Drawing.Point(110, 101);
this.netAdapterComboBox.Name = "netAdapterComboBox";
this.netAdapterComboBox.Size = new System.Drawing.Size(327, 21);
this.netAdapterComboBox.TabIndex = 11;
@ -153,8 +134,6 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
this.Controls.Add(this.checkPreviousRecordsCheckBox);
this.Controls.Add(this.connStrTextBox);
this.Controls.Add(this.connStrLabel);
this.Controls.Add(this.workplaceTextBox);
this.Controls.Add(this.workplaceLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
@ -171,8 +150,6 @@ namespace TBF.BenchControl.Output.DB.ProductionTracing
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.TextBox workplaceTextBox;
private System.Windows.Forms.Label workplaceLabel;
private System.Windows.Forms.TextBox connStrTextBox;
private System.Windows.Forms.Label connStrLabel;
private System.Windows.Forms.CheckBox saveTracingRecordsCheckBox;

View File

@ -661,8 +661,9 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
int maxpruefindexLowPart = ReadMaxPruefindex(conn, wm);
int MAX_Pruefindex = 100 * dbCfg.TestBenchId + maxpruefindexLowPart + 1;
TBF.BenchControl.GenericDevices.IBenchInfo benchInfo = TBF.BenchControl.Sequences.ProcessData.BenchInfo;
int testBenchID = (benchInfo != null) ? benchInfo.TestBenchId : 1;
int MAX_Pruefindex = 100 * testBenchID + maxpruefindexLowPart + 1;
int Hydr_Pruefung;
if (wm.Passed)

View File

@ -34,7 +34,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
public IComponentCfgCtrl GetControl() { return new DatabaseCfgCtrl(); }
public int TestBenchId;
public DBUsed DBUsed;
public int Baujahr; /// Written to the database
public bool ReadStartInfo;
@ -48,7 +47,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
{
Name = "Sensus-Oracle-DB";
ParentName = string.Empty;
TestBenchId = 1;
DBUsed = DBUsed.Test;
Baujahr = 2015;
ReadStartInfo = true;
@ -65,9 +63,8 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
public string ToString(int i)
{
return string.Format("Name={0}, BenchId={1}, DB={2}, Bjahr={3}, RdStartInfo={4}, SaveRslts={5}, StartInfoRqrd={6}, TestMode={7}",
return string.Format("Name={0}, DB={1}, Bjahr={2}, RdStartInfo={3}, SaveRslts={4}, StartInfoRqrd={5}, TestMode={6}",
Name,
TestBenchId,
DBUsed,
Baujahr,
ReadStartInfo,

View File

@ -47,7 +47,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
benchIdTextBox.Text = config.TestBenchId.ToString();
dbUsedComboBox.Text = config.DBUsed.ToString();
baujahrTextBox.Text = config.Baujahr.ToString();
readStartInfoCheckBox.Checked = config.ReadStartInfo;
@ -59,7 +58,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
public void Unlock()
{
nameTextBox.Enabled = true;
benchIdTextBox.Enabled = true;
dbUsedComboBox.Enabled = true;
baujahrTextBox.Enabled = true;
readStartInfoCheckBox.Enabled = true;
@ -72,13 +70,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
int tmp;
if (!int.TryParse(benchIdTextBox.Text, out tmp) || tmp <= 0)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid 'Test bench ID'";
}
int tmp;
if (!int.TryParse(baujahrTextBox.Text, out tmp) || tmp < 2015 || tmp > 2099)
{
flags |= CfgUpdateFlags.Error;
@ -105,13 +97,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
flags |= CfgUpdateFlags.RestartRqrd;
}
int benchId = int.Parse(benchIdTextBox.Text);
if (config.TestBenchId != benchId)
{
config.TestBenchId = benchId;
flags |= CfgUpdateFlags.RestartRqrd;
}
int baujahr = int.Parse(baujahrTextBox.Text);
if (config.Baujahr != baujahr)
{

View File

@ -36,8 +36,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
this.classNameLabel = new System.Windows.Forms.Label();
this.readStartInfoCheckBox = new System.Windows.Forms.CheckBox();
this.saveResultsCheckBox = new System.Windows.Forms.CheckBox();
this.benchIdTextBox = new System.Windows.Forms.TextBox();
this.benchIdLabel = new System.Windows.Forms.Label();
this.dbUsedComboBox = new System.Windows.Forms.ComboBox();
this.dbUsedLabel = new System.Windows.Forms.Label();
this.baujahrTextBox = new System.Windows.Forms.TextBox();
@ -49,7 +47,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(110, 30);
this.nameTextBox.Location = new System.Drawing.Point(110, 55);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
@ -57,7 +55,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(19, 33);
this.nameLabel.Location = new System.Drawing.Point(19, 58);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
@ -66,7 +64,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(107, 8);
this.classNameLabel.Location = new System.Drawing.Point(107, 27);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
@ -94,28 +92,11 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
this.saveResultsCheckBox.Text = "Save results";
this.saveResultsCheckBox.UseVisualStyleBackColor = true;
//
// benchIdTextBox
//
this.benchIdTextBox.Enabled = false;
this.benchIdTextBox.Location = new System.Drawing.Point(110, 53);
this.benchIdTextBox.Name = "benchIdTextBox";
this.benchIdTextBox.Size = new System.Drawing.Size(57, 20);
this.benchIdTextBox.TabIndex = 4;
//
// benchIdLabel
//
this.benchIdLabel.AutoSize = true;
this.benchIdLabel.Location = new System.Drawing.Point(19, 56);
this.benchIdLabel.Name = "benchIdLabel";
this.benchIdLabel.Size = new System.Drawing.Size(76, 13);
this.benchIdLabel.TabIndex = 3;
this.benchIdLabel.Text = "Test Bench ID";
//
// dbUsedComboBox
//
this.dbUsedComboBox.Enabled = false;
this.dbUsedComboBox.FormattingEnabled = true;
this.dbUsedComboBox.Location = new System.Drawing.Point(110, 76);
this.dbUsedComboBox.Location = new System.Drawing.Point(110, 79);
this.dbUsedComboBox.Name = "dbUsedComboBox";
this.dbUsedComboBox.Size = new System.Drawing.Size(145, 21);
this.dbUsedComboBox.TabIndex = 6;
@ -123,7 +104,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
// dbUsedLabel
//
this.dbUsedLabel.AutoSize = true;
this.dbUsedLabel.Location = new System.Drawing.Point(19, 78);
this.dbUsedLabel.Location = new System.Drawing.Point(19, 81);
this.dbUsedLabel.Name = "dbUsedLabel";
this.dbUsedLabel.Size = new System.Drawing.Size(79, 13);
this.dbUsedLabel.TabIndex = 5;
@ -132,7 +113,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
// baujahrTextBox
//
this.baujahrTextBox.Enabled = false;
this.baujahrTextBox.Location = new System.Drawing.Point(110, 100);
this.baujahrTextBox.Location = new System.Drawing.Point(110, 104);
this.baujahrTextBox.Name = "baujahrTextBox";
this.baujahrTextBox.Size = new System.Drawing.Size(57, 20);
this.baujahrTextBox.TabIndex = 8;
@ -140,7 +121,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
// baujahrLabel
//
this.baujahrLabel.AutoSize = true;
this.baujahrLabel.Location = new System.Drawing.Point(19, 103);
this.baujahrLabel.Location = new System.Drawing.Point(19, 107);
this.baujahrLabel.Name = "baujahrLabel";
this.baujahrLabel.Size = new System.Drawing.Size(43, 13);
this.baujahrLabel.TabIndex = 7;
@ -178,8 +159,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
this.Controls.Add(this.baujahrLabel);
this.Controls.Add(this.dbUsedComboBox);
this.Controls.Add(this.dbUsedLabel);
this.Controls.Add(this.benchIdTextBox);
this.Controls.Add(this.benchIdLabel);
this.Controls.Add(this.saveResultsCheckBox);
this.Controls.Add(this.readStartInfoCheckBox);
this.Controls.Add(this.nameTextBox);
@ -200,8 +179,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox readStartInfoCheckBox;
private System.Windows.Forms.CheckBox saveResultsCheckBox;
private System.Windows.Forms.TextBox benchIdTextBox;
private System.Windows.Forms.Label benchIdLabel;
private System.Windows.Forms.ComboBox dbUsedComboBox;
private System.Windows.Forms.Label dbUsedLabel;
private System.Windows.Forms.TextBox baujahrTextBox;