DataEntry.S620 added, Results.Entities.WaterMeter.AssignedSerialNr/Prefix/Suffix/CompleteSerialNr/WMTypeRevision mapped to DB.

This commit is contained in:
Milan Hanajik 2020-12-07 14:36:21 +01:00
parent 11eff5c962
commit 97df1250dc
45 changed files with 24843 additions and 146 deletions

View File

@ -59,7 +59,7 @@ namespace Results.Entities
public virtual string Remark { get; set; } public virtual string Remark { get; set; }
#if IPERL #if IPERL
public virtual double OrigCalibFactor { get; set; } /// Original iPerl calibration factor used during the test public virtual double OrigCalibFactor { get; set; } /// Original iPerl calibration factor used during the test
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double OrigCalibFactorLNA{ get; set; } /// Original iPerl LNA calibration factor used during the test public virtual double OrigCalibFactorLNA{ get; set; } /// Original iPerl LNA calibration factor used during the test
public virtual double CalibFactorLNA { get; set; } /// iPerl LNA calibration factor used during the test public virtual double CalibFactorLNA { get; set; } /// iPerl LNA calibration factor used during the test
@ -76,8 +76,6 @@ namespace Results.Entities
/// <summary> /// <summary>
/// Data from a production test bench (in case of tests on iPerl special) /// Data from a production test bench (in case of tests on iPerl special)
/// </summary> /// </summary>
public virtual int AssignedSerialNr { get; set; }
public virtual string CompleteSerialNr { get; set; }
public virtual string RadioAddress { get; set; } public virtual string RadioAddress { get; set; }
public virtual int PaletteNr { get; set; } public virtual int PaletteNr { get; set; }
public virtual int UmkartonNr { get; set; } public virtual int UmkartonNr { get; set; }
@ -91,13 +89,17 @@ namespace Results.Entities
public virtual int ProdQ2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl public virtual int ProdQ2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
#endif #endif
#if ORACLE_DB #if ORACLE_DB
public virtual int Pruefindex { get; set; } /// >= 1 ... pruefindex public virtual int AssignedSerialNr { get; set; }
public virtual string Prefix { get; set; }
public virtual string Suffix { get; set; }
public virtual string CompleteSerialNr { get; set; }
public virtual int WMTypeRevision { get; set; }
public virtual int Pruefindex { get; set; } /// >= 1 ... pruefindex
public virtual int HydrPruefung { get; set; } public virtual int HydrPruefung { get; set; }
public virtual int WMTypeRevision { get; set; } /// Not mapped to DB !!!
public virtual object RawTestInfos { get; set; } /// IList<SensusTestInfo> fetched from Oracle at the beginning of the cycle, not mapped to DB !!! public virtual object RawTestInfos { get; set; } /// IList<SensusTestInfo> fetched from Oracle at the beginning of the cycle, not mapped to DB !!!
public virtual object CompleteTestInfos { get; set; } /// SensusTestInfo[] obtained as a best match at the beginning of the cycle, not mapped to DB !!! public virtual object CompleteTestInfos { get; set; } /// SensusTestInfo[] obtained as a best match at the beginning of the cycle, not mapped to DB !!!
#endif #endif
public virtual int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID public virtual int ProcessId { get; set; } /// Not mapped to DB !!! Tracing DB Process ID
public virtual int SessionId { get; set; } /// Not mapped to DB !!! 1 (regular tracing DB session) or 2 (alternative tracing DB session) public virtual int SessionId { get; set; } /// Not mapped to DB !!! 1 (regular tracing DB session) or 2 (alternative tracing DB session)
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
@ -395,9 +397,13 @@ namespace Results.Entities
{ {
MeterTestRslts = new List<MeterTestRslt>(); MeterTestRslts = new List<MeterTestRslt>();
#if ORACLE_DB #if ORACLE_DB
AssignedSerialNr = 0;
Prefix = string.Empty;
Suffix = string.Empty;
CompleteSerialNr = string.Empty;
WMTypeRevision = 0;
Pruefindex = 1; Pruefindex = 1;
HydrPruefung = 0; HydrPruefung = 0;
WMTypeRevision = 0;
RawTestInfos = null; RawTestInfos = null;
CompleteTestInfos = null; CompleteTestInfos = null;
#endif #endif
@ -415,7 +421,6 @@ namespace Results.Entities
ArchivePath = string.Empty; ArchivePath = string.Empty;
Remark = string.Empty; Remark = string.Empty;
#if TURA_SPECIAL #if TURA_SPECIAL
CompleteSerialNr = string.Empty;
RadioAddress = string.Empty; RadioAddress = string.Empty;
ProdUserName = string.Empty; ProdUserName = string.Empty;
ProdPurchaseOrder = string.Empty; ProdPurchaseOrder = string.Empty;
@ -459,8 +464,6 @@ namespace Results.Entities
FWVersion = src.FWVersion; FWVersion = src.FWVersion;
#endif #endif
#if TURA_SPECIAL #if TURA_SPECIAL
AssignedSerialNr = src.AssignedSerialNr;
CompleteSerialNr = src.CompleteSerialNr;
RadioAddress = src.RadioAddress; RadioAddress = src.RadioAddress;
PaletteNr = src.PaletteNr; PaletteNr = src.PaletteNr;
UmkartonNr = src.UmkartonNr; UmkartonNr = src.UmkartonNr;
@ -474,9 +477,13 @@ namespace Results.Entities
ProdQ2CorrLR = src.ProdQ2CorrLR; ProdQ2CorrLR = src.ProdQ2CorrLR;
#endif #endif
#if ORACLE_DB #if ORACLE_DB
AssignedSerialNr = src.AssignedSerialNr;
Prefix = src.Prefix;
Suffix = src.Suffix;
CompleteSerialNr = src.CompleteSerialNr;
WMTypeRevision = src.WMTypeRevision;
Pruefindex = src.Pruefindex; Pruefindex = src.Pruefindex;
HydrPruefung = src.HydrPruefung; HydrPruefung = src.HydrPruefung;
WMTypeRevision = src.WMTypeRevision;
RawTestInfos = src.RawTestInfos; RawTestInfos = src.RawTestInfos;
CompleteTestInfos = src.CompleteTestInfos; CompleteTestInfos = src.CompleteTestInfos;
#endif #endif
@ -638,8 +645,6 @@ namespace Results.Entities
writer.Write((FWVersion != null) ? FWVersion : string.Empty); writer.Write((FWVersion != null) ? FWVersion : string.Empty);
#endif #endif
#if TURA_SPECIAL #if TURA_SPECIAL
writer.Write(AssignedSerialNr);
writer.Write((CompleteSerialNr != null) ? CompleteSerialNr : string.Empty);
writer.Write((RadioAddress != null) ? RadioAddress : string.Empty); writer.Write((RadioAddress != null) ? RadioAddress : string.Empty);
writer.Write(PaletteNr); writer.Write(PaletteNr);
writer.Write(UmkartonNr); writer.Write(UmkartonNr);
@ -653,9 +658,13 @@ namespace Results.Entities
writer.Write(ProdQ2CorrLR); writer.Write(ProdQ2CorrLR);
#endif #endif
#if ORACLE_DB #if ORACLE_DB
writer.Write(AssignedSerialNr);
writer.Write((Prefix != null) ? Prefix : string.Empty);
writer.Write((Suffix != null) ? Suffix : string.Empty);
writer.Write((CompleteSerialNr != null) ? CompleteSerialNr : string.Empty);
writer.Write(WMTypeRevision);
writer.Write(Pruefindex); writer.Write(Pruefindex);
writer.Write(HydrPruefung); writer.Write(HydrPruefung);
writer.Write(WMTypeRevision);
/// Write RawTestInfos /// Write RawTestInfos
IList<Results.Output.SensusTestInfo> rawTestInfos = RawTestInfos as IList<Results.Output.SensusTestInfo>; IList<Results.Output.SensusTestInfo> rawTestInfos = RawTestInfos as IList<Results.Output.SensusTestInfo>;
@ -731,8 +740,6 @@ namespace Results.Entities
FWVersion = reader.ReadString(); FWVersion = reader.ReadString();
#endif #endif
#if TURA_SPECIAL #if TURA_SPECIAL
AssignedSerialNr = reader.ReadInt32();
CompleteSerialNr = reader.ReadString();
RadioAddress = reader.ReadString(); RadioAddress = reader.ReadString();
PaletteNr = reader.ReadInt32(); PaletteNr = reader.ReadInt32();
UmkartonNr = reader.ReadInt32(); UmkartonNr = reader.ReadInt32();
@ -746,9 +753,13 @@ namespace Results.Entities
ProdQ2CorrLR = reader.ReadInt32(); ProdQ2CorrLR = reader.ReadInt32();
#endif #endif
#if ORACLE_DB #if ORACLE_DB
AssignedSerialNr = reader.ReadInt32();
Prefix = reader.ReadString();
Suffix = reader.ReadString();
CompleteSerialNr = reader.ReadString();
WMTypeRevision = reader.ReadInt32();
Pruefindex = reader.ReadInt32(); Pruefindex = reader.ReadInt32();
HydrPruefung = reader.ReadInt32(); HydrPruefung = reader.ReadInt32();
WMTypeRevision = reader.ReadInt32();
/// Read RawTestInfos /// Read RawTestInfos
int rawTestInfosCount = reader.ReadInt32(); int rawTestInfosCount = reader.ReadInt32();

View File

@ -43,8 +43,6 @@ namespace Results.Mappings
Map(x => x.FWVersion); Map(x => x.FWVersion);
#endif #endif
#if TURA_SPECIAL #if TURA_SPECIAL
Map(x => x.AssignedSerialNr);
Map(x => x.CompleteSerialNr);
Map(x => x.RadioAddress); Map(x => x.RadioAddress);
Map(x => x.PaletteNr); Map(x => x.PaletteNr);
Map(x => x.UmkartonNr); Map(x => x.UmkartonNr);
@ -58,8 +56,13 @@ namespace Results.Mappings
Map(x => x.ProdQ2CorrLR); Map(x => x.ProdQ2CorrLR);
#endif #endif
#if ORACLE_DB #if ORACLE_DB
Map(x => x.AssignedSerialNr);
Map(x => x.Prefix);
Map(x => x.Suffix);
Map(x => x.CompleteSerialNr);
Map(x => x.Pruefindex); Map(x => x.Pruefindex);
Map(x => x.HydrPruefung); Map(x => x.HydrPruefung);
Map(x => x.WMTypeRevision);
#endif #endif
References(x => x.WaterMeterData); References(x => x.WaterMeterData);
References(x => x.Batch); References(x => x.Batch);

View File

@ -25,6 +25,7 @@ namespace Results.Output
Suez_EMP_DN40, /// EMP: 12 flow rates Suez_EMP_DN40, /// EMP: 12 flow rates
Greece, /// Q3, Q2adj, Q2, Q1 Greece, /// Q3, Q2adj, Q2, Q1
S620, /// Q3, Q100, Q2, Q1 S620, /// Q3, Q100, Q2, Q1
S620_Alt, /// Q3, Q100, Q2, Q1
Count, Count,
None, None,
} }
@ -430,11 +431,19 @@ namespace Results.Output
}; };
case LogType.S620: case LogType.S620:
return new SensusTestInfo[]
{
/// TBF Oracle DB Opto RAW LU logfiles
new SensusTestInfo("Q3", 3, "Q3", 3, "04", 3, "Q3", Range.R90_100),
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
};
case LogType.S620_Alt:
return new SensusTestInfo[] return new SensusTestInfo[]
{ {
/// TBF Oracle DB Opto RAW LU logfiles /// TBF Oracle DB Opto RAW LU logfiles
new SensusTestInfo("Q3", 5, "Q3", 5, "04", 5, "Q3", Range.R90_100), new SensusTestInfo("Q3", 5, "Q3", 5, "04", 5, "Q3", Range.R90_100),
new SensusTestInfo("Q100", 4, "Q100l", 4, "03", 4,"Q100l", Range.R100_110),
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110), new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110), new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
}; };

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.26.1458.0")] [assembly: AssemblyVersion("2.26.1560.0")]
[assembly: AssemblyFileVersion("2.26.1458.0")] [assembly: AssemblyFileVersion("2.26.1560.0")]

View File

@ -451,9 +451,12 @@ namespace Results
#endif #endif
#endif #endif
#if ORACLE_DB
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_AssignedSerialNr, "Assigned s/n", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.AssignedSerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_CompleteSerialNr, "Complete s/n", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.CompleteSerialNr)));
#endif
#if TURA_SPECIAL #if TURA_SPECIAL
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_AssignedSerialNr, "iPerl assigned s/n", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.AssignedSerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_CompleteSerialNr, "iPerl complete s/n", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.CompleteSerialNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_RadioAddress, "iPerl radio address", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.RadioAddress))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_RadioAddress, "iPerl radio address", Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.RadioAddress)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PaletteNr, "iPerl palette nr.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.PaletteNr))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_PaletteNr, "iPerl palette nr.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.PaletteNr)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_UmkartonNr, "iPerl umkarton nr.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.UmkartonNr))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Prod_UmkartonNr, "iPerl umkarton nr.", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.UmkartonNr)));

View File

@ -0,0 +1,50 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using TracingDB;
namespace TBF.BenchControl.DataEntry.S620
{
public class BarcodeReceivedEventArgs : EventArgs
{
public string Barcode;
/// <summary>
/// ID of a part in this workstep:
/// 0 undefined
/// 1 reference part
/// 2..99 parts with unique codes
/// 100.. parts with batch numbers
/// </summary>
public int IxPolozky;
public CodeLocation CodeLocation;
public PartError Error;
public BarcodeReceivedEventArgs(string barcode, int ixPolozky, CodeLocation codeLocation)
{
this.Barcode = barcode;
this.IxPolozky = ixPolozky;
this.CodeLocation = codeLocation;
}
public BarcodeReceivedEventArgs(string barcode, int ixPolozky, CodeLocation codeLocation, PartError error)
: this(barcode, ixPolozky, codeLocation)
{
this.Error = error;
}
}
public enum PartError
{
None,
WrongPart, /// S/N or P/N of a part is wrong
FieldEmpty, /// A required field in UI is empty
PrviousRecordMissing, /// Previous record in the tracing DB is missing
BlacklistedPart, /// S/N of a part is on a black list
ValueOutOfRange, /// Measured value is out of range
UnspecifiedError, /// Other unspecified error
Count
}
}

View File

@ -0,0 +1,26 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
namespace TBF.BenchControl.DataEntry.S620
{
public class BodySerNrResult
{
public string BodyNr;
public int SerialNr;
public int Result;
public BodySerNrResult(string bodyNr, int serialNr, int result)
{
BodyNr = bodyNr;
SerialNr = serialNr;
Result = result;
}
public override string ToString()
{
return string.Format("{0}-{1}-{2}", BodyNr, SerialNr, Result);
}
}
}

View File

@ -0,0 +1,127 @@
namespace TBF.BenchControl.DataEntry.S620.CheckItems
{
partial class Barcode
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.kodMaterialuLabel = new System.Windows.Forms.Label();
this.scannedCodeTextBox = new System.Windows.Forms.TextBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.setFocusButton = new System.Windows.Forms.Button();
this.descriptionMaterialuLabel = new System.Windows.Forms.Label();
this.blackListLabel = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// kodMaterialuLabel
//
this.kodMaterialuLabel.AutoSize = true;
this.kodMaterialuLabel.Location = new System.Drawing.Point(42, -5);
this.kodMaterialuLabel.Name = "kodMaterialuLabel";
this.kodMaterialuLabel.Size = new System.Drawing.Size(122, 24);
this.kodMaterialuLabel.TabIndex = 1;
this.kodMaterialuLabel.Text = "kod materialu";
//
// scannedCodeTextBox
//
this.scannedCodeTextBox.Location = new System.Drawing.Point(239, 3);
this.scannedCodeTextBox.Name = "scannedCodeTextBox";
this.scannedCodeTextBox.Size = new System.Drawing.Size(240, 29);
this.scannedCodeTextBox.TabIndex = 3;
this.scannedCodeTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.scannedCodeTextBox_KeyPress);
//
// pictureBox1
//
this.pictureBox1.Image = TBF.Properties.Resources.Barcode;
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(499, 1);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false;
//
// setFocusButton
//
this.setFocusButton.Location = new System.Drawing.Point(2, 1);
this.setFocusButton.Name = "setFocusButton";
this.setFocusButton.Size = new System.Drawing.Size(32, 32);
this.setFocusButton.TabIndex = 0;
this.setFocusButton.UseVisualStyleBackColor = true;
this.setFocusButton.Click += new System.EventHandler(this.setFocusButton_Click);
//
// descriptionMaterialuLabel
//
this.descriptionMaterialuLabel.AutoSize = true;
this.descriptionMaterialuLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.descriptionMaterialuLabel.Location = new System.Drawing.Point(43, 25);
this.descriptionMaterialuLabel.Name = "descriptionMaterialuLabel";
this.descriptionMaterialuLabel.Size = new System.Drawing.Size(71, 13);
this.descriptionMaterialuLabel.TabIndex = 2;
this.descriptionMaterialuLabel.Text = "opis materialu";
//
// blackListLabel
//
this.blackListLabel.AutoSize = true;
this.blackListLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.blackListLabel.ForeColor = System.Drawing.Color.Red;
this.blackListLabel.Location = new System.Drawing.Point(480, 5);
this.blackListLabel.Name = "blackListLabel";
this.blackListLabel.Size = new System.Drawing.Size(19, 25);
this.blackListLabel.TabIndex = 4;
this.blackListLabel.Text = "!";
this.blackListLabel.Visible = false;
//
// Polozka
//
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.blackListLabel);
this.Controls.Add(this.descriptionMaterialuLabel);
this.Controls.Add(this.setFocusButton);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.scannedCodeTextBox);
this.Controls.Add(this.kodMaterialuLabel);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.Margin = new System.Windows.Forms.Padding(6);
this.Name = "Polozka";
this.Size = new System.Drawing.Size(547, 36);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label kodMaterialuLabel;
private System.Windows.Forms.TextBox scannedCodeTextBox;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button setFocusButton;
private System.Windows.Forms.Label descriptionMaterialuLabel;
private System.Windows.Forms.Label blackListLabel;
}
}

View File

