(1) Output.FileWriters.IperlLogger configuration for LogType.Suez, (2) DB.SensusOracle Quality DB + dead code/parameters cleanup, ver. 2.18.993

This commit is contained in:
Milan Hanajik 2018-09-10 16:39:19 +02:00
parent 072de642e1
commit 3382c6e77a
8 changed files with 249 additions and 426 deletions

View File

@ -57,7 +57,6 @@ namespace TBF.BenchControl.DB.SensusOracle
const int Anbid_StaraTura = 4;
public DatabaseCfg dbCfg;
string separatorStr;
///
@ -88,16 +87,6 @@ namespace TBF.BenchControl.DB.SensusOracle
currentOp = CurrentOp.None;
switch (dbCfg.Separator)
{
default:
case Separator.None: separatorStr = string.Empty; break;
case Separator.Space: separatorStr = " "; break;
case Separator.Tabulator: separatorStr = "\t"; break;
case Separator.Comma: separatorStr = ","; break;
case Separator.Semicolon: separatorStr = ";"; break;
}
log.Debug(this.ToString());
}
@ -109,7 +98,7 @@ namespace TBF.BenchControl.DB.SensusOracle
connection = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
break;
case DBUsed.Quality:
connection = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;"); /// TODO: Quality database specification
connection = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltaqual;Password=test;");
break;
case DBUsed.Test:
connection = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
@ -149,54 +138,6 @@ namespace TBF.BenchControl.DB.SensusOracle
public void StopDevice2() { }
/// <summary>
/// Eliminate spaces conditionally, depesing on bool WriterCfg.EliminateSpaces
/// </summary>
/// <param name="item">Input string</param>
/// <returns>Output string</returns>
string ElSpaces(string item)
{
if (dbCfg.EliminateSpaces)
return item.Replace(" ", string.Empty);
else
return item;
}
/// <summary>
/// Returns a file name derived from a DateTime structure.
/// Creates directories on this path as a side effect.
/// </summary>
/// <param name="time">Date and time</param>
/// <returns>File name</returns>
string GetFileName(DateTime time)
{
string directory = dbCfg.DestinationPath; /// Ends with "\\";
Directory.CreateDirectory(directory);
if (dbCfg.YearFolders)
{
directory = string.Format("{0}{1}\\", directory, time.Year.ToString());
Directory.CreateDirectory(directory);
}
if (dbCfg.MonthFolders)
{
directory = string.Format("{0}{1}\\", directory, time.Month.ToString("D2"));
Directory.CreateDirectory(directory);
}
if (dbCfg.DayFolders)
{
directory = string.Format("{0}{1}\\", directory, time.Day.ToString("D2"));
Directory.CreateDirectory(directory);
}
return string.Format("{0}{1}{2}{3}-{4}{5}.txt", directory, (time.Year % 100).ToString("D2"),
time.Month.ToString("D2"), time.Day.ToString("D2"), time.Hour.ToString("D2"), time.Minute.ToString("D2"));
}
/// <summary>
/// Returns a file name derived from a DateTime structure.
/// Creates directories on this path as a side effect.
@ -245,17 +186,23 @@ namespace TBF.BenchControl.DB.SensusOracle
this.batch = batch;
string fname = GetLogFileName(batch.StartTime);
try
{
logger = new StreamWriter(System.IO.File.Create(fname));
}
catch
{
logger = null;
log.ErrorFormat("Was not able to open LU log file {0}", fname);
}
if (string.IsNullOrEmpty(dbCfg.LogFolderPath))
{
logger = null;
log.ErrorFormat("Logging LU log files disabled");
}
else
{
try
{
logger = new StreamWriter(System.IO.File.Create(GetLogFileName(batch.StartTime)));
}
catch
{
logger = null;
log.ErrorFormat("Failed to open LU log file");
}
}
return this;
}
@ -294,7 +241,10 @@ namespace TBF.BenchControl.DB.SensusOracle
if (WriteResultsToDatabase(connection, batch, false) == Retv.Error) anyError = true;
}
#endif
WriteLogsToDisk(logger, batch);
if (!string.IsNullOrEmpty(dbCfg.LogFolderPath))
{
WriteLogsToDisk(logger, batch);
}
opCompleted = true;
}
@ -334,8 +284,9 @@ namespace TBF.BenchControl.DB.SensusOracle
currentOp = CurrentOp.None;
}
#region iPerl log files
public Retv WriteLogsToDisk(StreamWriter logger, Results.Entities.Batch batch)
public Retv WriteLogsToDisk(StreamWriter logger, Results.Entities.Batch batch)
{
#if TURA_IPERL || TURA_SPECIAL
if (logger == null) return Retv.Error;
@ -726,9 +677,10 @@ namespace TBF.BenchControl.DB.SensusOracle
logger.WriteLine(string.Format("GegenWaage{0}={1}", i, 0)); /// 1
}
#endregion iPerl log files
#if ORACLE_DB
public Retv CheckBarcodeScanning(OracleConnection conn, GenericDevices.IRegisterReader[] iPerlHeads)
public Retv CheckBarcodeScanning(OracleConnection conn, GenericDevices.IRegisterReader[] iPerlHeads)
{
try
{

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@ -39,13 +39,10 @@ namespace TBF.BenchControl.DB.SensusOracle
public int TestBenchId;
public DBUsed DBUsed;
public int Baujahr; /// Written to the database
public string DestinationPath; /// Directory path into which the results will be saved
public string LogFolderPath; /// Directory path into which the results will be saved
public bool YearFolders;
public bool MonthFolders;
public bool DayFolders;
public Separator Separator;
public bool EliminateSpaces;
/// Private parameterless constructor invoked by all other (public) constructors
@ -56,13 +53,10 @@ namespace TBF.BenchControl.DB.SensusOracle
TestBenchId = 1;
DBUsed = DBUsed.Test;
Baujahr = 2015;
DestinationPath = Program.HomeDir + "Results\\";
LogFolderPath = Program.HomeDir + "Logs\\";
YearFolders = true;
MonthFolders = true;
DayFolders = false;
Separator = Separator.None;
EliminateSpaces = false;
}
public DatabaseCfg(IComponentFactory factory)
@ -73,18 +67,14 @@ namespace TBF.BenchControl.DB.SensusOracle
public string ToString(int i)
{
return string.Format("Name={0}, BenchId={1}, DBUsed={2}, Baujahr={3}, Results={4}, Logs={5}, Y={6}, M={7}, D={8}, Elim.spaces={9}, Separator={10}",
Name,
return string.Format("BenchId={0}, DBUsed={1}, Baujahr={2}, Logs={3}, Y={4}, M={5}, D={6}",
TestBenchId,
DBUsed,
Baujahr,
DestinationPath,
LogFolderPath,
YearFolders,
MonthFolders,
DayFolders,
EliminateSpaces,
Separator);
DayFolders);
}
}
}

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
@ -34,10 +34,7 @@ namespace TBF.BenchControl.DB.SensusOracle
{
dbUsedComboBox.Items.Add(((DBUsed)i).ToString());
}
for (int i = 0; i < (int)Separator.Count; i++)
{
separatorComboBox.Items.Add(((Separator)i).ToString());
}
Redraw();
}
@ -53,13 +50,10 @@ namespace TBF.BenchControl.DB.SensusOracle
benchIdTextBox.Text = config.TestBenchId.ToString();
dbUsedComboBox.Text = config.DBUsed.ToString();
baujahrTextBox.Text = config.Baujahr.ToString();
destinationTextBox.Text = config.DestinationPath;
logsFolderTextBox.Text = config.LogFolderPath;
yearFoldersCheckBox.Checked = config.YearFolders;
monthFoldersCheckBox.Checked = config.MonthFolders;
dayFoldersCheckBox.Checked = config.DayFolders;
separatorComboBox.Text = config.Separator.ToString();
eliminateSpacesCheckBox.Checked = config.EliminateSpaces;
}
public void Unlock()
@ -68,15 +62,11 @@ namespace TBF.BenchControl.DB.SensusOracle
benchIdTextBox.Enabled = true;
dbUsedComboBox.Enabled = true;
baujahrTextBox.Enabled = true;
destinationTextBox.Enabled = true;
destinationButton.Enabled = true;
logsFolderTextBox.Enabled = true;
logsFolderButton.Enabled = true;
yearFoldersCheckBox.Enabled = true;
monthFoldersCheckBox.Enabled = true;
dayFoldersCheckBox.Enabled = true;
separatorComboBox.Enabled = true;
eliminateSpacesCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
@ -101,12 +91,6 @@ namespace TBF.BenchControl.DB.SensusOracle
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid 'Database used' item";
}
if (!separatorComboBox.Items.Contains(separatorComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid separator";
}
return flags;
}
@ -146,13 +130,6 @@ namespace TBF.BenchControl.DB.SensusOracle
}
}
if (config.DestinationPath != destinationTextBox.Text)
{
config.DestinationPath = destinationTextBox.Text;
if (!config.DestinationPath.EndsWith("\\")) config.DestinationPath += "\\";
flags = CfgUpdateFlags.RestartRqrd;
}
if (config.LogFolderPath != logsFolderTextBox.Text)
{
config.LogFolderPath = logsFolderTextBox.Text;
@ -176,30 +153,9 @@ namespace TBF.BenchControl.DB.SensusOracle
flags = CfgUpdateFlags.RestartRqrd;
}
for (int i = 0; i < (int)Separator.Count; i++)
{
if (((Separator)i).ToString().Equals(separatorComboBox.Text) && (config.Separator != (Separator)i))
{
config.Separator = (Separator)i;
flags = CfgUpdateFlags.RestartRqrd;
break;
}
}
if (eliminateSpacesCheckBox.Checked != config.EliminateSpaces)
{
config.EliminateSpaces = eliminateSpacesCheckBox.Checked;
flags = CfgUpdateFlags.RestartRqrd;
}
return flags;
}
private void destinationButton_Click(object sender, EventArgs e)
{
}
private void logsFolderButton_Click(object sender, EventArgs e)
{

View File

@ -32,255 +32,186 @@ namespace TBF.BenchControl.DB.SensusOracle
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.destinationTextBox = new System.Windows.Forms.TextBox();
this.destinationLabel = new System.Windows.Forms.Label();
this.dayFoldersCheckBox = new System.Windows.Forms.CheckBox();
this.destinationButton = new System.Windows.Forms.Button();
this.yearFoldersCheckBox = new System.Windows.Forms.CheckBox();
this.monthFoldersCheckBox = new System.Windows.Forms.CheckBox();
this.eliminateSpacesCheckBox = new System.Windows.Forms.CheckBox();
this.separatorLabel = new System.Windows.Forms.Label();
this.separatorComboBox = new System.Windows.Forms.ComboBox();
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();
this.baujahrLabel = new System.Windows.Forms.Label();
this.logsFolderButton = new System.Windows.Forms.Button();
this.logsFolderTextBox = new System.Windows.Forms.TextBox();
this.logsFolderLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(110, 30);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(19, 33);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(107, 8);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// destinationTextBox
//
this.destinationTextBox.Enabled = false;
this.destinationTextBox.Location = new System.Drawing.Point(110, 117);
this.destinationTextBox.Name = "destinationTextBox";
this.destinationTextBox.Size = new System.Drawing.Size(145, 20);
this.destinationTextBox.TabIndex = 10;
//
// destinationLabel
//
this.destinationLabel.AutoSize = true;
this.destinationLabel.Location = new System.Drawing.Point(19, 120);
this.destinationLabel.Name = "destinationLabel";
this.destinationLabel.Size = new System.Drawing.Size(71, 13);
this.destinationLabel.TabIndex = 9;
this.destinationLabel.Text = "Results folder";
//
// dayFoldersCheckBox
//
this.dayFoldersCheckBox.AutoSize = true;
this.dayFoldersCheckBox.Enabled = false;
this.dayFoldersCheckBox.Location = new System.Drawing.Point(207, 166);
this.dayFoldersCheckBox.Name = "dayFoldersCheckBox";
this.dayFoldersCheckBox.Size = new System.Drawing.Size(79, 17);
this.dayFoldersCheckBox.TabIndex = 17;
this.dayFoldersCheckBox.Text = "Day folders";
this.dayFoldersCheckBox.UseVisualStyleBackColor = true;
//
// destinationButton
//
this.destinationButton.Enabled = false;
this.destinationButton.Location = new System.Drawing.Point(261, 117);
this.destinationButton.Name = "destinationButton";
this.destinationButton.Size = new System.Drawing.Size(30, 20);
this.destinationButton.TabIndex = 11;
this.destinationButton.Text = "...";
this.destinationButton.UseVisualStyleBackColor = true;
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
//
// yearFoldersCheckBox
//
this.yearFoldersCheckBox.AutoSize = true;
this.yearFoldersCheckBox.Enabled = false;
this.yearFoldersCheckBox.Location = new System.Drawing.Point(23, 166);
this.yearFoldersCheckBox.Name = "yearFoldersCheckBox";
this.yearFoldersCheckBox.Size = new System.Drawing.Size(82, 17);
this.yearFoldersCheckBox.TabIndex = 15;
this.yearFoldersCheckBox.Text = "Year folders";
this.yearFoldersCheckBox.UseVisualStyleBackColor = true;
//
// monthFoldersCheckBox
//
this.monthFoldersCheckBox.AutoSize = true;
this.monthFoldersCheckBox.Enabled = false;
this.monthFoldersCheckBox.Location = new System.Drawing.Point(111, 166);
this.monthFoldersCheckBox.Name = "monthFoldersCheckBox";
this.monthFoldersCheckBox.Size = new System.Drawing.Size(90, 17);
this.monthFoldersCheckBox.TabIndex = 16;
this.monthFoldersCheckBox.Text = "Month folders";
this.monthFoldersCheckBox.UseVisualStyleBackColor = true;
//
// eliminateSpacesCheckBox
//
this.eliminateSpacesCheckBox.AutoSize = true;
this.eliminateSpacesCheckBox.Enabled = false;
this.eliminateSpacesCheckBox.Location = new System.Drawing.Point(111, 208);
this.eliminateSpacesCheckBox.Name = "eliminateSpacesCheckBox";
this.eliminateSpacesCheckBox.Size = new System.Drawing.Size(165, 17);
this.eliminateSpacesCheckBox.TabIndex = 20;
this.eliminateSpacesCheckBox.Text = "Eliminate spaces in each field";
this.eliminateSpacesCheckBox.UseVisualStyleBackColor = true;
//
// separatorLabel
//
this.separatorLabel.AutoSize = true;
this.separatorLabel.Location = new System.Drawing.Point(19, 188);
this.separatorLabel.Name = "separatorLabel";
this.separatorLabel.Size = new System.Drawing.Size(53, 13);
this.separatorLabel.TabIndex = 18;
this.separatorLabel.Text = "Separator";
//
// separatorComboBox
//
this.separatorComboBox.Enabled = false;
this.separatorComboBox.FormattingEnabled = true;
this.separatorComboBox.Location = new System.Drawing.Point(110, 185);
this.separatorComboBox.Name = "separatorComboBox";
this.separatorComboBox.Size = new System.Drawing.Size(146, 21);
this.separatorComboBox.TabIndex = 19;
//
// benchIdTextBox
//
this.benchIdTextBox.Enabled = false;
this.benchIdTextBox.Location = new System.Drawing.Point(110, 51);
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, 54);
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, 73);
this.dbUsedComboBox.Name = "dbUsedComboBox";
this.dbUsedComboBox.Size = new System.Drawing.Size(145, 21);
this.dbUsedComboBox.TabIndex = 6;
//
// dbUsedLabel
//
this.dbUsedLabel.AutoSize = true;
this.dbUsedLabel.Location = new System.Drawing.Point(19, 76);
this.dbUsedLabel.Name = "dbUsedLabel";
this.dbUsedLabel.Size = new System.Drawing.Size(79, 13);
this.dbUsedLabel.TabIndex = 5;
this.dbUsedLabel.Text = "Database used";
//
// baujahrTextBox
//
this.baujahrTextBox.Enabled = false;
this.baujahrTextBox.Location = new System.Drawing.Point(110, 95);
this.baujahrTextBox.Name = "baujahrTextBox";
this.baujahrTextBox.Size = new System.Drawing.Size(57, 20);
this.baujahrTextBox.TabIndex = 8;
//
// baujahrLabel
//
this.baujahrLabel.AutoSize = true;
this.baujahrLabel.Location = new System.Drawing.Point(19, 98);
this.baujahrLabel.Name = "baujahrLabel";
this.baujahrLabel.Size = new System.Drawing.Size(43, 13);
this.baujahrLabel.TabIndex = 7;
this.baujahrLabel.Text = "Baujahr";
//
// logsFolderButton
//
this.logsFolderButton.Enabled = false;
this.logsFolderButton.Location = new System.Drawing.Point(261, 139);
this.logsFolderButton.Name = "logsFolderButton";
this.logsFolderButton.Size = new System.Drawing.Size(30, 20);
this.logsFolderButton.TabIndex = 14;
this.logsFolderButton.Text = "...";
this.logsFolderButton.UseVisualStyleBackColor = true;
this.logsFolderButton.Click += new System.EventHandler(this.logsFolderButton_Click);
//
// logsFolderTextBox
//
this.logsFolderTextBox.Enabled = false;
this.logsFolderTextBox.Location = new System.Drawing.Point(110, 139);
this.logsFolderTextBox.Name = "logsFolderTextBox";
this.logsFolderTextBox.Size = new System.Drawing.Size(145, 20);
this.logsFolderTextBox.TabIndex = 13;
//
// logsFolderLabel
//
this.logsFolderLabel.AutoSize = true;
this.logsFolderLabel.Location = new System.Drawing.Point(19, 142);
this.logsFolderLabel.Name = "logsFolderLabel";
this.logsFolderLabel.Size = new System.Drawing.Size(59, 13);
this.logsFolderLabel.TabIndex = 12;
this.logsFolderLabel.Text = "Logs folder";
//
// DatabaseCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.logsFolderButton);
this.Controls.Add(this.logsFolderTextBox);
this.Controls.Add(this.logsFolderLabel);
this.Controls.Add(this.baujahrTextBox);
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.separatorComboBox);
this.Controls.Add(this.separatorLabel);
this.Controls.Add(this.eliminateSpacesCheckBox);
this.Controls.Add(this.monthFoldersCheckBox);
this.Controls.Add(this.yearFoldersCheckBox);
this.Controls.Add(this.destinationButton);
this.Controls.Add(this.dayFoldersCheckBox);
this.Controls.Add(this.destinationTextBox);
this.Controls.Add(this.destinationLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "DatabaseCfgCtrl";
this.Size = new System.Drawing.Size(300, 230);
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.dayFoldersCheckBox = new System.Windows.Forms.CheckBox();
this.yearFoldersCheckBox = new System.Windows.Forms.CheckBox();
this.monthFoldersCheckBox = 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();
this.baujahrLabel = new System.Windows.Forms.Label();
this.logsFolderButton = new System.Windows.Forms.Button();
this.logsFolderTextBox = new System.Windows.Forms.TextBox();
this.logsFolderLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(110, 30);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(19, 33);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(107, 8);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// dayFoldersCheckBox
//
this.dayFoldersCheckBox.AutoSize = true;
this.dayFoldersCheckBox.Enabled = false;
this.dayFoldersCheckBox.Location = new System.Drawing.Point(111, 190);
this.dayFoldersCheckBox.Name = "dayFoldersCheckBox";
this.dayFoldersCheckBox.Size = new System.Drawing.Size(79, 17);
this.dayFoldersCheckBox.TabIndex = 17;
this.dayFoldersCheckBox.Text = "Day folders";
this.dayFoldersCheckBox.UseVisualStyleBackColor = true;
//
// yearFoldersCheckBox
//
this.yearFoldersCheckBox.AutoSize = true;
this.yearFoldersCheckBox.Enabled = false;
this.yearFoldersCheckBox.Location = new System.Drawing.Point(111, 144);
this.yearFoldersCheckBox.Name = "yearFoldersCheckBox";
this.yearFoldersCheckBox.Size = new System.Drawing.Size(82, 17);
this.yearFoldersCheckBox.TabIndex = 15;
this.yearFoldersCheckBox.Text = "Year folders";
this.yearFoldersCheckBox.UseVisualStyleBackColor = true;
//
// monthFoldersCheckBox
//
this.monthFoldersCheckBox.AutoSize = true;
this.monthFoldersCheckBox.Enabled = false;
this.monthFoldersCheckBox.Location = new System.Drawing.Point(111, 167);
this.monthFoldersCheckBox.Name = "monthFoldersCheckBox";
this.monthFoldersCheckBox.Size = new System.Drawing.Size(90, 17);
this.monthFoldersCheckBox.TabIndex = 16;
this.monthFoldersCheckBox.Text = "Month folders";
this.monthFoldersCheckBox.UseVisualStyleBackColor = true;
//
// benchIdTextBox
//
this.benchIdTextBox.Enabled = false;
this.benchIdTextBox.Location = new System.Drawing.Point(110, 51);
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, 54);
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, 73);
this.dbUsedComboBox.Name = "dbUsedComboBox";
this.dbUsedComboBox.Size = new System.Drawing.Size(145, 21);
this.dbUsedComboBox.TabIndex = 6;
//
// dbUsedLabel
//
this.dbUsedLabel.AutoSize = true;
this.dbUsedLabel.Location = new System.Drawing.Point(19, 76);
this.dbUsedLabel.Name = "dbUsedLabel";
this.dbUsedLabel.Size = new System.Drawing.Size(79, 13);
this.dbUsedLabel.TabIndex = 5;
this.dbUsedLabel.Text = "Database used";
//
// baujahrTextBox
//
this.baujahrTextBox.Enabled = false;
this.baujahrTextBox.Location = new System.Drawing.Point(110, 95);
this.baujahrTextBox.Name = "baujahrTextBox";
this.baujahrTextBox.Size = new System.Drawing.Size(57, 20);
this.baujahrTextBox.TabIndex = 8;
//
// baujahrLabel
//
this.baujahrLabel.AutoSize = true;
this.baujahrLabel.Location = new System.Drawing.Point(19, 98);
this.baujahrLabel.Name = "baujahrLabel";
this.baujahrLabel.Size = new System.Drawing.Size(43, 13);
this.baujahrLabel.TabIndex = 7;
this.baujahrLabel.Text = "Baujahr";
//
// logsFolderButton
//
this.logsFolderButton.Enabled = false;
this.logsFolderButton.Location = new System.Drawing.Point(261, 116);
this.logsFolderButton.Name = "logsFolderButton";
this.logsFolderButton.Size = new System.Drawing.Size(30, 20);
this.logsFolderButton.TabIndex = 14;
this.logsFolderButton.Text = "...";
this.logsFolderButton.UseVisualStyleBackColor = true;
this.logsFolderButton.Click += new System.EventHandler(this.logsFolderButton_Click);
//
// logsFolderTextBox
//
this.logsFolderTextBox.Enabled = false;
this.logsFolderTextBox.Location = new System.Drawing.Point(110, 116);
this.logsFolderTextBox.Name = "logsFolderTextBox";
this.logsFolderTextBox.Size = new System.Drawing.Size(145, 20);
this.logsFolderTextBox.TabIndex = 13;
//
// logsFolderLabel
//
this.logsFolderLabel.AutoSize = true;
this.logsFolderLabel.Location = new System.Drawing.Point(19, 119);
this.logsFolderLabel.Name = "logsFolderLabel";
this.logsFolderLabel.Size = new System.Drawing.Size(59, 13);
this.logsFolderLabel.TabIndex = 12;
this.logsFolderLabel.Text = "Logs folder";
//
// DatabaseCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.logsFolderButton);
this.Controls.Add(this.logsFolderTextBox);
this.Controls.Add(this.logsFolderLabel);
this.Controls.Add(this.baujahrTextBox);
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.monthFoldersCheckBox);
this.Controls.Add(this.yearFoldersCheckBox);
this.Controls.Add(this.dayFoldersCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "DatabaseCfgCtrl";
this.Size = new System.Drawing.Size(300, 230);
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@ -288,16 +219,10 @@ namespace TBF.BenchControl.DB.SensusOracle
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.TextBox destinationTextBox;
private System.Windows.Forms.Label destinationLabel;
private System.Windows.Forms.CheckBox dayFoldersCheckBox;
private System.Windows.Forms.Button destinationButton;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox dayFoldersCheckBox;
private System.Windows.Forms.CheckBox yearFoldersCheckBox;
private System.Windows.Forms.CheckBox monthFoldersCheckBox;
private System.Windows.Forms.CheckBox eliminateSpacesCheckBox;
private System.Windows.Forms.Label separatorLabel;
private System.Windows.Forms.ComboBox separatorComboBox;
private System.Windows.Forms.CheckBox monthFoldersCheckBox;
private System.Windows.Forms.TextBox benchIdTextBox;
private System.Windows.Forms.Label benchIdLabel;
private System.Windows.Forms.ComboBox dbUsedComboBox;

View File

@ -75,18 +75,18 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
case LogType.Just_Q1Q2Q3Q4:
flowIDs = new string[] { "-5", "-4", "-3", "-2", "-1", "-0", "1", "2", "3", "4", "5" };
flowNames = new string[] { "", "", "", "", "Adjustment", "", "Q1", "Q2", "Q3", "Q4", "" };
qBzs = new string[] { "", "", "", "", "Just", "", "Q1", "Q2", "Q3", "Q4", "" };
pbs_100_110 = new bool[] { false, false, false, false, false, false, true, true, false, false, false };
flowIDs = new string[] { "-5", "-4", "-3", "-2", "-1", "-0", "1", "2", "3", "4", "5" };
flowNames = new string[] { "", "", "", "", "Adjustment", "", "Q1", "Q2", "Q3", "Q4", "" };
qBzs = new string[] { "", "", "", "", "Just", "", "Q1", "Q2", "Q3", "Q4", "" };
pbs_100_110 = new bool[] { false, false, false, false, false, false, true, true, false, false, false };
break;
case LogType.Suez:
flowIDs = new string[] { "-2", "-1", "01", "02", "03", "05", "06", "07", "08", "10" };
flowNames = new string[] { "Qjust_A4", "Qjust_A0", "Q1LR", "Q2LR", "Q2LRnc", "", "Q1", "Q2", "", "", "Q3" };
qBzs = new string[] { "", "", "", "", "Just", "", "Q1", "Q2", "", "", "Q3" };
pbs_100_110 = new bool[] { false, false, false, false, false, false, true, true, false, false, false };
flowIDs = new string[] { "-2", "-1", "01", "02", "03", "05", "06", "07", "08", "10", };
flowNames = new string[] { "Qjust_A4", "Qjust_A0", "Q1lr", "Q2aclr", "Q2lr", "Q3lr", "Q1rl", "Q2acrl", "Q2rl", "Q3rl", };
qBzs = new string[] { "Q-2", "Q-1", "Q1", "Q2ac", "Q2", "Q3", "Q1", "Q2ac", "Q2", "Q3", };
pbs_100_110 = new bool[] { false, false, true, true, true, false, true, true, true, false, };
break;
}