@ -0,0 +1,160 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using TracingDB;
using TracingDB.Entities;
namespace TBF.BenchControl.DataEntry.S620.CheckItems
{
public partial class Barcode : UserControl, ICheckItem
{
public override string ToString()
{
return string.Format(": {0} {1}({2})", IxPolozky, Part.Name, string.IsNullOrEmpty(Part.OraDBType) ? string.Empty : Part.OraDBType);
}
FormForMechanicalMetersWithTracing parent;
public Part Part { get { return part; } }
Part part;
public int IxPolozky
{
get { return ixPolozky; }
set { ixPolozky = value; }
}
int ixPolozky;
public string ScannedCode
{
get { return scannedCodeTextBox.Text; }
set { scannedCodeTextBox.Text = value; }
}
Barcode()
{
InitializeComponent();
}
public Barcode(FormForMechanicalMetersWithTracing parent, Part part)
: this()
{
this.parent = parent;
this.part = part;
scannedCodeTextBox.Text = (part.DefaultCode != null) ? part.DefaultCode : string.Empty;
kodMaterialuLabel.Text = part.Name;
descriptionMaterialuLabel.Text = part.Description;
if (part.CodeForm == CodeForm.Barcode)
{
try
{
Stream imageStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Pracovisko.Barcode.png");
pictureBox1.Image = new Bitmap(imageStream);
}
catch {}
}
}
public void ClearCode()
{
if (part.CodeType != CodeType.Silicon)
{
scannedCodeTextBox.Text = (part.DefaultCode != null) ? part.DefaultCode : string.Empty;
}
}
public void SubmitCode(string code)
{
scannedCodeTextBox.Text = code;
scannedCodeTextBox_KeyPress(null, new KeyPressEventArgs('\r'));
}
public void ResetFocus()
{
setFocusButton.Text = "";
}
public void SetFocus()
{
ClearCode();
setFocusButton.Text = ">";
scannedCodeTextBox.Focus();
}
private void setFocusButton_Click(object sender, EventArgs e)
{
setFocusButton.Text = ">";
parent.OnFocusPressed(this, new FocusPressedEventArgs(IxPolozky, Part.CodeLocation));
}
private void scannedCodeTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar != '\r') return;
PartError error = PartError.None;
if (string.IsNullOrEmpty(scannedCodeTextBox.Text))
{
error = PartError.FieldEmpty;
}
else
{
switch (part.CodeType)
{
case CodeType.FlowtubeNr:
if ((scannedCodeTextBox.Text.Length < 3) || !scannedCodeTextBox.Text.Substring(0, 3).Equals(part.Name.Substring(part.Name.Length - 3)))
{
error = PartError.WrongPart;
}
break;
case CodeType.FlowtubeNrLU:
if ((scannedCodeTextBox.Text.Length < part.Name.Length ||
!scannedCodeTextBox.Text.Substring(0, part.Name.Length).Equals(part.Name)))
{
error = PartError.WrongPart;
}
break;
case CodeType.BatchNrContainingPartName:
if (!scannedCodeTextBox.Text.Contains(part.Name))
{
error = PartError.WrongPart;
}
break;
case CodeType.DateMMYY:
if (part.LifetimeManagement == LifetimeManagement.OneYear)
{
int mmyy;
if (!int.TryParse(scannedCodeTextBox.Text, out mmyy))
{
error = PartError.WrongPart;
}
else
{
int batteryMonthsSince2000 = 12 * (mmyy % 100) + (mmyy / 100);
int monthsSince2000 = 12 * (DateTime.Now.Year - 2000) + DateTime.Now.Month;
int age = monthsSince2000 - batteryMonthsSince2000;
if (age < 0 || age > 12 + parent.ExtraBatteryLifetime)
{
error = PartError.WrongPart;
}
}
}
break;
}
}
parent.OnBarcodeReceived(this, new BarcodeReceivedEventArgs(scannedCodeTextBox.Text, IxPolozky, Part.CodeLocation, error));
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,128 @@
namespace TBF.BenchControl.DataEntry.S620.CheckItems
{
partial class Keyboard
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Keyboard));
this.kodMaterialuLabel = new System.Windows.Forms.Label();
this.scannedCodeTextBox = new System.Windows.Forms.TextBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.setFocusButton = new System.Windows.Forms.Button();
this.descriptionMaterialuLabel = new System.Windows.Forms.Label();
this.blackListLabel = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// kodMaterialuLabel
//
this.kodMaterialuLabel.AutoSize = true;
this.kodMaterialuLabel.Location = new System.Drawing.Point(42, -5);
this.kodMaterialuLabel.Name = "kodMaterialuLabel";
this.kodMaterialuLabel.Size = new System.Drawing.Size(122, 24);
this.kodMaterialuLabel.TabIndex = 1;
this.kodMaterialuLabel.Text = "kod materialu";
//
// scannedCodeTextBox
//
this.scannedCodeTextBox.Location = new System.Drawing.Point(239, 3);
this.scannedCodeTextBox.Name = "scannedCodeTextBox";
this.scannedCodeTextBox.Size = new System.Drawing.Size(228, 29);
this.scannedCodeTextBox.TabIndex = 3;
this.scannedCodeTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.scannedCodeTextBox_KeyPress);
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(493, -9);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(48, 48);
this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false;
//
// setFocusButton
//
this.setFocusButton.Location = new System.Drawing.Point(2, 1);
this.setFocusButton.Name = "setFocusButton";
this.setFocusButton.Size = new System.Drawing.Size(32, 32);
this.setFocusButton.TabIndex = 0;
this.setFocusButton.UseVisualStyleBackColor = true;
this.setFocusButton.Click += new System.EventHandler(this.setFocusButton_Click);
//
// descriptionMaterialuLabel
//
this.descriptionMaterialuLabel.AutoSize = true;
this.descriptionMaterialuLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.descriptionMaterialuLabel.Location = new System.Drawing.Point(43, 25);
this.descriptionMaterialuLabel.Name = "descriptionMaterialuLabel";
this.descriptionMaterialuLabel.Size = new System.Drawing.Size(71, 13);
this.descriptionMaterialuLabel.TabIndex = 2;
this.descriptionMaterialuLabel.Text = "opis materialu";
//
// blackListLabel
//
this.blackListLabel.AutoSize = true;
this.blackListLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.blackListLabel.ForeColor = System.Drawing.Color.Red;
this.blackListLabel.Location = new System.Drawing.Point(470, 5);
this.blackListLabel.Name = "blackListLabel";
this.blackListLabel.Size = new System.Drawing.Size(19, 25);
this.blackListLabel.TabIndex = 5;
this.blackListLabel.Text = "!";
this.blackListLabel.Visible = false;
//
// PolozkaKbd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.blackListLabel);
this.Controls.Add(this.descriptionMaterialuLabel);
this.Controls.Add(this.setFocusButton);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.scannedCodeTextBox);
this.Controls.Add(this.kodMaterialuLabel);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.Margin = new System.Windows.Forms.Padding(6);
this.Name = "PolozkaKbd";
this.Size = new System.Drawing.Size(547, 36);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label kodMaterialuLabel;
private System.Windows.Forms.TextBox scannedCodeTextBox;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button setFocusButton;
private System.Windows.Forms.Label descriptionMaterialuLabel;
private System.Windows.Forms.Label blackListLabel;
}
}

View File

@ -0,0 +1,147 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using TracingDB;
using TracingDB.Entities;
namespace TBF.BenchControl.DataEntry.S620.CheckItems
{
public partial class Keyboard : UserControl, ICheckItem
{
public override string ToString()
{
return string.Format("Kbd: {0} {1}({2})", IxPolozky, Part.Name, string.IsNullOrEmpty(Part.OraDBType) ? string.Empty : Part.OraDBType);
}
FormForMechanicalMetersWithTracing parent;
public Part Part { get { return part; } }
Part part;
public int IxPolozky
{
get { return ixPolozky; }
set { ixPolozky = value; }
}
int ixPolozky;
public string ScannedCode
{
get { return scannedCodeTextBox.Text; }
set
{
#if false
if (part.CodeType == CodeType.PO && parent.ValidOrderNumbers != null)
{
/// Counting pieces produced for a specified PO
if (!parent.ValidOrderNumbers.Contains(value))
{
/// Code is not a valid order number
scannedCodeTextBox.Text = string.Format("{0} !!!", value);
}
else
{
scannedCodeTextBox.Text = value;
int pcsCount;
if (parent.TargetPcsCounts.TryGetValue(scannedCodeTextBox.Text, out pcsCount))
{
parent.UpdateTargetPiecesCount(scannedCodeTextBox.Text, pcsCount, Part.Id);
}
}
}
else
#endif
{
scannedCodeTextBox.Text = value;
}
}
}
Keyboard()
{
InitializeComponent();
}
public Keyboard(FormForMechanicalMetersWithTracing parent, Part part)
: this()
{
this.parent = parent;
this.part = part;
scannedCodeTextBox.Text = (part.DefaultCode != null) ? part.DefaultCode : string.Empty;
kodMaterialuLabel.Text = part.Name;
descriptionMaterialuLabel.Text = part.Description;
}
public void ClearCode()
{
if (part.CodeType != CodeType.Silicon)
{
scannedCodeTextBox.Text = (part.DefaultCode != null) ? part.DefaultCode : string.Empty;
}
}
public void SubmitCode(string code)
{
scannedCodeTextBox.Text = code;
scannedCodeTextBox_KeyPress(null, new KeyPressEventArgs('\r'));
}
public void ResetFocus()
{
setFocusButton.Text = "";
}
public void SetFocus()
{
ClearCode();
setFocusButton.Text = ">";
scannedCodeTextBox.Focus();
}
private void setFocusButton_Click(object sender, EventArgs e)
{
setFocusButton.Text = ">";
parent.OnFocusPressed(this, new FocusPressedEventArgs(IxPolozky, Part.CodeLocation));
}
private void scannedCodeTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar != '\r') return;
PartError error = PartError.None;
///
if (string.IsNullOrEmpty(scannedCodeTextBox.Text))
{
error = PartError.FieldEmpty;
}
#if false
else if (part.CodeType == CodeType.PO && parent.ValidOrderNumbers != null)
{
/// Counting pieces produced for a specified PO
int pcsCount;
if (!parent.ValidOrderNumbers.Contains(scannedCodeTextBox.Text))
{
parent.UpdateTargetPiecesCount(string.Empty, -1, 0);
error = PartError.WrongPart;
}
else if (parent.TargetPcsCounts.TryGetValue(scannedCodeTextBox.Text, out pcsCount))
{
parent.UpdateTargetPiecesCount(scannedCodeTextBox.Text, pcsCount, Part.Id);
}
else
{
parent.UpdateTargetPiecesCount(string.Empty, -1, 0);
}
}
#endif
parent.OnBarcodeReceived(this, new BarcodeReceivedEventArgs(scannedCodeTextBox.Text, IxPolozky, Part.CodeLocation, error));
return;
}
}
}

View File

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAMGSURBVGhD7Zk9axVBGIVXRURFFJRAQLESVBRBEUlhVFAsLS0DgmhlCHYWamcjWIqNFkpsxBQB
LfUHiDYKdtqIWAbEL/DjPEPey8ly57KLCeyEPfAsM2dmZ953d2Z3c1P16rVER8VZsSvVCtRj8UdcSrUC
9UyQwLlUK0xrxRdBAnsxShNr/6/4JEimKO0RHwUJXMfouraII2JKPBBfBUvnjdgoOqkz4pHgShMsVzv4
LZ6K7aJz4mrPCw/6p3gr5sQ1cVB0Vk8EwS+Im+KQWC+K0HHBFWeNH8AoTfcECdxOtQL1WrB8uBMrqk3i
iuBb5Pky8ktwB16a978QI7ESc9KYeCf8KZEre71J/yblUW2jysRM7NVDgfleXBDnOw4xEisxE3v1TfAi
2U+lEBErMRN7yuQ7hcJEzCyl8hPg4AkcFp+NWYGuCvcvCnRfuD8h0AcRHmVEm/flXMRY7jMXYm73iS2U
vQPHBA34wKML3RDUo21aIL5nvP8JgWICvBifNh+DcxFjxfm0MRdibveJLbR6EuAwLIHAE3C/nkBQTwA8
Ae/rCbjvCbjf6A6sERuM+HJcJ9ynjmh3n/ORe4CWa2yUTYBXNJ+8wxgXaKdwf5tA+4T7/G0L7tEHcY77
jImYw31n8PkgDRLg4AnUl5BzS6C7wn3ekIinjftbF3Evnkic4z5jIuZw32m0hCIB3zxRricQfj2B8CMB
yuF7AtGPNk/AfS+vzgQ4eAKs0RcZ4uU1I9w/JRCfuu5vXsQ9+iDOcZ8xEXO478T+Qdk7UIqyCewQ/F4T
nBaIp4D7cTW4ku63Ie4cY7nPXIi53Se20CCB+hKKPRC0fZG1YUVeZPVN7AlQj7Z6AtG/TdkT8DZPwP1G
m7j4O7Bb3DHinw38euz+pED8ied+GzgXMZb7zIWY231iC2UTKEVLEvghSvpNnliJOSUQb8+4nSWIWIk5
vdUvi9jlrwQbq8sQI7ESM7EnsetZU5iRzLCy13N92pZHteXKxBpPqoH46DopeAJ0GWIk1l69epWvqvoH
eo2RB75S02kAAAAASUVORK5CYII=
</value>
</data>
</root>

View File

@ -0,0 +1,130 @@
namespace TBF.BenchControl.DataEntry.S620.CheckItems
{
partial class OkNok
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OkNok));
this.kodMaterialuLabel = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.setFocusButton = new System.Windows.Forms.Button();
this.descriptionMaterialuLabel = new System.Windows.Forms.Label();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// kodMaterialuLabel
//
this.kodMaterialuLabel.AutoSize = true;
this.kodMaterialuLabel.Location = new System.Drawing.Point(42, -5);
this.kodMaterialuLabel.Name = "kodMaterialuLabel";
this.kodMaterialuLabel.Size = new System.Drawing.Size(122, 24);
this.kodMaterialuLabel.TabIndex = 1;
this.kodMaterialuLabel.Text = "kod materialu";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(493, -8);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(48, 48);
this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false;
//
// setFocusButton
//
this.setFocusButton.Location = new System.Drawing.Point(2, 1);
this.setFocusButton.Name = "setFocusButton";
this.setFocusButton.Size = new System.Drawing.Size(32, 32);
this.setFocusButton.TabIndex = 0;
this.setFocusButton.UseVisualStyleBackColor = true;
this.setFocusButton.Click += new System.EventHandler(this.setFocusButton_Click);
//
// descriptionMaterialuLabel
//
this.descriptionMaterialuLabel.AutoSize = true;
this.descriptionMaterialuLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.descriptionMaterialuLabel.Location = new System.Drawing.Point(43, 25);
this.descriptionMaterialuLabel.Name = "descriptionMaterialuLabel";
this.descriptionMaterialuLabel.Size = new System.Drawing.Size(71, 13);
this.descriptionMaterialuLabel.TabIndex = 2;
this.descriptionMaterialuLabel.Text = "opis materialu";
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(239, 3);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(108, 28);
this.checkBox1.TabIndex = 3;
this.checkBox1.Text = "Vyhovuje";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(353, 3);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(129, 28);
this.checkBox2.TabIndex = 4;
this.checkBox2.Text = "Nevyhovuje";
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
//
// PolozkaOkNok
//
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.checkBox2);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.descriptionMaterialuLabel);
this.Controls.Add(this.setFocusButton);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.kodMaterialuLabel);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.Margin = new System.Windows.Forms.Padding(6);
this.Name = "PolozkaOkNok";
this.Size = new System.Drawing.Size(547, 36);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label kodMaterialuLabel;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button setFocusButton;
private System.Windows.Forms.Label descriptionMaterialuLabel;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.CheckBox checkBox2;
}
}

View File

@ -0,0 +1,132 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using TracingDB.Entities;
namespace TBF.BenchControl.DataEntry.S620.CheckItems
{
public partial class OkNok : UserControl, ICheckItem
{
public override string ToString()
{
return string.Format("Ok/Nok: {0} {1}({2})", IxPolozky, Part.Name, string.IsNullOrEmpty(Part.OraDBType) ? string.Empty : Part.OraDBType);
}
FormForMechanicalMetersWithTracing parent;
public Part Part { get { return part; } }
Part part;
public int IxPolozky
{
get { return ixPolozky; }
set { ixPolozky = value; }
}
int ixPolozky;
public string ScannedCode
{
get { return checkBox1.Checked ? "OK" : "NOK"; }
set
{
if (string.IsNullOrEmpty(value))
{
checkBox1.Checked = false;
checkBox2.Checked = false;
}
else if (value.ToLower().Equals("ok"))
{
checkBox1.Checked = true;
checkBox2.Checked = false;
}
else if (value.ToLower().Equals("nok"))
{
checkBox1.Checked = false;
checkBox2.Checked = true;
}
else
{
checkBox1.Checked = false;
checkBox2.Checked = false;
}
}
}
OkNok()
{
InitializeComponent();
}
public OkNok(FormForMechanicalMetersWithTracing parent, TracingDB.Entities.Part part)
: this()
{
this.parent = parent;
this.part = part;
kodMaterialuLabel.Text = part.Name;
descriptionMaterialuLabel.Text = part.Description;
}
public void ClearCode()
{
checkBox1.Checked = false;
checkBox2.Checked = false;
}
public void SubmitCode(string code)
{
ScannedCode = code;
scannedCodeTextBox_KeyPress(null, new KeyPressEventArgs('\r'));
}
public void ResetFocus()
{
setFocusButton.Text = "";
}
public void SetFocus()
{
setFocusButton.Text = ">";
checkBox1.Checked = false;
checkBox2.Checked = false;
checkBox1.Focus();
}
private void setFocusButton_Click(object sender, EventArgs e)
{
setFocusButton.Text = ">";
parent.OnFocusPressed(this, new FocusPressedEventArgs(IxPolozky, Part.CodeLocation));
}
private void scannedCodeTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar != '\r') return;
parent.OnBarcodeReceived(this, new BarcodeReceivedEventArgs(ScannedCode, IxPolozky, Part.CodeLocation));
return;
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked)
{
checkBox2.Checked = false;
parent.OnBarcodeReceived(this, new BarcodeReceivedEventArgs(ScannedCode, IxPolozky, Part.CodeLocation));
}
return;
}
private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
if (checkBox2.Checked)
{
checkBox1.Checked = false;
parent.OnBarcodeReceived(this, new BarcodeReceivedEventArgs(ScannedCode, IxPolozky, Part.CodeLocation));
}
return;
}
}
}

View File

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAQvSURBVGhD7Zl76N5THMd/zH2Yu00uLbfSxB/IJWVkkuxPl6X9g1gtyv6Y8IdI5JZWSCGzrCYl
UlKShr8oFLnkWpQS0dxv2+v1bJ/67Ox8L8+en/2e1fOuV99zzvd8z/dzzvM5n3PO95maaKKJJvo/tCcc
DnsMcjuJDoJb4D34DzbC3/AGXAm7wFhqFtwEP4FGh/Fl+hWwk2OlefA6aGgf3oV9YSy0AL6BPNJfw3I4
FNR8eBJyndUw4zoHfgQNCuNWwT5Q020QHfB6MkyLdodz4XpYuQVHcCE0GXM+/AoaIn/AZdCl7Gp3WTCK
ToKnYAPknzenf4N1cCZkfQVR52c4D/roWoh3vGDB9mg2PAb/QM3oWvpfeAYOBvU+WK7xZ1nQU1dAtPuq
BcPqCPgAfPmwOFmPA2XkuQ6OHeT6606I9h63YBhp/MeQRziuTelfQP/W+BNgFLlWfAnxjqXQW9n4bGBT
BzT4EtgV9oK5EHKL8ABYPoz8xfLA7A+9dRR8DqWxtQ7k0T4bnOwh9zUvgfXutqCnfL8hN95xH/TSnC1X
ZSOfgY00kY0Pf9WFLrYA3QNR1wh1CHRpb3gL4rnv4ADoVLjNvYPcZh0N0Yk86pE+HZTG5/LXQN0MuXwF
dGkN5GcuhU6VPp9/suxOuQPWV4a6XG5a/1VPQy5fD21yZc5t9Vq8wngfzJSdKN3pI1BXQy6PUT4NdKd8
73fYDWq6A3Ld58Gg0CoXKeN8jFAeLa81d4o6+r+T1D27I/c93ADqFDBfa/MYKOXWOu57fRmMXp16BMoX
lOmaO7XF+TC+qc0zIOsC8BAT9ZzA+0GnTgUftOEuyk4cvzk5kCPlxu5y0Gfzpq1G7rhRz8GIex9CL+OV
e24fKkeoTEc+u1NI443zfdox7R4pL0i2Gfc8neWBaZWx1tWtz4tzvlxQHoWyfls6Ipdy/rm5i3vLoEn+
KoZXw/NgoXTv7kPbQ1d0auN+CF0IUf4tNEWnw+BtiLpPwMBnayNUS+d8XNuiU1ub+VR1FcS95yyo6ET4
BOJ5uQYGky0Ko5GmdM7n8lp0KuvkdGnkYoh7X4BuneVnlR8g6tjWrTCQGysLRqWvO7kx836WESjmoXh8
vAiWgN+F8vN/wlZz5EaIXuUe1tI5X6vT5U5/gYbV5Eet3FYt7WbOM/VWssGuByOd8011mtzJY2jbQcSt
wsPQ1K6Rx8+N2+hAKPcpo1J24lPoe4pyNV4Lnp3fBH9VvyG1ylO+L671PKdzvqt+dqdee5lRZK998XTj
IWaH6UVoG9Ey31Qn0l0+P+1ygrgKNhlU5pvqmN7hxoc8eOQDdGlczjfVmTHjQ854o4ZGDYur5SKYcbnN
fQhc9TQsRjePdi53a/wsuHiNlY6E2+Ed0DXKDrglfhA64/Q4yFjujtBjogaPzT8lE0000U6rqalN3afe
HgkVr1gAAAAASUVORK5CYII=
</value>
</data>
</root>

View File

@ -0,0 +1,285 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
using TBF.BenchControl;
using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.DataEntry.S620
{
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasWMStatesForm
{
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
public override string ToString() { return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1)); }
public bool UsesCameras() { return false; }
readonly EntryFormCfg entryFormCfg;
IRegReader[] regReaders;
/// <summary>
/// Properties set by the Begin, End and WMStates form
/// </summary>
bool[] disabled; /// This array is shared between forms
string[] wmCycleEndState;
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
double[] wmStartState;
public double WMStartState(int wmNr) { return (wmNr >= 0 && wmNr < wmStartState.Length) ? wmStartState[wmNr] : 0; }
double[] wmEndState;
public double WMEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmEndState.Length) ? wmEndState[wmNr] : 0; }
string[] wmStartStateStr;
System.Windows.Forms.Form modelessDlg;
public bool Completed { get { return (modelessDlg is IHasCompleted) ? (modelessDlg as IHasCompleted).Completed : true; } }
double refVolume;
double errLimLo;
double errLimHi;
bool resultSaved; /// Set in Run() when results are saved
IList<Results.Entities.WaterMeter> waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
public enum CurrentOp
{
None,
ShowFormAtCycleBeginning,
ShowFormAtCycleEnd,
EnterTestStartStates,
EnterTestEndStates,
}
CurrentOp currentOp;
public EntryForm()
{
}
public EntryForm(Generic.IComponentCfg cfg)
: base(cfg)
{
entryFormCfg = cfg as EntryFormCfg;
disabled = new bool[Config.Data.WMsCount];
wmStartState = new double[Config.Data.WMsCount];
wmStartStateStr = new string[Config.Data.WMsCount];
wmEndState = new double[Config.Data.WMsCount];
wmCycleEndState = new string[Config.Data.WMsCount];
currentOp = CurrentOp.None;
log.Warn(this.ToString());
}
/// <returns>Reference to the operation</returns>
public IOperation ShowCycleBeginFormOp()
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.ShowFormAtCycleBeginning;
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.Batch.WaterMeters;
return this;
}
/// <returns>Reference to the operation</returns>
public IOperation ShowCycleEndFormOp()
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.ShowFormAtCycleEnd;
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.Batch.WaterMeters;
return this;
}
/// <returns>Reference to the operation</returns>
public IOperation ShowTestStartFormOp(IRegReader[] regReaders)
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.EnterTestStartStates;
this.regReaders = regReaders;
return this;
}
/// <returns>Reference to the operation</returns>
public IOperation ShowTestEndFormOp(IRegReader[] regReaders, double refVolume, double errLimLo, double errLimHi)
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.EnterTestEndStates;
this.regReaders = regReaders;
this.refVolume = refVolume;
this.errLimLo = errLimLo;
this.errLimHi = errLimHi;
return this;
}
delegate void EntryFormDlgt(EntryForm myRef);
///
void OpenMechanicalMetersDlg(EntryForm myRef)
{
myRef.modelessDlg = new FormForMechanicalMeters(waterMeters, entryFormCfg.SkipFailedMeters);
modelessDlg.Show();
}
///
void OpenMechanicalMetersWithTracingDlg(EntryForm myRef)
{
myRef.modelessDlg = new FormForMechanicalMetersWithTracing(waterMeters, entryFormCfg.SkipFailedMeters);
modelessDlg.Show();
}
///
void OpenTestStartStatesDlg(EntryForm myRef)
{
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, disabled);
modelessDlg.Show();
}
///
void OpenTestEndStatesDlg(EntryForm myRef)
{
myRef.modelessDlg = new TestStartEndForm(Config.Data.WMsCount, myRef.regReaders, wmStartStateStr, disabled, refVolume, errLimLo, errLimHi);
modelessDlg.Show();
}
/// <summary>Start this operation</summary>
public void Start()
{
resultSaved = false;
switch (currentOp)
{
default:
case CurrentOp.ShowFormAtCycleBeginning:
return;
case CurrentOp.ShowFormAtCycleEnd:
if (entryFormCfg.ProductionTracing)
{
Program.MainWnd.Invoke(new EntryFormDlgt(OpenMechanicalMetersWithTracingDlg), this);
}
else
{
Program.MainWnd.Invoke(new EntryFormDlgt(OpenMechanicalMetersDlg), this);
}
break;
case CurrentOp.EnterTestStartStates:
Program.MainWnd.Invoke(new EntryFormDlgt(OpenTestStartStatesDlg), this);
break;
case CurrentOp.EnterTestEndStates:
Program.MainWnd.Invoke(new EntryFormDlgt(OpenTestEndStatesDlg), this);
break;
}
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsPrinted</returns>
public Event Run()
{
if ((modelessDlg is IHasCompleted) && !(modelessDlg as IHasCompleted).Completed)
{
return Event.ModelessFormIsOpen;
}
if (!resultSaved) /// This is to save the result only once
{
if (currentOp == CurrentOp.ShowFormAtCycleEnd)
{
if (!entryFormCfg.ProductionTracing)
{
FormForMechanicalMeters dlg = (modelessDlg as FormForMechanicalMeters);
if (dlg != null)
{
for (int i = 0; i < waterMeters.Count; i++)
{
if (waterMeters[i] != null)
{
waterMeters[i].Disabled = disabled[i] = dlg.Disabled[i];
waterMeters[i].SerialNr = dlg.BodyNrText[i];
#if ORACLE_DB
waterMeters[i].AssignedSerialNr = dlg.AssignedSerialNr[i];
waterMeters[i].Prefix = dlg.Prefix;
waterMeters[i].Suffix = dlg.Suffix;
waterMeters[i].CompleteSerialNr = dlg.CompleteSerialNr[i];
#endif
if (dlg.PurchaseOrder != null) waterMeters[i].PurchaseOrder = dlg.PurchaseOrder;
}
}
}
}
else
{
FormForMechanicalMetersWithTracing dlg = (modelessDlg as FormForMechanicalMetersWithTracing);
if (dlg != null)
{
for (int i = 0; i < waterMeters.Count; i++)
{
if (waterMeters[i] != null)
{
waterMeters[i].Disabled = disabled[i] = dlg.Disabled[i];
waterMeters[i].SerialNr = dlg.BodyNrText[i];
#if ORACLE_DB
waterMeters[i].AssignedSerialNr = dlg.AssignedSerialNr[i];
waterMeters[i].Prefix = dlg.Prefix;
waterMeters[i].Suffix = dlg.Suffix;
waterMeters[i].CompleteSerialNr = dlg.CompleteSerialNr[i];
#endif
if (dlg.PurchaseOrder != null) waterMeters[i].PurchaseOrder = dlg.PurchaseOrder;
}
}
}
}
}
else if ((modelessDlg is TestStartEndForm) && (currentOp == CurrentOp.EnterTestStartStates))
{
/// Fixed start test - start
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
if (dlg != null)
{
for (int i = 0; i < dlg.WaterMetersCount; i++)
{
if (!(((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null))))
{
wmStartState[i] = dlg.WMStartState[i];
wmStartStateStr[i] = dlg.WMStartStateStr[i];
}
}
}
}
else if ((modelessDlg is TestStartEndForm) && (currentOp == CurrentOp.EnterTestEndStates))
{
/// Fixed start test - end
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
if (dlg != null)
{
for (int i = 0; i < dlg.WaterMetersCount; i++)
{
if (!(((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null))))
{
wmEndState[i] = dlg.WMEndState[i];
}
}
}
}
resultSaved = true;
modelessDlg = null;
}
return Event.ModelessFormClosed; /// Form closed
}
/// <summary>Stop this operation</summary>
public void Stop()
{
if (modelessDlg is IHasCompleted)
{
UiBridge.Bridge.OnCloseModelessForm(this, null);
modelessDlg = null;
}
currentOp = CurrentOp.None;
}
}
}

View File

@ -0,0 +1,43 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataEntry.S620
{
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
///
/// Serialized parameters
///
public bool SkipFailedMeters;
public bool ProductionTracing;
/// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg() { }
public EntryFormCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = string.Empty;
SkipFailedMeters = false;
ProductionTracing = false;
}
public string ToString(int i)
{
return string.Format("Name={0}, SkipFailedMeters={1}, ProductionTracing={2}", Name, SkipFailedMeters, ProductionTracing);
}
}
}

View File

@ -0,0 +1,83 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.DataEntry.S620
{
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
{
public bool ShowMore { get { return false; } }
EntryFormCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as EntryFormCfg;
Redraw();
}
}
public EntryFormCfgCtrl()
{
InitializeComponent();
}
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
{
Localize();
Redraw();
}
void Localize()
{
skipFailedMetersCheckBox.Text = "Preskočiť zlé vodomery pri skenovaní";
productionTracingCheckBox.Text = "Sledovanie výroby";
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
skipFailedMetersCheckBox.Checked = config.SkipFailedMeters;
productionTracingCheckBox.Checked = config.ProductionTracing;
}
public void Unlock()
{
nameTextBox.Enabled = true;
skipFailedMetersCheckBox.Enabled = true;
productionTracingCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
config.SkipFailedMeters = skipFailedMetersCheckBox.Checked;
config.ProductionTracing = productionTracingCheckBox.Checked;
return flags;
}
}
}

View File

@ -0,0 +1,114 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
namespace TBF.BenchControl.DataEntry.S620
{
partial class EntryFormCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </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.skipFailedMetersCheckBox = new System.Windows.Forms.CheckBox();
this.productionTracingCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(93, 57);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(35, 60);
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(90, 33);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// skipFailedMetersCheckBox
//
this.skipFailedMetersCheckBox.AutoSize = true;
this.skipFailedMetersCheckBox.Enabled = false;
this.skipFailedMetersCheckBox.Location = new System.Drawing.Point(93, 89);
this.skipFailedMetersCheckBox.Name = "skipFailedMetersCheckBox";
this.skipFailedMetersCheckBox.Size = new System.Drawing.Size(182, 17);
this.skipFailedMetersCheckBox.TabIndex = 3;
this.skipFailedMetersCheckBox.Text = "Skip failed meters while scanning";
this.skipFailedMetersCheckBox.UseVisualStyleBackColor = true;
//
// productionTracingCheckBox
//
this.productionTracingCheckBox.AutoSize = true;
this.productionTracingCheckBox.Enabled = false;
this.productionTracingCheckBox.Location = new System.Drawing.Point(93, 112);
this.productionTracingCheckBox.Name = "productionTracingCheckBox";
this.productionTracingCheckBox.Size = new System.Drawing.Size(112, 17);
this.productionTracingCheckBox.TabIndex = 5;
this.productionTracingCheckBox.Text = "Production tracing";
this.productionTracingCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.productionTracingCheckBox);
this.Controls.Add(this.skipFailedMetersCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "EntryFormCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox skipFailedMetersCheckBox;
private System.Windows.Forms.CheckBox productionTracingCheckBox;
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,26 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataEntry.S620
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
public IComponent DummyComponent() { return new EntryForm(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this.GetType().Namespace.Substring(17), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(EntryFormCfg.Serializer, component, this);
}
}
}

View File