View File

@ -27,7 +27,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
public LogType LogType;
public int Baujahr; /// Written to the database
public string DestinationPath; /// Directory path into which the logs will be saved
public bool YearFolders;
public bool MonthFolders;
@ -53,7 +52,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
public void InitializeAll()
{
LogType = LogType.Just_Q1Q2Q3;
Baujahr = 2018;
DestinationPath = Program.HomeDir + "Logs\\";
YearFolders = true;
MonthFolders = true;
@ -63,7 +61,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
string[] paramNames = new string[]
{
"Log type",
"Baujahr",
"Destination path",
"Year folders",
"Month folders",
@ -81,9 +78,9 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
for (LogType lt = 0; lt < LogType.Count; lt++) list1.Add(lt.ToString());
return list1;
case 2:
case 3:
case 4:
case 5:
IList<string> list2 = new List<string>();
list2.Add(Strings.yes);
list2.Add(Strings.no);
@ -97,10 +94,9 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
{
if (i == -1)
{
return string.Format("{0}: LogType={1}, Year of prod.={2}, Dest.={3}, Y={4}, M={5}, D={6}",
return string.Format("{0}: LogType={1}, Dest.={2}, Y={3}, M={4}, D={5}",
Name,
LogType,
Baujahr,
DestinationPath,
YearFolders,
MonthFolders,
@ -110,11 +106,10 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
switch (i)
{
case 0: return LogType.ToString();
case 1: return Baujahr.ToString();
case 2: return DestinationPath;
case 3: return YearFolders ? Strings.yes : Strings.no;
case 4: return MonthFolders ? Strings.yes : Strings.no;
case 5: return DayFolders ? Strings.yes : Strings.no;
case 1: return DestinationPath;
case 2: return YearFolders ? Strings.yes : Strings.no;
case 3: return MonthFolders ? Strings.yes : Strings.no;
case 4: return DayFolders ? Strings.yes : Strings.no;
default: return string.Empty;
}
}
@ -134,11 +129,10 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
}
return CfgUpdateFlags.None;
case 1: Baujahr = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
case 2: DestinationPath = strValue; return CfgUpdateFlags.RestartRqrd;
case 3: YearFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 4: MonthFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 5: DayFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 1: DestinationPath = strValue; return CfgUpdateFlags.RestartRqrd;
case 2: YearFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 3: MonthFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 4: DayFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
default: return CfgUpdateFlags.None;
}
@ -147,7 +141,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
int idummy;
switch (i)
{
@ -158,13 +151,10 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
}
break;
case 1:
if (int.TryParse(strValue, out idummy) && (idummy >= 2018)) return true;
break;
case 2:
return true;
case 2:
case 3:
case 4:
case 5:
if (strValue == Strings.yes || strValue == Strings.no) return true;
break;
default:
@ -179,7 +169,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
void CopyContentTo(WriterCfg prms)
{
prms.LogType = this.LogType;
prms.Baujahr = this.Baujahr;
prms.DestinationPath = this.DestinationPath;
prms.YearFolders = this.YearFolders;
prms.MonthFolders = this.MonthFolders;

View File

@ -151,9 +151,20 @@ namespace TBF.Forms
MessageBoxButtons.OK,
MessageBoxIcon.Information);
OracleConnection conn = (cfg.DBUsed == DBUsed.Production)
? new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;")
: new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
OracleConnection conn;
switch (cfg.DBUsed)
{
default:
case DBUsed.Production:
conn = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
break;
case DBUsed.Quality:
conn = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltaqual;Password=test;");
break;
case DBUsed.Test:
conn = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
break;
}
if ((TBF.BenchControl.Sequences.ProcessData.OracleDB != null) &&
(TBF.BenchControl.Sequences.ProcessData.OracleDB.WriteResultsToDatabase(conn, b, true) == Retv.OK))

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.18.992.0")]
[assembly: AssemblyFileVersion("2.18.992.0")]
[assembly: AssemblyVersion("2.18.993.0")]
[assembly: AssemblyFileVersion("2.18.993.0")]