@ -0,0 +1,26 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
namespace TBF.BenchControl.DataEntry.S620
{
public class FocusPressedEventArgs : EventArgs
{
/// <summary>
/// ID of a part in this workstep:
/// 0 undefined
/// 1 reference part
/// 2..99 parts with unique codes
/// 100.. parts with batch numbers
/// </summary>
public int IxPolozky;
public TracingDB.CodeLocation CodeLocation;
public FocusPressedEventArgs(int ixPolozky, TracingDB.CodeLocation codeLocation)
{
this.IxPolozky = ixPolozky;
this.CodeLocation = codeLocation;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,693 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Sequences;
using TBF.Resources;
using Oracle.DataAccess.Client;
using System.Diagnostics;
namespace TBF.BenchControl.DataEntry.S620
{
public partial class FormForMechanicalMeters : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(FormForMechanicalMeters));
/// <summary> Number of water meters </summary>
IList<Results.Entities.WaterMeter> waterMeters;
readonly int wmsCount;
readonly bool skipFailed;
/// To be retrieved after the form is closed
public string PurchaseOrder;
public string[] BodyNrText;
public int[] AssignedSerialNr;
public string[] CompleteSerialNr;
public bool[] Disabled;
public string Prefix; /// S/N prefix - Loaded from Oracle DB table VT_AUFTRAG_PD
public string Suffix; /// S/N suffix - Loaded from Oracle DB table VT_AUFTRAG_PD
/// Loaded from Oracle DB table VT_AUFTRAG_PD
int firstSN; /// First serial number
int snDigits; /// Number of digits of the middle part of the serial number
int pcsCount; /// Pieces count
IList<BodySerNrResult> foundMeters;
IList<int> foundSNsWithinRange;
IList<int> assignedSNs;
/// Entered manually
int snRangeFirst; /// 0 = invalid
int snRangeLast; /// 0 = invalid
/// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
bool completed;
/// <summary> Number of text boxes for serial numbers </summary>
int textBoxesCount;
Label[] labels;
ComboBox[] bodyNrBoxes;
TextBox[] serialNrBoxes;
CheckBox[] checkBoxes;
IList<ComboBox> enabledBodyNrBoxes; /// combo boxes containing body numbers
IList<TextBox> enabledSerialNrBoxes; /// text boxes containing assigned serial numbers
IList<TextBox> enabledCounterNrBoxes; /// text boxes containing assigned serial numbers
readonly LocalSettings LS;
/// <summary> Parameterless constructor for common functionality </summary>
public FormForMechanicalMeters()
{
InitializeComponent();
ControlBox = false;
firstSN = 0;
snDigits = 0;
pcsCount = 0;
Prefix = null;
Suffix = null;
foundMeters = new List<BodySerNrResult>();
foundSNsWithinRange = new List<int>();
assignedSNs = new List<int>();
snRangeFirst = 0;
snRangeLast = 0;
LS = Program.LocalSettings;
textBoxesCount = 40;
labels = new Label[]
{
label1, label2, label3, label4, label5, label6, label7, label8, label9, label10,
label11, label12, label13, label14, label15, label16, label17, label18, label19, label20,
label21, label22, label23, label24, label25, label26, label27, label28, label29, label30,
label31, label32, label33, label34, label35, label36, label37, label38, label39, label40,
};
bodyNrBoxes = new ComboBox[]
{
comboBox1, comboBox2, comboBox3, comboBox4, comboBox5, comboBox6, comboBox7, comboBox8, comboBox9, comboBox10,
comboBox11, comboBox12, comboBox13, comboBox14, comboBox15, comboBox16, comboBox17, comboBox18, comboBox19, comboBox20,
comboBox21, comboBox22, comboBox23, comboBox24, comboBox25, comboBox26, comboBox27, comboBox28, comboBox29, comboBox30,
comboBox31, comboBox32, comboBox33, comboBox34, comboBox35, comboBox36, comboBox37, comboBox38, comboBox39, comboBox40,
};
serialNrBoxes = new TextBox[]
{
textBox1, textBox2, textBox3, textBox4, textBox5, textBox6, textBox7, textBox8, textBox9, textBox10,
textBox11, textBox12, textBox13, textBox14, textBox15, textBox16, textBox17, textBox18, textBox19, textBox20,
textBox21, textBox22, textBox23, textBox24, textBox25, textBox26, textBox27, textBox28, textBox29, textBox30,
textBox31, textBox32, textBox33, textBox34, textBox35, textBox36, textBox37, textBox38, textBox39, textBox40,
};
checkBoxes = new CheckBox[]
{
checkBox1, checkBox2, checkBox3, checkBox4, checkBox5, checkBox6, checkBox7, checkBox8, checkBox9, checkBox10,
checkBox11, checkBox12, checkBox13, checkBox14, checkBox15, checkBox16, checkBox17, checkBox18, checkBox19, checkBox20,
checkBox21, checkBox22, checkBox23, checkBox24, checkBox25, checkBox26, checkBox27, checkBox28, checkBox29, checkBox30,
checkBox31, checkBox32, checkBox33, checkBox34, checkBox35, checkBox36, checkBox37, checkBox38, checkBox39, checkBox40,
};
enabledBodyNrBoxes = new List<ComboBox>();
enabledSerialNrBoxes = new List<TextBox>();
enabledCounterNrBoxes = new List<TextBox>();
completed = false;
StartForceCloseHandler();
}
#region Forced close handling
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
};
}
private void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
/// <summary>
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public FormForMechanicalMeters(IList<Results.Entities.WaterMeter> waterMeters, bool skipFailed)
: this()
{
this.waterMeters = waterMeters;
this.wmsCount = waterMeters.Count;
this.skipFailed = skipFailed;
BodyNrText = new string[wmsCount];
AssignedSerialNr = new int[wmsCount];
CompleteSerialNr = new string[wmsCount];
Disabled = new bool[wmsCount];
ShuffleTextBoxes(wmsCount, Config.Data.LineSize);
}
/// <summary>
/// Make sure the layout of labels/text boxes on the screen
/// corresponds to the layout of watermeters of the test bench.
/// </summary>
/// <param name="wmsCount">Number of watermeters</param>
/// <param name="lineSize">Number of watermeters in one line</param>
void ShuffleTextBoxes(int wmsCount, int lineSize)
{
if (wmsCount < textBoxesCount && lineSize > 0)
{
int nrLines = (wmsCount + lineSize - 1) / lineSize;
int gap = (textBoxesCount - wmsCount) / nrLines;
int dest = 0;
for (int l = 0; l < nrLines; l++)
{
for (int i = 0; i < lineSize; i++)
{
labels[dest] = labels[l * lineSize + l * gap + i];
bodyNrBoxes[dest] = bodyNrBoxes[l * lineSize + l * gap + i];
serialNrBoxes[dest] = serialNrBoxes[l * lineSize + l * gap + i];
checkBoxes[dest] = checkBoxes[l * lineSize + l * gap + i];
dest++;
}
}
textBoxesCount = wmsCount;
}
}
private void CycleBeginningForm_Load(object sender, EventArgs e)
{
Localize();
PrepareOrderAndSNRangeCombos();
for (int i = 0; i < textBoxesCount; i++)
{
if (Program.LocalSettings.LastSNTextsCount == textBoxesCount)
{
bodyNrBoxes[i].Items.Add((Program.LocalSettings.LastSNTexts[i] == null) ? string.Empty : Program.LocalSettings.LastSNTexts[i]);
}
labels[i].Visible = bodyNrBoxes[i].Visible = serialNrBoxes[i].Visible = checkBoxes[i].Visible = true;
if (waterMeters[i] == null || waterMeters[i].Disabled || (skipFailed && !waterMeters[i].PassedFromTests()))
{
bodyNrBoxes[i].Enabled = serialNrBoxes[i].Enabled = checkBoxes[i].Enabled = false;
}
else
{
enabledBodyNrBoxes.Add(bodyNrBoxes[i]);
enabledSerialNrBoxes.Add(serialNrBoxes[i]);
}
if (waterMeters[i] != null && !waterMeters[i].PassedFromTests())
{
bodyNrBoxes[i].BackColor = System.Drawing.Color.Pink;
serialNrBoxes[i].BackColor = System.Drawing.Color.Pink;
}
}
if (ProcessData.OracleDB != null && ProcessData.OracleDB.SelectedDB != null)
{
reloadButton.Enabled = true;
}
}
void Localize()
{
Text = Strings.Data;
orderGroupBox.Text = "Výrobná zakázka";
for (int i = 0; i < textBoxesCount; i++)
{
labels[i].Text = string.Format("Vodomer {0}", i + 1);
}
firstSNLabel.Text = "prvé s/n";
snDigitsLabel.Text = "číslic";
piecesCountLabel.Text = "kusov";
reloadButton.Text = "Načítať";
snRangeGroupBox.Text = "Rozsah sériových čísel";
fromLabel.Text = "od";
toLabel.Text = "do";
okButton.Text = Strings.OkBtnText;
clearButton.Text = Strings.ClearBtnText;
serialNumbersGroupBox.Text = "Sériové čísla";
label41.Text = label43.Text = "Číslo púzdra";
label42.Text = label44.Text = "Sériové číslo";
for (int i = 0; i < textBoxesCount; i++)
{
labels[i].Text = string.Format("Vodomer {0}", i + 1);
}
}
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="orderComboBox">Puchase order ComboBox</param>
void PrepareOrderAndSNRangeCombos()
{
/// Purchase order
for (int i = 0; i < LS.PurchaseOrderHistoryCount; i++) orderCB.Items.Add(LS.PurchaseOrderHistory[i]);
if (orderCB.Items.Count > 0) orderCB.Text = orderCB.Items[0].ToString();
/// First S/N in selected range
for (int i = 0; i < LS.FirstSNHistoryCount; i++) firstSNRangeCB.Items.Add(LS.FirstSNHistory[i]);
if (firstSNRangeCB.Items.Count > 0) firstSNRangeCB.Text = firstSNRangeCB.Items[0].ToString();
/// Last S/N in selected range
for (int i = 0; i < LS.LastSNHistoryCount; i++) lastSNRangeCB.Items.Add(LS.LastSNHistory[i]);
if (lastSNRangeCB.Items.Count > 0) lastSNRangeCB.Text = lastSNRangeCB.Items[0].ToString();
}
private void okButton_Click(object sender, EventArgs e)
{
PurchaseOrder = orderCB.Text;
Program.LocalSettings.UpdateHistory(orderCB.Text, ref Program.LocalSettings.PurchaseOrderHistory);
Program.LocalSettings.UpdateHistory(firstSNRangeCB.Text, ref Program.LocalSettings.FirstSNHistory);
Program.LocalSettings.UpdateHistory(lastSNRangeCB.Text, ref Program.LocalSettings.LastSNHistory);
Program.LocalSettings.LastSNTexts = BodyNrText;
int itmp;
for (int i = 0; i < Math.Min(wmsCount, textBoxesCount); i++)
{
BodyNrText[i] = bodyNrBoxes[i].Text;
AssignedSerialNr[i] = int.TryParse(serialNrBoxes[i].Text, out itmp) ? itmp : 0;
CompleteSerialNr[i] = string.Format("{0}{1}{2}",
(Prefix != null) ? Prefix : string.Empty,
AssignedSerialNr[i].ToString(string.Format("D{0}", Math.Max(snDigits, 1))),
(Suffix != null) ? Suffix : string.Empty);
Disabled[i] = !checkBoxes[i].Checked;
}
completed = true;
Close();
}
/// <summary>
/// When one combo box is updated using drop-down menu, all combo boxes
/// are updated by this function.
/// </summary>
private void UpdateAllCombos()
{
for (int i = 0; i < Math.Min(wmsCount, textBoxesCount); i++)
{
bodyNrBoxes[i].Text = Program.LocalSettings.LastSNTexts[i];
checkBoxes[i].Checked = !string.IsNullOrEmpty(bodyNrBoxes[i].Text);
}
}
private void clearButton_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Naozaj chcete všetky kódy vymazať?", "Upozonenie", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
for (int i = 0; i < Math.Min(wmsCount, textBoxesCount); i++)
{
bodyNrBoxes[i].Text = string.Empty;
serialNrBoxes[i].Text = string.Empty;
checkBoxes[i].Checked = false;
}
assignedSNs.Clear();
}
}
private void comboBox1_TextChanged(object s, EventArgs e) { checkBox1.Checked = true; }
private void comboBox2_TextChanged(object s, EventArgs e) { checkBox2.Checked = true; }
private void comboBox3_TextChanged(object s, EventArgs e) { checkBox3.Checked = true; }
private void comboBox4_TextChanged(object s, EventArgs e) { checkBox4.Checked = true; }
private void comboBox5_TextChanged(object s, EventArgs e) { checkBox5.Checked = true; }
private void comboBox6_TextChanged(object s, EventArgs e) { checkBox6.Checked = true; }
private void comboBox7_TextChanged(object s, EventArgs e) { checkBox7.Checked = true; }
private void comboBox8_TextChanged(object s, EventArgs e) { checkBox8.Checked = true; }
private void comboBox9_TextChanged(object s, EventArgs e) { checkBox9.Checked = true; }
private void comboBox10_TextChanged(object s, EventArgs e) { checkBox10.Checked = true; }
private void comboBox11_TextChanged(object s, EventArgs e) { checkBox11.Checked = true; }
private void comboBox12_TextChanged(object s, EventArgs e) { checkBox12.Checked = true; }
private void comboBox13_TextChanged(object s, EventArgs e) { checkBox13.Checked = true; }
private void comboBox14_TextChanged(object s, EventArgs e) { checkBox14.Checked = true; }
private void comboBox15_TextChanged(object s, EventArgs e) { checkBox15.Checked = true; }
private void comboBox16_TextChanged(object s, EventArgs e) { checkBox16.Checked = true; }
private void comboBox17_TextChanged(object s, EventArgs e) { checkBox17.Checked = true; }
private void comboBox18_TextChanged(object s, EventArgs e) { checkBox18.Checked = true; }
private void comboBox19_TextChanged(object s, EventArgs e) { checkBox19.Checked = true; }
private void comboBox20_TextChanged(object s, EventArgs e) { checkBox20.Checked = true; }
private void comboBox21_TextChanged(object s, EventArgs e) { checkBox21.Checked = true; }
private void comboBox22_TextChanged(object s, EventArgs e) { checkBox22.Checked = true; }
private void comboBox23_TextChanged(object s, EventArgs e) { checkBox23.Checked = true; }
private void comboBox24_TextChanged(object s, EventArgs e) { checkBox24.Checked = true; }
private void comboBox25_TextChanged(object s, EventArgs e) { checkBox25.Checked = true; }
private void comboBox26_TextChanged(object s, EventArgs e) { checkBox26.Checked = true; }
private void comboBox27_TextChanged(object s, EventArgs e) { checkBox27.Checked = true; }
private void comboBox28_TextChanged(object s, EventArgs e) { checkBox28.Checked = true; }
private void comboBox29_TextChanged(object s, EventArgs e) { checkBox29.Checked = true; }
private void comboBox30_TextChanged(object s, EventArgs e) { checkBox30.Checked = true; }
private void comboBox31_TextChanged(object s, EventArgs e) { checkBox31.Checked = true; }
private void comboBox32_TextChanged(object s, EventArgs e) { checkBox32.Checked = true; }
private void comboBox33_TextChanged(object s, EventArgs e) { checkBox33.Checked = true; }
private void comboBox34_TextChanged(object s, EventArgs e) { checkBox34.Checked = true; }
private void comboBox35_TextChanged(object s, EventArgs e) { checkBox35.Checked = true; }
private void comboBox36_TextChanged(object s, EventArgs e) { checkBox36.Checked = true; }
private void comboBox37_TextChanged(object s, EventArgs e) { checkBox37.Checked = true; }
private void comboBox38_TextChanged(object s, EventArgs e) { checkBox38.Checked = true; }
private void comboBox39_TextChanged(object s, EventArgs e) { checkBox39.Checked = true; }
private void comboBox40_TextChanged(object s, EventArgs e) { checkBox40.Checked = true; }
private void comboBox1_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox1.Text == comboBox1.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox2_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox2.Text == comboBox2.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox3_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox3.Text == comboBox3.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox4_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox4.Text == comboBox4.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox5_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox5.Text == comboBox5.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox6_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox6.Text == comboBox6.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox7_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox7.Text == comboBox7.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox8_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox8.Text == comboBox8.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox9_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox9.Text == comboBox9.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox10_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox10.Text == comboBox10.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox11_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox11.Text == comboBox11.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox12_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox12.Text == comboBox12.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox13_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox13.Text == comboBox13.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox14_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox14.Text == comboBox14.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox15_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox15.Text == comboBox15.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox16_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox16.Text == comboBox16.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox17_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox17.Text == comboBox17.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox18_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox18.Text == comboBox18.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox19_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox19.Text == comboBox19.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox20_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox20.Text == comboBox20.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox21_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox21.Text == comboBox21.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox22_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox22.Text == comboBox22.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox23_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox23.Text == comboBox23.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox24_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox24.Text == comboBox24.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox25_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox25.Text == comboBox25.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox26_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox26.Text == comboBox26.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox27_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox27.Text == comboBox27.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox28_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox28.Text == comboBox28.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox29_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox29.Text == comboBox29.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox30_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox30.Text == comboBox30.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox31_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox31.Text == comboBox31.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox32_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox32.Text == comboBox32.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox33_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox33.Text == comboBox33.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox34_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox34.Text == comboBox34.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox35_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox35.Text == comboBox35.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox36_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox36.Text == comboBox36.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox37_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox37.Text == comboBox37.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox38_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox38.Text == comboBox38.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox39_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox39.Text == comboBox39.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox40_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox40.Text == comboBox40.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox1_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox1); }
private void comboBox2_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox2); }
private void comboBox3_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox3); }
private void comboBox4_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox4); }
private void comboBox5_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox5); }
private void comboBox6_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox6); }
private void comboBox7_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox7); }
private void comboBox8_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox8); }
private void comboBox9_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox9); }
private void comboBox10_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox10); }
private void comboBox11_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox11); }
private void comboBox12_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox12); }
private void comboBox13_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox13); }
private void comboBox14_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox14); }
private void comboBox15_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox15); }
private void comboBox16_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox16); }
private void comboBox17_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox17); }
private void comboBox18_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox18); }
private void comboBox19_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox19); }
private void comboBox20_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox20); }
private void comboBox21_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox21); }
private void comboBox22_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox22); }
private void comboBox23_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox23); }
private void comboBox24_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox24); }
private void comboBox25_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox25); }
private void comboBox26_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox26); }
private void comboBox27_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox27); }
private void comboBox28_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox28); }
private void comboBox29_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox29); }
private void comboBox30_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox30); }
private void comboBox31_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox31); }
private void comboBox32_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox32); }
private void comboBox33_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox33); }
private void comboBox34_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox34); }
private void comboBox35_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox35); }
private void comboBox36_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox36); }
private void comboBox37_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox37); }
private void comboBox38_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox38); }
private void comboBox39_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox39); }
private void comboBox40_KeyPress(object s, KeyPressEventArgs e) { ProcKeyPress(s, e, comboBox40); }
/// <summary>
/// Process a key press within any enabled text boxe
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="currentFocusOwner">TextBox control which received the event</param>
private void ProcKeyPress(object sender, KeyPressEventArgs e, ComboBox currentFocusOwner)
{
if (e.KeyChar == '+')
{
/// Process '+' key ..... Form completed
okButton_Click(sender, e);
}
if (e.KeyChar == '\r')
{
/// Process <enter> key ..... Next text field
for (int i = 0; i < textBoxesCount; i++)
{
if (bodyNrBoxes[i] == currentFocusOwner)
{
if (waterMeters[i].PassedFromTests())
{
serialNrBoxes[i].Text = GetNextSerialNr().ToString(); /// WM Passed
}
else
{
serialNrBoxes[i].Text = "0"; /// WM failed
}
}
}
if (enabledBodyNrBoxes.Count < 2) return; /// There is just one enabled textbox
for (int i = 0; i < enabledBodyNrBoxes.Count; i++)
{
if (enabledBodyNrBoxes[i] == currentFocusOwner)
{
/// Change focus to the next enabled text box
enabledBodyNrBoxes[(i + 1) % enabledBodyNrBoxes.Count].Focus();
return;
}
}
}
}
private void orderCB_SelectedIndexChanged(object sender, EventArgs e)
{
ProcessPO();
}
private void reloadButton_Click(object sender, EventArgs e)
{
ProcessPO();
}
void ProcessPO()
{
if (ReadPurchaseOrderParamsFromDB(ProcessData.OracleDB.SelectedDB, orderCB.Text, out firstSN, out snDigits, out pcsCount, out Prefix, out Suffix))
{
prefixTextBox.Text = (Prefix != null) ? Prefix : string.Empty;
suffixTextBox.Text = (Suffix != null) ? Suffix : string.Empty;
snDigitsTextBox.Text = snDigits.ToString();
firstSNTextBox.Text = firstSN.ToString(string.Format("D{0}", snDigits));
pcsCountTextBox.Text = pcsCount.ToString();
exclamationPOLabel.Visible = false;
}
else
{
prefixTextBox.Text = suffixTextBox.Text = string.Empty;
firstSNTextBox.Text = snDigitsTextBox.Text = pcsCountTextBox.Text = string.Empty;
exclamationPOLabel.Visible = true;
}
UpdateSNFromTo();
}
bool ReadPurchaseOrderParamsFromDB(OracleConnection connection, string orderNr, out int firstSN, out int snDigits, out int piecesCount, out string prefix, out string suffix)
{
firstSN = 0;
piecesCount = 0;
snDigits = 0;
prefix = null;
suffix = null;
if (connection == null || string.IsNullOrEmpty(orderNr)) return false;
try
{
connection.Open();
foreach (var status in new string[] { "NEU", "AKTIV" })
{
/// STATUS='NEU'
OracleCommand cmd = new OracleCommand("select SOLLSTUECK, ERSTE_ZAEHLERNR, PREFIX, SUFFIX, ZNRLAENGE from VT_AUFTRAG_PD" +
" where PRODUKTION_ANBID=:1 AND STATUS=:2 AND PRODUKTION_USESTATE=:3 AND AUFTRAGSNUMMER=:4", connection);
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Output.DB.SensusOracle.Database.Anbid_StaraTura }); ///:1
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = status }); ///:2
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); ///:3
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = orderNr }); ///:4
OracleDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
piecesCount = dr.GetInt32(0);
firstSN = dr.GetInt32(1);
try { prefix = dr.GetString(2); } catch { prefix = null; }
try { suffix = dr.GetString(3); } catch { suffix = null; }
snDigits = dr.GetInt32(4);
}
dr.Close();
}
if (firstSN == 0 && piecesCount == 0)
{
string msg2 = string.Format("Nebola nájdená žiadna výrobná zakázka {0}", orderNr);
log.Warn(msg2);
Debug.WriteLine(msg2);
connection.Close();
return false;
}
foundMeters.Clear();
OracleCommand cmd2 = new OracleCommand("select VT_FERNUM, ZAEHLERNUMMER, HYDR_PRUEFUNG from VT_ZAEHLER_PD" +
" where ANBID=:1 AND AUFTRAGSNUMMER=:2 order by ZAEHLERNUMMER asc", connection);
cmd2.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Output.DB.SensusOracle.Database.Anbid_StaraTura }); ///:1
cmd2.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = orderNr }); ///:2
OracleDataReader dr2 = cmd2.ExecuteReader();
while (dr2.Read())
{
string bodyNr = dr2.GetString(0); /// Body number
int serialNr = dr2.GetInt32(1); /// Assigned serial number when OK, 0 when NOK
int result = dr2.GetInt32(2); /// HYDR_PRUEFUNG: 96=OK, 224=OK after a repetition, 97=NOK
if (serialNr != 0 && result != 97)
{
foundMeters.Add(new BodySerNrResult(bodyNr, serialNr, result));
}
}
dr2.Close();
string msg = string.Format("Výrobná zakázka bola nájdená: prvé S/N = {0}, počet kusov = {1}, doteraz vyrobených {2}", firstSN, piecesCount, foundMeters.Count);
log.Warn(msg);
Debug.WriteLine(msg);
connection.Close();
return true;
}
catch (Exception exc)
{
string msg = string.Format("ERROR: ORACLE DB query select AUFTRAGSNUMMER, SOLLSTUECK from VT_AUFTRAG_PD where ... failed: {0}", exc.Message);
log.Error(msg);
Debug.WriteLine(msg);
firstSN = 0;
piecesCount = 0;
connection.Close();
return false;
}
}
private void firstSNRangeCB_TextChanged(object s, EventArgs e) { UpdateSNFromTo(); }
private void lastSNRangeCB_TextChanged(object s, EventArgs e) { UpdateSNFromTo(); }
private void firstSNRangeCB_SelectedIndexChanged(object s, EventArgs e) { UpdateSNFromTo(); }
private void lastSNRangeCB_SelectedIndexChanged(object s, EventArgs e) { UpdateSNFromTo(); }
void UpdateSNFromTo()
{
bool anyError = false;
foundSNsWithinRange.Clear();
int _snRangeFirst;
if (int.TryParse(firstSNRangeCB.Text, out _snRangeFirst) && (_snRangeFirst >= firstSN)
&& (_snRangeFirst < firstSN + pcsCount))
{
snRangeFirst = _snRangeFirst;
exclamationFromLabel.Visible = false;
}
else
{
snRangeFirst = 0;
exclamationFromLabel.Visible = true;
anyError = true;
}
int _snRangeLast;
if (int.TryParse(lastSNRangeCB.Text, out _snRangeLast) && (_snRangeLast >= firstSN)
&& (_snRangeLast < firstSN + pcsCount))
{
snRangeLast = _snRangeLast;
exclamationToLabel.Visible = false;
}
else
{
snRangeLast = 0;
exclamationToLabel.Visible = true;
anyError = true;
}
if (snRangeFirst > 0 && snRangeLast > 0 && snRangeFirst > snRangeLast)
{
snRangeFirst = snRangeLast = 0;
exclamationFromLabel.Visible = exclamationToLabel.Visible = true;
anyError = true;
}
if (!anyError)
{
foreach (var mtr in foundMeters)
{
if (snRangeFirst <= mtr.SerialNr && mtr.SerialNr <= snRangeLast)
{
foundSNsWithinRange.Add(mtr.SerialNr);
}
}
}
serialNumbersGroupBox.Enabled = !anyError;
}
/// <summary>
/// Returns next free serial number within specified range or 0 if no appropriate s/n is available
/// </summary>
/// <returns>Serial number or 0</returns>
int GetNextSerialNr()
{
for (int sn = snRangeFirst; sn <= snRangeLast; sn++)
{
if (!foundSNsWithinRange.Contains(sn) && !assignedSNs.Contains(sn))
{
/// A free serial number within specified range found
assignedSNs.Add(sn);
return sn;
}
}
return 0; /// No free serial number found
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,973 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Sequences;
using TBF.Resources;
using Oracle.DataAccess.Client;
using TracingDB.Entities;
using NHibernate;
using System.Threading;
using TracingDB;
namespace TBF.BenchControl.DataEntry.S620
{
public partial class FormForMechanicalMetersWithTracing : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(FormForMechanicalMetersWithTracing));
/// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
bool completed;
/// <summary> Number of water meters </summary>
IList<Results.Entities.WaterMeter> waterMeters;
readonly int wmsCount;
readonly bool skipFailed;
/// To be retrieved after the form is closed
public string PurchaseOrder;
public string[] BodyNrText;
public int[] AssignedSerialNr;
public string[] CompleteSerialNr;
public bool[] Disabled;
public string Prefix; /// S/N prefix - Loaded from Oracle DB table VT_AUFTRAG_PD
public string Suffix; /// S/N suffix - Loaded from Oracle DB table VT_AUFTRAG_PD
/// Loaded from Oracle DB table VT_AUFTRAG_PD
int firstSN; /// First serial number
int snDigits; /// Number of digits of the middle part of the serial number
int pcsCount; /// Pieces count
IList<BodySerNrResult> foundMeters;
IList<int> foundSNsWithinRange;
IList<int> assignedSNs;
/// Entered manually
int snRangeFirst; /// 0 = invalid
int snRangeLast; /// 0 = invalid
///
/// Production tracing
///
ISession dbSession;
IList<Process> processes; /// Processes from the database
Process currentProcess; /// Currently used workflow
Workstep currentWorkstep; /// Currently used workstep(s)
IList<Workstep> workstepsOfTheCurrentProcess;
/// Previous workstep verification
Workstep verifiedWorkstep;
Part verifiedPart; /// Applicable when verifyReferencePart == false
bool verifyReferencePart;
/// Items to be scanned/filled in
IList<ICheckItem> komponenty;
IList<ICheckItem> palety;
public int ExtraBatteryLifetime { get { return 0; } }
/// <summary> Number of text boxes for serial numbers </summary>
int textBoxesCount;
Label[] labels;
ComboBox[] bodyNrBoxes;
TextBox[] serialNrBoxes;
TextBox[] counterNrBoxes;
CheckBox[] checkBoxes;
IList<ComboBox> enabledBodyNrBoxes; /// combo boxes containing body numbers
IList<TextBox> enabledSerialNrBoxes; /// text boxes containing assigned serial numbers
IList<TextBox> enabledCounterNrBoxes; /// text boxes containing assigned serial numbers
readonly LocalSettings LS;
/// <summary> Parameterless constructor for common functionality </summary>
public FormForMechanicalMetersWithTracing()
{
InitializeComponent();
ControlBox = false;
ManageCheckGroupBox(batchesCheckBox, batchesGroupBox);
firstSN = 0;
snDigits = 0;
pcsCount = 0;
Prefix = null;
Suffix = null;
foundMeters = new List<BodySerNrResult>();
foundSNsWithinRange = new List<int>();
assignedSNs = new List<int>();
snRangeFirst = 0;
snRangeLast = 0;
LS = Program.LocalSettings;
textBoxesCount = 40;
labels = new Label[]
{
label1, label2, label3, label4, label5, label6, label7, label8, label9, label10,
label11, label12, label13, label14, label15, label16, label17, label18, label19, label20,
label21, label22, label23, label24, label25, label26, label27, label28, label29, label30,
label31, label32, label33, label34, label35, label36, label37, label38, label39, label40,
};
bodyNrBoxes = new ComboBox[]
{
comboBox1, comboBox2, comboBox3, comboBox4, comboBox5, comboBox6, comboBox7, comboBox8, comboBox9, comboBox10,
comboBox11, comboBox12, comboBox13, comboBox14, comboBox15, comboBox16, comboBox17, comboBox18, comboBox19, comboBox20,
comboBox21, comboBox22, comboBox23, comboBox24, comboBox25, comboBox26, comboBox27, comboBox28, comboBox29, comboBox30,
comboBox31, comboBox32, comboBox33, comboBox34, comboBox35, comboBox36, comboBox37, comboBox38, comboBox39, comboBox40,
};
serialNrBoxes = new TextBox[]
{
textBox1, textBox2, textBox3, textBox4, textBox5, textBox6, textBox7, textBox8, textBox9, textBox10,
textBox11, textBox12, textBox13, textBox14, textBox15, textBox16, textBox17, textBox18, textBox19, textBox20,
textBox21, textBox22, textBox23, textBox24, textBox25, textBox26, textBox27, textBox28, textBox29, textBox30,
textBox31, textBox32, textBox33, textBox34, textBox35, textBox36, textBox37, textBox38, textBox39, textBox40,
};
counterNrBoxes = new TextBox[]
{
textBox41, textBox42, textBox43, textBox44, textBox45, textBox46, textBox47, textBox48, textBox49, textBox50,
textBox51, textBox52, textBox53, textBox54, textBox55, textBox56, textBox57, textBox58, textBox59, textBox60,
textBox61, textBox62, textBox63, textBox64, textBox65, textBox66, textBox67, textBox68, textBox69, textBox70,
textBox71, textBox72, textBox73, textBox74, textBox75, textBox76, textBox77, textBox78, textBox79, textBox80,
};
checkBoxes = new CheckBox[]
{
checkBox1, checkBox2, checkBox3, checkBox4, checkBox5, checkBox6, checkBox7, checkBox8, checkBox9, checkBox10,
checkBox11, checkBox12, checkBox13, checkBox14, checkBox15, checkBox16, checkBox17, checkBox18, checkBox19, checkBox20,
checkBox21, checkBox22, checkBox23, checkBox24, checkBox25, checkBox26, checkBox27, checkBox28, checkBox29, checkBox30,
checkBox31, checkBox32, checkBox33, checkBox34, checkBox35, checkBox36, checkBox37, checkBox38, checkBox39, checkBox40,
};
enabledBodyNrBoxes = new List<ComboBox>();
enabledSerialNrBoxes = new List<TextBox>();
enabledCounterNrBoxes = new List<TextBox>();
completed = false;
StartForceCloseHandler();
}
#region Forced close handling
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
};
}
private void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
/// <summary>
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public FormForMechanicalMetersWithTracing(IList<Results.Entities.WaterMeter> waterMeters, bool skipFailed)
: this()
{
this.waterMeters = waterMeters;
this.wmsCount = waterMeters.Count;
this.skipFailed = skipFailed;
BodyNrText = new string[wmsCount];
AssignedSerialNr = new int[wmsCount];
CompleteSerialNr = new string[wmsCount];
Disabled = new bool[wmsCount];
ShuffleTextBoxes(wmsCount, Config.Data.LineSize);
processes = null;
if (TracingDB.DB.SessionFactory != null)
{
new Thread(() => Application.Run(new TracingDB.Forms.ModelessForm()
{
Title = "",
Message = Strings.Reading_the_production_tracing_configuration,
BackgroundColor = System.Drawing.Color.LightGreen,
FontFamily = "Arial",
FontSize = 14,
FontStyle = System.Drawing.FontStyle.Regular,
})).Start();
try
{
dbSession = TracingDB.DB.SessionFactory.OpenSession();
}
catch (Exception exc)
{
DialogResult rslt = MessageBox.Show(Strings.Opening_production_tracing_DB_failed +
Environment.NewLine + Environment.NewLine + exc.Message,
Strings.Error,
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
}
if (dbSession != null)
{
processes = ReadReleasedActiveProcesses(dbSession);
if (processes == null)
{
MessageBox.Show(Strings.Reading_from_the_production_tracing_DB_failed,
Strings.Error,
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
}
}
TracingDB.Forms.ModelessForm.CloseForm();
}
BarcodeReceivedHandler += delegate(object sndr, BarcodeReceivedEventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<BarcodeReceivedEventArgs>(BarcodeReceived), sndr, args); }
else { BarcodeReceived(sndr, args); }
};
FocusPressedHandler += delegate(object sndr, FocusPressedEventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<FocusPressedEventArgs>(FocusPressed), sndr, args); }
else { FocusPressed(sndr, args); }
};
}
/// <summary>
/// Make sure the layout of labels/text boxes on the screen
/// corresponds to the layout of watermeters of the test bench.
/// </summary>
/// <param name="wmsCount">Number of watermeters</param>
/// <param name="lineSize">Number of watermeters in one line</param>
void ShuffleTextBoxes(int wmsCount, int lineSize)
{
if (wmsCount < textBoxesCount && lineSize > 0)
{
int nrLines = (wmsCount + lineSize - 1) / lineSize;
int gap = (textBoxesCount - wmsCount) / nrLines;
int dest = 0;
for (int l = 0; l < nrLines; l++)
{
for (int i = 0; i < lineSize; i++)
{
labels[dest] = labels[l * lineSize + l * gap + i];
bodyNrBoxes[dest] = bodyNrBoxes[l * lineSize + l * gap + i];
serialNrBoxes[dest] = serialNrBoxes[l * lineSize + l * gap + i];
counterNrBoxes[dest] = counterNrBoxes[l * lineSize + l * gap + i];
checkBoxes[dest] = checkBoxes[l * lineSize + l * gap + i];
dest++;
}
}
textBoxesCount = wmsCount;
}
}
private void CycleBeginningForm_Load(object sender, EventArgs e)
{
Localize();
PrepareOrderAndSNRangeCombos();
for (int i = 0; i < textBoxesCount; i++)
{
if (Program.LocalSettings.LastSNTextsCount == textBoxesCount)
{
bodyNrBoxes[i].Items.Add((Program.LocalSettings.LastSNTexts[i] == null) ? string.Empty : Program.LocalSettings.LastSNTexts[i]);
}
labels[i].Visible = bodyNrBoxes[i].Visible = serialNrBoxes[i].Visible = counterNrBoxes[i].Visible = checkBoxes[i].Visible = true;
if (waterMeters[i] == null || waterMeters[i].Disabled || (skipFailed && !waterMeters[i].PassedFromTests()))
{
bodyNrBoxes[i].Enabled = serialNrBoxes[i].Enabled = counterNrBoxes[i].Enabled = checkBoxes[i].Enabled = false;
}
else
{
enabledBodyNrBoxes.Add(bodyNrBoxes[i]);
enabledSerialNrBoxes.Add(serialNrBoxes[i]);
enabledCounterNrBoxes.Add(counterNrBoxes[i]);
}
if (waterMeters[i] != null && !waterMeters[i].PassedFromTests())
{
bodyNrBoxes[i].BackColor = System.Drawing.Color.Pink;
serialNrBoxes[i].BackColor = System.Drawing.Color.Pink;
counterNrBoxes[i].BackColor = System.Drawing.Color.Pink;
}
}
if (ProcessData.OracleDB != null && ProcessData.OracleDB.SelectedDB != null)
{
reloadButton.Enabled = true;
}
#if DEBUG
firstSN = 1;
snDigits = 6;
pcsCount = 1000;
Prefix = "21620";
Suffix = null;
firstSNTextBox.Text = firstSN.ToString();
snDigitsTextBox.Text = snDigits.ToString();
pcsCountTextBox.Text = pcsCount.ToString();
prefixTextBox.Text = (Prefix != null) ? Prefix : string.Empty;
suffixTextBox.Text = (Suffix != null) ? Suffix : string.Empty;
#endif
}
void Localize()
{
Text = Strings.Data;
orderGroupBox.Text = "Výrobná zakázka";
for (int i = 0; i < textBoxesCount; i++)
{
labels[i].Text = string.Format("Vodomer {0}", i + 1);
}
firstSNLabel.Text = "prvé s/n";
snDigitsLabel.Text = "číslic";
piecesCountLabel.Text = "kusov";
reloadButton.Text = "Načítať";
snRangeGroupBox.Text = "Rozsah sériových čísel";
fromLabel.Text = "od";
toLabel.Text = "do";
okButton.Text = Strings.OkBtnText;
clearButton.Text = Strings.ClearBtnText;
serialNumbersGroupBox.Text = "Sériové čísla";
bodyLabel.Text = bodyLabel2.Text = "Číslo púzdra";
snLabel.Text = snLabel2.Text = "Sériové číslo";
counterLabel.Text = counterLabel2.Text = "Číslo strojčeka";
for (int i = 0; i < textBoxesCount; i++)
{
labels[i].Text = string.Format("Vodomer {0}", i + 1);
}
}
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="orderComboBox">Puchase order ComboBox</param>
void PrepareOrderAndSNRangeCombos()
{
/// Purchase order
for (int i = 0; i < LS.PurchaseOrderHistoryCount; i++) orderCB.Items.Add(LS.PurchaseOrderHistory[i]);
if (orderCB.Items.Count > 0) orderCB.Text = orderCB.Items[0].ToString();
/// First S/N in selected range
for (int i = 0; i < LS.FirstSNHistoryCount; i++) firstSNRangeCB.Items.Add(LS.FirstSNHistory[i]);
if (firstSNRangeCB.Items.Count > 0) firstSNRangeCB.Text = firstSNRangeCB.Items[0].ToString();
/// Last S/N in selected range
for (int i = 0; i < LS.LastSNHistoryCount; i++) lastSNRangeCB.Items.Add(LS.LastSNHistory[i]);
if (lastSNRangeCB.Items.Count > 0) lastSNRangeCB.Text = lastSNRangeCB.Items[0].ToString();
}
private void okButton_Click(object sender, EventArgs e)
{
PurchaseOrder = orderCB.Text;
Program.LocalSettings.UpdateHistory(orderCB.Text, ref Program.LocalSettings.PurchaseOrderHistory);
Program.LocalSettings.UpdateHistory(firstSNRangeCB.Text, ref Program.LocalSettings.FirstSNHistory);
Program.LocalSettings.UpdateHistory(lastSNRangeCB.Text, ref Program.LocalSettings.LastSNHistory);
Program.LocalSettings.LastSNTexts = BodyNrText;
int itmp;
for (int i = 0; i < Math.Min(wmsCount, textBoxesCount); i++)
{
BodyNrText[i] = bodyNrBoxes[i].Text;
AssignedSerialNr[i] = int.TryParse(serialNrBoxes[i].Text, out itmp) ? itmp : 0;
CompleteSerialNr[i] = string.Format("{0}{1}{2}",
(Prefix != null) ? Prefix : string.Empty,
AssignedSerialNr[i].ToString(string.Format("D{0}", Math.Max(snDigits, 1))),
(Suffix != null) ? Suffix : string.Empty);
Disabled[i] = !checkBoxes[i].Checked;
}
completed = true;
Close();
}
/// <summary>
/// When one combo box is updated using drop-down menu, all combo boxes
/// are updated by this function.
/// </summary>
private void UpdateAllCombos()
{
for (int i = 0; i < Math.Min(wmsCount, textBoxesCount); i++)
{
bodyNrBoxes[i].Text = Program.LocalSettings.LastSNTexts[i];
checkBoxes[i].Checked = !string.IsNullOrEmpty(bodyNrBoxes[i].Text);
}
}
private void clearButton_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Naozaj chcete všetky kódy vymazať?", "Upozonenie", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
for (int i = 0; i < Math.Min(wmsCount, textBoxesCount); i++)
{
bodyNrBoxes[i].Text = string.Empty;
serialNrBoxes[i].Text = string.Empty;
counterNrBoxes[i].Text = string.Empty;
checkBoxes[i].Checked = false;
}
assignedSNs.Clear();
}
}
private void comboBox1_TextChanged(object s, EventArgs e) { checkBox1.Checked = true; }
private void comboBox2_TextChanged(object s, EventArgs e) { checkBox2.Checked = true; }
private void comboBox3_TextChanged(object s, EventArgs e) { checkBox3.Checked = true; }
private void comboBox4_TextChanged(object s, EventArgs e) { checkBox4.Checked = true; }
private void comboBox5_TextChanged(object s, EventArgs e) { checkBox5.Checked = true; }
private void comboBox6_TextChanged(object s, EventArgs e) { checkBox6.Checked = true; }
private void comboBox7_TextChanged(object s, EventArgs e) { checkBox7.Checked = true; }
private void comboBox8_TextChanged(object s, EventArgs e) { checkBox8.Checked = true; }
private void comboBox9_TextChanged(object s, EventArgs e) { checkBox9.Checked = true; }
private void comboBox10_TextChanged(object s, EventArgs e) { checkBox10.Checked = true; }
private void comboBox11_TextChanged(object s, EventArgs e) { checkBox11.Checked = true; }
private void comboBox12_TextChanged(object s, EventArgs e) { checkBox12.Checked = true; }
private void comboBox13_TextChanged(object s, EventArgs e) { checkBox13.Checked = true; }
private void comboBox14_TextChanged(object s, EventArgs e) { checkBox14.Checked = true; }
private void comboBox15_TextChanged(object s, EventArgs e) { checkBox15.Checked = true; }
private void comboBox16_TextChanged(object s, EventArgs e) { checkBox16.Checked = true; }
private void comboBox17_TextChanged(object s, EventArgs e) { checkBox17.Checked = true; }
private void comboBox18_TextChanged(object s, EventArgs e) { checkBox18.Checked = true; }
private void comboBox19_TextChanged(object s, EventArgs e) { checkBox19.Checked = true; }
private void comboBox20_TextChanged(object s, EventArgs e) { checkBox20.Checked = true; }
private void comboBox21_TextChanged(object s, EventArgs e) { checkBox21.Checked = true; }
private void comboBox22_TextChanged(object s, EventArgs e) { checkBox22.Checked = true; }
private void comboBox23_TextChanged(object s, EventArgs e) { checkBox23.Checked = true; }
private void comboBox24_TextChanged(object s, EventArgs e) { checkBox24.Checked = true; }
private void comboBox25_TextChanged(object s, EventArgs e) { checkBox25.Checked = true; }
private void comboBox26_TextChanged(object s, EventArgs e) { checkBox26.Checked = true; }
private void comboBox27_TextChanged(object s, EventArgs e) { checkBox27.Checked = true; }
private void comboBox28_TextChanged(object s, EventArgs e) { checkBox28.Checked = true; }
private void comboBox29_TextChanged(object s, EventArgs e) { checkBox29.Checked = true; }
private void comboBox30_TextChanged(object s, EventArgs e) { checkBox30.Checked = true; }
private void comboBox31_TextChanged(object s, EventArgs e) { checkBox31.Checked = true; }
private void comboBox32_TextChanged(object s, EventArgs e) { checkBox32.Checked = true; }
private void comboBox33_TextChanged(object s, EventArgs e) { checkBox33.Checked = true; }
private void comboBox34_TextChanged(object s, EventArgs e) { checkBox34.Checked = true; }
private void comboBox35_TextChanged(object s, EventArgs e) { checkBox35.Checked = true; }
private void comboBox36_TextChanged(object s, EventArgs e) { checkBox36.Checked = true; }
private void comboBox37_TextChanged(object s, EventArgs e) { checkBox37.Checked = true; }
private void comboBox38_TextChanged(object s, EventArgs e) { checkBox38.Checked = true; }
private void comboBox39_TextChanged(object s, EventArgs e) { checkBox39.Checked = true; }
private void comboBox40_TextChanged(object s, EventArgs e) { checkBox40.Checked = true; }
private void comboBox1_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox1.Text == comboBox1.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox2_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox2.Text == comboBox2.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox3_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox3.Text == comboBox3.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox4_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox4.Text == comboBox4.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox5_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox5.Text == comboBox5.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox6_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox6.Text == comboBox6.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox7_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox7.Text == comboBox7.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox8_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox8.Text == comboBox8.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox9_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox9.Text == comboBox9.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox10_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox10.Text == comboBox10.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox11_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox11.Text == comboBox11.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox12_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox12.Text == comboBox12.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox13_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox13.Text == comboBox13.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox14_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox14.Text == comboBox14.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox15_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox15.Text == comboBox15.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox16_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox16.Text == comboBox16.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox17_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox17.Text == comboBox17.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox18_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox18.Text == comboBox18.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox19_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox19.Text == comboBox19.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox20_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox20.Text == comboBox20.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox21_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox21.Text == comboBox21.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox22_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox22.Text == comboBox22.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox23_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox23.Text == comboBox23.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox24_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox24.Text == comboBox24.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox25_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox25.Text == comboBox25.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox26_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox26.Text == comboBox26.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox27_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox27.Text == comboBox27.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox28_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox28.Text == comboBox28.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox29_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox29.Text == comboBox29.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox30_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox30.Text == comboBox30.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox31_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox31.Text == comboBox31.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox32_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox32.Text == comboBox32.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox33_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox33.Text == comboBox33.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox34_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox34.Text == comboBox34.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox35_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox35.Text == comboBox35.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox36_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox36.Text == comboBox36.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox37_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox37.Text == comboBox37.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox38_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox38.Text == comboBox38.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox39_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox39.Text == comboBox39.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox40_SelectedIndexChanged(object s, EventArgs e) { if (LS.LastSNTextsCount == wmsCount && comboBox40.Text == comboBox40.Items[0].ToString()) UpdateAllCombos(); }
private void comboBox1_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox1); }
private void comboBox2_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox2); }
private void comboBox3_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox3); }
private void comboBox4_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox4); }
private void comboBox5_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox5); }
private void comboBox6_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox6); }
private void comboBox7_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox7); }
private void comboBox8_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox8); }
private void comboBox9_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox9); }
private void comboBox10_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox10); }
private void comboBox11_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox11); }
private void comboBox12_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox12); }
private void comboBox13_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox13); }
private void comboBox14_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox14); }
private void comboBox15_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox15); }
private void comboBox16_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox16); }
private void comboBox17_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox17); }
private void comboBox18_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox18); }
private void comboBox19_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox19); }
private void comboBox20_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox20); }
private void comboBox21_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox21); }
private void comboBox22_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox22); }
private void comboBox23_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox23); }
private void comboBox24_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox24); }
private void comboBox25_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox25); }
private void comboBox26_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox26); }
private void comboBox27_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox27); }
private void comboBox28_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox28); }
private void comboBox29_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox29); }
private void comboBox30_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox30); }
private void comboBox31_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox31); }
private void comboBox32_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox32); }
private void comboBox33_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox33); }
private void comboBox34_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox34); }
private void comboBox35_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox35); }
private void comboBox36_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox36); }
private void comboBox37_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox37); }
private void comboBox38_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox38); }
private void comboBox39_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox39); }
private void comboBox40_KeyPress(object s, KeyPressEventArgs e) { ProcCBKeyPress(s, e, comboBox40); }
/// <summary>
/// Process a key press within any enabled combo boxe
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="currentFocusOwner">TextBox control which received the event</param>
private void ProcCBKeyPress(object sender, KeyPressEventArgs e, ComboBox currentFocusOwner)
{
if (e.KeyChar == '+')
{
/// Process '+' key ..... Form completed
okButton_Click(sender, e);
}
if (e.KeyChar == '\r')
{
/// Process <enter> key ..... Next text field
for (int i = 0; i < textBoxesCount; i++)
{
if (bodyNrBoxes[i] == currentFocusOwner)
{
if (waterMeters[i].PassedFromTests())
{
serialNrBoxes[i].Text = GetNextSerialNr().ToString(); /// WM Passed
}
else
{
serialNrBoxes[i].Text = "0"; /// WM failed
}
}
}
if (enabledBodyNrBoxes.Count < 2) return; /// There is just one enabled textbox
for (int i = 0; i < enabledBodyNrBoxes.Count; i++)
{
if (enabledBodyNrBoxes[i] == currentFocusOwner)
{
/// Change focus to the next enabled text box
enabledCounterNrBoxes[i].Focus();
return;
}
}
}
}
private void textBox41_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox41); }
private void textBox42_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox42); }
private void textBox43_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox43); }
private void textBox44_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox44); }
private void textBox45_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox45); }
private void textBox46_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox46); }
private void textBox47_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox47); }
private void textBox48_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox48); }
private void textBox49_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox49); }
private void textBox50_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox50); }
private void textBox51_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox51); }
private void textBox52_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox52); }
private void textBox53_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox53); }
private void textBox54_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox54); }
private void textBox55_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox55); }
private void textBox56_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox56); }
private void textBox57_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox57); }
private void textBox58_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox58); }
private void textBox59_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox59); }
private void textBox60_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox60); }
private void textBox61_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox61); }
private void textBox62_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox62); }
private void textBox63_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox63); }
private void textBox64_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox64); }
private void textBox65_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox65); }
private void textBox66_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox66); }
private void textBox67_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox67); }
private void textBox68_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox68); }
private void textBox69_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox69); }
private void textBox70_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox70); }
private void textBox71_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox71); }
private void textBox72_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox72); }
private void textBox73_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox73); }
private void textBox74_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox74); }
private void textBox75_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox75); }
private void textBox76_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox76); }
private void textBox77_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox77); }
private void textBox78_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox78); }
private void textBox79_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox79); }
private void textBox80_KeyPress(object s, KeyPressEventArgs e) { ProcTBKeyPress(s, e, textBox80); }
/// <summary>
/// Process a key press within any enabled combo boxe
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="currentFocusOwner">TextBox control which received the event</param>
private void ProcTBKeyPress(object sender, KeyPressEventArgs e, TextBox currentFocusOwner)
{
if (e.KeyChar == '+')
{
/// Process '+' key ..... Form completed
okButton_Click(sender, e);
}
if (e.KeyChar == '\r')
{
/// Process <enter> key ..... Next text field
if (enabledCounterNrBoxes.Count < 2) return; /// There is just one enabled textbox
for (int i = 0; i < enabledBodyNrBoxes.Count; i++)
{
if (enabledCounterNrBoxes[i] == currentFocusOwner)
{
/// Change focus to the next enabled text box
enabledBodyNrBoxes[(i + 1) % enabledBodyNrBoxes.Count].Focus();
return;
}
}
}
}
private void orderCB_SelectedIndexChanged(object sender, EventArgs e)
{
ProcessPO();
}
private void reloadButton_Click(object sender, EventArgs e)
{
ProcessPO();
}
void ProcessPO()
{
if (ReadPurchaseOrderParamsFromDB(ProcessData.OracleDB.SelectedDB, orderCB.Text, out firstSN, out snDigits, out pcsCount, out Prefix, out Suffix))
{
prefixTextBox.Text = (Prefix != null) ? Prefix : string.Empty;
suffixTextBox.Text = (Suffix != null) ? Suffix : string.Empty;
snDigitsTextBox.Text = snDigits.ToString();
firstSNTextBox.Text = firstSN.ToString(string.Format("D{0}", snDigits));
pcsCountTextBox.Text = pcsCount.ToString();
exclamationPOLabel.Visible = false;
}
else
{
prefixTextBox.Text = suffixTextBox.Text = string.Empty;
firstSNTextBox.Text = snDigitsTextBox.Text = pcsCountTextBox.Text = string.Empty;
exclamationPOLabel.Visible = true;
}
UpdateSNFromTo();
}
bool ReadPurchaseOrderParamsFromDB(OracleConnection connection, string orderNr, out int firstSN, out int snDigits, out int piecesCount, out string prefix, out string suffix)
{
firstSN = 0;
piecesCount = 0;
snDigits = 0;
prefix = null;
suffix = null;
if (connection == null || string.IsNullOrEmpty(orderNr)) return false;
try
{
connection.Open();
foreach (var status in new string[] { "NEU", "AKTIV" })
{
/// STATUS='NEU'
OracleCommand cmd = new OracleCommand("select SOLLSTUECK, ERSTE_ZAEHLERNR, PREFIX, SUFFIX, ZNRLAENGE from VT_AUFTRAG_PD" +
" where PRODUKTION_ANBID=:1 AND STATUS=:2 AND PRODUKTION_USESTATE=:3 AND AUFTRAGSNUMMER=:4", connection);
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Output.DB.SensusOracle.Database.Anbid_StaraTura }); ///:1
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = status }); ///:2
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); ///:3
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = orderNr }); ///:4
OracleDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
piecesCount = dr.GetInt32(0);
firstSN = dr.GetInt32(1);
try { prefix = dr.GetString(2); } catch { prefix = null; }
try { suffix = dr.GetString(3); } catch { suffix = null; }
snDigits = dr.GetInt32(4);
}
dr.Close();
}
if (firstSN == 0 && piecesCount == 0)
{
string msg2 = string.Format("Nebola nájdená žiadna výrobná zakázka {0}", orderNr);
log.Warn(msg2);
System.Diagnostics.Debug.WriteLine(msg2);
connection.Close();
return false;
}
foundMeters.Clear();
OracleCommand cmd2 = new OracleCommand("select VT_FERNUM, ZAEHLERNUMMER, HYDR_PRUEFUNG from VT_ZAEHLER_PD" +
" where ANBID=:1 AND AUFTRAGSNUMMER=:2 order by ZAEHLERNUMMER asc", connection);
cmd2.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Output.DB.SensusOracle.Database.Anbid_StaraTura }); ///:1
cmd2.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = orderNr }); ///:2
OracleDataReader dr2 = cmd2.ExecuteReader();
while (dr2.Read())
{
string bodyNr = dr2.GetString(0); /// Body number
int serialNr = dr2.GetInt32(1); /// Assigned serial number when OK, 0 when NOK
int result = dr2.GetInt32(2); /// HYDR_PRUEFUNG: 96=OK, 224=OK after a repetition, 97=NOK
if (serialNr != 0 && result != 97)
{
foundMeters.Add(new BodySerNrResult(bodyNr, serialNr, result));
}
}
dr2.Close();
string msg = string.Format("Výrobná zakázka bola nájdená: prvé S/N = {0}, počet kusov = {1}, doteraz vyrobených {2}", firstSN, piecesCount, foundMeters.Count);
log.Warn(msg);
System.Diagnostics.Debug.WriteLine(msg);
connection.Close();
return true;
}
catch (Exception exc)
{
string msg = string.Format("ERROR: ORACLE DB query select AUFTRAGSNUMMER, SOLLSTUECK from VT_AUFTRAG_PD where ... failed: {0}", exc.Message);
log.Error(msg);
System.Diagnostics.Debug.WriteLine(msg);
firstSN = 0;
piecesCount = 0;
connection.Close();
return false;
}
}
private void firstSNRangeCB_TextChanged(object s, EventArgs e) { UpdateSNFromTo(); }
private void lastSNRangeCB_TextChanged(object s, EventArgs e) { UpdateSNFromTo(); }
private void firstSNRangeCB_SelectedIndexChanged(object s, EventArgs e) { UpdateSNFromTo(); }
private void lastSNRangeCB_SelectedIndexChanged(object s, EventArgs e) { UpdateSNFromTo(); }
void UpdateSNFromTo()
{
bool anyError = false;
foundSNsWithinRange.Clear();
int _snRangeFirst;
if (int.TryParse(firstSNRangeCB.Text, out _snRangeFirst) && (_snRangeFirst >= firstSN)
&& (_snRangeFirst < firstSN + pcsCount))
{
snRangeFirst = _snRangeFirst;
exclamationFromLabel.Visible = false;
}
else
{
snRangeFirst = 0;
exclamationFromLabel.Visible = true;
anyError = true;
}
int _snRangeLast;
if (int.TryParse(lastSNRangeCB.Text, out _snRangeLast) && (_snRangeLast >= firstSN)
&& (_snRangeLast < firstSN + pcsCount))
{
snRangeLast = _snRangeLast;
exclamationToLabel.Visible = false;
}
else
{
snRangeLast = 0;
exclamationToLabel.Visible = true;
anyError = true;
}
if (snRangeFirst > 0 && snRangeLast > 0 && snRangeFirst > snRangeLast)
{
snRangeFirst = snRangeLast = 0;
exclamationFromLabel.Visible = exclamationToLabel.Visible = true;
anyError = true;
}
if (!anyError)
{
foreach (var mtr in foundMeters)
{
if (snRangeFirst <= mtr.SerialNr && mtr.SerialNr <= snRangeLast)
{
foundSNsWithinRange.Add(mtr.SerialNr);
}
}
}
serialNumbersGroupBox.Enabled = !anyError;
}
/// <summary>
/// Returns next free serial number within specified range or 0 if no appropriate s/n is available
/// </summary>
/// <returns>Serial number or 0</returns>
int GetNextSerialNr()
{
for (int sn = snRangeFirst; sn <= snRangeLast; sn++)
{
if (!foundSNsWithinRange.Contains(sn) && !assignedSNs.Contains(sn))
{
/// A free serial number within specified range found
assignedSNs.Add(sn);
return sn;
}
}
return 0; /// No free serial number found
}
/// <summary>
/// Read released-active processes from the database.
/// </summary>
/// <param name="session">Production tracing DB session</param>
/// <returns>A list of processes (success) or null (failure)</returns>
private IList<Process> ReadReleasedActiveProcesses(ISession session)
{
try
{
return session.QueryOver<Process>()
.Where(x => (x.ReleaseStatus == ReleaseStatus.ReleasedActive || x.ReleaseStatus == ReleaseStatus.ToBeApproved))
.OrderBy(x => x.Name).Asc
.List();
}
catch (Exception exc)
{
log.ErrorFormat(Strings.Reading_from_the_production_tracing_DB_failed, exc.Message);
return null;
}
}
public void OnFocusPressed(object sender, FocusPressedEventArgs data)
{
if (FocusPressedHandler == null) return;
try
{
FocusPressedHandler(sender, data);
}
catch (Exception)
{
// log.Error("FocusPressedHandler(...) failed", e);
}
}
public event EventHandler<FocusPressedEventArgs> FocusPressedHandler;
///
public void FocusPressed(object sender, FocusPressedEventArgs data)
{
foreach (var k in komponenty) k.ResetFocus();
foreach (var p in palety) p.ResetFocus();
if ((data.IxPolozky >= 1) && (data.IxPolozky <= komponenty.Count))
{
komponenty[data.IxPolozky - 1].SetFocus();
}
else if ((data.IxPolozky >= 100) && (data.IxPolozky - 100 < palety.Count))
{
palety[data.IxPolozky - 100].SetFocus();
}
}
public void OnBarcodeReceived(object sender, BarcodeReceivedEventArgs data)
{
if (BarcodeReceivedHandler == null) return;
try
{
BarcodeReceivedHandler(sender, data);
}
catch (Exception exc)
{
string msg = exc.Message;
// log.Error("BarcodeReceivedHandler(...) failed", e);
}
}
public event EventHandler<BarcodeReceivedEventArgs> BarcodeReceivedHandler;
///
public void BarcodeReceived(object sender, BarcodeReceivedEventArgs data)
{
foreach (var k in komponenty) k.ResetFocus();
foreach (var p in palety) p.ResetFocus();
/// TODO
}
private void ManageCheckGroupBox(CheckBox chk, GroupBox grp)
{
/// Make sure the CheckBox isn't in the GroupBox. This will only happen the first time.
if (chk.Parent == grp)
{
grp.Parent.Controls.Add(chk); /// Reparent the CheckBox so it's not in the GroupBox.
chk.Location = new System.Drawing.Point(chk.Left + grp.Left, chk.Top + grp.Top); /// Adjust the CheckBox's location.
chk.BringToFront(); /// Move the CheckBox to the top of the stacking order.
}
/// Enable or disable the GroupBox.
grp.Enabled = chk.Checked;
}
private void batchesCheckBox_CheckStateChanged(object sender, EventArgs e)
{
ManageCheckGroupBox(batchesCheckBox, batchesGroupBox);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,35 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
namespace TBF.BenchControl.DataEntry.S620
{
public interface ICheckItem
{
/// <summary>
/// Part to be scanned / checked
/// </summary>
TracingDB.Entities.Part Part { get; }
/// <summary>
/// ID of a part in this workstep:
/// 0 undefined
/// 1 reference part
/// 2..99 parts with unique codes
/// 100.. parts with batch numbers
/// </summary>
int IxPolozky { get; set; }
/// <summary>
/// Scanned or obtained code of the part
/// </summary>
string ScannedCode { get; set; } /// Read/Set the scanned code
void ClearCode(); /// Clear the code
void SubmitCode(string code); /// Set the code and proceed like enter button is pressed
void ResetFocus();
void SetFocus();
}
}

View File

@ -0,0 +1,688 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.GenericDevices;
using TBF.Resources;
namespace TBF.BenchControl.DataEntry.S620
{
public partial class TestStartEndForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(TestStartEndForm));
// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
bool completed;
/// <summary> Number of text boxes for serial numbers </summary>
public readonly int WaterMetersCount;
readonly IRegReader[] regReaders;
readonly bool[] disabled;
// To be retrieved after the form closes
public double[] WMStartState;
// To be retrieved after the form closes
public readonly string[] WMStartStateStr;
// To be retrieved after the form closes
public double[] WMEndState;
bool endStates; /// false=start states, true=end states
double refVolume;
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
bool fixedErrorLimits; /// false in case of calculated error limits
int TextBoxesCount;
///
Label[] labels;
TextBox[] startTextBoxes;
TextBox[] endTextBoxes;
Label[] exclamations;
///
IList<TextBox> activeTextBoxes;
IList<int> activeWmNrs;
/// <summary>
/// Parameterless constructor initializing common part for start and endstate form
/// </summary>
public TestStartEndForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 48;
labels = new Label[]
{
label1, label2, label3, label4, label5, label6, label7, label8, label9, label10,
label11, label12, label13, label14, label15, label16, label17, label18, label19, label20,
label21, label22, label23, label24, label25, label26, label27, label28, label29, label30,
label31, label32, label33, label34, label35, label36, label37, label38, label39, label40,
label41, label42, label43, label44, label45, label46, label47, label48,
};
startTextBoxes = new TextBox[]
{
startTextBox1, startTextBox2, startTextBox3, startTextBox4, startTextBox5, startTextBox6, startTextBox7, startTextBox8, startTextBox9, startTextBox10,
startTextBox11, startTextBox12, startTextBox13, startTextBox14, startTextBox15, startTextBox16, startTextBox17, startTextBox18, startTextBox19, startTextBox20,
startTextBox21, startTextBox22, startTextBox23, startTextBox24, startTextBox25, startTextBox26, startTextBox27, startTextBox28, startTextBox29, startTextBox30,
startTextBox31, startTextBox32, startTextBox33, startTextBox34, startTextBox35, startTextBox36, startTextBox37, startTextBox38, startTextBox39, startTextBox40,
startTextBox41, startTextBox42, startTextBox43, startTextBox44, startTextBox45, startTextBox46, startTextBox47, startTextBox48,
};
endTextBoxes = new TextBox[]
{
endTextBox1, endTextBox2, endTextBox3, endTextBox4, endTextBox5, endTextBox6, endTextBox7, endTextBox8, endTextBox9, endTextBox10,
endTextBox11, endTextBox12, endTextBox13, endTextBox14, endTextBox15, endTextBox16, endTextBox17, endTextBox18, endTextBox19, endTextBox20,
endTextBox21, endTextBox22, endTextBox23, endTextBox24, endTextBox25, endTextBox26, endTextBox27, endTextBox28, endTextBox29, endTextBox30,
endTextBox31, endTextBox32, endTextBox33, endTextBox34, endTextBox35, endTextBox36, endTextBox37, endTextBox38, endTextBox39, endTextBox40,
endTextBox41, endTextBox42, endTextBox43, endTextBox44, endTextBox45, endTextBox46, endTextBox47, endTextBox48,
};
exclamations = new Label[]
{
exclamation1, exclamation2, exclamation3, exclamation4, exclamation5, exclamation6,
exclamation7, exclamation8, exclamation9, exclamation10, exclamation11, exclamation12,
exclamation13, exclamation14, exclamation15, exclamation16, exclamation17, exclamation18,
exclamation19, exclamation20, exclamation21, exclamation22, exclamation23, exclamation24,
exclamation25, exclamation26, exclamation27, exclamation28, exclamation29, exclamation30,
exclamation31, exclamation32, exclamation33, exclamation34, exclamation35, exclamation36,
exclamation37, exclamation38, exclamation39, exclamation40, exclamation41, exclamation42,
exclamation43, exclamation44, exclamation45, exclamation46, exclamation47, exclamation48,
};
activeTextBoxes = new List<TextBox>();
activeWmNrs = new List<int>();
completed = false;
StartForceCloseHandler();
}
/// <summary>
/// Constructor to fill in start states
/// </summary>
/// <param name="waterMetersCount">Number of water meters</param>
/// <param name="disabled">Information from CycleBeginningForm about availability of water meters</param>
public TestStartEndForm(int waterMetersCount, IRegReader[] regReaders, bool[] disabled)
: this()
{
endStates = false;
this.WaterMetersCount = waterMetersCount;
this.regReaders = regReaders;
this.disabled = disabled;
ShuffleTextBoxes();
WMStartState = new double[waterMetersCount];
WMStartStateStr = new string[waterMetersCount];
}
/// <summary>
/// Constructor to fill in end states
/// </summary>
/// <param name="waterMetersCount">Number of water meters</param>
/// <param name="wmStartStateStr">Information entered on test start</param>
/// <param name="disabled">Information from CycleBeginningForm about availability of water meters</param>
/// <param name="refVolume">Reference volume, it is used to verify the end state, show/hide exclamation if necessary</param>
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
public TestStartEndForm(int waterMetersCount, IRegReader[] regReaders, string[] wmStartStateStr, bool[] disabled,
double refVolume, double errLimLo, double errLimHi)
: this()
{
endStates = true;
this.WaterMetersCount = waterMetersCount;
this.regReaders = regReaders;
if (wmStartStateStr == null || wmStartStateStr.Length != waterMetersCount)
throw (new Exception("Invalid 'wmStartStateStr' argument"));
this.WMStartStateStr = wmStartStateStr;
this.disabled = disabled;
this.refVolume = refVolume;
this.warningLimLo = 2 * errLimLo;
this.warningLimHi = 2 * errLimHi;
this.fixedErrorLimits = (errLimHi > errLimLo);
ShuffleTextBoxes();
WMEndState = new double[waterMetersCount];
}
/// <summary>
/// Make sure the layout of labels/text boxes on the screen
/// corresponds to the layout of watermeters of the test bench.
/// </summary>
void ShuffleTextBoxes()
{
if (TextBoxesCount > WaterMetersCount)
{
int nrLines = WaterMetersCount / Config.Data.LineSize;
int gap = (TextBoxesCount - WaterMetersCount) / nrLines;
int dest = 0;
for (int l = 0; l < nrLines; l++)
{
for (int i = 0; i < Config.Data.LineSize; i++)
{
labels[dest] = labels[l * Config.Data.LineSize + l * gap + i];
startTextBoxes[dest] = startTextBoxes[l * Config.Data.LineSize + l * gap + i];
endTextBoxes[dest] = endTextBoxes[l * Config.Data.LineSize + l * gap + i];
exclamations[dest] = exclamations[l * Config.Data.LineSize + l * gap + i];
dest++;
}
}
TextBoxesCount = WaterMetersCount;
}
}
private void CycleEndForm_Load(object sender, EventArgs e)
{
Localize();
//Height = 115 + 90 * WaterMetersCount;
for (int i = 0; i < TextBoxesCount; i++)
{
if (i < WaterMetersCount)
{
labels[i].Visible = startTextBoxes[i].Visible = endTextBoxes[i].Visible = true;
}
}
if (endStates)
{
/// End of test
for (int i = 0; i < TextBoxesCount; i++)
{
if (WMStartStateStr != null && i < WMStartStateStr.Length)
{
startTextBoxes[i].Text = WMStartStateStr[i];
}
if (((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null)))
{
endTextBoxes[i].Enabled = false;
}
else
{
endTextBoxes[i].Enabled = true;
activeTextBoxes.Add(endTextBoxes[i]);
activeWmNrs.Add(i);
}
}
}
else
{
/// Start of test
for (int i = 0; i < TextBoxesCount; i++)
{
if (((i < disabled.Length) && disabled[i]) || ((i < regReaders.Length) && (regReaders[i] == null)))
{
startTextBoxes[i].Enabled = false;
}
else
{
startTextBoxes[i].Enabled = true;
activeTextBoxes.Add(startTextBoxes[i]);
activeWmNrs.Add(i);
}
}
}
if ((activeTextBoxes.Count > 0) && (activeWmNrs.Count > 0))
{
activeTextBoxes[0].Focus();
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, activeWmNrs[0] + 1, string.Empty);
}
}
void Localize()
{
Text = Strings.Water_Meter_States;
for (int i = 0; i < TextBoxesCount; i++)
{
labels[i].Text = string.Format("{0} {1}", Strings.Water_Meter, i + 1);
}
startLabel.Text = start2Label.Text = Strings.Start;
endLabel.Text = end2Label.Text = Strings.End;
okButton.Text = Strings.OkBtnText;
}
private void okButton_Click(object sender, EventArgs eArgs)
{
try
{
if (endStates)
{
for (int i = 0; i < Math.Min(WaterMetersCount, TextBoxesCount); i++)
{
if (endTextBoxes[i].Visible && endTextBoxes[i].Enabled)
{
WMEndState[i] = Utils.ParseUDouble(endTextBoxes[i].Text);
}
}
}
else
{
for (int i = 0; i < Math.Min(WaterMetersCount, TextBoxesCount); i++)
{
if (startTextBoxes[i].Visible && startTextBoxes[i].Enabled)
{
WMStartStateStr[i] = startTextBoxes[i].Text;
WMStartState[i] = Utils.ParseUDouble(startTextBoxes[i].Text);
}
}
}
}
catch(Exception e)
{
log.ErrorFormat("Exception: {0}", e.Message);
return;
}
completed = true;
Close();
}
#region Forced close handling
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
};
}
void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
/// <summary>
/// Calculate the approximate error and verify whether it is within limits.
/// Make an exclamation mark visible if out of range.
/// Similar event handler is implemented for all endTextBoxes (1..24).
/// </summary>
private void ProcEndTextChanged(object sender, EventArgs e, TextBox endTBox)
{
int wmIx = -1;
for (int i = 0; i < endTextBoxes.Length; i++)
{
if (endTextBoxes[i] == endTBox)
{
wmIx = i;
break;
}
}
double err = 0;
try
{
double endState = Utils.ParseUDouble(endTextBoxes[wmIx].Text);
double startState = Utils.ParseUDouble(startTextBoxes[wmIx].Text);
err = 100.0 * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
bool errorOoR = fixedErrorLimits ? ((err < warningLimLo) || (warningLimHi < err)) : ((err < -6) || (+6 < err));
exclamations[wmIx].Visible = errorOoR;
largeExclamationLabel.Visible = errorOoR;
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, wmIx + 1, endTextBoxes[wmIx].Text);
}
private void endTextBox1_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox1); }
private void endTextBox2_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox2); }
private void endTextBox3_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox3); }
private void endTextBox4_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox4); }
private void endTextBox5_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox5); }
private void endTextBox6_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox6); }
private void endTextBox7_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox7); }
private void endTextBox8_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox8); }
private void endTextBox9_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox9); }
private void endTextBox10_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox10); }
private void endTextBox11_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox11); }
private void endTextBox12_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox12); }
private void endTextBox13_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox13); }
private void endTextBox14_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox14); }
private void endTextBox15_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox15); }
private void endTextBox16_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox16); }
private void endTextBox17_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox17); }
private void endTextBox18_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox18); }
private void endTextBox19_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox19); }
private void endTextBox20_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox20); }
private void endTextBox21_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox21); }
private void endTextBox22_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox22); }
private void endTextBox23_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox23); }
private void endTextBox24_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox24); }
private void endTextBox25_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox25); }
private void endTextBox26_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox26); }
private void endTextBox27_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox27); }
private void endTextBox28_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox28); }
private void endTextBox29_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox29); }
private void endTextBox30_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox30); }
private void endTextBox31_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox31); }
private void endTextBox32_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox32); }
private void endTextBox33_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox33); }
private void endTextBox34_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox34); }
private void endTextBox35_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox35); }
private void endTextBox36_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox36); }
private void endTextBox37_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox37); }
private void endTextBox38_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox38); }
private void endTextBox39_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox39); }
private void endTextBox40_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox40); }
private void endTextBox41_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox41); }
private void endTextBox42_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox42); }
private void endTextBox43_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox43); }
private void endTextBox44_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox44); }
private void endTextBox45_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox45); }
private void endTextBox46_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox46); }
private void endTextBox47_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox47); }
private void endTextBox48_TextChanged(object sndr, EventArgs e) { ProcEndTextChanged(sndr, e, endTextBox48); }
private void endTextBox1_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox1); }
private void endTextBox2_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox2); }
private void endTextBox3_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox3); }
private void endTextBox4_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox4); }
private void endTextBox5_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox5); }
private void endTextBox6_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox6); }
private void endTextBox7_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox7); }
private void endTextBox8_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox8); }
private void endTextBox9_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox9); }
private void endTextBox10_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox10); }
private void endTextBox11_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox11); }
private void endTextBox12_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox12); }
private void endTextBox13_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox13); }
private void endTextBox14_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox14); }
private void endTextBox15_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox15); }
private void endTextBox16_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox16); }
private void endTextBox17_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox17); }
private void endTextBox18_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox18); }
private void endTextBox19_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox19); }
private void endTextBox20_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox20); }
private void endTextBox21_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox21); }
private void endTextBox22_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox22); }
private void endTextBox23_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox23); }
private void endTextBox24_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox24); }
private void endTextBox25_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox25); }
private void endTextBox26_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox26); }
private void endTextBox27_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox27); }
private void endTextBox28_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox28); }
private void endTextBox29_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox29); }
private void endTextBox30_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox30); }
private void endTextBox31_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox31); }
private void endTextBox32_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox32); }
private void endTextBox33_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox33); }
private void endTextBox34_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox34); }
private void endTextBox35_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox35); }
private void endTextBox36_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox36); }
private void endTextBox37_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox37); }
private void endTextBox38_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox38); }
private void endTextBox39_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox39); }
private void endTextBox40_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox40); }
private void endTextBox41_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox41); }
private void endTextBox42_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox42); }
private void endTextBox43_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox43); }
private void endTextBox44_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox44); }
private void endTextBox45_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox45); }
private void endTextBox46_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox46); }
private void endTextBox47_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox47); }
private void endTextBox48_MouseClick(object sndr, MouseEventArgs e) { ProcEndTextChanged(sndr, e, endTextBox48); }
/// <summary>
/// Process a key press within any enabled text boxe
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="currentFocusOwner">TextBox control which received the event</param>
private void ProcKeyPress(object sender, KeyPressEventArgs e, TextBox currentFocusOwner)
{
if (e.KeyChar == '+')
{
/// Process '+' key ..... Form completed
okButton_Click(sender, e);
}
if (e.KeyChar == '\r')
{
/// Process <enter> key ..... Next text field
if (activeTextBoxes.Count < 2) return; /// There is just one enabled textbox
for (int i = 0; i < activeTextBoxes.Count; i++)
{
if (activeTextBoxes[i] == currentFocusOwner)
{
/// Index of the next active text box
int newTBIdx = (i + 1) % activeTextBoxes.Count;
/// Change focus to the next active text box
activeTextBoxes[newTBIdx].Focus();
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, activeWmNrs[newTBIdx] + 1, activeTextBoxes[newTBIdx].Text);
largeExclamationLabel.Visible = false;
return;
}
}
}
}
private void startTextBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox1); }
private void startTextBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox2); }
private void startTextBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox3); }
private void startTextBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox4); }
private void startTextBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox5); }
private void startTextBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox6); }
private void startTextBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox7); }
private void startTextBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox8); }
private void startTextBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox9); }
private void startTextBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox10); }
private void startTextBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox11); }
private void startTextBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox12); }
private void startTextBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox13); }
private void startTextBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox14); }
private void startTextBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox15); }
private void startTextBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox16); }
private void startTextBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox17); }
private void startTextBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox18); }
private void startTextBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox19); }
private void startTextBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox20); }
private void startTextBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox21); }
private void startTextBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox22); }
private void startTextBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox23); }
private void startTextBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox24); }
private void startTextBox25_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox25); }
private void startTextBox26_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox26); }
private void startTextBox27_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox27); }
private void startTextBox28_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox28); }
private void startTextBox29_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox29); }
private void startTextBox30_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox30); }
private void startTextBox31_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox31); }
private void startTextBox32_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox32); }
private void startTextBox33_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox33); }
private void startTextBox34_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox34); }
private void startTextBox35_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox35); }
private void startTextBox36_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox36); }
private void startTextBox37_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox37); }
private void startTextBox38_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox38); }
private void startTextBox39_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox39); }
private void startTextBox40_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox40); }
private void startTextBox41_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox41); }
private void startTextBox42_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox42); }
private void startTextBox43_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox43); }
private void startTextBox44_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox44); }
private void startTextBox45_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox45); }
private void startTextBox46_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox46); }
private void startTextBox47_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox47); }
private void startTextBox48_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox48); }
private void endTextBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox1); }
private void endTextBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox2); }
private void endTextBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox3); }
private void endTextBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox4); }
private void endTextBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox5); }
private void endTextBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox6); }
private void endTextBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox7); }
private void endTextBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox8); }
private void endTextBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox9); }
private void endTextBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox10); }
private void endTextBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox11); }
private void endTextBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox12); }
private void endTextBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox13); }
private void endTextBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox14); }
private void endTextBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox15); }
private void endTextBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox16); }
private void endTextBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox17); }
private void endTextBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox18); }
private void endTextBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox19); }
private void endTextBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox20); }
private void endTextBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox21); }
private void endTextBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox22); }
private void endTextBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox23); }
private void endTextBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox24); }
private void endTextBox25_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox25); }
private void endTextBox26_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox26); }
private void endTextBox27_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox27); }
private void endTextBox28_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox28); }
private void endTextBox29_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox29); }
private void endTextBox30_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox30); }
private void endTextBox31_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox31); }
private void endTextBox32_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox32); }
private void endTextBox33_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox33); }
private void endTextBox34_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox34); }
private void endTextBox35_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox35); }
private void endTextBox36_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox36); }
private void endTextBox37_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox37); }
private void endTextBox38_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox38); }
private void endTextBox39_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox39); }
private void endTextBox40_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox40); }
private void endTextBox41_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox41); }
private void endTextBox42_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox42); }
private void endTextBox43_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox43); }
private void endTextBox44_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox44); }
private void endTextBox45_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox45); }
private void endTextBox46_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox46); }
private void endTextBox47_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox47); }
private void endTextBox48_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox48); }
private void ProcStartTextChanged(object sender, EventArgs e, TextBox startTBox)
{
for (int i = 0; i < startTextBoxes.Length; i++)
{
if (startTextBoxes[i] == startTBox)
{
/// wmIx == i
largeTextBox.Text = string.Format("{0} {1}: {2}", Strings.Water_Meter, i + 1, startTextBoxes[i].Text);
largeExclamationLabel.Visible = false;
break;
}
}
}
private void startTextBox1_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox1); }
private void startTextBox2_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox2); }
private void startTextBox3_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox3); }
private void startTextBox4_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox4); }
private void startTextBox5_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox5); }
private void startTextBox6_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox6); }
private void startTextBox7_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox7); }
private void startTextBox8_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox8); }
private void startTextBox9_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox9); }
private void startTextBox10_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox10); }
private void startTextBox11_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox11); }
private void startTextBox12_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox12); }
private void startTextBox13_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox13); }
private void startTextBox14_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox14); }
private void startTextBox15_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox15); }
private void startTextBox16_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox16); }
private void startTextBox17_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox17); }
private void startTextBox18_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox18); }
private void startTextBox19_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox19); }
private void startTextBox20_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox20); }
private void startTextBox21_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox21); }
private void startTextBox22_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox22); }
private void startTextBox23_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox23); }
private void startTextBox24_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox24); }
private void startTextBox25_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox25); }
private void startTextBox26_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox26); }
private void startTextBox27_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox27); }
private void startTextBox28_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox28); }
private void startTextBox29_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox29); }
private void startTextBox30_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox30); }
private void startTextBox31_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox31); }
private void startTextBox32_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox32); }
private void startTextBox33_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox33); }
private void startTextBox34_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox34); }
private void startTextBox35_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox35); }
private void startTextBox36_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox36); }
private void startTextBox37_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox37); }
private void startTextBox38_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox38); }
private void startTextBox39_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox39); }
private void startTextBox40_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox40); }
private void startTextBox41_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox41); }
private void startTextBox42_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox42); }
private void startTextBox43_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox43); }
private void startTextBox44_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox44); }
private void startTextBox45_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox45); }
private void startTextBox46_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox46); }
private void startTextBox47_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox47); }
private void startTextBox48_TextChanged(object sender, EventArgs e) { ProcStartTextChanged(sender, e, startTextBox48); }
private void startTextBox1_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox1); }
private void startTextBox2_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox2); }
private void startTextBox3_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox3); }
private void startTextBox4_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox4); }
private void startTextBox5_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox5); }
private void startTextBox6_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox6); }
private void startTextBox7_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox7); }
private void startTextBox8_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox8); }
private void startTextBox9_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox9); }
private void startTextBox10_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox10); }
private void startTextBox11_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox11); }
private void startTextBox12_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox12); }
private void startTextBox13_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox13); }
private void startTextBox14_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox14); }
private void startTextBox15_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox15); }
private void startTextBox16_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox16); }
private void startTextBox17_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox17); }
private void startTextBox18_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox18); }
private void startTextBox19_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox19); }
private void startTextBox20_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox20); }
private void startTextBox21_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox21); }
private void startTextBox22_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox22); }
private void startTextBox23_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox23); }
private void startTextBox24_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox24); }
private void startTextBox25_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox25); }
private void startTextBox26_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox26); }
private void startTextBox27_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox27); }
private void startTextBox28_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox28); }
private void startTextBox29_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox29); }
private void startTextBox30_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox30); }
private void startTextBox31_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox31); }
private void startTextBox32_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox32); }
private void startTextBox33_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox33); }
private void startTextBox34_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox34); }
private void startTextBox35_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox35); }
private void startTextBox36_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox36); }
private void startTextBox37_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox37); }
private void startTextBox38_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox38); }
private void startTextBox39_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox39); }
private void startTextBox40_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox40); }
private void startTextBox41_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox41); }
private void startTextBox42_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox42); }
private void startTextBox43_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox43); }
private void startTextBox44_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox44); }
private void startTextBox45_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox45); }
private void startTextBox46_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox46); }
private void startTextBox47_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox47); }
private void startTextBox48_MouseClick(object sender, MouseEventArgs e) { ProcStartTextChanged(sender, e, startTextBox48); }
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -31,8 +31,19 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
public enum WMKind public enum WMKind
{ {
Iperl, iPERL,
S620, Mechanical,
Count
}
/// <summary>
/// Test/Q designation mode for IperlLogger and IperlHead opto data files
/// </summary>
public enum DesigMode
{
Auto,
Based_on_procedure,
As_specified,
Count Count
} }
@ -42,18 +53,19 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
private static readonly ILog log = LogManager.GetLogger(typeof(Database)); private static readonly ILog log = LogManager.GetLogger(typeof(Database));
public override string ToString() { return string.Format("{0}({1})", GetType().Namespace.Substring(17), Cfg.ToString(1)); } public override string ToString() { return string.Format("{0}({1})", GetType().Namespace.Substring(17), Cfg.ToString(1)); }
const int Anbid_StaraTura = 4; public const int Anbid_StaraTura = 4;
DatabaseCfg dbCfg; DatabaseCfg dbCfg;
public DBUsed DBUsed { get { return (dbCfg == null || dbCfg.ProcParams == null) ? DBUsed.None : dbCfg.ProcParams.DBUsed; } } public DBUsed DBUsed { get { return (dbCfg == null || dbCfg.ProcParams == null) ? DBUsed.None : dbCfg.ProcParams.DBUsed; } }
public WMKind WMKind { get { return (dbCfg == null || dbCfg.ProcParams == null) ? WMKind.Iperl : dbCfg.ProcParams.WMKind; } } public WMKind WMKind { get { return (dbCfg == null || dbCfg.ProcParams == null) ? WMKind.iPERL : dbCfg.ProcParams.WMKind; } }
public int WMTypeId { get { return (dbCfg == null || dbCfg.ProcParams == null) ? 0 : dbCfg.ProcParams.WMTypeId; } } public int WMTypeId { get { return (dbCfg == null || dbCfg.ProcParams == null) ? 0 : dbCfg.ProcParams.WMTypeId; } }
public int YearOfManufacture { get { return (dbCfg == null || dbCfg.ProcParams == null) ? DateTime.Now.Year : dbCfg.ProcParams.YearOfManufacture; } } public int YearOfManufacture { get { return (dbCfg == null || dbCfg.ProcParams == null) ? DateTime.Now.Year : dbCfg.ProcParams.YearOfManufacture; } }
public bool SaveResults { get { return (dbCfg == null || dbCfg.ProcParams == null) ? false : dbCfg.ProcParams.SaveResults; } } public bool SaveResults { get { return (dbCfg == null || dbCfg.ProcParams == null) ? false : dbCfg.ProcParams.SaveResults; } }
public bool ReadStartInfo { get { return (dbCfg == null || dbCfg.ProcParams == null) ? true : dbCfg.ProcParams.ReadStartInfo; } } public bool ReadStartInfo { get { return (dbCfg == null || dbCfg.ProcParams == null) ? true : dbCfg.ProcParams.ReadStartInfo; } }
public bool StartInfoIsRequired { get { return (dbCfg == null || dbCfg.ProcParams == null) ? false : dbCfg.ProcParams.StartInfoIsRequired; } } public bool StartInfoIsRequired { get { return (dbCfg == null || dbCfg.ProcParams == null) ? false : dbCfg.ProcParams.StartInfoIsRequired; } }
public DesigMode DesigMode { get { return (dbCfg == null || dbCfg.ProcParams == null) ? DesigMode.Auto : dbCfg.ProcParams.DesigMode; } }
public LogType DesigType { get { return (dbCfg == null || dbCfg.ProcParams == null) ? LogType.Just_Q3Q2Q1 : dbCfg.ProcParams.DesigType; } }
enum OpState enum OpState
{ {
@ -83,17 +95,15 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
OracleConnection qualityDB; /// Quality Oracle DB connection OracleConnection qualityDB; /// Quality Oracle DB connection
OracleConnection testDB; /// Test Oracle DB connection OracleConnection testDB; /// Test Oracle DB connection
OracleConnection selectedDB public OracleConnection SelectedDB
{ {
get get
{ {
if (dbCfg == null || dbCfg.ProcParams == null) return null; switch (DBUsed)
switch (dbCfg.ProcParams.DBUsed)
{ {
case DBUsed.Production: return productionDB; case DBUsed.Production: return productionDB;
case DBUsed.Quality: return qualityDB; case DBUsed.Quality: return qualityDB;
case DBUsed.Test: return testDB; case DBUsed.Test: return testDB;
default: default:
case DBUsed.None: case DBUsed.None:
@ -128,26 +138,26 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// ///
public void Initialize() public void Initialize()
{ {
if (dbCfg.DebugLevel == DebugMode.Simulate) return;
productionDB = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;"); productionDB = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
qualityDB = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltaqual;Password=test;"); qualityDB = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltaqual;Password=test;");
testDB = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;"); testDB = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
if (dbCfg.DebugLevel == DebugMode.Simulate) return;
/// ///
/// Do something with the database to see if the connection works well /// Do something with the database to see if the connection works well
/// ///
if (productionDB != null) if (DBUsed == DBUsed.Production)
{ {
productionDB.Open(); SelectedDB.Open();
string rslt = "none"; string rslt = "none";
OracleCommand cmd = new OracleCommand("select Standort from ANBIETER_SD where ANBID = 4", productionDB); OracleCommand cmd = new OracleCommand("select Standort from ANBIETER_SD where ANBID = 4", SelectedDB);
OracleDataReader dr = cmd.ExecuteReader(); OracleDataReader dr = cmd.ExecuteReader();
if (dr.Read()) rslt = dr.GetString(0); if (dr.Read()) rslt = dr.GetString(0);
dr.Close(); dr.Close();
productionDB.Close(); SelectedDB.Close();
} }
} }
/// ///
@ -253,11 +263,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// <returns>Reference to the operation</returns> /// <returns>Reference to the operation</returns>
public IOperation ReadStartInfoOp(IList<Results.Entities.WaterMeter> waterMeters) public IOperation ReadStartInfoOp(IList<Results.Entities.WaterMeter> waterMeters)
{ {
if (!ReadStartInfo) if ((currentOpState == OpState.ReadStartInfoRunning) || (currentOpState == OpState.WriteResultsRunning))
{
return null;
}
else if ((currentOpState == OpState.ReadStartInfoRunning) || (currentOpState == OpState.WriteResultsRunning))
{ {
throw new Exception("Sequence error"); throw new Exception("Sequence error");
} }
@ -317,15 +323,25 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
{ {
if (!opCompleted) if (!opCompleted)
{ {
if (waterMeters.Count == 0) return Event.ResultsWritten; log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOpState);
if ((dbCfg.DebugLevel == DebugMode.Normal) && (selectedDB != null)) if (dbCfg.DebugLevel == DebugMode.Normal && SelectedDB != null && ReadStartInfo && waterMeters.Count != 0)
{ {
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOpState);
#if ORACLE_DB #if ORACLE_DB
if (ReadStartInfoFromDB(selectedDB) == Retv.Error) anyError = true; log.WarnFormat("{0} : Run() : reading from database", Name);
if (ReadStartInfoFromDB(SelectedDB) == Retv.Error) anyError = true;
#endif #endif
} }
if (DesigMode == DesigMode.Based_on_procedure && StateMachine.Procedure != null)
{
Sequences.ProcessData.CompleteTestInfos = Results.Output.SensusTestInfo.CreateFromProcedure(StateMachine.Procedure);
}
else if (DesigMode == DesigMode.As_specified && DesigType >= 0 && DesigType < LogType.Count)
{
Sequences.ProcessData.CompleteTestInfos = SensusTestInfo.GetTestInfos(DesigType);
}
opCompleted = true; opCompleted = true;
} }
@ -337,11 +353,11 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
{ {
if (batch.WaterMeters.Count == 0) return Event.ResultsWritten; if (batch.WaterMeters.Count == 0) return Event.ResultsWritten;
if ((dbCfg.DebugLevel == DebugMode.Normal) && (selectedDB != null)) if ((dbCfg.DebugLevel == DebugMode.Normal) && (SelectedDB != null))
{ {
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOpState); log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOpState);
#if ORACLE_DB #if ORACLE_DB
if (WriteResultsToDB(selectedDB, batch, false) == Retv.Error) anyError = true; if (WriteResultsToDB(SelectedDB, batch, false) == Retv.Error) anyError = true;
#endif #endif
} }
opCompleted = true; opCompleted = true;
@ -679,17 +695,17 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
SaveBatchData(conn, batch); SaveBatchData(conn, batch);
foreach (var wMtr in batch.WaterMeters) foreach (var wMtr in batch.WaterMeters)
{ {
if (WMKind == WMKind.Iperl) if (WMKind == WMKind.iPERL)
{ {
if ((wMtr.ErrorFlags & ((int)ErrorFlagMask.E26 | (int)ErrorFlagMask.E27 | (int)ErrorFlagMask.E28)) == 0) if ((wMtr.ErrorFlags & ((int)ErrorFlagMask.E26 | (int)ErrorFlagMask.E27 | (int)ErrorFlagMask.E28)) == 0)
{ {
/// No production error => write the result of testing to Oracle DB /// No production error => write the result of testing to Oracle DB
SaveOneIperlToDB(conn, wMtr, safeMode); SaveIperlToDB(conn, wMtr, safeMode);
} }
} }
else if (WMKind == WMKind.S620) else if (WMKind == WMKind.Mechanical)
{ {
SaveOneS620ToDB(conn, wMtr, safeMode); SaveMechanicalMeterToDB(conn, wMtr, safeMode);
} }
} }
@ -948,7 +964,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// </summary> /// </summary>
/// <param name="wmNr">0-based water meter number</param> /// <param name="wmNr">0-based water meter number</param>
/// <param name="results">Sorted list of results to save</param> /// <param name="results">Sorted list of results to save</param>
void SaveOneIperlToDB(OracleConnection conn, Results.Entities.WaterMeter wm, bool safeMode) void SaveIperlToDB(OracleConnection conn, Results.Entities.WaterMeter wm, bool safeMode)
{ {
if (safeMode && !wm.Passed) return; if (safeMode && !wm.Passed) return;
@ -1141,11 +1157,11 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// <summary> /// <summary>
/// Write one meter results into the database /// Write results of one mechanical meter into the database
/// </summary> /// </summary>
/// <param name="wmNr">0-based water meter number</param> /// <param name="wmNr">0-based water meter number</param>
/// <param name="results">Sorted list of results to save</param> /// <param name="results">Sorted list of results to save</param>
void SaveOneS620ToDB(OracleConnection conn, Results.Entities.WaterMeter wm, bool safeMode) void SaveMechanicalMeterToDB(OracleConnection conn, Results.Entities.WaterMeter wm, bool safeMode)
{ {
if (safeMode && !wm.Passed) return; if (safeMode && !wm.Passed) return;
@ -1174,32 +1190,40 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
wm.Pruefindex = MAX_Pruefindex; wm.Pruefindex = MAX_Pruefindex;
wm.HydrPruefung = Hydr_Pruefung; wm.HydrPruefung = Hydr_Pruefung;
SaveOrUpdateS620(conn, wm, MAX_Pruefindex, Hydr_Pruefung); SaveOrUpdateMechanicalMeter(conn, wm, MAX_Pruefindex, Hydr_Pruefung);
} }
void SaveOrUpdateS620(OracleConnection conn, Results.Entities.WaterMeter wm, int max_Pruefindex, int hydr_Pruefung) void SaveOrUpdateMechanicalMeter(OracleConnection conn, Results.Entities.WaterMeter wm, int max_Pruefindex, int hydr_Pruefung)
{ {
int sekundaere_Adr = wm.Passed ? 1 : 0;
int idBenutzer = 6; // = wm.Batch.UserNumber; int idBenutzer = 6; // = wm.Batch.UserNumber;
if (max_Pruefindex % 100 == 1) if (max_Pruefindex % 100 == 1)
{ {
if (!dbCfg.TestMode) if (!dbCfg.TestMode)
{ {
OracleCommand cmd = new OracleCommand("INSERT INTO VT_ZAEHLER_PD(Auftragsnummer, VT_Identnummer, VT_Fernum, Max_Pruefindex," + OracleCommand cmd = new OracleCommand("INSERT INTO VT_ZAEHLER_PD(Auftragsnummer, VT_Identnummer, VT_Fernum, Max_Pruefindex, MBUS_ADR, LIEGENSCHAFTS_NR, Sekundaere_Adr," +
" Zaehlernummer, Sekundaere_Adr, Hydr_Pruefung, ID_Benutzer, ANBID, Baujahr)" + " Hydr_Pruefung, MARK_DATE, Baujahr, EICH_JAHR, UMKARTON_NR, PALETTE_NR, ZAEHLERNUMMER, PREFIX, SUFFIX, Z_NR_KOMPLETT," +
" VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10)", conn); " ANBID, ID_Benutzer) VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19)", conn);
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.PurchaseOrder }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.PurchaseOrder }); /// :1
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = "IPBATMXX" }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = "88888888" }); /// :2
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.SerialNr }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.SerialNr }); /// :3
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = max_Pruefindex }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = max_Pruefindex }); /// :4
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = -1 }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// :5 MBUS_ADR
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = sekundaere_Adr }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// :6 LIEGENSCHAFTS_NR
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = hydr_Pruefung }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// :7 Sekundaere_Adr
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = idBenutzer }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = hydr_Pruefung }); /// :8
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_StaraTura }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.TimeStamp, Value = wm.Batch.EndTime }); /// :9
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = YearOfManufacture }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = YearOfManufacture }); /// :10
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = YearOfManufacture }); /// :11
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// :12 UMKARTON_NR
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// :13 PALETTE_NR
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wm.AssignedSerialNr }); /// :14
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.Prefix }); /// :15
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.Suffix }); /// :16
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.CompleteSerialNr }); /// :17
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_StaraTura }); /// :18
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = idBenutzer }); /// :19
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
log.InfoFormat("VT_ZAEHLER_PD inserted, PcbNr={0}, pos={1}, maxPruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex); log.InfoFormat("VT_ZAEHLER_PD inserted, PcbNr={0}, pos={1}, maxPruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex);
@ -1213,16 +1237,29 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
{ {
if (!dbCfg.TestMode) if (!dbCfg.TestMode)
{ {
OracleCommand cmd = new OracleCommand("UPDATE VT_ZAEHLER_PD SET Auftragsnummer = :1, VT_Identnummer = :2, Max_Pruefindex = :3, Hydr_Pruefung= :4, ID_Benutzer= :5, Baujahr= :6 WHERE VT_Fernum = :7 and ANBID = :8", conn); OracleCommand cmd = new OracleCommand("UPDATE VT_ZAEHLER_PD SET Auftragsnummer= :1, VT_Identnummer= :2, Max_Pruefindex= :3, MBUS_ADR= :4, LIEGENSCHAFTS_NR= :5," +
" Sekundaere_Adr= :6, Hydr_Pruefung= :7, MARK_DATE= :8, Baujahr= :9, EICH_JAHR= :10, UMKARTON_NR= :11, PALETTE_NR= :12," +
" ZAEHLERNUMMER= :13, PREFIX= :14, SUFFIX= :15, Z_NR_KOMPLETT= :16, ID_Benutzer= :17 WHERE VT_Fernum = :18 and ANBID = :19", conn);
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.PurchaseOrder }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.PurchaseOrder }); /// :1
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = "IPBATMXX" }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = "88888888" }); /// :2
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = max_Pruefindex }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = max_Pruefindex }); /// :3
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = hydr_Pruefung }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// :4 MBUS_ADR
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = idBenutzer }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// :5 LIEGENSCHAFTS_NR
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = YearOfManufacture }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// :6 Sekundaere_Adr
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.SerialNr }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = hydr_Pruefung }); /// :7
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_StaraTura }); cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.TimeStamp, Value = wm.Batch.EndTime }); /// :8
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = YearOfManufacture }); /// :9
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = YearOfManufacture }); /// :10
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// :11 UMKARTON_NR
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// :12 PALETTE_NR
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wm.AssignedSerialNr }); /// :13
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.Prefix }); /// :14
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.Suffix }); /// :15
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.CompleteSerialNr }); /// :16
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = idBenutzer }); /// :17
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.SerialNr }); /// :18
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_StaraTura }); /// :19
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
log.InfoFormat("VT_ZAEHLER_PD updated, PcbNr={0}, pos={1}, maxPruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex); log.InfoFormat("VT_ZAEHLER_PD updated, PcbNr={0}, pos={1}, maxPruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex);

View File

@ -2,13 +2,14 @@
/// Copyright (c) 2020 Sensus Slovensko a.s. /// Copyright (c) 2020 Sensus Slovensko a.s.
/// ///
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Xml.Serialization; using System.Xml.Serialization;
using Config.Entities; using Config.Entities;
using Results.Output;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;
using System.Collections.Generic;
namespace TBF.BenchControl.Output.DB.SensusOracle namespace TBF.BenchControl.Output.DB.SensusOracle
{ {
@ -17,76 +18,87 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcedureParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcedureParams) })[0];
public override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public DBUsed DBUsed; /// 0 public DBUsed DBUsed; /// 0
public WMKind WMKind; /// 1 public WMKind WMKind; /// 1
public int WMTypeId; /// 2 public int WMTypeId; /// 2
public int YearOfManufacture; /// 3 public int YearOfManufacture; /// 3
public bool SaveResults; /// 4 public bool SaveResults; /// 4
public bool ReadStartInfo; /// 5 public bool ReadStartInfo; /// 5
public bool StartInfoIsRequired; /// 6 public bool StartInfoIsRequired; /// 6
public DesigMode DesigMode; /// 7
public override void InitializeAll() public Results.Output.LogType DesigType; /// 8
{
DBUsed = DBUsed.Production; /// 0 public override void InitializeAll()
WMKind = WMKind.Iperl; /// 1 {
WMTypeId = 2; /// 2 DBUsed = DBUsed.Production; /// 0
YearOfManufacture = DateTime.Now.Year; /// 3 WMKind = WMKind.iPERL; /// 1
#if TURA_SPECIAL WMTypeId = 2; /// 2
SaveResults = false; /// 4 YearOfManufacture = DateTime.Now.Year; /// 3
#else #if TURA_SPECIAL
SaveResults = true; /// 4 SaveResults = false; /// 4
#endif #else
ReadStartInfo = true; /// 5 SaveResults = true; /// 4
StartInfoIsRequired = false; /// 6 #endif
} ReadStartInfo = true; /// 5
StartInfoIsRequired = false; /// 6
DesigMode = DesigMode.Auto; /// 7
DesigType = Results.Output.LogType.Just_Q3Q2Q1; /// 8
}
string[] paramNames = new string[] string[] paramNames = new string[]
{ {
"Database", /// 0 "Database", /// 0
"Kind of WMs", /// 1 "Kind of WMs", /// 1
"WM type ID", /// 2 "WM type ID", /// 2
"Year of manufacture", /// 3 "Year of manufacture", /// 3
"Save results", /// 4 "Save results", /// 4
"Read start info", /// 5 "Read start info", /// 5
"Start info is required", /// 6 "Start info is required", /// 6
"Designation Mode", /// 7
"Designation when mode is 'As_specified'", /// 8
}; };
public override string ParamName(int i) { return paramNames[i]; } public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; } public override int ParamsCount() { return paramNames.Length; }
public override IList<string> ParamValues(int i) public override IList<string> ParamValues(int i)
{ {
if (i == 0) IList<string> retVal = new List<string>();
{
IList<string> retVal = new List<string>();
for (DBUsed db = 0; db < DBUsed.Count; db++) retVal.Add(db.ToString());
return retVal;
}
if (i == 1) switch (i)
{ {
IList<string> retVal = new List<string>(); case 0:
for (WMKind wm = 0; wm < WMKind.Count; wm++) retVal.Add(wm.ToString()); for (DBUsed db = 0; db < DBUsed.Count; db++) retVal.Add(db.ToString());
return retVal; return retVal;
}
if (i == 3) case 1:
{ for (WMKind wm = 0; wm < WMKind.Count; wm++) retVal.Add(wm.ToString());
IList<string> retVal = new List<string>(); return retVal;
int year = DateTime.Now.Year;
retVal.Add(year.ToString());
retVal.Add((year + 1).ToString());
return retVal;
}
if (i == 4 || i == 5 || i == 6) case 2:
{ default:
IList<string> retVal = new List<string>(); return null;
retVal.Add(Strings.yes);
retVal.Add(Strings.no);
return retVal;
}
return null; case 3:
int year = DateTime.Now.Year;
retVal.Add(year.ToString());
retVal.Add((year + 1).ToString());
return retVal;
case 4:
case 5:
case 6:
retVal.Add(Strings.yes);
retVal.Add(Strings.no);
return retVal;
case 7:
for (DesigMode md = 0; md < DesigMode.Count; md++) retVal.Add(md.ToString());
return retVal;
case 8:
for (Results.Output.LogType wm = 0; wm < Results.Output.LogType.Count; wm++) retVal.Add(wm.ToString());
return retVal;
}
} }
public override string ToString(int i) public override string ToString(int i)
@ -100,6 +112,8 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
case 4: return SaveResults ? Strings.yes : Strings.no; case 4: return SaveResults ? Strings.yes : Strings.no;
case 5: return ReadStartInfo ? Strings.yes : Strings.no; case 5: return ReadStartInfo ? Strings.yes : Strings.no;
case 6: return StartInfoIsRequired ? Strings.yes : Strings.no; case 6: return StartInfoIsRequired ? Strings.yes : Strings.no;
case 7: return DesigMode.ToString();
case 8: return DesigType.ToString();
default: return string.Empty; default: return string.Empty;
} }
} }
@ -136,7 +150,29 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
case 4: SaveResults = (strValue == Strings.yes); break; case 4: SaveResults = (strValue == Strings.yes); break;
case 5: ReadStartInfo = (strValue == Strings.yes); break; case 5: ReadStartInfo = (strValue == Strings.yes); break;
case 6: StartInfoIsRequired = (strValue == Strings.yes); break; case 6: StartInfoIsRequired = (strValue == Strings.yes); break;
}
case 7:
for (DesigMode db = 0; db < DesigMode.Count; db++)
{
if (db.ToString() == strValue)
{
DesigMode = db;
return CfgUpdateFlags.None;
}
}
break;
case 8:
for (Results.Output.LogType wm = 0; wm < Results.Output.LogType.Count; wm++)
{
if (wm.ToString() == strValue)
{
DesigType = wm;
return CfgUpdateFlags.None;
}
}
break;
}
return CfgUpdateFlags.None; return CfgUpdateFlags.None;
} }
@ -180,6 +216,20 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
return true; return true;
break; break;
case 7:
for (DesigMode db = 0; db < DesigMode.Count; db++)
{
if (db.ToString() == strValue) return true;
}
break;
case 8:
for (Results.Output.LogType wm = 0; wm < Results.Output.LogType.Count; wm++)
{
if (wm.ToString() == strValue) return true;
}
break;
default: default:
message = "Invalid index"; message = "Invalid index";
return false; return false;
@ -198,7 +248,9 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
prms.SaveResults = this.SaveResults; prms.SaveResults = this.SaveResults;
prms.ReadStartInfo = this.ReadStartInfo; prms.ReadStartInfo = this.ReadStartInfo;
prms.StartInfoIsRequired = this.StartInfoIsRequired; prms.StartInfoIsRequired = this.StartInfoIsRequired;
} prms.DesigMode = this.DesigMode;
prms.DesigType = this.DesigType;
}
public IParamsProvider Clone() public IParamsProvider Clone()
{ {

View File

@ -31,6 +31,7 @@ namespace TBF.BenchControl
Factories.Add(new DataEntry.Munich3.EntryFormFactory()); Factories.Add(new DataEntry.Munich3.EntryFormFactory());
Factories.Add(new DataEntry.Munich.EntryFormFactory()); Factories.Add(new DataEntry.Munich.EntryFormFactory());
Factories.Add(new DataEntry.iPerl.EntryFormFactory()); Factories.Add(new DataEntry.iPerl.EntryFormFactory());
Factories.Add(new DataEntry.S620.Factory());
Factories.Add(new DataEntry.Single.Factory()); Factories.Add(new DataEntry.Single.Factory());
Factories.Add(new DataEntry.Single.FactoryNoStartEnd()); Factories.Add(new DataEntry.Single.FactoryNoStartEnd());
Factories.Add(new DataEntry.Standard6.Factory()); Factories.Add(new DataEntry.Standard6.Factory());

View File

@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2013-2019 Sensus Slovensko a.s. /// Copyright (c) 2013-2020 Sensus Slovensko a.s.
/// ///
using System; using System;
using System.Drawing; using System.Drawing;
@ -230,11 +230,26 @@ namespace TBF
[XmlIgnore] [XmlIgnore]
public int PurchaseOrderHistoryCount { get { return (PurchaseOrderHistory != null) ? PurchaseOrderHistory.Length : 0; } } public int PurchaseOrderHistoryCount { get { return (PurchaseOrderHistory != null) ? PurchaseOrderHistory.Length : 0; } }
/// First s/n history
public string[] FirstSNHistory;
[XmlIgnore]
public int FirstSNHistoryCount { get { return (FirstSNHistory != null) ? FirstSNHistory.Length : 0; } }
/// Last s/n history
public string[] LastSNHistory;
[XmlIgnore]
public int LastSNHistoryCount { get { return (LastSNHistory != null) ? LastSNHistory.Length : 0; } }
/// Prefix history /// Prefix history
public string[] PrefixHistory; public string[] PrefixHistory;
[XmlIgnore] [XmlIgnore]
public int PrefixHistoryCount { get { return (PrefixHistory != null) ? PrefixHistory.Length : 0; } } public int PrefixHistoryCount { get { return (PrefixHistory != null) ? PrefixHistory.Length : 0; } }
/// Suffix history
public string[] SuffixHistory;
[XmlIgnore]
public int SuffixHistoryCount { get { return (SuffixHistory != null) ? SuffixHistory.Length : 0; } }
/// Remarks history /// Remarks history
public string[] RemarkHistory; public string[] RemarkHistory;
[XmlIgnore] [XmlIgnore]

View File

@ -60,6 +60,16 @@ namespace TBF.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Barcode {
get {
object obj = ResourceManager.GetObject("Barcode", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
@ -70,6 +80,16 @@ namespace TBF.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap QRCode_48x48 {
get {
object obj = ResourceManager.GetObject("QRCode_48x48", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View File

@ -153,4 +153,11 @@
</data> </data>
<data name="SwitchOn" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="SwitchOn" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\switch-on.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\switch-on.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data></root> </data>
<data name="Barcode" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Barcode.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="QRCode_48x48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\qrcode-48x48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

BIN
TBF/Resources/Barcode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

View File

@ -19,7 +19,7 @@ namespace TBF.Resources {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Strings { internal class Strings {
@ -3291,6 +3291,15 @@ namespace TBF.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Opening production tracing DB failed.
/// </summary>
internal static string Opening_production_tracing_DB_failed {
get {
return ResourceManager.GetString("Opening_production_tracing_DB_failed", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Other. /// Looks up a localized string similar to Other.
/// </summary> /// </summary>
@ -4182,6 +4191,24 @@ namespace TBF.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Reading from the production tracing DB failed.
/// </summary>
internal static string Reading_from_the_production_tracing_DB_failed {
get {
return ResourceManager.GetString("Reading_from_the_production_tracing_DB_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Reading the production tracing configuration.
/// </summary>
internal static string Reading_the_production_tracing_configuration {
get {
return ResourceManager.GetString("Reading_the_production_tracing_configuration", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Ready. /// Looks up a localized string similar to Ready.
/// </summary> /// </summary>
@ -6417,6 +6444,15 @@ namespace TBF.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Writing to the production tracing DB failed.
/// </summary>
internal static string Writing_to_the_production_tracing_DB_failed {
get {
return ResourceManager.GetString("Writing_to_the_production_tracing_DB_failed", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Wrong iPerl counting direction. /// Looks up a localized string similar to Wrong iPerl counting direction.
/// </summary> /// </summary>

View File

@ -1641,4 +1641,16 @@
<data name="Certificate" xml:space="preserve"> <data name="Certificate" xml:space="preserve">
<value>Certifikát</value> <value>Certifikát</value>
</data> </data>
<data name="Opening_production_tracing_DB_failed" xml:space="preserve">
<value>Připojení k databázi pro seldování výroby zlyhalo</value>
</data>
<data name="Reading_from_the_production_tracing_DB_failed" xml:space="preserve">
<value>Čtení z databáze sledování výroby zlyhalo</value>
</data>
<data name="Reading_the_production_tracing_configuration" xml:space="preserve">
<value>Čtení konfigurace databáze sledování výroby</value>
</data>
<data name="Writing_to_the_production_tracing_DB_failed" xml:space="preserve">
<value>Zápis do databáze sledování výroby zlyhalo</value>
</data>
</root> </root>

View File

@ -2251,4 +2251,16 @@
<data name="All_day" xml:space="preserve"> <data name="All_day" xml:space="preserve">
<value>All day</value> <value>All day</value>
</data> </data>
<data name="Opening_production_tracing_DB_failed" xml:space="preserve">
<value>Opening production tracing DB failed</value>
</data>
<data name="Reading_from_the_production_tracing_DB_failed" xml:space="preserve">
<value>Reading from the production tracing DB failed</value>
</data>
<data name="Reading_the_production_tracing_configuration" xml:space="preserve">
<value>Reading the production tracing configuration</value>
</data>
<data name="Writing_to_the_production_tracing_DB_failed" xml:space="preserve">
<value>Writing to the production tracing DB failed</value>
</data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -330,6 +330,55 @@
<Compile Include="BenchControl\DataEntry\Munich3\TestStartEndForm.designer.cs"> <Compile Include="BenchControl\DataEntry\Munich3\TestStartEndForm.designer.cs">
<DependentUpon>TestStartEndForm.cs</DependentUpon> <DependentUpon>TestStartEndForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="BenchControl\DataEntry\S620\BarcodeReceivedEventArgs.cs" />
<Compile Include="BenchControl\DataEntry\S620\BodySerNrResult.cs" />
<Compile Include="BenchControl\DataEntry\S620\CheckItems\Barcode.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\CheckItems\Barcode.designer.cs">
<DependentUpon>Barcode.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\CheckItems\Keyboard.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\CheckItems\Keyboard.designer.cs">
<DependentUpon>Keyboard.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\CheckItems\OkNok.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\CheckItems\OkNok.designer.cs">
<DependentUpon>OkNok.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\FocusPressedEventArgs.cs" />
<Compile Include="BenchControl\DataEntry\S620\FormForMechanicalMeters.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\FormForMechanicalMeters.Designer.cs">
<DependentUpon>FormForMechanicalMeters.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\EntryFormCfg.cs" />
<Compile Include="BenchControl\DataEntry\S620\EntryFormCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\EntryFormCfgCtrl.designer.cs">
<DependentUpon>EntryFormCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\EntryForm.cs" />
<Compile Include="BenchControl\DataEntry\S620\Factory.cs" />
<Compile Include="BenchControl\DataEntry\S620\FormForMechanicalMetersWithTracing.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\FormForMechanicalMetersWithTracing.Designer.cs">
<DependentUpon>FormForMechanicalMetersWithTracing.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\ICheckItem.cs" />
<Compile Include="BenchControl\DataEntry\S620\TestStartEndForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\S620\TestStartEndForm.designer.cs">
<DependentUpon>TestStartEndForm.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\Single\CycleBeginningForm.cs"> <Compile Include="BenchControl\DataEntry\Single\CycleBeginningForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -2690,6 +2739,27 @@
<EmbeddedResource Include="BenchControl\DataEntry\Munich\EntryFormCfgCtrl.resx"> <EmbeddedResource Include="BenchControl\DataEntry\Munich\EntryFormCfgCtrl.resx">
<DependentUpon>EntryFormCfgCtrl.cs</DependentUpon> <DependentUpon>EntryFormCfgCtrl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\S620\CheckItems\Barcode.resx">
<DependentUpon>Barcode.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\S620\CheckItems\Keyboard.resx">
<DependentUpon>Keyboard.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\S620\CheckItems\OkNok.resx">
<DependentUpon>OkNok.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\S620\FormForMechanicalMeters.resx">
<DependentUpon>FormForMechanicalMeters.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\S620\EntryFormCfgCtrl.resx">
<DependentUpon>EntryFormCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\S620\FormForMechanicalMetersWithTracing.resx">
<DependentUpon>FormForMechanicalMetersWithTracing.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\S620\TestStartEndForm.resx">
<DependentUpon>TestStartEndForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\Single\CycleBeginningForm.resx"> <EmbeddedResource Include="BenchControl\DataEntry\Single\CycleBeginningForm.resx">
<DependentUpon>CycleBeginningForm.cs</DependentUpon> <DependentUpon>CycleBeginningForm.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -3559,7 +3629,9 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Pictures\sample.bmp" /> <Content Include="Pictures\sample.bmp" />
<None Include="Resources\Barcode.png" />
<Content Include="Resources\empty.png" /> <Content Include="Resources\empty.png" />
<None Include="Resources\qrcode-48x48.png" />
<Content Include="Resources\switch-off.png" /> <Content Include="Resources\switch-off.png" />
<Content Include="Resources\switch-on.png" /> <Content Include="Resources\switch-on.png" />
<Content Include="SampleConfig\config.xml"> <Content Include="SampleConfig\config.xml">