initialize
This commit is contained in:
886
interface/asm/dotnet/Oib5xGUI/Form1.Designer.cs
generated
Normal file
886
interface/asm/dotnet/Oib5xGUI/Form1.Designer.cs
generated
Normal file
@@ -0,0 +1,886 @@
|
||||
namespace oib5._1.GUI
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Erforderliche Designervariable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Verwendete Ressourcen bereinigen.
|
||||
/// </summary>
|
||||
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Vom Windows Form-Designer generierter Code
|
||||
|
||||
/// <summary>
|
||||
/// Erforderliche Methode für die Designerunterstützung.
|
||||
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.PrinterTab = new System.Windows.Forms.TabControl();
|
||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||
this.button8 = new System.Windows.Forms.Button();
|
||||
this.button7 = new System.Windows.Forms.Button();
|
||||
this.button5 = new System.Windows.Forms.Button();
|
||||
this.button6 = new System.Windows.Forms.Button();
|
||||
this.button4 = new System.Windows.Forms.Button();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
this.button24 = new System.Windows.Forms.Button();
|
||||
this.button25 = new System.Windows.Forms.Button();
|
||||
this.button23 = new System.Windows.Forms.Button();
|
||||
this.button21 = new System.Windows.Forms.Button();
|
||||
this.button22 = new System.Windows.Forms.Button();
|
||||
this.button19 = new System.Windows.Forms.Button();
|
||||
this.button20 = new System.Windows.Forms.Button();
|
||||
this.button18 = new System.Windows.Forms.Button();
|
||||
this.button17 = new System.Windows.Forms.Button();
|
||||
this.button16 = new System.Windows.Forms.Button();
|
||||
this.button15 = new System.Windows.Forms.Button();
|
||||
this.button14 = new System.Windows.Forms.Button();
|
||||
this.button13 = new System.Windows.Forms.Button();
|
||||
this.button12 = new System.Windows.Forms.Button();
|
||||
this.button11 = new System.Windows.Forms.Button();
|
||||
this.button10 = new System.Windows.Forms.Button();
|
||||
this.tabPage3 = new System.Windows.Forms.TabPage();
|
||||
this.button35 = new System.Windows.Forms.Button();
|
||||
this.tabPage4 = new System.Windows.Forms.TabPage();
|
||||
this.cbTrace = new System.Windows.Forms.ComboBox();
|
||||
this.traceResponse = new System.Windows.Forms.TextBox();
|
||||
this.button9 = new System.Windows.Forms.Button();
|
||||
this.button28 = new System.Windows.Forms.Button();
|
||||
this.tabPage5 = new System.Windows.Forms.TabPage();
|
||||
this.button37 = new System.Windows.Forms.Button();
|
||||
this.button36 = new System.Windows.Forms.Button();
|
||||
this.tabPage6 = new System.Windows.Forms.TabPage();
|
||||
this.DekExtControlResult = new System.Windows.Forms.TextBox();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.tabPage9 = new System.Windows.Forms.TabPage();
|
||||
this.printerMaterialVerifyRequired = new System.Windows.Forms.CheckBox();
|
||||
this.printerMaterialBinNumber = new System.Windows.Forms.TextBox();
|
||||
this.tbMateriaProductNumber = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.tabPage10 = new System.Windows.Forms.TabPage();
|
||||
this.toolVerify = new System.Windows.Forms.CheckBox();
|
||||
this.tbToolIdentification = new System.Windows.Forms.TextBox();
|
||||
this.tbToolPartNumber = new System.Windows.Forms.TextBox();
|
||||
this.toolNumber = new System.Windows.Forms.Label();
|
||||
this.toolPartNumber = new System.Windows.Forms.Label();
|
||||
this.button27 = new System.Windows.Forms.Button();
|
||||
this.button26 = new System.Windows.Forms.Button();
|
||||
this.tabPage7 = new System.Windows.Forms.TabPage();
|
||||
this.tabPage8 = new System.Windows.Forms.TabPage();
|
||||
this.mesInterceptorText = new System.Windows.Forms.TextBox();
|
||||
this.button33 = new System.Windows.Forms.Button();
|
||||
this.button32 = new System.Windows.Forms.Button();
|
||||
this.button31 = new System.Windows.Forms.Button();
|
||||
this.button30 = new System.Windows.Forms.Button();
|
||||
this.button29 = new System.Windows.Forms.Button();
|
||||
this.tabPage11 = new System.Windows.Forms.TabPage();
|
||||
this.button34 = new System.Windows.Forms.Button();
|
||||
this.PrinterTab.SuspendLayout();
|
||||
this.tabPage1.SuspendLayout();
|
||||
this.tabPage2.SuspendLayout();
|
||||
this.tabPage3.SuspendLayout();
|
||||
this.tabPage4.SuspendLayout();
|
||||
this.tabPage5.SuspendLayout();
|
||||
this.tabPage6.SuspendLayout();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.tabPage9.SuspendLayout();
|
||||
this.tabPage10.SuspendLayout();
|
||||
this.tabPage8.SuspendLayout();
|
||||
this.tabPage11.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// PrinterTab
|
||||
//
|
||||
this.PrinterTab.Controls.Add(this.tabPage1);
|
||||
this.PrinterTab.Controls.Add(this.tabPage2);
|
||||
this.PrinterTab.Controls.Add(this.tabPage3);
|
||||
this.PrinterTab.Controls.Add(this.tabPage4);
|
||||
this.PrinterTab.Controls.Add(this.tabPage5);
|
||||
this.PrinterTab.Controls.Add(this.tabPage6);
|
||||
this.PrinterTab.Controls.Add(this.tabPage7);
|
||||
this.PrinterTab.Controls.Add(this.tabPage8);
|
||||
this.PrinterTab.Controls.Add(this.tabPage11);
|
||||
this.PrinterTab.Location = new System.Drawing.Point(12, 12);
|
||||
this.PrinterTab.Name = "PrinterTab";
|
||||
this.PrinterTab.SelectedIndex = 0;
|
||||
this.PrinterTab.Size = new System.Drawing.Size(1065, 596);
|
||||
this.PrinterTab.TabIndex = 5;
|
||||
//
|
||||
// tabPage1
|
||||
//
|
||||
this.tabPage1.Controls.Add(this.button8);
|
||||
this.tabPage1.Controls.Add(this.button7);
|
||||
this.tabPage1.Controls.Add(this.button5);
|
||||
this.tabPage1.Controls.Add(this.button6);
|
||||
this.tabPage1.Controls.Add(this.button4);
|
||||
this.tabPage1.Controls.Add(this.button3);
|
||||
this.tabPage1.Controls.Add(this.button2);
|
||||
this.tabPage1.Controls.Add(this.button1);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage1.Size = new System.Drawing.Size(1057, 570);
|
||||
this.tabPage1.TabIndex = 0;
|
||||
this.tabPage1.Text = "Printer Events";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button8
|
||||
//
|
||||
this.button8.Location = new System.Drawing.Point(21, 253);
|
||||
this.button8.Name = "button8";
|
||||
this.button8.Size = new System.Drawing.Size(197, 23);
|
||||
this.button8.TabIndex = 12;
|
||||
this.button8.Text = "Printer Consumables Updated";
|
||||
this.button8.UseVisualStyleBackColor = true;
|
||||
this.button8.Click += new System.EventHandler(this.printerconsumablesUpdate_click);
|
||||
//
|
||||
// button7
|
||||
//
|
||||
this.button7.Location = new System.Drawing.Point(21, 309);
|
||||
this.button7.Name = "button7";
|
||||
this.button7.Size = new System.Drawing.Size(197, 23);
|
||||
this.button7.TabIndex = 11;
|
||||
this.button7.Text = "Printer CapabilitiesChanged ";
|
||||
this.button7.UseVisualStyleBackColor = true;
|
||||
this.button7.Click += new System.EventHandler(this.printerCapabilitiesChanged_Click);
|
||||
//
|
||||
// button5
|
||||
//
|
||||
this.button5.Location = new System.Drawing.Point(263, 184);
|
||||
this.button5.Name = "button5";
|
||||
this.button5.Size = new System.Drawing.Size(197, 23);
|
||||
this.button5.TabIndex = 10;
|
||||
this.button5.Text = "PrinterToolUnverified";
|
||||
this.button5.UseVisualStyleBackColor = true;
|
||||
this.button5.Click += new System.EventHandler(this.PrinterToolUnverified_Click);
|
||||
//
|
||||
// button6
|
||||
//
|
||||
this.button6.Location = new System.Drawing.Point(21, 184);
|
||||
this.button6.Name = "button6";
|
||||
this.button6.Size = new System.Drawing.Size(197, 23);
|
||||
this.button6.TabIndex = 9;
|
||||
this.button6.Text = "PrinterToolVerified";
|
||||
this.button6.UseVisualStyleBackColor = true;
|
||||
this.button6.Click += new System.EventHandler(this.PrinterToolVerified_Click);
|
||||
//
|
||||
// button4
|
||||
//
|
||||
this.button4.Location = new System.Drawing.Point(263, 97);
|
||||
this.button4.Name = "button4";
|
||||
this.button4.Size = new System.Drawing.Size(197, 23);
|
||||
this.button4.TabIndex = 8;
|
||||
this.button4.Text = "PrinterMaterialUnverified";
|
||||
this.button4.UseVisualStyleBackColor = true;
|
||||
this.button4.Click += new System.EventHandler(this.PrinterMaterialUnverified_Click);
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Location = new System.Drawing.Point(21, 97);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(197, 23);
|
||||
this.button3.TabIndex = 7;
|
||||
this.button3.Text = "PrinterMaterialVerified";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.PrinterMaterialVerified_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(263, 17);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(197, 23);
|
||||
this.button2.TabIndex = 6;
|
||||
this.button2.Text = "PrinterCoverClosed";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.printerCoverClosed_Click);
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(21, 17);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(197, 23);
|
||||
this.button1.TabIndex = 5;
|
||||
this.button1.Text = "PrinterCoverOpened";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.printerCoverOpened_Click);
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Controls.Add(this.button24);
|
||||
this.tabPage2.Controls.Add(this.button25);
|
||||
this.tabPage2.Controls.Add(this.button23);
|
||||
this.tabPage2.Controls.Add(this.button21);
|
||||
this.tabPage2.Controls.Add(this.button22);
|
||||
this.tabPage2.Controls.Add(this.button19);
|
||||
this.tabPage2.Controls.Add(this.button20);
|
||||
this.tabPage2.Controls.Add(this.button18);
|
||||
this.tabPage2.Controls.Add(this.button17);
|
||||
this.tabPage2.Controls.Add(this.button16);
|
||||
this.tabPage2.Controls.Add(this.button15);
|
||||
this.tabPage2.Controls.Add(this.button14);
|
||||
this.tabPage2.Controls.Add(this.button13);
|
||||
this.tabPage2.Controls.Add(this.button12);
|
||||
this.tabPage2.Controls.Add(this.button11);
|
||||
this.tabPage2.Controls.Add(this.button10);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(1057, 570);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "Setupcenter Events";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button24
|
||||
//
|
||||
this.button24.Location = new System.Drawing.Point(270, 469);
|
||||
this.button24.Name = "button24";
|
||||
this.button24.Size = new System.Drawing.Size(197, 23);
|
||||
this.button24.TabIndex = 21;
|
||||
this.button24.Text = "Splice chain Split";
|
||||
this.button24.UseVisualStyleBackColor = true;
|
||||
this.button24.Click += new System.EventHandler(this.spliceChainSplit_Click);
|
||||
//
|
||||
// button25
|
||||
//
|
||||
this.button25.Location = new System.Drawing.Point(20, 469);
|
||||
this.button25.Name = "button25";
|
||||
this.button25.Size = new System.Drawing.Size(197, 23);
|
||||
this.button25.TabIndex = 20;
|
||||
this.button25.Text = "Lock State Changed";
|
||||
this.button25.UseVisualStyleBackColor = true;
|
||||
this.button25.Click += new System.EventHandler(this.loclStateChanged_Click);
|
||||
//
|
||||
// button23
|
||||
//
|
||||
this.button23.Location = new System.Drawing.Point(270, 151);
|
||||
this.button23.Name = "button23";
|
||||
this.button23.Size = new System.Drawing.Size(197, 23);
|
||||
this.button23.TabIndex = 19;
|
||||
this.button23.Text = "Packaging Unit Updated";
|
||||
this.button23.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button21
|
||||
//
|
||||
this.button21.Location = new System.Drawing.Point(270, 421);
|
||||
this.button21.Name = "button21";
|
||||
this.button21.Size = new System.Drawing.Size(197, 23);
|
||||
this.button21.TabIndex = 18;
|
||||
this.button21.Text = "Packaging Unit Deleted";
|
||||
this.button21.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button22
|
||||
//
|
||||
this.button22.Location = new System.Drawing.Point(20, 421);
|
||||
this.button22.Name = "button22";
|
||||
this.button22.Size = new System.Drawing.Size(197, 23);
|
||||
this.button22.TabIndex = 17;
|
||||
this.button22.Text = "PackagingUnit Created";
|
||||
this.button22.UseVisualStyleBackColor = true;
|
||||
this.button22.Click += new System.EventHandler(this.button22_Click);
|
||||
//
|
||||
// button19
|
||||
//
|
||||
this.button19.Location = new System.Drawing.Point(270, 373);
|
||||
this.button19.Name = "button19";
|
||||
this.button19.Size = new System.Drawing.Size(197, 23);
|
||||
this.button19.TabIndex = 16;
|
||||
this.button19.Text = "Table Removed";
|
||||
this.button19.UseVisualStyleBackColor = true;
|
||||
this.button19.Click += new System.EventHandler(this.tableRemoved_Click);
|
||||
//
|
||||
// button20
|
||||
//
|
||||
this.button20.Location = new System.Drawing.Point(20, 373);
|
||||
this.button20.Name = "button20";
|
||||
this.button20.Size = new System.Drawing.Size(197, 23);
|
||||
this.button20.TabIndex = 15;
|
||||
this.button20.Text = "Table Placed";
|
||||
this.button20.UseVisualStyleBackColor = true;
|
||||
this.button20.Click += new System.EventHandler(this.tablePlaced_Click);
|
||||
//
|
||||
// button18
|
||||
//
|
||||
this.button18.Location = new System.Drawing.Point(20, 328);
|
||||
this.button18.Name = "button18";
|
||||
this.button18.Size = new System.Drawing.Size(197, 23);
|
||||
this.button18.TabIndex = 14;
|
||||
this.button18.Text = "Material Moved";
|
||||
this.button18.UseVisualStyleBackColor = true;
|
||||
this.button18.Click += new System.EventHandler(this.button18_Click);
|
||||
//
|
||||
// button17
|
||||
//
|
||||
this.button17.Location = new System.Drawing.Point(20, 282);
|
||||
this.button17.Name = "button17";
|
||||
this.button17.Size = new System.Drawing.Size(197, 23);
|
||||
this.button17.TabIndex = 13;
|
||||
this.button17.Text = "PackagingUnit consumed";
|
||||
this.button17.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button16
|
||||
//
|
||||
this.button16.Location = new System.Drawing.Point(20, 240);
|
||||
this.button16.Name = "button16";
|
||||
this.button16.Size = new System.Drawing.Size(197, 23);
|
||||
this.button16.TabIndex = 12;
|
||||
this.button16.Text = "Material Reordered";
|
||||
this.button16.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button15
|
||||
//
|
||||
this.button15.Location = new System.Drawing.Point(20, 199);
|
||||
this.button15.Name = "button15";
|
||||
this.button15.Size = new System.Drawing.Size(197, 23);
|
||||
this.button15.TabIndex = 11;
|
||||
this.button15.Text = "Setup changed";
|
||||
this.button15.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button14
|
||||
//
|
||||
this.button14.Location = new System.Drawing.Point(20, 151);
|
||||
this.button14.Name = "button14";
|
||||
this.button14.Size = new System.Drawing.Size(197, 23);
|
||||
this.button14.TabIndex = 10;
|
||||
this.button14.Text = "Packaging Quantity Changed";
|
||||
this.button14.UseVisualStyleBackColor = true;
|
||||
this.button14.Click += new System.EventHandler(this.PackquantityChanged_Click);
|
||||
//
|
||||
// button13
|
||||
//
|
||||
this.button13.Location = new System.Drawing.Point(20, 107);
|
||||
this.button13.Name = "button13";
|
||||
this.button13.Size = new System.Drawing.Size(197, 23);
|
||||
this.button13.TabIndex = 9;
|
||||
this.button13.Text = "New Setup Active";
|
||||
this.button13.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button12
|
||||
//
|
||||
this.button12.Location = new System.Drawing.Point(20, 64);
|
||||
this.button12.Name = "button12";
|
||||
this.button12.Size = new System.Drawing.Size(197, 23);
|
||||
this.button12.TabIndex = 8;
|
||||
this.button12.Text = "Messages Received";
|
||||
this.button12.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button11
|
||||
//
|
||||
this.button11.Location = new System.Drawing.Point(270, 19);
|
||||
this.button11.Name = "button11";
|
||||
this.button11.Size = new System.Drawing.Size(197, 23);
|
||||
this.button11.TabIndex = 7;
|
||||
this.button11.Text = "Feeder Removed";
|
||||
this.button11.UseVisualStyleBackColor = true;
|
||||
this.button11.Click += new System.EventHandler(this.feederRemoved_click);
|
||||
//
|
||||
// button10
|
||||
//
|
||||
this.button10.Location = new System.Drawing.Point(20, 19);
|
||||
this.button10.Name = "button10";
|
||||
this.button10.Size = new System.Drawing.Size(197, 23);
|
||||
this.button10.TabIndex = 6;
|
||||
this.button10.Text = "Feeder Placed";
|
||||
this.button10.UseVisualStyleBackColor = true;
|
||||
this.button10.Click += new System.EventHandler(this.feederPlaced_Click);
|
||||
//
|
||||
// tabPage3
|
||||
//
|
||||
this.tabPage3.Controls.Add(this.button35);
|
||||
this.tabPage3.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage3.Name = "tabPage3";
|
||||
this.tabPage3.Size = new System.Drawing.Size(1057, 570);
|
||||
this.tabPage3.TabIndex = 2;
|
||||
this.tabPage3.Text = "Monitoring Events";
|
||||
this.tabPage3.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button35
|
||||
//
|
||||
this.button35.Location = new System.Drawing.Point(18, 18);
|
||||
this.button35.Name = "button35";
|
||||
this.button35.Size = new System.Drawing.Size(175, 31);
|
||||
this.button35.TabIndex = 0;
|
||||
this.button35.Text = "StationEventComposite";
|
||||
this.button35.UseVisualStyleBackColor = true;
|
||||
this.button35.Click += new System.EventHandler(this.button35_Click);
|
||||
//
|
||||
// tabPage4
|
||||
//
|
||||
this.tabPage4.Controls.Add(this.cbTrace);
|
||||
this.tabPage4.Controls.Add(this.traceResponse);
|
||||
this.tabPage4.Controls.Add(this.button9);
|
||||
this.tabPage4.Controls.Add(this.button28);
|
||||
this.tabPage4.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage4.Name = "tabPage4";
|
||||
this.tabPage4.Size = new System.Drawing.Size(1057, 570);
|
||||
this.tabPage4.TabIndex = 3;
|
||||
this.tabPage4.Text = "Trace";
|
||||
this.tabPage4.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbTrace
|
||||
//
|
||||
this.cbTrace.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.cbTrace.FormattingEnabled = true;
|
||||
this.cbTrace.Items.AddRange(new object[] {
|
||||
"gültige Daten",
|
||||
"traceabilityData = null",
|
||||
"printerName = null"});
|
||||
this.cbTrace.Location = new System.Drawing.Point(21, 21);
|
||||
this.cbTrace.Name = "cbTrace";
|
||||
this.cbTrace.Size = new System.Drawing.Size(209, 21);
|
||||
this.cbTrace.TabIndex = 4;
|
||||
//
|
||||
// traceResponse
|
||||
//
|
||||
this.traceResponse.Location = new System.Drawing.Point(262, 22);
|
||||
this.traceResponse.Multiline = true;
|
||||
this.traceResponse.Name = "traceResponse";
|
||||
this.traceResponse.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.traceResponse.Size = new System.Drawing.Size(682, 528);
|
||||
this.traceResponse.TabIndex = 3;
|
||||
//
|
||||
// button9
|
||||
//
|
||||
this.button9.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.button9.Location = new System.Drawing.Point(21, 77);
|
||||
this.button9.Name = "button9";
|
||||
this.button9.Size = new System.Drawing.Size(209, 23);
|
||||
this.button9.TabIndex = 2;
|
||||
this.button9.Text = "Send PrinterTrace";
|
||||
this.button9.UseVisualStyleBackColor = true;
|
||||
this.button9.Click += new System.EventHandler(this.printerTraceData_Click);
|
||||
//
|
||||
// button28
|
||||
//
|
||||
this.button28.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.button28.Location = new System.Drawing.Point(21, 48);
|
||||
this.button28.Name = "button28";
|
||||
this.button28.Size = new System.Drawing.Size(209, 23);
|
||||
this.button28.TabIndex = 1;
|
||||
this.button28.Text = "Send SmtTrace";
|
||||
this.button28.UseVisualStyleBackColor = true;
|
||||
this.button28.Click += new System.EventHandler(this.boardProduced_Click);
|
||||
//
|
||||
// tabPage5
|
||||
//
|
||||
this.tabPage5.Controls.Add(this.button37);
|
||||
this.tabPage5.Controls.Add(this.button36);
|
||||
this.tabPage5.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage5.Name = "tabPage5";
|
||||
this.tabPage5.Size = new System.Drawing.Size(1057, 570);
|
||||
this.tabPage5.TabIndex = 4;
|
||||
this.tabPage5.Text = "BoardGateKeeper";
|
||||
this.tabPage5.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button37
|
||||
//
|
||||
this.button37.Location = new System.Drawing.Point(19, 77);
|
||||
this.button37.Name = "button37";
|
||||
this.button37.Size = new System.Drawing.Size(265, 30);
|
||||
this.button37.TabIndex = 1;
|
||||
this.button37.Text = "Virtua Inkspot Fail";
|
||||
this.button37.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button36
|
||||
//
|
||||
this.button36.Location = new System.Drawing.Point(19, 20);
|
||||
this.button36.Name = "button36";
|
||||
this.button36.Size = new System.Drawing.Size(265, 30);
|
||||
this.button36.TabIndex = 0;
|
||||
this.button36.Text = "Virtua Inkspot Pass";
|
||||
this.button36.UseVisualStyleBackColor = true;
|
||||
this.button36.Click += new System.EventHandler(this.button36_Click);
|
||||
//
|
||||
// tabPage6
|
||||
//
|
||||
this.tabPage6.Controls.Add(this.DekExtControlResult);
|
||||
this.tabPage6.Controls.Add(this.tabControl1);
|
||||
this.tabPage6.Controls.Add(this.button27);
|
||||
this.tabPage6.Controls.Add(this.button26);
|
||||
this.tabPage6.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage6.Name = "tabPage6";
|
||||
this.tabPage6.Size = new System.Drawing.Size(1057, 570);
|
||||
this.tabPage6.TabIndex = 5;
|
||||
this.tabPage6.Text = "Dek External Control";
|
||||
this.tabPage6.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// DekExtControlResult
|
||||
//
|
||||
this.DekExtControlResult.Location = new System.Drawing.Point(256, 214);
|
||||
this.DekExtControlResult.Multiline = true;
|
||||
this.DekExtControlResult.Name = "DekExtControlResult";
|
||||
this.DekExtControlResult.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.DekExtControlResult.Size = new System.Drawing.Size(635, 316);
|
||||
this.DekExtControlResult.TabIndex = 5;
|
||||
//
|
||||
// tabControl1
|
||||
//
|
||||
this.tabControl1.Controls.Add(this.tabPage9);
|
||||
this.tabControl1.Controls.Add(this.tabPage10);
|
||||
this.tabControl1.Location = new System.Drawing.Point(253, 28);
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(639, 160);
|
||||
this.tabControl1.TabIndex = 4;
|
||||
//
|
||||
// tabPage9
|
||||
//
|
||||
this.tabPage9.Controls.Add(this.printerMaterialVerifyRequired);
|
||||
this.tabPage9.Controls.Add(this.printerMaterialBinNumber);
|
||||
this.tabPage9.Controls.Add(this.tbMateriaProductNumber);
|
||||
this.tabPage9.Controls.Add(this.label2);
|
||||
this.tabPage9.Controls.Add(this.label1);
|
||||
this.tabPage9.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage9.Name = "tabPage9";
|
||||
this.tabPage9.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage9.Size = new System.Drawing.Size(631, 134);
|
||||
this.tabPage9.TabIndex = 0;
|
||||
this.tabPage9.Text = "VerifyPrinterMaterial";
|
||||
this.tabPage9.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// printerMaterialVerifyRequired
|
||||
//
|
||||
this.printerMaterialVerifyRequired.AutoSize = true;
|
||||
this.printerMaterialVerifyRequired.Checked = true;
|
||||
this.printerMaterialVerifyRequired.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.printerMaterialVerifyRequired.Location = new System.Drawing.Point(30, 92);
|
||||
this.printerMaterialVerifyRequired.Name = "printerMaterialVerifyRequired";
|
||||
this.printerMaterialVerifyRequired.Size = new System.Drawing.Size(102, 17);
|
||||
this.printerMaterialVerifyRequired.TabIndex = 4;
|
||||
this.printerMaterialVerifyRequired.Text = "isVerifyRequired";
|
||||
this.printerMaterialVerifyRequired.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// printerMaterialBinNumber
|
||||
//
|
||||
this.printerMaterialBinNumber.Location = new System.Drawing.Point(161, 50);
|
||||
this.printerMaterialBinNumber.Name = "printerMaterialBinNumber";
|
||||
this.printerMaterialBinNumber.Size = new System.Drawing.Size(173, 20);
|
||||
this.printerMaterialBinNumber.TabIndex = 3;
|
||||
this.printerMaterialBinNumber.Text = "GutePaste";
|
||||
//
|
||||
// tbMateriaProductNumber
|
||||
//
|
||||
this.tbMateriaProductNumber.Location = new System.Drawing.Point(161, 17);
|
||||
this.tbMateriaProductNumber.Name = "tbMateriaProductNumber";
|
||||
this.tbMateriaProductNumber.Size = new System.Drawing.Size(173, 20);
|
||||
this.tbMateriaProductNumber.TabIndex = 2;
|
||||
this.tbMateriaProductNumber.Text = "Paste1";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(24, 57);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(102, 13);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Material Bin Number";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(24, 24);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(84, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Product Number";
|
||||
//
|
||||
// tabPage10
|
||||
//
|
||||
this.tabPage10.Controls.Add(this.toolVerify);
|
||||
this.tabPage10.Controls.Add(this.tbToolIdentification);
|
||||
this.tabPage10.Controls.Add(this.tbToolPartNumber);
|
||||
this.tabPage10.Controls.Add(this.toolNumber);
|
||||
this.tabPage10.Controls.Add(this.toolPartNumber);
|
||||
this.tabPage10.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage10.Name = "tabPage10";
|
||||
this.tabPage10.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage10.Size = new System.Drawing.Size(631, 134);
|
||||
this.tabPage10.TabIndex = 1;
|
||||
this.tabPage10.Text = "PrinterTool";
|
||||
this.tabPage10.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// toolVerify
|
||||
//
|
||||
this.toolVerify.AutoSize = true;
|
||||
this.toolVerify.Checked = true;
|
||||
this.toolVerify.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.toolVerify.Location = new System.Drawing.Point(28, 86);
|
||||
this.toolVerify.Name = "toolVerify";
|
||||
this.toolVerify.Size = new System.Drawing.Size(102, 17);
|
||||
this.toolVerify.TabIndex = 9;
|
||||
this.toolVerify.Text = "isVerifyRequired";
|
||||
this.toolVerify.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tbToolIdentification
|
||||
//
|
||||
this.tbToolIdentification.Location = new System.Drawing.Point(159, 44);
|
||||
this.tbToolIdentification.Name = "tbToolIdentification";
|
||||
this.tbToolIdentification.Size = new System.Drawing.Size(173, 20);
|
||||
this.tbToolIdentification.TabIndex = 8;
|
||||
this.tbToolIdentification.Text = "SiebSXCPPTestA";
|
||||
//
|
||||
// tbToolPartNumber
|
||||
//
|
||||
this.tbToolPartNumber.Location = new System.Drawing.Point(159, 11);
|
||||
this.tbToolPartNumber.Name = "tbToolPartNumber";
|
||||
this.tbToolPartNumber.Size = new System.Drawing.Size(173, 20);
|
||||
this.tbToolPartNumber.TabIndex = 7;
|
||||
this.tbToolPartNumber.Text = "Sieb";
|
||||
//
|
||||
// toolNumber
|
||||
//
|
||||
this.toolNumber.AutoSize = true;
|
||||
this.toolNumber.Location = new System.Drawing.Point(22, 51);
|
||||
this.toolNumber.Name = "toolNumber";
|
||||
this.toolNumber.Size = new System.Drawing.Size(88, 13);
|
||||
this.toolNumber.TabIndex = 6;
|
||||
this.toolNumber.Text = "Tool Number (ID)";
|
||||
//
|
||||
// toolPartNumber
|
||||
//
|
||||
this.toolPartNumber.AutoSize = true;
|
||||
this.toolPartNumber.Location = new System.Drawing.Point(22, 18);
|
||||
this.toolPartNumber.Name = "toolPartNumber";
|
||||
this.toolPartNumber.Size = new System.Drawing.Size(55, 13);
|
||||
this.toolPartNumber.TabIndex = 5;
|
||||
this.toolPartNumber.Text = "Tool Type";
|
||||
//
|
||||
// button27
|
||||
//
|
||||
this.button27.Location = new System.Drawing.Point(25, 80);
|
||||
this.button27.Name = "button27";
|
||||
this.button27.Size = new System.Drawing.Size(170, 23);
|
||||
this.button27.TabIndex = 3;
|
||||
this.button27.Text = "Verify Printer Tool";
|
||||
this.button27.UseVisualStyleBackColor = true;
|
||||
this.button27.Click += new System.EventHandler(this.verifyPrinterTool_Click);
|
||||
//
|
||||
// button26
|
||||
//
|
||||
this.button26.Location = new System.Drawing.Point(25, 28);
|
||||
this.button26.Name = "button26";
|
||||
this.button26.Size = new System.Drawing.Size(170, 23);
|
||||
this.button26.TabIndex = 2;
|
||||
this.button26.Text = "Verify Printer Material";
|
||||
this.button26.UseVisualStyleBackColor = true;
|
||||
this.button26.Click += new System.EventHandler(this.verifyPrinterMaterial_click);
|
||||
//
|
||||
// tabPage7
|
||||
//
|
||||
this.tabPage7.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage7.Name = "tabPage7";
|
||||
this.tabPage7.Size = new System.Drawing.Size(1057, 570);
|
||||
this.tabPage7.TabIndex = 6;
|
||||
this.tabPage7.Text = "Setup Center External Control";
|
||||
this.tabPage7.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// tabPage8
|
||||
//
|
||||
this.tabPage8.Controls.Add(this.mesInterceptorText);
|
||||
this.tabPage8.Controls.Add(this.button33);
|
||||
this.tabPage8.Controls.Add(this.button32);
|
||||
this.tabPage8.Controls.Add(this.button31);
|
||||
this.tabPage8.Controls.Add(this.button30);
|
||||
this.tabPage8.Controls.Add(this.button29);
|
||||
this.tabPage8.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage8.Name = "tabPage8";
|
||||
this.tabPage8.Size = new System.Drawing.Size(1057, 570);
|
||||
this.tabPage8.TabIndex = 7;
|
||||
this.tabPage8.Text = "Dek Mes Interceptor";
|
||||
this.tabPage8.ToolTipText = "Line Control Server requests the MES System to verify the recipe download in Auto" +
|
||||
"-Program-Download mode when the station requests the program data for a PCB whic" +
|
||||
"h has moved into the station. ";
|
||||
this.tabPage8.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// mesInterceptorText
|
||||
//
|
||||
this.mesInterceptorText.Location = new System.Drawing.Point(238, 28);
|
||||
this.mesInterceptorText.Multiline = true;
|
||||
this.mesInterceptorText.Name = "mesInterceptorText";
|
||||
this.mesInterceptorText.Size = new System.Drawing.Size(520, 498);
|
||||
this.mesInterceptorText.TabIndex = 5;
|
||||
//
|
||||
// button33
|
||||
//
|
||||
this.button33.Location = new System.Drawing.Point(15, 215);
|
||||
this.button33.Name = "button33";
|
||||
this.button33.Size = new System.Drawing.Size(203, 23);
|
||||
this.button33.TabIndex = 4;
|
||||
this.button33.Text = "VerifyStartAutoProgramDownload";
|
||||
this.button33.UseVisualStyleBackColor = true;
|
||||
this.button33.Click += new System.EventHandler(this.button33_Click);
|
||||
//
|
||||
// button32
|
||||
//
|
||||
this.button32.Location = new System.Drawing.Point(15, 168);
|
||||
this.button32.Name = "button32";
|
||||
this.button32.Size = new System.Drawing.Size(203, 23);
|
||||
this.button32.TabIndex = 3;
|
||||
this.button32.Text = "VerifyRecipeForAutoProgramDownload";
|
||||
this.button32.UseVisualStyleBackColor = true;
|
||||
this.button32.Click += new System.EventHandler(this.button32_Click);
|
||||
//
|
||||
// button31
|
||||
//
|
||||
this.button31.Location = new System.Drawing.Point(15, 119);
|
||||
this.button31.Name = "button31";
|
||||
this.button31.Size = new System.Drawing.Size(203, 23);
|
||||
this.button31.TabIndex = 2;
|
||||
this.button31.Text = "VerifyRecipeDownload";
|
||||
this.button31.UseVisualStyleBackColor = true;
|
||||
this.button31.Click += new System.EventHandler(this.button31_Click);
|
||||
//
|
||||
// button30
|
||||
//
|
||||
this.button30.Location = new System.Drawing.Point(15, 70);
|
||||
this.button30.Name = "button30";
|
||||
this.button30.Size = new System.Drawing.Size(203, 23);
|
||||
this.button30.TabIndex = 1;
|
||||
this.button30.Text = "VerifyRecipeActivationOnDekPrinter";
|
||||
this.button30.UseVisualStyleBackColor = true;
|
||||
this.button30.Click += new System.EventHandler(this.button30_Click);
|
||||
//
|
||||
// button29
|
||||
//
|
||||
this.button29.Location = new System.Drawing.Point(15, 28);
|
||||
this.button29.Name = "button29";
|
||||
this.button29.Size = new System.Drawing.Size(203, 23);
|
||||
this.button29.TabIndex = 0;
|
||||
this.button29.Text = "VerifyPcbForAutoProgramDownload";
|
||||
this.button29.UseVisualStyleBackColor = true;
|
||||
this.button29.Click += new System.EventHandler(this.button29_Click);
|
||||
//
|
||||
// tabPage11
|
||||
//
|
||||
this.tabPage11.Controls.Add(this.button34);
|
||||
this.tabPage11.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage11.Name = "tabPage11";
|
||||
this.tabPage11.Size = new System.Drawing.Size(1057, 570);
|
||||
this.tabPage11.TabIndex = 8;
|
||||
this.tabPage11.Text = "DisplayService";
|
||||
this.tabPage11.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button34
|
||||
//
|
||||
this.button34.Location = new System.Drawing.Point(35, 42);
|
||||
this.button34.Name = "button34";
|
||||
this.button34.Size = new System.Drawing.Size(288, 38);
|
||||
this.button34.TabIndex = 0;
|
||||
this.button34.Text = "Answer 200002";
|
||||
this.button34.UseVisualStyleBackColor = true;
|
||||
this.button34.Click += new System.EventHandler(this.button34_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1089, 620);
|
||||
this.Controls.Add(this.PrinterTab);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Form1";
|
||||
this.PrinterTab.ResumeLayout(false);
|
||||
this.tabPage1.ResumeLayout(false);
|
||||
this.tabPage2.ResumeLayout(false);
|
||||
this.tabPage3.ResumeLayout(false);
|
||||
this.tabPage4.ResumeLayout(false);
|
||||
this.tabPage4.PerformLayout();
|
||||
this.tabPage5.ResumeLayout(false);
|
||||
this.tabPage6.ResumeLayout(false);
|
||||
this.tabPage6.PerformLayout();
|
||||
this.tabControl1.ResumeLayout(false);
|
||||
this.tabPage9.ResumeLayout(false);
|
||||
this.tabPage9.PerformLayout();
|
||||
this.tabPage10.ResumeLayout(false);
|
||||
this.tabPage10.PerformLayout();
|
||||
this.tabPage8.ResumeLayout(false);
|
||||
this.tabPage8.PerformLayout();
|
||||
this.tabPage11.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TabControl PrinterTab;
|
||||
private System.Windows.Forms.TabPage tabPage1;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.TabPage tabPage2;
|
||||
private System.Windows.Forms.Button button4;
|
||||
private System.Windows.Forms.Button button5;
|
||||
private System.Windows.Forms.Button button6;
|
||||
private System.Windows.Forms.Button button7;
|
||||
private System.Windows.Forms.Button button8;
|
||||
private System.Windows.Forms.Button button24;
|
||||
private System.Windows.Forms.Button button25;
|
||||
private System.Windows.Forms.Button button23;
|
||||
private System.Windows.Forms.Button button21;
|
||||
private System.Windows.Forms.Button button22;
|
||||
private System.Windows.Forms.Button button19;
|
||||
private System.Windows.Forms.Button button20;
|
||||
private System.Windows.Forms.Button button18;
|
||||
private System.Windows.Forms.Button button17;
|
||||
private System.Windows.Forms.Button button16;
|
||||
private System.Windows.Forms.Button button15;
|
||||
private System.Windows.Forms.Button button14;
|
||||
private System.Windows.Forms.Button button13;
|
||||
private System.Windows.Forms.Button button12;
|
||||
private System.Windows.Forms.Button button11;
|
||||
private System.Windows.Forms.Button button10;
|
||||
private System.Windows.Forms.TabPage tabPage3;
|
||||
private System.Windows.Forms.TabPage tabPage4;
|
||||
private System.Windows.Forms.TabPage tabPage5;
|
||||
private System.Windows.Forms.TabPage tabPage6;
|
||||
private System.Windows.Forms.TabPage tabPage7;
|
||||
private System.Windows.Forms.Button button28;
|
||||
private System.Windows.Forms.Button button27;
|
||||
private System.Windows.Forms.Button button26;
|
||||
private System.Windows.Forms.TabPage tabPage8;
|
||||
private System.Windows.Forms.Button button33;
|
||||
private System.Windows.Forms.Button button32;
|
||||
private System.Windows.Forms.Button button31;
|
||||
private System.Windows.Forms.Button button30;
|
||||
private System.Windows.Forms.Button button29;
|
||||
private System.Windows.Forms.TextBox mesInterceptorText;
|
||||
private System.Windows.Forms.TabControl tabControl1;
|
||||
private System.Windows.Forms.TabPage tabPage9;
|
||||
private System.Windows.Forms.CheckBox printerMaterialVerifyRequired;
|
||||
private System.Windows.Forms.TextBox printerMaterialBinNumber;
|
||||
private System.Windows.Forms.TextBox tbMateriaProductNumber;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TabPage tabPage10;
|
||||
private System.Windows.Forms.TextBox DekExtControlResult;
|
||||
private System.Windows.Forms.CheckBox toolVerify;
|
||||
private System.Windows.Forms.TextBox tbToolIdentification;
|
||||
private System.Windows.Forms.TextBox tbToolPartNumber;
|
||||
private System.Windows.Forms.Label toolNumber;
|
||||
private System.Windows.Forms.Label toolPartNumber;
|
||||
private System.Windows.Forms.Button button9;
|
||||
private System.Windows.Forms.TextBox traceResponse;
|
||||
private System.Windows.Forms.ComboBox cbTrace;
|
||||
private System.Windows.Forms.TabPage tabPage11;
|
||||
private System.Windows.Forms.Button button34;
|
||||
private System.Windows.Forms.Button button35;
|
||||
private System.Windows.Forms.Button button37;
|
||||
private System.Windows.Forms.Button button36;
|
||||
}
|
||||
}
|
||||
|
||||
622
interface/asm/dotnet/Oib5xGUI/Form1.cs
Normal file
622
interface/asm/dotnet/Oib5xGUI/Form1.cs
Normal file
@@ -0,0 +1,622 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Asm.As.Oib.Client;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
using com.itac.mes.proxy.sockets;
|
||||
using com.itac.oib;
|
||||
using com.itac.oib.displayservice.contracts.data;
|
||||
using com.itac.oib.linecontrol.contracts.data;
|
||||
using com.itac.oib.monitoring.contracts.data;
|
||||
using com.itac.oib.siplacesetupcenter.contracts.data;
|
||||
using com.itac.oib.traceability.contracts.data;
|
||||
|
||||
namespace oib5._1.GUI
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitService();
|
||||
}
|
||||
|
||||
private SocketAdapter _socketAdapter;
|
||||
private OIBEventHandler _eventHandler;
|
||||
private static List<KeyValue> versionList;
|
||||
|
||||
/// <summary>
|
||||
/// Dieser Adapter übernimmt die Steuerung der Subscriptions und der Endpoints
|
||||
/// </summary>
|
||||
private readonly AdapterControl _adapterControl = new AdapterControl();
|
||||
|
||||
|
||||
private void InitService()
|
||||
{
|
||||
// Ausgabe hilfe für xml-Messages
|
||||
var messageWriter = new MessageWriter();
|
||||
messageWriter.init();
|
||||
_eventHandler = new OIBEventHandler(_adapterControl, messageWriter);
|
||||
|
||||
var config = new AppSettingsReader();
|
||||
try
|
||||
{
|
||||
#if (SERVICE)
|
||||
TraceListener eventLogTraceListener = new EventLogTraceListener(Constants.SERVICE_NAME);
|
||||
eventLogTraceListener.Filter = new EventTypeFilter(SourceLevels.Information);
|
||||
LogHandler.addListener(eventLogTraceListener);
|
||||
#endif
|
||||
// create configuration with some default values (not configurable)
|
||||
|
||||
|
||||
// This is the port where the oib adapter listens for new incoming connections from the data interface
|
||||
var listenPort = (int)config.GetValue("ListenPort", typeof(int));
|
||||
|
||||
// all required configuration values
|
||||
string LineFullPath = (String)config.GetValue("LineName", typeof(String));
|
||||
|
||||
|
||||
|
||||
_eventHandler.LineName = LineFullPath;
|
||||
versionList = new List<KeyValue>();
|
||||
|
||||
String version = GetVersionNr();
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, version);
|
||||
String fileVersion = GetFileVersionNr();
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, fileVersion);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "listening for incoming connections on port " + listenPort);
|
||||
|
||||
var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||
foreach (Assembly assembly in loadedAssemblies)
|
||||
{
|
||||
if (assembly.FullName.StartsWith("AsmApi"))
|
||||
{
|
||||
AssemblyProductAttribute adAttr = (AssemblyProductAttribute)Attribute.GetCustomAttribute(assembly, typeof(AssemblyProductAttribute));
|
||||
versionList.Add(new KeyValue() { key = "AsmApi", value = adAttr.Product });
|
||||
Console.WriteLine("AsmApi" + adAttr.Product);
|
||||
}
|
||||
}
|
||||
|
||||
String firstMachineInLine = "";
|
||||
String lastMachineInLine = "";
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, getHeadertext("Setup Center Access"));
|
||||
var serviceImpl = new OIBServiceImpl(_adapterControl, messageWriter);
|
||||
_eventHandler.serviceImpl = serviceImpl;
|
||||
|
||||
#region Check Setup Center Version and that the configured line is also configured in setup center.
|
||||
var stationFullPaths = new List<string>();
|
||||
|
||||
|
||||
serviceImpl.configuredLineFullPath = LineFullPath;
|
||||
serviceImpl.firstMachineInLine = firstMachineInLine;
|
||||
serviceImpl.lastMachineInLine = lastMachineInLine;
|
||||
|
||||
#endregion
|
||||
/// listener auf externalcontrol bauen
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, getHeadertext("SetupCenterExternalControl"));
|
||||
|
||||
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, getHeadertext("Setup Center Events"));
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, getHeadertext("SIPLACE Pro"));
|
||||
|
||||
try
|
||||
{
|
||||
HashSet<string> versionKeySet = new HashSet<string>();
|
||||
versionKeySet.Add("ConfigurationManager");
|
||||
versionKeySet.Add("ServiceLocator");
|
||||
versionKeySet.Add("DisplayService");
|
||||
versionKeySet.Add("SIPLACE.SetupCenter.MaterialControl");
|
||||
versionKeySet.Add("SIPLACE.Pro.LineControl");
|
||||
versionKeySet.Add("SIPLACE.Monitoring");
|
||||
versionKeySet.Add("SIPLACE.Pro.SPI");
|
||||
// var serviceLocator = _oibClient. GetSeriviceLocatorClient();
|
||||
// var allServices = serviceLocator.GetAllServices();
|
||||
// for (int i = 0; i < allServices.Length; i++)
|
||||
// {
|
||||
// var sd = allServices[i];
|
||||
// if (versionKeySet.Contains(sd.ServiceName) && sd.Configuration != null)
|
||||
// {
|
||||
// versionList.Add(new KeyValue() { key = sd.ServiceName, value = sd.ServiceVersion });
|
||||
// }
|
||||
// }
|
||||
|
||||
_adapterControl.productVersions = versionList;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, getHeadertext("Siplace Pro"));
|
||||
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, getHeadertext("Line Control"));
|
||||
// LogHandler.log(Constants.LOGGER, TraceEventType.Information, "connect to Line Control: " + serviceImpl.OibLineControlAccess.LineControlSession.EndpointAddress OibServiceComputerName);
|
||||
|
||||
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, getHeadertext("Changeover Manager"));
|
||||
// ab client 2.1.0.14 diesen Constructor nutzen
|
||||
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, getHeadertext("iHap Connection"));
|
||||
_socketAdapter = new SocketAdapter(listenPort, _adapterControl, serviceImpl);
|
||||
|
||||
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, getHeadertext("Initialization completed"));
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Critical, "Initialization failed! " + e.Message, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private string getHeadertext(string v)
|
||||
{
|
||||
String separator = "--------------------------------------------------------------------";
|
||||
if (separator.Length < v.Length)
|
||||
{
|
||||
return separator.Substring(0, 10) + " " + v;
|
||||
}
|
||||
else
|
||||
{
|
||||
return separator.Substring(0, 10) + " " + v + " " + separator.Substring(0, separator.Length - v.Length);
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetVersionNr()
|
||||
{
|
||||
var asm = Assembly.GetExecutingAssembly();
|
||||
var asmName = asm.GetName();
|
||||
|
||||
object[] attribs = asm.GetCustomAttributes(typeof(AssemblyProductAttribute), true);
|
||||
string productName = String.Empty;
|
||||
|
||||
if (attribs.Length > 0)
|
||||
{
|
||||
var asmProduct = attribs[0] as AssemblyProductAttribute;
|
||||
productName = asmProduct.Product;
|
||||
}
|
||||
string aVersion = String.Format("{1}.{2}.{3}.{4}",
|
||||
productName, asmName.Version.Major, asmName.Version.Minor, asmName.Version.Build, asmName.Version.Revision);
|
||||
string vers = String.Format("{0} - Version: {1}", productName, aVersion);
|
||||
return (vers);
|
||||
}
|
||||
|
||||
private static string GetFileVersionNr()
|
||||
{
|
||||
var asm = Assembly.GetExecutingAssembly();
|
||||
|
||||
object[] attribs = asm.GetCustomAttributes(typeof(AssemblyProductAttribute), true);
|
||||
string productName = String.Empty;
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
if (attribs.Length > 0)
|
||||
{
|
||||
var asmProduct = attribs[0] as AssemblyProductAttribute;
|
||||
productName = asmProduct.Product;
|
||||
}
|
||||
|
||||
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
|
||||
// string version = fvi.ProductVersion;
|
||||
versionList.Add(new KeyValue() { key = productName, value = fvi.ProductVersion });
|
||||
string version = String.Format("{0} - FileVersion: {1}", productName, fvi.ProductVersion);
|
||||
|
||||
|
||||
String[] xVersion = fvi.Comments.Split();
|
||||
String[] mesVersion = xVersion[3].Split('=');
|
||||
versionList.Add(new KeyValue() { key = mesVersion[0], value = mesVersion[1] });
|
||||
String[] intfVersion = xVersion[4].Split('=');
|
||||
versionList.Add(new KeyValue() { key = intfVersion[0], value = intfVersion[1] });
|
||||
return (version);
|
||||
}
|
||||
|
||||
private void printerCoverOpened_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrinterCoverOpenedReport coverOpenedReport = new PrinterCoverOpenedReport();
|
||||
|
||||
coverOpenedReport.Machine = getMachinelocator();
|
||||
coverOpenedReport.SetupPath = "setupPath";
|
||||
_eventHandler.printerCoverOpened(coverOpenedReport);
|
||||
}
|
||||
|
||||
private MachineLocator getMachinelocator()
|
||||
{
|
||||
MachineLocator machinelocator = new MachineLocator();
|
||||
machinelocator.LinePath = "DekLine";
|
||||
machinelocator.MachineId = "01234";
|
||||
machinelocator.MachineName = "DekNeoHorizon";
|
||||
machinelocator.MachineType = "DEK NeoHorizon 03 iX";
|
||||
return machinelocator;
|
||||
}
|
||||
|
||||
private void printerCoverClosed_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrinterCoverClosedReport coverClosedReport = new PrinterCoverClosedReport();
|
||||
coverClosedReport.Machine = getMachinelocator();
|
||||
coverClosedReport.SetupPath = "setupPath";
|
||||
_eventHandler.printerCoverClosed(coverClosedReport);
|
||||
}
|
||||
|
||||
private void PrinterMaterialVerified_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrinterMaterialVerifiedReport report = new PrinterMaterialVerifiedReport();
|
||||
_eventHandler.printerMaterialVerified(report);
|
||||
}
|
||||
|
||||
private void PrinterMaterialUnverified_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrinterMaterialUnverifiedReport report = new PrinterMaterialUnverifiedReport();
|
||||
_eventHandler.printerMaterialUnverified(report);
|
||||
}
|
||||
|
||||
private void PrinterToolVerified_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrinterToolVerifiedReport report = new PrinterToolVerifiedReport();
|
||||
_eventHandler.printerToolVerified(report);
|
||||
}
|
||||
|
||||
private void PrinterToolUnverified_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrinterToolUnverifiedReport report = new PrinterToolUnverifiedReport();
|
||||
_eventHandler.printerToolUnverified(report);
|
||||
}
|
||||
|
||||
private void printerCapabilitiesChanged_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrinterCapabilitiesChangedReport report = new PrinterCapabilitiesChangedReport();
|
||||
_eventHandler.printerCapabilitiesChanged(report);
|
||||
}
|
||||
|
||||
private void printerconsumablesUpdate_click(object sender, EventArgs e)
|
||||
{
|
||||
PrinterConsumablesUpdatedReport report = new PrinterConsumablesUpdatedReport();
|
||||
_eventHandler.printerConsumablesUpdated(report);
|
||||
}
|
||||
|
||||
private void printerDeviceStateChange_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void feederPlaced_Click(object sender, EventArgs e)
|
||||
{
|
||||
FeederPlacedReport args = new FeederPlacedReport();
|
||||
_eventHandler.feederPlaced(args);
|
||||
}
|
||||
|
||||
private void feederRemoved_click(object sender, EventArgs e)
|
||||
{
|
||||
FeederRemovedReport args = new FeederRemovedReport();
|
||||
_eventHandler.feederRemoved(args);
|
||||
}
|
||||
|
||||
private void tablePlaced_Click(object sender, EventArgs e)
|
||||
{
|
||||
TablePlacedReport args = new TablePlacedReport();
|
||||
_eventHandler.tablePlaced(args);
|
||||
}
|
||||
|
||||
private void PackquantityChanged_Click(object sender, EventArgs e)
|
||||
{
|
||||
PackagingQuantityChangedReport args = new PackagingQuantityChangedReport();
|
||||
_eventHandler.packagingQuantityChanged(args);
|
||||
}
|
||||
|
||||
private void loclStateChanged_Click(object sender, EventArgs e)
|
||||
{
|
||||
LockStateChangedReport args = new LockStateChangedReport();
|
||||
_eventHandler.lockStateChanged(args);
|
||||
}
|
||||
|
||||
private void spliceChainSplit_Click(object sender, EventArgs e)
|
||||
{
|
||||
SpliceChainSplitReport args = new SpliceChainSplitReport();
|
||||
_eventHandler.spliceChainSplit(args);
|
||||
}
|
||||
|
||||
private void tableRemoved_Click(object sender, EventArgs e)
|
||||
{
|
||||
TableRemovedReport args = new TableRemovedReport();
|
||||
_eventHandler.tableRemoved(args);
|
||||
}
|
||||
|
||||
|
||||
private void button18_Click(object sender, EventArgs e)
|
||||
{
|
||||
MaterialMovedReport a = new MaterialMovedReport();
|
||||
_eventHandler.materialMoved(a);
|
||||
}
|
||||
|
||||
private void boardProduced_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Message from text
|
||||
com.itac.oib.traceability.contracts.data.TraceabilityData trcData
|
||||
= new com.itac.oib.traceability.contracts.data.TraceabilityData();
|
||||
_eventHandler.boardProduced(trcData);
|
||||
}
|
||||
|
||||
private void verifyPrinterMaterial_click(object sender, EventArgs e)
|
||||
{
|
||||
VerifyPrinterMaterialRequest requestData = new VerifyPrinterMaterialRequest();
|
||||
requestData.PrinterMaterial = new com.itac.oib.siplacesetupcenter.contracts.data.PrinterMaterial();
|
||||
requestData.PrinterMaterial.Barcode = printerMaterialBinNumber.Text;
|
||||
requestData.PrinterMaterial.Machine = getMachinelocator();
|
||||
requestData.PrinterMaterial.Message = "";
|
||||
requestData.PrinterMaterial.Name = "";
|
||||
requestData.PrinterMaterial.PrinterValidationStatus = 0;
|
||||
requestData.PrinterMaterial.ProductInfo = new ProductInfo();
|
||||
requestData.PrinterMaterial.ProductInfo.ConveyorLane = 0; //???
|
||||
requestData.PrinterMaterial.ProductInfo.DateModified = DateTime.Now;
|
||||
requestData.PrinterMaterial.ProductInfo.ProductId = tbMateriaProductNumber.Text;
|
||||
requestData.PrinterMaterial.ProductInfo.ProductName = tbMateriaProductNumber.Text;
|
||||
|
||||
requestData.PrinterMaterial.SetupPath = "setup_here";
|
||||
requestData.PrinterMaterial.VerificationItemId = "PrintMedium";
|
||||
requestData.PrinterMaterial.VerificationRequired = printerMaterialVerifyRequired.Checked ? 1 : 0;
|
||||
VerifyPrinterMaterialResponse response = _eventHandler.verifyPrinterMaterial(requestData);
|
||||
|
||||
|
||||
ItacXmlSerializer serializer = new ItacXmlSerializer();
|
||||
StringBuilder v = serializer.serialize(requestData);
|
||||
|
||||
v.Append(serializer.serialize(response));
|
||||
DekExtControlResult.Text = v.ToString();
|
||||
}
|
||||
|
||||
private void verifyPrinterTool_Click(object sender, EventArgs e)
|
||||
{
|
||||
VerifyPrinterToolRequest requestData = new VerifyPrinterToolRequest();
|
||||
requestData.PrinterTool = new com.itac.oib.siplacesetupcenter.contracts.data.PrinterTool();
|
||||
requestData.PrinterTool.Machine = getMachinelocator();
|
||||
requestData.PrinterTool.Barcode = tbToolIdentification.Text;
|
||||
requestData.PrinterTool.Message = "";
|
||||
requestData.PrinterTool.Name = "";
|
||||
requestData.PrinterTool.PrinterValidationStatus = 0;
|
||||
requestData.PrinterTool.ProductInfo = new ProductInfo();
|
||||
requestData.PrinterTool.ProductInfo.ConveyorLane = 1;
|
||||
requestData.PrinterTool.ProductInfo.DateModified = DateTime.Now;
|
||||
requestData.PrinterTool.ProductInfo.ProductId = tbToolPartNumber.Text;
|
||||
requestData.PrinterTool.ProductInfo.ProductName = tbToolPartNumber.Text;
|
||||
requestData.PrinterTool.SetupPath = "setup_here";
|
||||
requestData.PrinterTool.VerificationItemId = "Screen";
|
||||
requestData.PrinterTool.VerificationRequired = toolVerify.Checked ? 1 : 0;
|
||||
VerifyPrinterToolResponse response = _eventHandler.verifyPrinterTool(requestData);
|
||||
|
||||
ItacXmlSerializer serializer = new ItacXmlSerializer();
|
||||
StringBuilder v = serializer.serialize(requestData);
|
||||
|
||||
v.Append(serializer.serialize(response));
|
||||
DekExtControlResult.Text = v.ToString();
|
||||
}
|
||||
|
||||
private void button29_Click(object sender, EventArgs e)
|
||||
{
|
||||
com.itac.oib.linecontrol.contracts.data.VerifyPcbForAutoProgramDownloadRequest k = new com.itac.oib.linecontrol.contracts.data.VerifyPcbForAutoProgramDownloadRequest();
|
||||
|
||||
ItacXmlSerializer serializer = new ItacXmlSerializer();
|
||||
StringBuilder v = serializer.serialize(k);
|
||||
|
||||
var x = _eventHandler.verifyPcbForAutoProgramDownload(k);
|
||||
|
||||
v.Append(serializer.serialize(x));
|
||||
mesInterceptorText.Text = v.ToString();
|
||||
}
|
||||
|
||||
private void button30_Click(object sender, EventArgs e)
|
||||
{
|
||||
com.itac.oib.linecontrol.contracts.data.VerifyRecipeActivationOnDekPrinterRequest k = new com.itac.oib.linecontrol.contracts.data.VerifyRecipeActivationOnDekPrinterRequest();
|
||||
// set Values
|
||||
k.DeviceLocator = new DeviceLocator();
|
||||
k.DeviceLocator.LineName = "DekLine";
|
||||
k.DeviceLocator.MachineId = "0";
|
||||
k.DeviceLocator.MachineName = "DekNeoHorizon";
|
||||
k.DeviceLocator.MachineType = "DEK NeoHorizon 03 iX";
|
||||
|
||||
k.DekPrinterRecipeVerificationData = new DekPrinterRecipeVerificationData();
|
||||
k.DekPrinterRecipeVerificationData.ConveyorLane = 0;
|
||||
k.DekPrinterRecipeVerificationData.DateModified = DateTime.Now.ToString();
|
||||
k.DekPrinterRecipeVerificationData.ProductId = "product";
|
||||
k.DekPrinterRecipeVerificationData.ProductName = "SXCPP_TESTA";
|
||||
|
||||
ItacXmlSerializer serializer = new ItacXmlSerializer();
|
||||
StringBuilder v = serializer.serialize(k);
|
||||
|
||||
var x = _eventHandler.verifyRecipeActivationOnDekPrinter(k);
|
||||
|
||||
v.Append(serializer.serialize(x));
|
||||
mesInterceptorText.Text = v.ToString();
|
||||
}
|
||||
|
||||
private void button31_Click(object sender, EventArgs e)
|
||||
{
|
||||
com.itac.oib.linecontrol.contracts.data.VerifyRecipeDownloadRequest k = new com.itac.oib.linecontrol.contracts.data.VerifyRecipeDownloadRequest();
|
||||
k.LineName = "LineName";
|
||||
k.DownloadVerificationData = new DownloadVerificationData[1];
|
||||
k.DownloadVerificationData[0] = new DownloadVerificationData();
|
||||
k.DownloadVerificationData[0].Lane = 1;
|
||||
k.DownloadVerificationData[0].OrderId = "dekOrderNo";
|
||||
k.DownloadVerificationData[0].ProductionSchedule = "ProductionSchedule";
|
||||
k.DownloadVerificationData[0].ProductionScheduleElementId = "-1";
|
||||
k.DownloadVerificationData[0].Recipe = "Recipe";
|
||||
|
||||
ItacXmlSerializer serializer = new ItacXmlSerializer();
|
||||
StringBuilder v = serializer.serialize(k);
|
||||
|
||||
var x = _eventHandler.verifyRecipeDownload(k);
|
||||
|
||||
v.Append(serializer.serialize(x));
|
||||
mesInterceptorText.Text = v.ToString();
|
||||
}
|
||||
|
||||
private void button32_Click(object sender, EventArgs e)
|
||||
{
|
||||
com.itac.oib.linecontrol.contracts.data.VerifyRecipeForAutoProgramDownloadRequest k = new com.itac.oib.linecontrol.contracts.data.VerifyRecipeForAutoProgramDownloadRequest();
|
||||
|
||||
ItacXmlSerializer serializer = new ItacXmlSerializer();
|
||||
StringBuilder v = serializer.serialize(k);
|
||||
|
||||
var x = _eventHandler.verifyRecipeForAutoProgramDownload(k);
|
||||
|
||||
v.Append(serializer.serialize(x));
|
||||
mesInterceptorText.Text = v.ToString();
|
||||
}
|
||||
|
||||
private void button33_Click(object sender, EventArgs e)
|
||||
{
|
||||
com.itac.oib.linecontrol.contracts.data.VerifyRecipeForAutoProgramDownloadRequest k = new com.itac.oib.linecontrol.contracts.data.VerifyRecipeForAutoProgramDownloadRequest();
|
||||
|
||||
ItacXmlSerializer serializer = new ItacXmlSerializer();
|
||||
StringBuilder v = serializer.serialize(k);
|
||||
|
||||
var x = _eventHandler.verifyStartAutoProgramDownload(k);
|
||||
|
||||
v.Append(serializer.serialize(x));
|
||||
mesInterceptorText.Text = v.ToString();
|
||||
}
|
||||
|
||||
private void printerTraceData_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Message from text
|
||||
com.itac.oib.traceability.contracts.data.TraceabilityData trcData
|
||||
= new com.itac.oib.traceability.contracts.data.TraceabilityData();
|
||||
trcData.Line = getMachinelocator().LinePath;
|
||||
trcData.Station = getMachinelocator().MachineName;
|
||||
trcData.Lane = ConveyorLanes.RIGHT.ToString();
|
||||
trcData.PrePlacement = new PrePlacement();
|
||||
|
||||
PrinterData printerData = new PrinterData();
|
||||
trcData.PrePlacement.Printers = new PrinterData[] { printerData };
|
||||
|
||||
printerData.BoardsSinceLastClean = 4;
|
||||
printerData.BoardsSincePasteReplenish = 3;
|
||||
printerData.BoardState = 0;
|
||||
printerData.Conditions = new PrinterEnvironmentalConditions();
|
||||
printerData.Conditions.Humidity = 45.5;
|
||||
printerData.Conditions.Temperature = 22.6;
|
||||
printerData.DateTime = DateTime.Now;
|
||||
printerData.IdleTime = 14.5;
|
||||
printerData.Individual = new PrinterBoardIndividual();
|
||||
printerData.Individual.BatchID = "batch";
|
||||
printerData.Individual.BoardBarcode = "serial";
|
||||
printerData.Individual.BoardNo = 1;
|
||||
printerData.Individual.BoardWhisperGuid = "whisperGuid";
|
||||
printerData.MachineID = "";
|
||||
com.itac.oib.traceability.contracts.data.PrinterMaterial printerMaterial = new com.itac.oib.traceability.contracts.data.PrinterMaterial();
|
||||
printerData.Materials = new com.itac.oib.traceability.contracts.data.PrinterMaterial[] { printerMaterial };
|
||||
// Paste...
|
||||
printerMaterial.Barcode = "GutePaste";
|
||||
printerMaterial.Name = "Paste1";
|
||||
printerMaterial.VerificationItemId = "PRINT_MEDIUM";
|
||||
printerData.OperatorID = "operator";
|
||||
printerData.PostSPCData = new PrinterPostSPCData();
|
||||
printerData.PreSPCData = new PrinterPreSPCData();
|
||||
printerData.PrintDirection = 0;
|
||||
printerData.ProcessData = new PrinterPrintProcess();
|
||||
|
||||
printerData.Recipe = new PrinterRecipe();
|
||||
printerData.SqueegeePrintDistance = 4;
|
||||
|
||||
com.itac.oib.traceability.contracts.data.PrinterTool printerTool = new com.itac.oib.traceability.contracts.data.PrinterTool();
|
||||
com.itac.oib.traceability.contracts.data.PrinterTool printerTool2 = new com.itac.oib.traceability.contracts.data.PrinterTool();
|
||||
printerData.Tools = new com.itac.oib.traceability.contracts.data.PrinterTool[] { printerTool, printerTool2 };
|
||||
printerTool.Barcode = "SiebSXCPPTestA2";
|
||||
printerTool.Name = "Sieb";
|
||||
printerTool.VerificationItemId = "SCREEN";
|
||||
|
||||
printerTool2.Barcode = "RakelSxCppTestA";
|
||||
printerTool2.Name = "Rakel";
|
||||
printerTool2.VerificationItemId = "SQUEEGEE";
|
||||
|
||||
switch (cbTrace.SelectedIndex)
|
||||
{
|
||||
case 1:
|
||||
trcData.PrePlacement.Printers = new PrinterData[] { };
|
||||
break;
|
||||
case 2:
|
||||
trcData.PrePlacement.Printers[0].MachineID = null;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
BoardProducedResponse response = _eventHandler.boardProduced(trcData);
|
||||
ItacXmlSerializer serializer = new ItacXmlSerializer();
|
||||
StringBuilder v = serializer.serialize(trcData);
|
||||
v.Append("\n");
|
||||
|
||||
v.Append(serializer.serialize(response));
|
||||
traceResponse.Text = v.ToString();
|
||||
}
|
||||
|
||||
private void button34_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConfirmationReceivedRequest confirmationReceivedRequest = new ConfirmationReceivedRequest();
|
||||
confirmationReceivedRequest.Answer = new Answer();
|
||||
confirmationReceivedRequest.Answer.AnswerText = "200002 | Top | SXCPPTestA | LEITERPLATTE REFLOW-GR Einseitig";
|
||||
confirmationReceivedRequest.SubAnswer = new SubAnswer();
|
||||
confirmationReceivedRequest.SubAnswer.SubAnswerText = "DekLine:DekNeoHorizon:BOTH:product";
|
||||
|
||||
_eventHandler.confirmationReceivedEvent(confirmationReceivedRequest);
|
||||
}
|
||||
|
||||
private void button35_Click(object sender, EventArgs e)
|
||||
{
|
||||
StationEventComposite sec = new StationEventComposite();
|
||||
sec.BoardNumber = 2;
|
||||
// sec.completionStatusType = CompletionStatusType.MESSAGECOMPLETE;
|
||||
sec.Conveyor = ConveyorType.LEFT;
|
||||
sec.FactoryLayoutPath = "factLayPath";
|
||||
// sec.gantryStates = null;
|
||||
// sec.processingLocationStates = null;
|
||||
sec.Station = new Station();
|
||||
sec.Station.ComputerAddress = "localhost";
|
||||
sec.Station.FullPath = "fullPath";
|
||||
sec.Station.LineFullPath = "lineFullPath";
|
||||
sec.Station.LineName = "lineName";
|
||||
sec.Station.Name = "DekHorizon";
|
||||
|
||||
sec.StationTime = DateTime.Now;
|
||||
sec.StateTransitions = new StateTransition[] { new StateTransition() };
|
||||
|
||||
_eventHandler.stationEventReceived(sec);
|
||||
}
|
||||
|
||||
private void button36_Click(object sender, EventArgs e)
|
||||
{
|
||||
com.itac.oib.client.customextensions.VirtualInkspotHandlerBoardRequest evt = new com.itac.oib.client.customextensions.VirtualInkspotHandlerBoardRequest();
|
||||
com.itac.oib.boardgatekeeper.contracts.data.BoardRequestData brd = new com.itac.oib.boardgatekeeper.contracts.data.BoardRequestData();
|
||||
brd.Board = new com.itac.oib.boardgatekeeper.contracts.data.BoardData();
|
||||
brd.Board.Barcode = "SMT004578";
|
||||
brd.Board.BoardTime = DateTime.Now;
|
||||
evt.RecipeFullPath = "system\\SXCPP_TESTA-TOP";
|
||||
evt.BoardRequestData = brd;
|
||||
_eventHandler.virtualInkspotBoardRequest(evt);
|
||||
}
|
||||
|
||||
private void button22_Click(object sender, EventArgs e)
|
||||
{
|
||||
PackagingUnitCreatedReport pucr = new PackagingUnitCreatedReport();
|
||||
pucr.FactoryLocation = "";
|
||||
pucr.TimeStamp = DateTime.Now;
|
||||
PackagingUnitManagementData pumd = new PackagingUnitManagementData();
|
||||
pumd.Date = DateTime.Now;
|
||||
pumd.Source = 2;
|
||||
pumd.PackagingUnit = new com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnit();
|
||||
pucr.PackagingUnitManagementDataList = new PackagingUnitManagementData[] { pumd };
|
||||
_eventHandler.packagingUnitCreated(pucr);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
interface/asm/dotnet/Oib5xGUI/Form1.resx
Normal file
120
interface/asm/dotnet/Oib5xGUI/Form1.resx
Normal 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>
|
||||
172
interface/asm/dotnet/Oib5xGUI/MessageFactory.cs
Normal file
172
interface/asm/dotnet/Oib5xGUI/MessageFactory.cs
Normal file
@@ -0,0 +1,172 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using com.itac.oib.traceability.contracts.data;
|
||||
|
||||
namespace oib5._1.GUI
|
||||
{
|
||||
internal class MessageFactory
|
||||
{
|
||||
|
||||
private Dictionary<String, Type> typeMap = new Dictionary<string, Type>();
|
||||
|
||||
public MessageFactory()
|
||||
{
|
||||
typeMap.Add("TraceabilityData", typeof(TraceabilityData));
|
||||
typeMap.Add("comp", typeof(ComponentType));
|
||||
}
|
||||
|
||||
internal void createMessage(string text)
|
||||
{
|
||||
// read the xml and try to create a message accordingly to the text...
|
||||
XmlReader xmlReader = XmlReader.Create(new StringReader(text));
|
||||
// read root Tag
|
||||
|
||||
while (xmlReader.Read())
|
||||
{
|
||||
switch (xmlReader.NodeType)
|
||||
{
|
||||
case XmlNodeType.Element: // The root node is an element.
|
||||
string rootType = xmlReader.Name;
|
||||
|
||||
Type t = null;
|
||||
if (typeMap.ContainsKey(rootType))
|
||||
{
|
||||
t = typeMap[rootType];
|
||||
}
|
||||
if (t != null)
|
||||
{
|
||||
// abbildung von Namen auf Felder, alles in lowercase...
|
||||
Dictionary<String, PropertyInfo> propertyMap = new Dictionary<string, PropertyInfo>();
|
||||
PropertyInfo[] properties = t.GetProperties();
|
||||
foreach (PropertyInfo propertyInfo in properties)
|
||||
{
|
||||
propertyMap.Add(propertyInfo.Name.ToLower(), propertyInfo);
|
||||
}
|
||||
|
||||
// Read this type...
|
||||
// create an instance
|
||||
Object instance = Activator.CreateInstance(t);
|
||||
populateInstance(instance, t, propertyMap, xmlReader);
|
||||
}
|
||||
break;
|
||||
|
||||
// case XmlNodeType.EndElement: //Display the end of the element.
|
||||
// Console.Write("</" + xmlReader.Name);
|
||||
// Console.WriteLine(">");
|
||||
// break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void populateInstance(object instance, Type t, Dictionary<String, PropertyInfo> propertyMap, XmlReader xmlReader)
|
||||
{
|
||||
while (xmlReader.Read())
|
||||
{
|
||||
switch (xmlReader.NodeType)
|
||||
{
|
||||
case XmlNodeType.Element: // The root node is an element.
|
||||
string fieldName = xmlReader.Name.ToLower();
|
||||
//find the corresponding field
|
||||
if (propertyMap.ContainsKey(fieldName))
|
||||
{
|
||||
// einfache werte direkt setzen
|
||||
PropertyInfo thisProp = propertyMap[fieldName];
|
||||
switch (thisProp.PropertyType.Name.ToLower())
|
||||
{
|
||||
case "string": setStringValue(instance, thisProp, xmlReader); break;
|
||||
case "datetime": setDateTimeValue(instance, thisProp, xmlReader); break;
|
||||
case "Boolean":
|
||||
case "bool": setBoolValue(instance, thisProp, xmlReader); break;
|
||||
case "int":
|
||||
case "int16":
|
||||
case "int32":
|
||||
case "int64":
|
||||
case "uint":
|
||||
case "uint16":
|
||||
case "uint32":
|
||||
case "uint64": setIntValue(instance, thisProp, xmlReader); break;
|
||||
case "double": setDoubleValue(instance, thisProp, xmlReader); break;
|
||||
default:
|
||||
if (thisProp.PropertyType.Namespace.StartsWith("com.itac."))
|
||||
{
|
||||
// complex type..., arrays, lists, dictionary
|
||||
//
|
||||
if (thisProp.PropertyType.IsArray)
|
||||
{
|
||||
Console.WriteLine("array type " + thisProp.PropertyType.Name);
|
||||
}
|
||||
else if (thisProp.PropertyType.IsGenericType)
|
||||
{
|
||||
Console.WriteLine("generic type " + thisProp.PropertyType.Name);
|
||||
}
|
||||
else {
|
||||
// type direkt...
|
||||
Console.WriteLine("direct type " + thisProp.PropertyType.Name);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case XmlNodeType.EndElement: //Display the end of the element.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setDoubleValue(object instance, PropertyInfo thisProp, XmlReader xmlReader)
|
||||
{
|
||||
xmlReader.Read();
|
||||
if (xmlReader.NodeType == XmlNodeType.Text)
|
||||
{
|
||||
double simpleValue = double.Parse(xmlReader.Value);
|
||||
thisProp.SetValue(instance, simpleValue);
|
||||
}
|
||||
}
|
||||
|
||||
private void setBoolValue(object instance, PropertyInfo thisProp, XmlReader xmlReader)
|
||||
{
|
||||
xmlReader.Read();
|
||||
if (xmlReader.NodeType == XmlNodeType.Text)
|
||||
{
|
||||
bool simpleValue = bool.Parse(xmlReader.Value);
|
||||
thisProp.SetValue(instance, simpleValue);
|
||||
}
|
||||
}
|
||||
|
||||
private void setIntValue(object instance, PropertyInfo thisProp, XmlReader xmlReader)
|
||||
{
|
||||
xmlReader.Read();
|
||||
if (xmlReader.NodeType == XmlNodeType.Text)
|
||||
{
|
||||
int simpleValue = int.Parse(xmlReader.Value);
|
||||
thisProp.SetValue(instance, simpleValue);
|
||||
}
|
||||
}
|
||||
|
||||
private void setDateTimeValue(object instance, PropertyInfo thisProp, XmlReader xmlReader)
|
||||
{
|
||||
xmlReader.Read();
|
||||
if (xmlReader.NodeType == XmlNodeType.Text)
|
||||
{
|
||||
DateTime simpleValue = DateTime.Parse(xmlReader.Value);
|
||||
thisProp.SetValue(instance, simpleValue);
|
||||
}
|
||||
}
|
||||
|
||||
private void setStringValue(object instance, PropertyInfo thisProp, XmlReader xmlReader)
|
||||
{
|
||||
xmlReader.Read();
|
||||
if (xmlReader.NodeType == XmlNodeType.Text)
|
||||
{
|
||||
string simpleValue = xmlReader.Value;
|
||||
thisProp.SetValue(instance, simpleValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
218
interface/asm/dotnet/Oib5xGUI/Oib5xGUI.csproj
Normal file
218
interface/asm/dotnet/Oib5xGUI/Oib5xGUI.csproj
Normal file
@@ -0,0 +1,218 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D3FB410B-1F7E-458E-9B60-9541F296D00E}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>oib5._1.GUI</RootNamespace>
|
||||
<AssemblyName>oib5.1.GUI</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>oib5._1.GUI.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>icon_itac_logo_oib.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="artes-dotnet, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\libs\itac\artes-dotnet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASM.AS.OIB.Client">
|
||||
<HintPath>..\libs\asm5client\ASM.AS.OIB.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASM.AS.OIB.Client.CustomExtensions">
|
||||
<HintPath>..\libs\asm5client\ASM.AS.OIB.Client.CustomExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.Common">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.Common.Proxy">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.Common.Proxy.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.ConfigurationManager.Contracts">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.ConfigurationManager.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.ConfigurationManager.Proxy">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.ConfigurationManager.Proxy.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASM.AS.OIB.DisplayService.Contracts">
|
||||
<HintPath>..\libs\oib5\ASM.AS.OIB.DisplayService.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASM.AS.OIB.DisplayService.Proxy">
|
||||
<HintPath>..\libs\oib5\ASM.AS.OIB.DisplayService.Proxy.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASM.AS.OIB.HealthCheck.Contracts">
|
||||
<HintPath>..\libs\oib5\ASM.AS.OIB.HealthCheck.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.Monitoring.Contracts">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.Monitoring.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.Monitoring.Proxy">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.Monitoring.Proxy.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASM.AS.OIB.ServiceLocator.Contracts">
|
||||
<HintPath>..\libs\oib5\ASM.AS.OIB.ServiceLocator.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.SIPLACEPro.Contracts">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.SIPLACEPro.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.SIPLACEPro.LineControl.Contracts">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.SIPLACEPro.LineControl.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.SIPLACEPro.LineControl.Proxy">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.SIPLACEPro.LineControl.Proxy.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.SIPLACEPro.Optimizer.Contracts">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.SIPLACEPro.Optimizer.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.SIPLACEPro.Optimizer.Proxy">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.SIPLACEPro.Optimizer.Proxy.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.SIPLACEPro.Proxy">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.SIPLACEPro.Proxy.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.SIPLACESetupCenter.Contracts">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.SIPLACESetupCenter.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.SiplaceSetupCenter.Proxy">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.SiplaceSetupCenter.Proxy.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.WS.Common">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.WS.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Asm.As.Oib.WS.Eventing.Contracts">
|
||||
<HintPath>..\libs\oib5\Asm.As.Oib.WS.Eventing.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="AsmApi5x">
|
||||
<HintPath>..\libs\itac\AsmApi5x.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\libs\itac\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MessageFactory.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="src\main\csharp\DisplayServiceReceiver.cs" />
|
||||
<Compile Include="src\main\csharp\LineControlMesInterceptorReceiver.cs" />
|
||||
<Compile Include="src\main\csharp\BoardGateKeeperReceiver.cs" />
|
||||
<Compile Include="src\main\csharp\ChangeoverReceiver.cs" />
|
||||
<Compile Include="src\main\csharp\com\IReceiver.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\mes\domain\OIBEvents.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\mes\domain\OIBService.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\mes\proxy\business\OIBEventHandler.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\mes\proxy\business\OIBServiceImpl.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\mes\proxy\Constants.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\mes\proxy\LogHandler.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\mes\proxy\sockets\IhapEventChannel.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\mes\proxy\sockets\IhapHandler.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\mes\proxy\sockets\SocketAdapter.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\AdapterControl.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\IAdapterControl.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\IAdapterNotify.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\ItacXmlSerializer.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\KeyValue.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\linecontrol\service\OibClientService.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\linecontrol\service\OibLineControlAccess.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\linecontrol\service\OibService.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\MessageWriter.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\QueueInfo.cs" />
|
||||
<Compile Include="src\main\csharp\com\itac\oib\siplacepro\service\SiplacePro.cs" />
|
||||
<Compile Include="src\main\csharp\MonitoringReceiver.cs" />
|
||||
<Compile Include="src\main\csharp\ReceiverTemplate.cs" />
|
||||
<Compile Include="src\main\csharp\DekPrinterExternalControlReceiver.cs" />
|
||||
<Compile Include="src\main\csharp\SetupCenterExternalControlReceiver.cs" />
|
||||
<Compile Include="src\main\csharp\SetupCenterReceiver.cs" />
|
||||
<Compile Include="src\main\csharp\SpiReceiver.cs" />
|
||||
<Compile Include="src\main\csharp\TraceabilityReceiver.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<None Include="src\main\resources\app.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="icon_itac_logo_oib.ico" />
|
||||
<Content Include="src\main\resources\Readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Oib5xMapper\Oib5xMapper.csproj">
|
||||
<Project>{9c9a30e3-68e7-4cd5-9dbb-4e54e70fb22c}</Project>
|
||||
<Name>Oib5xMapper</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
75
interface/asm/dotnet/Oib5xGUI/Program.cs
Normal file
75
interface/asm/dotnet/Oib5xGUI/Program.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Asm.As.Oib.Client;
|
||||
using Asm.As.Oib.Client.Configuration;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.oib;
|
||||
|
||||
namespace oib5._1.GUI
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Der Haupteinstiegspunkt für die Anwendung.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
|
||||
{
|
||||
if (e.IsTerminating)
|
||||
{
|
||||
object o = e.ExceptionObject;
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Critical, "### general exception handling ###");
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Critical, o.ToString());
|
||||
}
|
||||
};
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// OnStart(): Put startup code here
|
||||
/// - Start threads, get inital data, etc.
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/* protected override void OnStart(string[] args)
|
||||
{
|
||||
InitService();
|
||||
base.OnStart(args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OnStop(): Put your stop code here
|
||||
/// - Stop threads, set final data, etc.
|
||||
/// </summary>
|
||||
protected override void OnStop()
|
||||
{
|
||||
ShutdownService();
|
||||
base.OnStop();
|
||||
}
|
||||
*/
|
||||
/// <summary>
|
||||
/// OnShutdown(): Called when the System is shutting down
|
||||
/// - Put code here when you need special handling
|
||||
/// of code that deals with a system shutdown, such
|
||||
/// as saving special data before shutdown.
|
||||
/// </summary>
|
||||
/* protected override void OnShutdown()
|
||||
{
|
||||
ShutdownService();
|
||||
base.OnShutdown();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
36
interface/asm/dotnet/Oib5xGUI/Properties/AssemblyInfo.cs
Normal file
36
interface/asm/dotnet/Oib5xGUI/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die einer Assembly zugeordnet sind.
|
||||
[assembly: AssemblyTitle("oib5.1.GUI")]
|
||||
[assembly: AssemblyDescription("iTAC.OIB.Adapter OIB ${asm.oib.version}: MES=${mes.suite.version} INTF=${mes.interface.version}/${timestamp}")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("oib5.1.GUI")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("d3fb410b-1f7e-458e-9b60-9541f296d00e")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("3.2.0.42")]
|
||||
63
interface/asm/dotnet/Oib5xGUI/Properties/Resources.Designer.cs
generated
Normal file
63
interface/asm/dotnet/Oib5xGUI/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace oib5._1.GUI.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("oib5._1.GUI.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
interface/asm/dotnet/Oib5xGUI/Properties/Resources.resx
Normal file
117
interface/asm/dotnet/Oib5xGUI/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
26
interface/asm/dotnet/Oib5xGUI/Properties/Settings.Designer.cs
generated
Normal file
26
interface/asm/dotnet/Oib5xGUI/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace oib5._1.GUI.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
BIN
interface/asm/dotnet/Oib5xGUI/icon_itac_logo_oib.ico
Normal file
BIN
interface/asm/dotnet/Oib5xGUI/icon_itac_logo_oib.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
31
interface/asm/dotnet/Oib5xGUI/src/main/assembly/bin.xml
Normal file
31
interface/asm/dotnet/Oib5xGUI/src/main/assembly/bin.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
|
||||
<id>bin</id>
|
||||
<baseDirectory>/</baseDirectory>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/src</directory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/lib</directory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/OibAdapterUnitTests</directory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/Properties</directory>
|
||||
<filtered>true</filtered>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/</directory>
|
||||
<includes>
|
||||
<include>*.ico</include>
|
||||
<include>*.csproj</include>
|
||||
<include>*.sln</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -0,0 +1,35 @@
|
||||
<assembly>
|
||||
<id>windows</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<files>
|
||||
<file>
|
||||
<!-- aus der app.config eine oib.adapter.config machen-->
|
||||
<source>${basedir}/src/main/resources/app.config</source>
|
||||
<destName>${binary.name}.config</destName>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>${basedir}/src/main/resources/Readme.txt</source>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</file>
|
||||
</files>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${basedir}/target</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>*.exe</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${basedir}/lib</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -0,0 +1,155 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
using OibClient = Asm.As.Oib.Client;
|
||||
using com.itac.oib.client.customextensions;
|
||||
#endregion
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
/// <summary>
|
||||
/// Receiver class for the TraceService events
|
||||
/// </summary>
|
||||
public class BoardGateKeeperReceiver : IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
|
||||
OIBEventHandler _eventHandler;
|
||||
readonly OibClient.OibBoardGateKeeperEvents _oibBoardGateKeeperEvents;
|
||||
|
||||
public BoardGateKeeperReceiver(OibClient.OibBoardGateKeeperEvents oibBoardGateKeeperEvents,
|
||||
OIBEventHandler eventHandler)
|
||||
{
|
||||
if (oibBoardGateKeeperEvents == null) throw new ArgumentNullException("oibBoardGateKeeperEvents");
|
||||
if (eventHandler == null) throw new ArgumentNullException("eventHandler");
|
||||
|
||||
this._oibBoardGateKeeperEvents = oibBoardGateKeeperEvents;
|
||||
this._eventHandler = eventHandler;
|
||||
_oibBoardGateKeeperEvents.Ping = Ping;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Start/Stop
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_oibBoardGateKeeperEvents.Start();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
_oibBoardGateKeeperEvents.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Handling of events
|
||||
|
||||
bool Ping()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "BoardGateKeeperReceiver.Ping");
|
||||
return _eventHandler != null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposeable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_oibBoardGateKeeperEvents != null) { _oibBoardGateKeeperEvents.Dispose(); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void virtualInkspotData(OibClient.CustomExtensions.VirtualInkspotHandlerBoardRequest virtualInkspotHandlerBoardRequest)
|
||||
{
|
||||
try
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "BoardGateKeeperReceiver.VirtualInkspotData");
|
||||
if (_eventHandler != null)
|
||||
{
|
||||
|
||||
com.itac.oib.client.customextensions.VirtualInkspotHandlerBoardRequest virtInkspotBoardRequest = VirtualInkspotHandlerBoardRequestMapper.get(virtualInkspotHandlerBoardRequest);
|
||||
|
||||
com.itac.oib.boardgatekeeper.contracts.data.BoardRequestResult itacResult = _eventHandler.virtualInkspotBoardRequest(virtInkspotBoardRequest);
|
||||
|
||||
// itacResult ist null: call an das DataInterface schlug fehl
|
||||
if (itacResult == null)
|
||||
{
|
||||
// setzen default Fehlertext
|
||||
virtualInkspotHandlerBoardRequest.BoardRequestResult.Reason = "no results from iTAC.MES.Suite";
|
||||
virtualInkspotHandlerBoardRequest.BoardRequestResult.RequestResult = "Rejected";
|
||||
for (int i = 0; i < virtualInkspotHandlerBoardRequest.BoardRequestResult.VIHResult.SubPanelStates.Length; i++)
|
||||
{
|
||||
virtualInkspotHandlerBoardRequest.BoardRequestResult.VIHResult.SubPanelStates[i].Place = false;
|
||||
virtualInkspotHandlerBoardRequest.BoardRequestResult.VIHResult.SubPanelStates[i].Reason = "no results from iTAC.MES.Suite";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Werte in die Rückgabe kopieren;
|
||||
/* virtualInkspotHandlerBoardRequest.BoardRequestResult.Reason = itacResult.getBoardRequestResult().reason;
|
||||
virtualInkspotHandlerBoardRequest.BoardRequestResult.RequestResult = itacResult.getBoardRequestResult().requestResult;
|
||||
if (itacResult.getBoardRequestResult().getVIHResult().getSubPanelStates() != null)
|
||||
{
|
||||
if (itacResult.getBoardRequestResult().getVIHResult().getSubPanelStates().Length == virtualInkspotHandlerBoardRequest.BoardRequestResult.VIHResult.SubPanelStates.Length)
|
||||
{
|
||||
// subPanelStates kopieren
|
||||
for (int i = 0; i < itacResult.getBoardRequestResult().getVIHResult().getSubPanelStates().Length; i++)
|
||||
{
|
||||
virtualInkspotHandlerBoardRequest.BoardRequestResult.VIHResult.SubPanelStates[i].Place = itacResult.getBoardRequestResult().getVIHResult().getSubPanelStates()[i].getPlace();
|
||||
virtualInkspotHandlerBoardRequest.BoardRequestResult.VIHResult.SubPanelStates[i].Reason = itacResult.getBoardRequestResult().getVIHResult().getSubPanelStates()[i].getReason();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/ }
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Warning, "calling BoardGateKeeperReceiver.VirtualInkspotData not performed");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// der letzte Aufruf schlug fehl!!
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "calling BoardRequestResult in eventHandler failed", e);
|
||||
for (int i = 0; i < virtualInkspotHandlerBoardRequest.BoardRequestResult.VIHResult.SubPanelStates.Length; i++)
|
||||
{
|
||||
virtualInkspotHandlerBoardRequest.BoardRequestResult.VIHResult.SubPanelStates[i].Place = false;
|
||||
virtualInkspotHandlerBoardRequest.BoardRequestResult.VIHResult.SubPanelStates[i].Reason = e.Message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// called by incoming xml files
|
||||
public void virtualInkspotData(com.itac.oib.client.customextensions.VirtualInkspotHandlerBoardRequest requestData)
|
||||
{
|
||||
try
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "BoardGateKeeperReceiver.VirtualInkspotData from xml-file");
|
||||
if (_eventHandler != null)
|
||||
{
|
||||
com.itac.oib.boardgatekeeper.contracts.data.BoardRequestResult itacResult = _eventHandler.virtualInkspotBoardRequest(requestData);
|
||||
// TODO: Rückgabe noch auswerten ?
|
||||
// requestData.setBoardRequestResult(itacResult);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Warning, "calling BoardGateKeeperReceiver.VirtualInkspotData not performed");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// der letzte Aufruf schlug fehl!!
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "calling BoardRequestResult in eventHandler failed", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using Asm.As.Oib.Client.CustomExtensions;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
using com.itac.oib.client.customextensions;
|
||||
#endregion
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
/// <summary>
|
||||
/// Receiver class for the Changeover manager events
|
||||
/// </summary>
|
||||
public class ChangeoverReceiver : IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
|
||||
public OIBEventHandler _eventHandler { get; set; }
|
||||
private readonly ChangeoverManager _changeoverManager;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public ChangeoverReceiver(ChangeoverManager changeoverManager)
|
||||
{
|
||||
_changeoverManager = changeoverManager;
|
||||
_changeoverManager.LineChangeover += new Asm.As.Oib.Client.CustomExtensions.LineChangeoverEvent(ChangeoverManagerLineChangeover);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposeable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_changeoverManager != null)
|
||||
_changeoverManager.Dispose();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Start/Stop
|
||||
|
||||
public void Start()
|
||||
{
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Handling of events
|
||||
|
||||
public class LineChangeoverThread : ThreadTemplate<Asm.As.Oib.Client.CustomExtensions.LineChangeoverEventArgs>
|
||||
{
|
||||
public LineChangeoverThread(OIBEventHandler eventHandler, Asm.As.Oib.Client.CustomExtensions.LineChangeoverEventArgs request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = LineChangeoverEventArgsMapper.get(_request);
|
||||
getEventHandler().lineChangeoverEvent(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeoverManagerLineChangeover(object sender, Asm.As.Oib.Client.CustomExtensions.LineChangeoverEventArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, string.Format("Changeover completed for line '{0}'", args.Line.Name));
|
||||
// interessante Infos:
|
||||
// String conveyorModeString = args.Line.StationInLines[0].StationConveyorSystem.ConveyorMode.ToString();
|
||||
// com.itac.oib.client.customextensions.LineChangeoverEventArgs lineChangeoverEvent = LineChangeoverEventArgsMapper.get(args);
|
||||
// if (lineChangeoverEvent == null)
|
||||
// {
|
||||
// LogHandler.log(Constants.LOGGER, TraceEventType.Error, "LineChangeover not converted");
|
||||
// return;
|
||||
// }
|
||||
var mmt = new LineChangeoverThread(_eventHandler, args);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, string.Format("LineChangeover could not be pushed to java receiver"), e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal com.itac.oib.client.customextensions.LineChangeoverEventArgs getCurrentLineProductionData()
|
||||
{
|
||||
com.itac.oib.client.customextensions.LineChangeoverEventArgs lineChangeoverEvent = LineChangeoverEventArgsMapper.get(_changeoverManager.GetCurrentLineProductionData());
|
||||
if (lineChangeoverEvent == null)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "LineChangeover not converted");
|
||||
return null;
|
||||
}
|
||||
return lineChangeoverEvent;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Asm.As.Oib.Client;
|
||||
using Asm.As.Oib.SiplaceSetupCenter.Contracts.Data;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
#endregion
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
|
||||
// [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
|
||||
public class DekPrinterExternalControlReceiver : IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly OibDekPrinterExtenalControlEvents _oibDekPrinterExternalControlEvents;
|
||||
public OIBEventHandler _eventHandler { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region constructor, event delegate assignment
|
||||
|
||||
public DekPrinterExternalControlReceiver(OibDekPrinterExtenalControlEvents oibSetupCenterExternalControlEvents)
|
||||
{
|
||||
_oibDekPrinterExternalControlEvents = oibSetupCenterExternalControlEvents;
|
||||
|
||||
oibSetupCenterExternalControlEvents.VerifyPrinterMaterial = VerifyPrinterMaterial;
|
||||
oibSetupCenterExternalControlEvents.VerifyPrinterTool = VerifyPrinterTool;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Start/Stop
|
||||
public void Start()
|
||||
{
|
||||
_oibDekPrinterExternalControlEvents.Start();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
_oibDekPrinterExternalControlEvents.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public OIBEventHandler getEventHandler(Object request)
|
||||
{
|
||||
if (_eventHandler == null)
|
||||
{
|
||||
if (request == null) { throw new Exception("missing event handler to transport unknown message"); }
|
||||
throw new Exception("missing event handler to transport message of type " + request.GetType().Name);
|
||||
}
|
||||
return _eventHandler;
|
||||
}
|
||||
#region IDekPrinterCenterExternalControl Members
|
||||
|
||||
private void startCall(string method)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, String.Format("DekPrinterExternalControl.{0} called", method));
|
||||
}
|
||||
|
||||
public VerifyPrinterToolResponse VerifyPrinterTool(VerifyPrinterToolRequest request)
|
||||
{
|
||||
startCall("VerifyPrinterTool");
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.VerifyPrinterToolRequestMapper.get(request);
|
||||
VerifyPrinterToolResponse oibResult = null;
|
||||
try
|
||||
{
|
||||
var mesNamespaceConformResult = getEventHandler(request).verifyPrinterTool(mesNamespaceConformRequest);
|
||||
oibResult = com.itac.oib.siplacesetupcenter.contracts.data.VerifyPrinterToolResponseMapper.get(mesNamespaceConformResult);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "failed to process VerifyPrinterToolRequest", e);
|
||||
}
|
||||
|
||||
return oibResult;
|
||||
}
|
||||
|
||||
|
||||
public VerifyPrinterMaterialResponse VerifyPrinterMaterial(VerifyPrinterMaterialRequest request)
|
||||
{
|
||||
startCall("VerifyPrinterMaterial");
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.VerifyPrinterMaterialRequestMapper.get(request);
|
||||
VerifyPrinterMaterialResponse oibResult = null;
|
||||
try
|
||||
{
|
||||
var mesNamespaceConformResult = getEventHandler(request).verifyPrinterMaterial(mesNamespaceConformRequest);
|
||||
oibResult = com.itac.oib.siplacesetupcenter.contracts.data.VerifyPrinterMaterialResponseMapper.get(mesNamespaceConformResult);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "failed to process VerifyPrinterMaterialRequest", e);
|
||||
}
|
||||
|
||||
return oibResult;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region IDisposeable
|
||||
public void Dispose()
|
||||
{
|
||||
if (_oibDekPrinterExternalControlEvents != null)
|
||||
_oibDekPrinterExternalControlEvents.Dispose();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using Asm.As.Oib.Client.CustomExtensions;
|
||||
using Asm.As.Oib.DisplayService.Contracts.Messages;
|
||||
using Asm.As.Oib.DisplayService.Proxy.Architecture.Objects;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
using com.itac.oib.client.customextensions;
|
||||
#endregion
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
/// <summary>
|
||||
/// Receiver class for the Changeover manager events
|
||||
/// </summary>
|
||||
public class DisplayServiceReceiver : IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
|
||||
public OIBEventHandler _eventHandler { get; set; }
|
||||
private readonly DisplayServiceClient _displayServiceClient;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public DisplayServiceReceiver(DisplayServiceClient displayServiceClient)
|
||||
{
|
||||
_displayServiceClient = displayServiceClient;
|
||||
_displayServiceClient.ConfirmationReceived += confirmationReceived;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposeable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_displayServiceClient != null)
|
||||
_displayServiceClient.Dispose();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Start/Stop
|
||||
|
||||
public void Start()
|
||||
{
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Handling of events
|
||||
private void confirmationReceived(ConfirmationReceivedRequest confirmationReceivedRequest)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/*public class LineChangeoverThread : ThreadTemplate<Asm.As.Oib.Client.CustomExtensions.LineChangeoverEventArgs>
|
||||
{
|
||||
public LineChangeoverThread(OIBEventHandler eventHandler, Asm.As.Oib.Client.CustomExtensions.LineChangeoverEventArgs request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = LineChangeoverEventArgsMapper.get(_request);
|
||||
getEventHandler().lineChangeoverEvent(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeoverManagerLineChangeover(object sender, Asm.As.Oib.Client.CustomExtensions.LineChangeoverEventArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, string.Format("Changeover completed for line '{0}'", args.Line.Name));
|
||||
// interessante Infos:
|
||||
// String conveyorModeString = args.Line.StationInLines[0].StationConveyorSystem.ConveyorMode.ToString();
|
||||
// com.itac.oib.client.customextensions.LineChangeoverEventArgs lineChangeoverEvent = LineChangeoverEventArgsMapper.get(args);
|
||||
// if (lineChangeoverEvent == null)
|
||||
// {
|
||||
// LogHandler.log(Constants.LOGGER, TraceEventType.Error, "LineChangeover not converted");
|
||||
// return;
|
||||
// }
|
||||
var mmt = new LineChangeoverThread(_eventHandler, args);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, string.Format("LineChangeover could not be pushed to java receiver"), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
internal com.itac.oib.client.customextensions.LineChangeoverEventArgs getCurrentLineProductionData()
|
||||
{
|
||||
com.itac.oib.client.customextensions.LineChangeoverEventArgs lineChangeoverEvent = LineChangeoverEventArgsMapper.get(_displayServiceClient.GetCurrentLineProductionData());
|
||||
if (lineChangeoverEvent == null)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "LineChangeover not converted");
|
||||
return null;
|
||||
}
|
||||
return lineChangeoverEvent;
|
||||
}*/
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
using OibClient = Asm.As.Oib.Client;
|
||||
using MesNamespace = com.itac.oib.linecontrol.contracts.data;
|
||||
using AsmNamespace = www.siplace.com.OIB._2015._10.LineControlServer.Contracts.Data;
|
||||
using www.siplace.com.OIB._2015._10.LineControlServer.Contracts.Data;
|
||||
#endregion
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
/// <summary>
|
||||
/// Receiver class for the TraceService events
|
||||
/// </summary>
|
||||
public class LineControlMesInterceptorReceiver : IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
|
||||
OIBEventHandler _eventHandler;
|
||||
readonly OibClient.OibLineControlMesInterceptorEvents _oibLineControlMesInterceptorEvents;
|
||||
#endregion
|
||||
|
||||
#region construtor/destructor
|
||||
public LineControlMesInterceptorReceiver(OibClient.OibLineControlMesInterceptorEvents oibLineControlMesInterceptorEvents,
|
||||
OIBEventHandler eventHandler)
|
||||
{
|
||||
if (oibLineControlMesInterceptorEvents == null) throw new ArgumentNullException("oibLineControlMesInterceptorEvents");
|
||||
if (eventHandler == null) throw new ArgumentNullException("eventHandler");
|
||||
|
||||
this._oibLineControlMesInterceptorEvents = oibLineControlMesInterceptorEvents;
|
||||
this._eventHandler = eventHandler;
|
||||
_oibLineControlMesInterceptorEvents.Ping = Ping;
|
||||
_oibLineControlMesInterceptorEvents.VerifyPcbForAutoProgramDownload = VerifyPcbForAutoProgramDownload;
|
||||
_oibLineControlMesInterceptorEvents.VerifyRecipeActivationOnDekPrinter = VerifyRecipeActivationOnDekPrinter;
|
||||
_oibLineControlMesInterceptorEvents.VerifyRecipeDownload = VerifyRecipeDownload;
|
||||
_oibLineControlMesInterceptorEvents.VerifyRecipeForAutoProgramDownload = VerifyRecipeForAutoProgramDownload;
|
||||
_oibLineControlMesInterceptorEvents.VerifyStartAutoProgramDownload = VerifyStartAutoProgramDownload;
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_oibLineControlMesInterceptorEvents != null) { _oibLineControlMesInterceptorEvents.Dispose(); }
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Start/Stop
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_oibLineControlMesInterceptorEvents.Start();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
_oibLineControlMesInterceptorEvents.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Handling of events
|
||||
bool Ping()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "LineControlMesInterceptorReceiver.Ping");
|
||||
return _eventHandler != null;
|
||||
}
|
||||
|
||||
private MesVerificationResult VerifyRecipeForAutoProgramDownload(VerifyRecipeForAutoProgramDownloadRequest request)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "LineControlMesInterceptorReceiver VerifyRecipeForAutoProgramDownload called");
|
||||
// map value from asm namespace to mes namespace
|
||||
MesNamespace.VerifyRecipeForAutoProgramDownloadRequest report = MesNamespace.VerifyRecipeForAutoProgramDownloadRequestMapper.get(request);
|
||||
|
||||
// create return value
|
||||
AsmNamespace.MesVerificationResult asmResult = null;
|
||||
try
|
||||
{
|
||||
MesNamespace.MesVerificationResult mesResult = _eventHandler.verifyRecipeForAutoProgramDownload(report);
|
||||
asmResult = MesNamespace.MesVerificationResultMapper.get(mesResult);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
asmResult = getFailureResult(e);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "failed to process LineControlMesInterceptorReceiver.VerifyRecipeForAutoProgramDownload", e);
|
||||
}
|
||||
|
||||
return asmResult;
|
||||
}
|
||||
|
||||
private MesVerificationResult VerifyStartAutoProgramDownload(VerifyRecipeForAutoProgramDownloadRequest request)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "LineControlMesInterceptorReceiver VerifyStartAutoProgramDownload called");
|
||||
// map value from asm namespace to mes namespace
|
||||
MesNamespace.VerifyRecipeForAutoProgramDownloadRequest report = MesNamespace.VerifyRecipeForAutoProgramDownloadRequestMapper.get(request);
|
||||
AsmNamespace.MesVerificationResult asmResult = null;
|
||||
try
|
||||
{
|
||||
MesNamespace.MesVerificationResult mesResult = _eventHandler.verifyStartAutoProgramDownload(report);
|
||||
asmResult = MesNamespace.MesVerificationResultMapper.get(mesResult);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
asmResult = getFailureResult(e);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "failed to process LineControlMesInterceptorReceiver.VerifyStartAutoProgramDownload", e);
|
||||
}
|
||||
|
||||
return asmResult;
|
||||
}
|
||||
|
||||
private MesVerificationResult VerifyRecipeDownload(VerifyRecipeDownloadRequest request)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "LineControlMesInterceptorReceiver VerifyRecipeDownload called");
|
||||
// map value from asm namespace to mes namespace
|
||||
MesNamespace.VerifyRecipeDownloadRequest report = MesNamespace.VerifyRecipeDownloadRequestMapper.get(request);
|
||||
AsmNamespace.MesVerificationResult asmResult = null;
|
||||
try
|
||||
{
|
||||
MesNamespace.MesVerificationResult mesResult = _eventHandler.verifyRecipeDownload(report);
|
||||
asmResult = MesNamespace.MesVerificationResultMapper.get(mesResult);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
asmResult = getFailureResult(e);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "failed to process LineControlMesInterceptorReceiver.VerifyRecipeDownload", e);
|
||||
}
|
||||
|
||||
return asmResult;
|
||||
}
|
||||
|
||||
private MesVerificationResult VerifyRecipeActivationOnDekPrinter(VerifyRecipeActivationOnDekPrinterRequest request)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "LineControlMesInterceptorReceiver VerifyRecipeActivationOnDekPrinterRequest called");
|
||||
// map value from asm namespace to mes namespace
|
||||
MesNamespace.VerifyRecipeActivationOnDekPrinterRequest report = MesNamespace.VerifyRecipeActivationOnDekPrinterRequestMapper.get(request);
|
||||
AsmNamespace.MesVerificationResult asmResult = null;
|
||||
try
|
||||
{
|
||||
MesNamespace.MesVerificationResult mesResult = _eventHandler.verifyRecipeActivationOnDekPrinter(report);
|
||||
asmResult = MesNamespace.MesVerificationResultMapper.get(mesResult);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
asmResult = getFailureResult(e);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "failed to process LineControlMesInterceptorReceiver.VerifyRecipeActivationOnDekPrinterRequest", e);
|
||||
}
|
||||
|
||||
return asmResult;
|
||||
}
|
||||
|
||||
private MesVerificationResult VerifyPcbForAutoProgramDownload(VerifyPcbForAutoProgramDownloadRequest request)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "LineControlMesInterceptorReceiver VerifyPcbForAutoProgramDownloadRequest called");
|
||||
// map value from asm namespace to mes namespace
|
||||
MesNamespace.VerifyPcbForAutoProgramDownloadRequest report = MesNamespace.VerifyPcbForAutoProgramDownloadRequestMapper.get(request);
|
||||
AsmNamespace.MesVerificationResult asmResult = null;
|
||||
try
|
||||
{
|
||||
MesNamespace.MesVerificationResult mesResult = _eventHandler.verifyPcbForAutoProgramDownload(report);
|
||||
asmResult = MesNamespace.MesVerificationResultMapper.get(mesResult);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
asmResult = getFailureResult(e);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "failed to process LineControlMesInterceptorReceiver.VerifyPcbForAutoProgramDownloadRequest", e);
|
||||
}
|
||||
|
||||
return asmResult;
|
||||
}
|
||||
|
||||
private AsmNamespace.MesVerificationResult getFailureResult(Exception e)
|
||||
{
|
||||
MesVerificationResult result = new MesVerificationResult();
|
||||
result.VerificationResult = 2; // 0=OK, 1=Rejected, 2=Error
|
||||
result.Reason = e.Message;
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
using Constants = com.itac.mes.proxy.Constants;
|
||||
using OibMonBizObj = Asm.As.Oib.Monitoring.Proxy.Business.EventArgs;
|
||||
using OibClient = Asm.As.Oib.Client;
|
||||
using System.Configuration;
|
||||
using com.itac.oib.monitoring.contracts.data;
|
||||
using Asm.As.Oib.Monitoring.Proxy.Business.Objects;
|
||||
#endregion
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
public class MonitoringReceiver : IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
|
||||
public OIBEventHandler _eventHandler { get; set; }
|
||||
private readonly String _lineFullPath;
|
||||
private readonly OibClient.OibMonitoringEvents _oibMonitoringEvents;
|
||||
private TimeSpan boardProcessedMaxAge = new TimeSpan(0, 0, 0);
|
||||
private TimeSpan stationEventMaxAge = new TimeSpan(0, 0, 0);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public MonitoringReceiver(OibClient.OibMonitoringEvents oibMonitoringEvents, string lineFullPath)
|
||||
{
|
||||
_oibMonitoringEvents = oibMonitoringEvents;
|
||||
_lineFullPath = lineFullPath;
|
||||
|
||||
oibMonitoringEvents.BoardProcessed += BoardProcessedEventReceived;
|
||||
oibMonitoringEvents.StationEvent += StationEventReceived;
|
||||
|
||||
try
|
||||
{
|
||||
String sMaxAge = (String)new AppSettingsReader().GetValue("BoardProcessedDataMaxAge", typeof(String));
|
||||
boardProcessedMaxAge = TimeSpan.Parse(sMaxAge);
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
// default Wert 1 Stunde
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "configured Value for 'BoardProcessedDataMaxAge' is invalid, use default value");
|
||||
boardProcessedMaxAge = new TimeSpan(24, 0, 0);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
boardProcessedMaxAge = new TimeSpan(0, 0, 0);
|
||||
}
|
||||
if (boardProcessedMaxAge.Ticks > 0)
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "maximum age for BoardProcessedMessages = " + boardProcessedMaxAge.ToString());
|
||||
else
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "no maximum age for BoardProcessedMessages");
|
||||
try
|
||||
{
|
||||
String sMaxAge = (String)new AppSettingsReader().GetValue("StationEventMaxAge", typeof(String));
|
||||
stationEventMaxAge = TimeSpan.Parse(sMaxAge);
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
// default Wert 1 Stunde
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "configured Value for 'StationEventMaxAge' is invalid, use default value");
|
||||
stationEventMaxAge = new TimeSpan(24, 0, 0);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
stationEventMaxAge = new TimeSpan(0, 0, 0);
|
||||
}
|
||||
if (stationEventMaxAge.Ticks > 0)
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "maximum age for StationEventMaxAge = " + stationEventMaxAge.ToString());
|
||||
else
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "no maximum age for StationEventMaxAge");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Start/Stopp
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_oibMonitoringEvents.Start();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
_oibMonitoringEvents.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Handling of events
|
||||
|
||||
#region Board Processed
|
||||
|
||||
public void BoardProcessedEventReceived(object sender, OibMonBizObj.BoardProcessedEventArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "BoardProcessedEventArgs");
|
||||
if (boardProcessedMaxAge.Ticks > 0)
|
||||
{
|
||||
Boolean skip = false;
|
||||
DateTime oldestDate = new DateTime(DateTime.Now.Ticks - boardProcessedMaxAge.Ticks).ToUniversalTime();
|
||||
foreach (Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessedBoard processedBoard in args.BoardProcessedData.ProcessedBoards)
|
||||
{
|
||||
if (processedBoard.StationTime != null && processedBoard.StationTime.ToUniversalTime().Ticks < oldestDate.Ticks)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "found old BoardProcessedEvent from " + processedBoard.StationTime.ToUniversalTime().ToString() +
|
||||
", oldest message to be processed is " + oldestDate.ToString());
|
||||
skip = true;
|
||||
}
|
||||
}
|
||||
if (skip)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ignore BoardProcessedEvent because one of its " +
|
||||
"stationEvents is older than configured time " + boardProcessedMaxAge.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
var mmt = new BoardProcessedThread(_eventHandler, args.BoardProcessedData);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "BoardProcessedEventArgs failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
private class BoardProcessedThread : ThreadTemplate<Asm.As.Oib.Monitoring.Proxy.Business.Objects.BoardProcessedData>
|
||||
{
|
||||
public BoardProcessedThread(OIBEventHandler eventHandler, Asm.As.Oib.Monitoring.Proxy.Business.Objects.BoardProcessedData request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.monitoring.contracts.data.BoardProcessedDataMapper.get(_request);
|
||||
getEventHandler().boardProcessedEventReceived(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Station Event
|
||||
|
||||
public void StationEventReceived(object sender, OibMonBizObj.StationEventArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "StationEventReceived");
|
||||
if (stationEventMaxAge.Ticks > 0)
|
||||
{
|
||||
DateTime oldestDate = new DateTime(DateTime.Now.Ticks - stationEventMaxAge.Ticks).ToUniversalTime();
|
||||
if (args.StationEventComposite != null && args.StationEventComposite.StationTime.ToUniversalTime().Ticks < oldestDate.Ticks)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "ignore StationEvent because its time '" +
|
||||
args.StationEventComposite.StationTime.ToUniversalTime() + "' is older than configured time " + stationEventMaxAge.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var mmt = new StationEventThread(_eventHandler, args.StationEventComposite);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "StationEventArgs failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
public class StationEventThread : ThreadTemplate<Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEventComposite>
|
||||
{
|
||||
public StationEventThread(OIBEventHandler eventHandler, Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEventComposite request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.monitoring.contracts.data.StationEventCompositeMapper.get(_request);
|
||||
getEventHandler().stationEventReceived(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
void MonitoringSubscriptionHealthStatus(object sender, OibClient.OibServiceStatusEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!e.SubscriptionCheckResult.Succeeded)
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, string.Format("OIB Monitoring Queue for line '{0}' cound not be checked.", _lineFullPath));
|
||||
else
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, string.Format("OIB Monitoring Queue for line '{0}' is in state '{1}' containing '{2}' messages.", _lineFullPath, e.SubscriptionCheckResult.QueueStatus, e.SubscriptionCheckResult.MessagesInQueue));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, string.Format("OIB Monitoring Queue for line '{0}' checked failed: '{1}'.", _lineFullPath, ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region IDisposeable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_oibMonitoringEvents != null)
|
||||
_oibMonitoringEvents.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using com.itac.mes.proxy.business;
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
|
||||
public class ThreadTemplate<T>
|
||||
{
|
||||
protected readonly OIBEventHandler _eventHandler;
|
||||
protected readonly T _request;
|
||||
|
||||
public ThreadTemplate(OIBEventHandler eventHandler, T request)
|
||||
{
|
||||
_eventHandler = eventHandler;
|
||||
_request = request;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get the event handler. By calling a funcion at the eventHandler the object is serialized and transported to java receiver.
|
||||
/// </summary>
|
||||
/// <returns>The event handler instance</returns>
|
||||
/// <exception>An exception is thrown when the handler was not set to this instance of thread template</exception>
|
||||
public OIBEventHandler getEventHandler()
|
||||
{
|
||||
if (_eventHandler == null)
|
||||
{
|
||||
if (_request == null) { throw new Exception("missing event handler to transport unknown message"); }
|
||||
throw new Exception("missing event handler to transport message of type " + _request.GetType().Name);
|
||||
}
|
||||
return _eventHandler;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using Asm.As.Oib.SiplaceSetupCenter.Contracts.Data;
|
||||
using Asm.As.Oib.SiplaceSetupCenter.Contracts.Service;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
using OibClient = Asm.As.Oib.Client;
|
||||
#endregion
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
|
||||
// [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
|
||||
public class SetupCenterExternalControlReceiver : IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly OibClient.OibSetupCenterExternalControlEvents _oibSetupCenterExternalControlEvents;
|
||||
public OIBEventHandler _eventHandler { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public SetupCenterExternalControlReceiver(OibClient.OibSetupCenterExternalControlEvents oibSetupCenterExternalControlEvents)
|
||||
{
|
||||
_oibSetupCenterExternalControlEvents = oibSetupCenterExternalControlEvents;
|
||||
oibSetupCenterExternalControlEvents.Ping = Ping;
|
||||
oibSetupCenterExternalControlEvents.GetNewPackagingUnitData = GetNewPackagingUnitData;
|
||||
oibSetupCenterExternalControlEvents.GetPackagingUnitControlStatus = GetPackagingUnitControlStatus;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Start/Stop
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_oibSetupCenterExternalControlEvents.Start();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
_oibSetupCenterExternalControlEvents.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISiplaceSetupCenterExternalControl Members
|
||||
|
||||
/// <summary>
|
||||
/// Check for the client if this service is available.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool Ping()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "SetupCenterExternalControl.Ping");
|
||||
return _eventHandler != null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ExternalControlResult[] GetPackagingUnitControlStatus(PackagingUnitLocation[] packagingUnitLocations)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "ExternalControl GetPackagingUnitControlStatus called");
|
||||
com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitLocation[] report = com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitLocationMapper.getArray(packagingUnitLocations);
|
||||
Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ExternalControlResult[] oibResult = null;
|
||||
try
|
||||
{
|
||||
com.itac.oib.siplacesetupcenter.contracts.data.ExternalControlResult[] itacResult = _eventHandler.getPackagingUnitControlStatus(report);
|
||||
oibResult = com.itac.oib.siplacesetupcenter.contracts.data.ExternalControlResultMapper.get(itacResult);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "failed to process GetPackagingUnitControlStatus", e);
|
||||
}
|
||||
|
||||
asmHandler(ref packagingUnitLocations, ref oibResult);
|
||||
return oibResult;
|
||||
}
|
||||
|
||||
public void UpdateEmptyFields(List<PackagingUnitLocation> packagingUnitLocations, List<ExternalControlResult> result)
|
||||
{
|
||||
if (packagingUnitLocations == null || packagingUnitLocations.Count == 0)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "SetupCenterExternalControl.updateEmptyFields: packagingUnitLocations empty or null");
|
||||
return;
|
||||
}
|
||||
if (result == null || result.Count == 0)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "SetupCenterExternalControl.updateEmptyFields: result empty or null");
|
||||
return;
|
||||
}
|
||||
if (packagingUnitLocations.Count != result.Count)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "SetupCenterExternalControl.updateEmptyFields: packagingUnitLocations and result different size");
|
||||
return;
|
||||
}
|
||||
// über alle Items iterieren
|
||||
for (int i = 0; i < packagingUnitLocations.Count; i++)
|
||||
{
|
||||
UpdateEmptyFields(packagingUnitLocations[i], result[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateEmptyFields(PackagingUnitLocation packagingUnitLocation, ExternalControlResult result)
|
||||
{
|
||||
if (packagingUnitLocation == null)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "SetupCenterExternalControl.updateEmptyFields: packagingUnitLocation is null");
|
||||
return;
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "SetupCenterExternalControl.updateEmptyFields: result is null");
|
||||
return;
|
||||
}
|
||||
// per reflection über alle Felder iterieren, dabei per Name vorgehen
|
||||
// deepCopy(packagingUnitLocation, result);
|
||||
// Console.WriteLine("");
|
||||
if (packagingUnitLocation.PackagingUnit.BatchPackagingUnit != null && result.PackagingUnit.BatchPackagingUnit == null)
|
||||
{
|
||||
result.PackagingUnit.BatchPackagingUnit = packagingUnitLocation.PackagingUnit.BatchPackagingUnit;
|
||||
}
|
||||
}
|
||||
|
||||
// muss noch weiter getestet werden...
|
||||
public void DeepCopy(object sourceObject, object destObject)
|
||||
{
|
||||
Type sourceType = sourceObject.GetType();
|
||||
Type destType = destObject.GetType();
|
||||
MemberInfo[] sourceMbrInfoArray = sourceType.GetMembers();
|
||||
MemberInfo[] destMbrInfoArray = destType.GetMembers();
|
||||
|
||||
foreach (MemberInfo sourceMbrInfo in sourceMbrInfoArray)
|
||||
{
|
||||
if (sourceMbrInfo.MemberType == MemberTypes.Property)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "" + sourceMbrInfo + " is a " + sourceMbrInfo.MemberType);
|
||||
// alle einfachen TypeNameConverter direkt prüfen (int, String, bool)
|
||||
// komplexe Typen ???
|
||||
|
||||
PropertyInfo sourcePropInfo = sourceType.GetProperty(sourceMbrInfo.Name);
|
||||
|
||||
// gibt es das Property auch im Zielobjekt
|
||||
foreach (MemberInfo destMbrInfo in destMbrInfoArray)
|
||||
{
|
||||
// identischer Name, identischerr Typ
|
||||
if (destMbrInfo.MemberType == sourceMbrInfo.MemberType && destMbrInfo.Name == sourceMbrInfo.Name)
|
||||
{
|
||||
PropertyInfo destPropInfo = destType.GetProperty(destMbrInfo.Name);
|
||||
object sourceValue = sourcePropInfo.GetValue(sourceObject, null);
|
||||
object destValue = destPropInfo.GetValue(destObject, null);
|
||||
if (sourcePropInfo.PropertyType == typeof(String) || sourcePropInfo.PropertyType == typeof(int)
|
||||
|| sourcePropInfo.PropertyType == typeof(Int32) || sourcePropInfo.PropertyType == typeof(Int64)
|
||||
|| sourcePropInfo.PropertyType == typeof(long) || sourcePropInfo.PropertyType == typeof(bool)
|
||||
|| sourcePropInfo.PropertyType == typeof(Boolean))
|
||||
{
|
||||
if (sourceValue != destValue)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "primitive type copy value");
|
||||
destPropInfo.SetValue(destObject, sourceValue, null);
|
||||
}
|
||||
}
|
||||
else if (!sourceType.IsArray)
|
||||
{
|
||||
// komplexer Typ, kein Array
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, sourceMbrInfo.Name + " is complex type ");
|
||||
if (sourceValue != null)
|
||||
{
|
||||
DeepCopy(sourceValue, destValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, sourceMbrInfo.Name + " is complex type, sourceValue is null");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void asmHandler(ref Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PackagingUnitLocation[] packagingUnitLocations,
|
||||
ref Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ExternalControlResult[] result)
|
||||
{
|
||||
//
|
||||
// special ASM Handling:
|
||||
// simply return MSD Level and MSD Open Date as received in request
|
||||
|
||||
foreach (Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PackagingUnitLocation item in packagingUnitLocations)
|
||||
{
|
||||
// find this container in result and copy the values
|
||||
foreach (Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ExternalControlResult resultItem in result)
|
||||
{
|
||||
if (item.PackagingUnit.UID.Equals(resultItem.PackagingUnit.UID))
|
||||
{
|
||||
resultItem.PackagingUnit.MsdLevel = item.PackagingUnit.MsdLevel;
|
||||
resultItem.PackagingUnit.MsdOpenDate = item.PackagingUnit.MsdOpenDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ExternalControlResult[] GetNewPackagingUnitData(PackagingUnitLocation[] packagingUnitLocations)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "SetupCenterExternalControl.GetPackagingUnitControlStatus");
|
||||
try
|
||||
{
|
||||
// List<ExternalControlResult> result = _eventHandler.GetPackagingUnitControlStatus(packagingUnitLocations);
|
||||
|
||||
// hier müssen eigentliche alle Felder aus den quelldaten, die nicht in den Zieldaten enthalten sind per
|
||||
// Reflection übernommen werden, damit wir nie mehr irgend welche Werte verlieren
|
||||
// UpdateEmptyFields(packagingUnitLocations, result);
|
||||
// return result;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
_eventHandler = null;
|
||||
// Fehler, keine weitere info vorhanden, da die Applikation nicht läuft
|
||||
}
|
||||
return new ExternalControlResult[0];
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposeable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_oibSetupCenterExternalControlEvents != null)
|
||||
_oibSetupCenterExternalControlEvents.Dispose();
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,513 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
using System.Threading;
|
||||
using OibClient = Asm.As.Oib.Client;
|
||||
using Asm.As.Oib.SiplaceSetupCenter.Contracts.Data;
|
||||
using Asm.As.Oib.SiplaceSetupCenter.Proxy.Business.Objects;
|
||||
#endregion
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
public class SetupCenterReceiver : IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
public OIBEventHandler _eventHandler { get; set; }
|
||||
private readonly String _lineFullPath;
|
||||
private readonly OibClient.OibSetupCenterEvents _oibSetupCenterEvents;
|
||||
private bool _isSetupStation;
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public SetupCenterReceiver(OibClient.OibSetupCenterEvents oibSetupCenterEvents, string lineFullPath, bool isSetupStation)
|
||||
{
|
||||
_oibSetupCenterEvents = oibSetupCenterEvents;
|
||||
_lineFullPath = lineFullPath;
|
||||
_isSetupStation = isSetupStation;
|
||||
|
||||
oibSetupCenterEvents.FeederPlaced += SetupCenterFeederPlaced;
|
||||
oibSetupCenterEvents.FeederRemoved += SetupCenterFeederRemoved;
|
||||
oibSetupCenterEvents.NewSetupActive += SetupCenterNewSetupActive;
|
||||
oibSetupCenterEvents.PackagingQuantityChanged += SetupCenterPackagingQuantityChanged;
|
||||
oibSetupCenterEvents.SetupChanged += SetupCenterSetupChanged;
|
||||
oibSetupCenterEvents.PackagingUnitConsumed += SetupCenterPackagingUnitConsumed;
|
||||
oibSetupCenterEvents.MaterialMoved += SetupCenterMaterialMoved;
|
||||
oibSetupCenterEvents.PrinterToolVerified += SetupCenterPrinterToolVerified;
|
||||
oibSetupCenterEvents.PrinterToolUnverified += SetupCenterPrinterToolUnVerified;
|
||||
oibSetupCenterEvents.PrinterCapabilitiesChanged += SetupCenterPrinterCapabilitiesChanged;
|
||||
oibSetupCenterEvents.PrinterConsumablesUpdated += SetupCenterPrinterConsumablesChanged;
|
||||
oibSetupCenterEvents.PrinterCoverClosed += SetupCenterPrintercoverClosed;
|
||||
oibSetupCenterEvents.PrinterCoverOpened += SetupCenterPrinterCoverOpened;
|
||||
oibSetupCenterEvents.PrinterMaterialUnverified += SetupCenterPrinterMaterialUnverified;
|
||||
oibSetupCenterEvents.PrinterMaterialVerified += SetupCenterPrinterMaterialVerified;
|
||||
oibSetupCenterEvents.PrinterRecipeVerified += SetupCenterPrinterRecipeVerified;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Start/Stop
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_oibSetupCenterEvents.Start();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
_oibSetupCenterEvents.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Handling of events
|
||||
private void startSetupcenterEvent(Object args)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, String.Format("SetupCenterReceiver.{0}", args.GetType().Name));
|
||||
}
|
||||
private void setupcenterEventFailed(Object args, Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, String.Format("calling SetupCenterNotifyReceiver.{0} failed", args.GetType().Name), e);
|
||||
}
|
||||
|
||||
void SetupCenterPackagingQuantityChanged(object sender, OibClient.PackagingQuantityChangedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PackagingQuantityChangedThread(_eventHandler, args.PackagingQuantityChangedReport);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
void SetupCenterFeederPlaced(object sender, OibClient.FeederPlacedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new FeederPlacedThread(_eventHandler, args.FeederPlacedReportRequest);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
void SetupCenterFeederRemoved(object sender, OibClient.FeederRemovedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new FeederRemovedThread(_eventHandler, args.FeederRemovedReport);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
void SetupCenterNewSetupActive(object sender, OibClient.NewSetupActiveEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new NewSetupActiveThread(_eventHandler, args.NewSetupActiveReport);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
void SetupCenterSetupChanged(object sender, OibClient.SetupChangedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new SetupChangedThread(_eventHandler, args.SetupChangedReport);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
void SetupCenterPackagingUnitConsumed(object sender, OibClient.PackagingUnitConsumedEventArgs args)
|
||||
{
|
||||
if (_isSetupStation)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "ignore PackagingUnitConsumed because in SetupStation mode");
|
||||
return;
|
||||
}
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PackagingUnitConsumedThread(_eventHandler, args.PackagingUnitConsumedReport);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupCenterMaterialMoved(object sender, OibClient.MaterialMovedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new MaterialMovedThread(_eventHandler, args.MaterialMovedReport);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
#region PrinterFunctions Receiver
|
||||
public void SetupCenterPrinterToolVerified(object sender, OibClient.PrinterToolVerifiedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PrinterToolVerifiedThread(_eventHandler, args.PrinterToolVerifiedReportRequest);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupCenterPrinterRecipeVerified(object sender, OibClient.PrinterRecipeVerifiedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PrinterRecipeVerifiedThread(_eventHandler, args.PrinterRecipeVerifiedReportRequest);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupCenterPrinterMaterialVerified(object sender, OibClient.PrinterMaterialVerifiedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PrinterMaterialVerifiedThread(_eventHandler, args.PrinterMaterialVerifiedReportRequest);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupCenterPrinterMaterialUnverified(object sender, OibClient.PrinterMaterialUnverifiedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PrinterMaterialUnverifiedThread(_eventHandler, args.PrinterMaterialUnverifiedReportRequest);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupCenterPrinterCoverOpened(object sender, OibClient.PrinterCoverOpenedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PrinterCoverOpenedThread(_eventHandler, args.PrinterCoverOpenedReportRequest);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupCenterPrintercoverClosed(object sender, OibClient.PrinterCoverClosedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PrinterCoverClosedThread(_eventHandler, args.PrinterCoverClosedReportRequest);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupCenterPrinterConsumablesChanged(object sender, OibClient.PrinterConsumablesUpdatedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PrinterConsumablesChangedThread(_eventHandler, args.PrinterConsumablesUpdatedReportRequest);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupCenterPrinterCapabilitiesChanged(object sender, OibClient.PrinterCapabilitiesChangedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PrinterCapabilitiesChangedThread(_eventHandler, args.PrinterCapabilitiesChangedReportRequest);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupCenterPrinterToolUnVerified(object sender, OibClient.PrinterToolUnverifiedEventArgs args)
|
||||
{
|
||||
startSetupcenterEvent(args);
|
||||
try
|
||||
{
|
||||
var mmt = new PrinterToolUnVerifiedThread(_eventHandler, args.PrinterToolUnverifiedReportRequest);
|
||||
var thread = new Thread(mmt.ThreadFunction);
|
||||
thread.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
setupcenterEventFailed(args, e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Calls delegieren an die eigentliche Implementierung
|
||||
|
||||
public class FeederPlacedThread : ThreadTemplate<FeederPlacedReport>
|
||||
{
|
||||
public FeederPlacedThread(OIBEventHandler eventHandler, FeederPlacedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.FeederPlacedReportMapper.get(_request);
|
||||
getEventHandler().feederPlaced(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class FeederRemovedThread : ThreadTemplate<FeederRemovedReport>
|
||||
{
|
||||
public FeederRemovedThread(OIBEventHandler eventHandler, FeederRemovedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.FeederRemovedReportMapper.get(_request);
|
||||
getEventHandler().feederRemoved(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class NewSetupActiveThread : ThreadTemplate<NewSetupActiveReport>
|
||||
{
|
||||
public NewSetupActiveThread(OIBEventHandler eventHandler, NewSetupActiveReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.NewSetupActiveReportMapper.get(_request);
|
||||
getEventHandler().newSetupActive(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PackagingQuantityChangedThread : ThreadTemplate<PackagingQuantityChangedReport>
|
||||
{
|
||||
public PackagingQuantityChangedThread(OIBEventHandler eventHandler, PackagingQuantityChangedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PackagingQuantityChangedReportMapper.get(_request);
|
||||
getEventHandler().packagingQuantityChanged(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
public class SetupChangedThread : ThreadTemplate<SetupChangedReport>
|
||||
{
|
||||
public SetupChangedThread(OIBEventHandler eventHandler, SetupChangedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.SetupChangedReportMapper.get(_request);
|
||||
getEventHandler().setupChanged(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PackagingUnitConsumedThread : ThreadTemplate<PackagingUnitConsumedReport>
|
||||
{
|
||||
public PackagingUnitConsumedThread(OIBEventHandler eventHandler, PackagingUnitConsumedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitConsumedReportMapper.get(_request);
|
||||
getEventHandler().packagingUnitConsumed(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Calls delegieren an die eigentliche Implementierung
|
||||
|
||||
|
||||
public class MaterialMovedThread : ThreadTemplate<MaterialMovedReport>
|
||||
{
|
||||
public MaterialMovedThread(OIBEventHandler eventHandler, MaterialMovedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.MaterialMovedReportMapper.get(_request);
|
||||
getEventHandler().materialMoved(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PrinterToolVerifiedThread : ThreadTemplate<PrinterToolVerifiedReport>
|
||||
{
|
||||
public PrinterToolVerifiedThread(OIBEventHandler eventHandler, PrinterToolVerifiedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PrinterToolVerifiedReportMapper.get(_request);
|
||||
getEventHandler().printerToolVerified(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PrinterMaterialVerifiedThread : ThreadTemplate<PrinterMaterialVerifiedReport>
|
||||
{
|
||||
public PrinterMaterialVerifiedThread(OIBEventHandler eventHandler, PrinterMaterialVerifiedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PrinterMaterialVerifiedReportMapper.get(_request);
|
||||
getEventHandler().printerMaterialVerified(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PrinterMaterialUnverifiedThread : ThreadTemplate<PrinterMaterialUnverifiedReport>
|
||||
{
|
||||
public PrinterMaterialUnverifiedThread(OIBEventHandler eventHandler, PrinterMaterialUnverifiedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PrinterMaterialUnverifiedReportMapper.get(_request);
|
||||
getEventHandler().printerMaterialUnverified(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PrinterCoverOpenedThread : ThreadTemplate<PrinterCoverOpenedReport>
|
||||
{
|
||||
public PrinterCoverOpenedThread(OIBEventHandler eventHandler, PrinterCoverOpenedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PrinterCoverOpenedReportMapper.get(_request);
|
||||
getEventHandler().printerCoverOpened(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PrinterCoverClosedThread : ThreadTemplate<PrinterCoverClosedReport>
|
||||
{
|
||||
public PrinterCoverClosedThread(OIBEventHandler eventHandler, PrinterCoverClosedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PrinterCoverClosedReportMapper.get(_request);
|
||||
getEventHandler().printerCoverClosed(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PrinterConsumablesChangedThread : ThreadTemplate<PrinterConsumablesUpdatedReport>
|
||||
{
|
||||
public PrinterConsumablesChangedThread(OIBEventHandler eventHandler, PrinterConsumablesUpdatedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PrinterConsumablesUpdatedReportMapper.get(_request);
|
||||
getEventHandler().printerConsumablesUpdated(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PrinterCapabilitiesChangedThread : ThreadTemplate<PrinterCapabilitiesChangedReport>
|
||||
{
|
||||
public PrinterCapabilitiesChangedThread(OIBEventHandler eventHandler, PrinterCapabilitiesChangedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PrinterCapabilitiesChangedReportMapper.get(_request);
|
||||
getEventHandler().printerCapabilitiesChanged(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PrinterToolUnVerifiedThread : ThreadTemplate<PrinterToolUnverifiedReport>
|
||||
{
|
||||
public PrinterToolUnVerifiedThread(OIBEventHandler eventHandler, PrinterToolUnverifiedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PrinterToolUnverifiedReportMapper.get(_request);
|
||||
getEventHandler().printerToolUnverified(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public class PrinterRecipeVerifiedThread : ThreadTemplate<PrinterRecipeVerifiedReport>
|
||||
{
|
||||
public PrinterRecipeVerifiedThread(OIBEventHandler eventHandler, PrinterRecipeVerifiedReport request) : base(eventHandler, request) { }
|
||||
|
||||
public void ThreadFunction()
|
||||
{
|
||||
var mesNamespaceConformRequest = com.itac.oib.siplacesetupcenter.contracts.data.PrinterRecipeVerifiedReportMapper.get(_request);
|
||||
getEventHandler().printerRecipeVerified(mesNamespaceConformRequest);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region IDisposeable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_oibSetupCenterEvents != null)
|
||||
_oibSetupCenterEvents.Dispose();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
88
interface/asm/dotnet/Oib5xGUI/src/main/csharp/SpiReceiver.cs
Normal file
88
interface/asm/dotnet/Oib5xGUI/src/main/csharp/SpiReceiver.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Asm.As.Oib.Client;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
public class SpiReceiver : IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly OIBEventHandler _eventHandler;
|
||||
private readonly OibSpiEvents _oibSpiEvents;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public SpiReceiver(OibSpiEvents oibSpiEvents, OIBEventHandler eventHandler)
|
||||
{
|
||||
_eventHandler = eventHandler;
|
||||
_oibSpiEvents = oibSpiEvents;
|
||||
|
||||
oibSpiEvents.RecipeSecifiedForStation += OibSpiEventsRecipeSecifiedForStation;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Start/Stopp
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_oibSpiEvents.StartDownloadEvents();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
_oibSpiEvents.StopDownloadEvents();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Handling of events
|
||||
|
||||
public void OibSpiEventsRecipeSecifiedForStation(object sender, Asm.As.Oib.Client.RecipeSecifiedForStationEventArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
com.itac.oib.linecontrol.data.DownloadData downloadData = new com.itac.oib.linecontrol.data.DownloadData();
|
||||
downloadData.strServiceComputer = "";
|
||||
downloadData.downloadTime = args.DownloadTime;
|
||||
downloadData.lineName = args.ProductionScheduleElement.Recipe.Setup.Line.FullPath;
|
||||
downloadData.stationName = args.StationIdentity.FullPath;
|
||||
downloadData.conveyorLanes = args.IsRightLane ? "Right" : "Left";
|
||||
downloadData.jobName = args.ProductionScheduleElement.OrderID;
|
||||
downloadData.recipeName = args.ProductionScheduleElement.Recipe.FullPath;
|
||||
downloadData.productionScheduleName = args.ProductionScheduleDisplayName;
|
||||
downloadData.productionScheduleElementId = args.ProductionScheduleElement.ID;
|
||||
downloadData.placementInfo = com.itac.oib.siplacepro.service.SiplacePro.GetPlacementForRecipe(args.ProductionScheduleElement.Recipe);
|
||||
_eventHandler.downloadEvent(downloadData);
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "download Event received");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Trace.WriteLine("Error processing SPI property changed event: " + ex.Message);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "Error processing SPI property changed event: ", ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposeable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_oibSpiEvents != null)
|
||||
_oibSpiEvents.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Asm.As.Oib.Client.CustomExtensions;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
using com.itac.oib.traceability.contracts.data;
|
||||
using OibClient = Asm.As.Oib.Client;
|
||||
#endregion
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
/// <summary>
|
||||
/// Receiver class for the TraceService events
|
||||
/// </summary>
|
||||
public class TraceabilityReceiver : IDisposable, IReceiver
|
||||
{
|
||||
#region Fields
|
||||
|
||||
OIBEventHandler _eventHandler;
|
||||
readonly OibClient.OibTraceabilityEvents _oibTraceabilityEvents;
|
||||
readonly OperatorNotificationManager _operatorNotificationManager;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
public TraceabilityReceiver(OibClient.OibTraceabilityEvents oibTraceEvents, OIBEventHandler eventHandler, OperatorNotificationManager operatorNotificationManager)
|
||||
{
|
||||
if (oibTraceEvents == null) throw new ArgumentNullException("oibTraceEvents");
|
||||
if (eventHandler == null) throw new ArgumentNullException("eventHandler");
|
||||
if (operatorNotificationManager == null) throw new ArgumentNullException("operatorNotificationManager");
|
||||
|
||||
_oibTraceabilityEvents = oibTraceEvents;
|
||||
_eventHandler = eventHandler;
|
||||
_operatorNotificationManager = operatorNotificationManager;
|
||||
|
||||
oibTraceEvents.TraceabilityData = TraceDataReceived;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Start/Stop
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_oibTraceabilityEvents.Start();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
_oibTraceabilityEvents.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Handling of events
|
||||
|
||||
|
||||
public www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.BoardProducedResponse TraceDataReceived(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.TraceabilityData traceabilityData)
|
||||
{
|
||||
www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.BoardProducedResponse response = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.BoardProducedResponse ();
|
||||
try
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "ITraceabilityOibService.NewTraceabilityData");
|
||||
if (_eventHandler != null)
|
||||
{
|
||||
|
||||
TraceabilityData itacTraceData = TraceabilityDataMapper.get(traceabilityData);
|
||||
BoardProducedResponse result = _eventHandler.boardProduced(itacTraceData);
|
||||
if (result.BoardValidationResult == 2)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "received the RC_TRCDATA_REJECTED return code");
|
||||
try
|
||||
{
|
||||
_operatorNotificationManager.TraceDataRejected("Die letzte Station wurde gestoppt, da iTac die Tracedaten als fehlerhaft erkannt hat.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "calling OperatorNotificationManager failed", ex);
|
||||
}
|
||||
}
|
||||
else if (result.BoardValidationReason.StartsWith("RC_TRCDATA_REJECTED:"))
|
||||
{
|
||||
string message = result.BoardValidationReason.Replace("RC_TRCDATA_REJECTED:", "");
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "received the RC_TRCDATA_REJECTED return code with additional l message text " + message);
|
||||
try
|
||||
{
|
||||
_operatorNotificationManager.TraceDataRejected(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "calling OperatorNotificationManager failed", ex);
|
||||
}
|
||||
}
|
||||
response.BoardValidationResult = 2;
|
||||
return response;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Warning, "calling ITraceabilityOibService.NewTraceabilityData not performed");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// der letzte Aufruf schlug fehl!!
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "calling NewTraceabilityData in eventHandler failed", e);
|
||||
}
|
||||
response.BoardValidationResult = 1;
|
||||
return response;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposeable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_oibTraceabilityEvents != null)
|
||||
_oibTraceabilityEvents.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Itac.Oib
|
||||
{
|
||||
public interface IReceiver
|
||||
{
|
||||
void Start();
|
||||
|
||||
void Stop();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
using com.itac.oib;
|
||||
using com.itac.oib.boardgatekeeper.service;
|
||||
using com.itac.oib.displayservice.service;
|
||||
using com.itac.oib.linecontrol.service;
|
||||
using com.itac.oib.monitoring.service;
|
||||
using com.itac.oib.siplacesetupcenter.service;
|
||||
using com.itac.oib.traceability.service;
|
||||
|
||||
namespace com.itac.mes.domain
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Defines all events, that will sent from siplace machine
|
||||
/// </summary>
|
||||
public interface OIBEvents : ISiplaceSetupCenterNotify, ITraceability, ISetupCenterExternalControl, IMonitoringReceiver,
|
||||
IDisplayServiceCallback, ILineControlReceiver, IAdapterNotify, IChangeoverManager, IBoardGateKeeper, IDekPrinterExternalControl, ILineControlMesInterceptor
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using com.itac.oib;
|
||||
using com.itac.oib.displayservice.service;
|
||||
using com.itac.oib.linecontrol.service;
|
||||
using com.itac.oib.siplacepro.service;
|
||||
using com.itac.oib.siplacesetupcenter.service;
|
||||
|
||||
namespace com.itac.mes.domain
|
||||
{
|
||||
|
||||
public interface OIBService : ISiplaceSetupCenter, IAdapterControl, ILineControl, ISiplacePro, IDisplayService
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace com.itac.mes.proxy
|
||||
{
|
||||
public class Constants
|
||||
{
|
||||
public const String SERVICE_NAME = "iTAC OIB Proxy";
|
||||
public const String SERVICE_DESC = "iTAC OIB Proxy";
|
||||
|
||||
public const String EVENT_TYPE = "Application";
|
||||
|
||||
public const String LOGGER = "iTAC-OIB";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using log4net.Config;
|
||||
|
||||
namespace com.itac.mes.proxy
|
||||
{
|
||||
public class LogHandler
|
||||
{
|
||||
private static Object lockObject = new Object();
|
||||
|
||||
protected static readonly ILog logger = LogManager.GetLogger(Constants.LOGGER);
|
||||
private static TraceSource ts = new TraceSource(Constants.SERVICE_NAME, SourceLevels.All);
|
||||
|
||||
static LogHandler()
|
||||
{
|
||||
XmlConfigurator.Configure();
|
||||
}
|
||||
|
||||
public static void addListener(TraceListener listener)
|
||||
{
|
||||
ts.Listeners.Add(listener);
|
||||
}
|
||||
|
||||
public static void log(String loggerName, TraceEventType level, String message)
|
||||
{
|
||||
log(loggerName, level, message, null);
|
||||
}
|
||||
|
||||
public static void log(String loggerName, TraceEventType level, String message, Exception e)
|
||||
{
|
||||
// alles wird geloggt, aber nur Error und Fatal an die TraceSource weiter gereicht
|
||||
try
|
||||
{
|
||||
lock (lockObject)
|
||||
{
|
||||
switch (level)
|
||||
{
|
||||
case TraceEventType.Critical: ts.TraceEvent(level, 10, message);
|
||||
ts.Flush();
|
||||
logger.Fatal(message, e);
|
||||
break;
|
||||
case TraceEventType.Error: ts.TraceEvent(level, 10, message);
|
||||
ts.Flush();
|
||||
logger.Error(message, e);
|
||||
break;
|
||||
case TraceEventType.Information:
|
||||
logger.Info(message, e);
|
||||
break;
|
||||
case TraceEventType.Verbose:
|
||||
logger.Debug(message, e);
|
||||
break;
|
||||
case TraceEventType.Warning:
|
||||
logger.Warn(message, e);
|
||||
break;
|
||||
default: logger.Info(message, e);
|
||||
ts.TraceEvent(level, 10, message);
|
||||
ts.Flush();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ThreadInterruptedException) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,698 @@
|
||||
#region Namespace
|
||||
using Asm.As.Oib.Client;
|
||||
using Asm.As.Oib.SiplacePro.LineControl.Contracts;
|
||||
using Asm.As.Oib.SiplacePro.Proxy.Architecture.Objects;
|
||||
using com.itac.mes.domain;
|
||||
using com.itac.oib;
|
||||
using com.itac.oib.displayservice.contracts.data;
|
||||
using com.itac.oib.linecontrol.contracts.data;
|
||||
using com.itac.oib.siplacesetupcenter.contracts.data;
|
||||
using com.itac.oib.siplacepro.service;
|
||||
using com.itac.oib.siplacepro.contracts.data;
|
||||
using Itac.Oib;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using LcTypes = Asm.As.Oib.SiplacePro.LineControl.Contracts;
|
||||
using OibSpiTyp = Asm.As.Oib.SiplacePro.Proxy.Types;
|
||||
using Asm.As.Oib.Client.CustomExtensions;
|
||||
using com.itac.oib.client.customextensions;
|
||||
using com.itac.oib.traceability.contracts.data;
|
||||
using com.itac.oib.linecontrol.data;
|
||||
using System.Collections.Generic;
|
||||
using Asm.As.Oib.DisplayService.Contracts.Messages;
|
||||
#endregion
|
||||
|
||||
namespace com.itac.mes.proxy.business
|
||||
{
|
||||
public class OIBServiceImpl : OIBService, IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private IAdapterControl _adapterControl;
|
||||
private readonly MessageWriter _messageWriter;
|
||||
public ChangeoverReceiver ChangeoverReceiver { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public OIBServiceImpl(IAdapterControl adapterControl, MessageWriter messageWriter)
|
||||
{
|
||||
_adapterControl = adapterControl;
|
||||
_messageWriter = messageWriter;
|
||||
}
|
||||
|
||||
public OibSetupCenterAccess OibSetupCenterAccess { get; set; }
|
||||
public OibLineControlAccess OibLineControlAccess { get; set; }
|
||||
public SiplacePro SiplacePro { set; get; }
|
||||
public OibDisplayServiceAccess DisplayServiceAccess { get; set; }
|
||||
public string configuredLineFullPath { get; set; }
|
||||
public string firstMachineInLine { get; set; }
|
||||
public string lastMachineInLine { get; set; }
|
||||
|
||||
public void Shutdown()
|
||||
{
|
||||
}
|
||||
|
||||
internal void SetAdapterControl(IAdapterControl adapterControl)
|
||||
{
|
||||
_adapterControl = adapterControl;
|
||||
}
|
||||
|
||||
#region ISiplaceSetupCenter Member
|
||||
|
||||
public void set(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitLocation[] packagingUnitLocations)
|
||||
{
|
||||
try
|
||||
{
|
||||
OibSetupCenterAccess.Set(PackagingUnitLocationMapper.get(packagingUnitLocations));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "Class OIBServiceImpl, Call ISiplaceSetupCenter.Set failed: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void refill(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitLocation[] packagingUnitLocations)
|
||||
{
|
||||
try
|
||||
{
|
||||
OibSetupCenterAccess.Refill(PackagingUnitLocationMapper.get(packagingUnitLocations));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "Class OIBServiceImpl, Call ISiplaceSetupCenter.Refill failed: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void tearDown(string strSetup, com.itac.oib.siplacesetupcenter.contracts.data.ComponentLocation[] componentLocations)
|
||||
{
|
||||
try
|
||||
{
|
||||
OibSetupCenterAccess.TearDown(strSetup, ComponentLocationMapper.get(componentLocations));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "Class OIBServiceImpl, Call ISiplaceSetupCenter.TearDown failed: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
public com.itac.oib.siplacesetupcenter.contracts.data.MachineSetup getReducedActualSetup(string machineId)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SetupCenter.GetReducedActualSetup(machineId=" + machineId + ")");
|
||||
try
|
||||
{
|
||||
Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.MachineSetup oibMachineSetup = OibSetupCenterAccess.GetReducedActualSetup(machineId);
|
||||
if (oibMachineSetup == null)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to SetupCenter.GetReducedActualSetup returned null");
|
||||
return null;
|
||||
}
|
||||
MachineSetup machineSetup = MachineSetupMapper.get(oibMachineSetup);
|
||||
Evaluate(machineSetup);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to SetupCenter.GetReducedActualSetup returned");
|
||||
return machineSetup;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to SetupCenter.GetReducedActualSetup failed", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public PackagingUnitResult[] update(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnit[] packagingUnits)
|
||||
{
|
||||
try
|
||||
{
|
||||
return PackagingUnitResultMapper.getArray(OibSetupCenterAccess.Get(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitMapper.get(packagingUnits)));
|
||||
}
|
||||
catch (Exception) { return null; }
|
||||
}
|
||||
|
||||
public PackagingUnitResult[] get(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnit[] packagingUnits)
|
||||
{
|
||||
try
|
||||
{
|
||||
return PackagingUnitResultMapper.getArray(OibSetupCenterAccess.Get(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitMapper.get(packagingUnits)));
|
||||
}
|
||||
catch (Exception) { return null; }
|
||||
}
|
||||
|
||||
public com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitResult[] create(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnit[] packagingUnits)
|
||||
{
|
||||
try { return PackagingUnitResultMapper.getArray(OibSetupCenterAccess.Get(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitMapper.get(packagingUnits))); }
|
||||
catch (Exception) { return null; }
|
||||
}
|
||||
|
||||
public PackagingUnitResult[] delete(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnit[] packagingUnits)
|
||||
{
|
||||
return PackagingUnitResultMapper.getArray(OibSetupCenterAccess.Get(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitMapper.get(packagingUnits)));
|
||||
}
|
||||
|
||||
public void activate(ComponentLocation[] componentLocations)
|
||||
{
|
||||
try
|
||||
{
|
||||
OibSetupCenterAccess.Activate(ComponentLocationMapper.get(componentLocations));
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
public void deactivate(com.itac.oib.siplacesetupcenter.contracts.data.ComponentLocation[] componentLocations, string reason)
|
||||
{
|
||||
try
|
||||
{
|
||||
OibSetupCenterAccess.Deactivate(ComponentLocationMapper.get(componentLocations), reason);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
public void lockUids(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnit[] puIDs, string reason)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SetupCenter.Lock(reason=" + reason + ")");
|
||||
try
|
||||
{
|
||||
OibSetupCenterAccess.Lock(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitMapper.get(puIDs), reason);
|
||||
Evaluate(puIDs);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to SetupCenter.Lock returned");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to SetupCenter.Lock failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void unlockUids(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnit[] puIDs)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SetupCenter.Unlock");
|
||||
try
|
||||
{
|
||||
OibSetupCenterAccess.Unlock(com.itac.oib.siplacesetupcenter.contracts.data.PackagingUnitMapper.get(puIDs));
|
||||
Evaluate(puIDs);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to SetupCenter.Unlock returned");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to SetupCenter.Unlock failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
public Configuration getConfiguration()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SetupCenter.GetConfiguration");
|
||||
try
|
||||
{
|
||||
var configuration = ConfigurationMapper.get(OibSetupCenterAccess.GetConfiguration());
|
||||
Evaluate(configuration);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to SetupCenter.GetConfiguration returned");
|
||||
|
||||
return configuration;
|
||||
}
|
||||
catch
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to SetupCenter.GetConfiguration failed");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public bool isConnected()
|
||||
{
|
||||
try
|
||||
{
|
||||
return OibSetupCenterAccess.IsConnected();
|
||||
}
|
||||
catch { return false; }
|
||||
}
|
||||
|
||||
public void setMessageLevel(int messageLevel)
|
||||
{
|
||||
try
|
||||
{
|
||||
OibSetupCenterAccess.SetMessageLevel(messageLevel);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public string getDatabaseName()
|
||||
{
|
||||
try
|
||||
{
|
||||
return OibSetupCenterAccess.GetDatabaseName();
|
||||
}
|
||||
catch { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ILineControl Member
|
||||
|
||||
public string getDatabaseId()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to LineControl.getDatabaseId");
|
||||
try
|
||||
{
|
||||
String result = OibLineControlAccess.LineControlSession.DatabaseId;
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to LineControl.getDatabaseId returned " + result);
|
||||
return result;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to LineControl.getDatabaseId failed, return false ", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string getAdapterTimeZone()
|
||||
{
|
||||
try
|
||||
{
|
||||
return OibLineControlAccess.LineControlSession.GetAdapterTimeZone();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to LineControl.getAdapterTimeZone failed, return empty string ", e);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// full path required (including folders)
|
||||
/// </summary>
|
||||
/// <param name="lineName"></param>
|
||||
/// <returns></returns>
|
||||
public bool stopLine(string lineName)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to LineControl.StopLine(" + lineName + ")");
|
||||
try
|
||||
{
|
||||
bool b = OibLineControlAccess.LineControlSession.StopLine(lineName);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to LineControl.StopLine returned " + b);
|
||||
return b;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to LineControl.StopLine failed, return false ", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool stopLineConveyor(string lineName, int nLanes)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to LineControl.StopLineConveyor(" + lineName + "," + nLanes + ")");
|
||||
try
|
||||
{
|
||||
var oibLanes = (LcTypes.ConveyorLanes)Enum.ToObject(typeof(LcTypes.ConveyorLanes), nLanes);
|
||||
bool b = OibLineControlAccess.LineControlSession.StopLineConveyor(lineName, oibLanes);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to LineControl.StopLineConveyor returned " + b);
|
||||
return b;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to LineControl.StopLineConveyor failed, return false", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool continueLine(string lineName)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to LineControl.ContinueLine(" + lineName + ")");
|
||||
try
|
||||
{
|
||||
bool b = OibLineControlAccess.LineControlSession.ContinueLine(lineName);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to LineControl.ContinueLine returned " + b);
|
||||
return b;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to LineControl.ContinueLine failed, return false", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool continueLineConveyor(string lineName, int nLanes)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to LineControl.ContinueLineConveyor(" + lineName + "," + nLanes + ")");
|
||||
try
|
||||
{
|
||||
var oibLanes = (LcTypes.ConveyorLanes)Enum.ToObject(typeof(LcTypes.ConveyorLanes), nLanes);
|
||||
bool b = OibLineControlAccess.LineControlSession.ContinueLineConveyor(lineName, oibLanes);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to LineControl.ContinueLineConveyor returned " + b);
|
||||
return b;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to LineControl.ContinueLineConveyor failed, return false", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool blockStationInputConveyor(string station, bool bLock, string strBlockingApplicationName)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to LineControl.BlockStationInputConveyor(" + station + "," + bLock + ", " + strBlockingApplicationName + ")");
|
||||
try
|
||||
{
|
||||
bool b = OibLineControlAccess.LineControlSession.BlockStationInputConveyor(station, bLock, strBlockingApplicationName);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to LineControl.BlockStationInputConveyor returned " + b);
|
||||
return b;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to LineControl.BlockStationInputConveyor failed, return false", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool unBlockStationInputConveyor(string station, string strUnblockingApplicationName)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to LineControl.UnBlockStationInputConveyor(" + station + ", " + strUnblockingApplicationName + ")");
|
||||
try
|
||||
{
|
||||
bool b = OibLineControlAccess.LineControlSession.UnBlockStationInputConveyor(station, strUnblockingApplicationName);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to LineControl.UnBlockStationInputConveyor returned " + b);
|
||||
return b;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to LineControl.UnBlockStationInputConveyor failed, return false", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public string getActiveProductionSchedule(string lineName)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to LineControl.GetActiveProductionSchedule(" + lineName + ")");
|
||||
String result = null;
|
||||
try
|
||||
{
|
||||
result = OibLineControlAccess.LineControlSession.GetActiveProductionSchedule(lineName);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to LineControl.GetActiveProductionSchedule(" + lineName + ") returned " + result);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to LineControl.GetActiveProductionSchedule failed", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public LineControlLineStatus getLineStatus(string lineName)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to LineControl.GetLineStatus(" + lineName + ")");
|
||||
LineControlLineStatus result = null;
|
||||
try
|
||||
{
|
||||
result = LineControlLineStatusMapper.get(OibLineControlAccess.LineControlSession.GetLineStatus(lineName));
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to LineControl.GetLineStatus(" + lineName + ") returned ");
|
||||
Evaluate(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, ".NET call to LineControl.GetLineStatus failed", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public StartJobResult startPlacementRecipe(string productionSchedule, string jobName, int conveyor)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to LineControl.startPlacementRecipe(schedule=" + productionSchedule + ", job=" + jobName + ", conveyor=" + conveyor + ")");
|
||||
|
||||
StartJobResult startJobResult = new StartJobResult();
|
||||
try
|
||||
{
|
||||
// evtl. ist productionSchedule leer, dann den aktuellen Schedule der Linie nehmen
|
||||
LcTypes.ConveyorLanes lcLane = (LcTypes.ConveyorLanes)conveyor;
|
||||
|
||||
// Get the SIPLACE Pro session for the SPI adapter on the local host
|
||||
Session session = SiplacePro.oibSpiAccess.Session;
|
||||
|
||||
// Get the line the production schedule will be for.
|
||||
Object line = session.GetObject(configuredLineFullPath, OibSpiTyp.ObjectServerType.Line);
|
||||
if (line == null)
|
||||
{
|
||||
startJobResult.errorText = string.Format("Line '{0}' does not exist in SIPLACE Pro.", configuredLineFullPath);
|
||||
startJobResult.result = false;
|
||||
return startJobResult;
|
||||
}
|
||||
|
||||
if (productionSchedule.Equals("") || productionSchedule.Equals("*"))
|
||||
{
|
||||
// automatic resolving of current production schedule
|
||||
productionSchedule = OibLineControlAccess.LineControlSession.GetActiveProductionSchedule(configuredLineFullPath);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "automatic resolved ProductionSchedule is " + productionSchedule);
|
||||
}
|
||||
|
||||
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.ProductionSchedule prodSched = session.GetObject(productionSchedule, OibSpiTyp.ObjectServerType.ProductionSchedule) as Asm.As.Oib.SiplacePro.Proxy.Business.Objects.ProductionSchedule;
|
||||
if (prodSched == null)
|
||||
{
|
||||
startJobResult.errorText = string.Format("ProductionSchedule '{0}' not found in SIPLACE Pro.", productionSchedule);
|
||||
startJobResult.result = false;
|
||||
return startJobResult;
|
||||
}
|
||||
bool found = false;
|
||||
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.ProductionScheduleElement productionScheduleElement = null;
|
||||
foreach (Asm.As.Oib.SiplacePro.Proxy.Business.Objects.ProductionScheduleElement prodSchedElem in prodSched.ProductionScheduleElements.Values)
|
||||
{
|
||||
if (prodSchedElem.Recipe.Name.Equals(jobName) || prodSchedElem.Recipe.FullPath.Equals(jobName))
|
||||
{
|
||||
found = true;
|
||||
productionScheduleElement = prodSchedElem;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
startJobResult.errorText = string.Format("Job {0} not found in ProductionSchedule '{1}'.", jobName, productionSchedule);
|
||||
startJobResult.result = false;
|
||||
return startJobResult;
|
||||
}
|
||||
|
||||
Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.DownloadResult result = OibLineControlAccess.LineControlSession.DownloadIC(
|
||||
prodSched.FullPath, //Name of the production schedule
|
||||
prodSched.ProductionScheduleElements.IndexOf(productionScheduleElement), //Zero based index of the ProductionScheduleElement
|
||||
"", // ProductionScheduleElement ID, if this is empty, Index will be used
|
||||
lcLane,//
|
||||
LcTypes.IntegrityCheckMode.AllowHeadstepRecalcuation,
|
||||
LcTypes.IntegrityCheckModeForRepartitioning.AvoidRepartitioning,
|
||||
LcTypes.DownloadProcessingOptions.AutoWidthAdjust | LcTypes.DownloadProcessingOptions.OverwriteFeederSettings)
|
||||
as Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.DownloadResult;
|
||||
startJobResult.result = result.Succeeded;
|
||||
startJobResult.errorText = result.DetailedResults.ToString();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
startJobResult.errorText = e.Message;
|
||||
startJobResult.result = false;
|
||||
return startJobResult;
|
||||
}
|
||||
Evaluate(startJobResult);
|
||||
return startJobResult;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region IAdapterControl Member
|
||||
|
||||
public void startSetupCenterNotifyReceiver()
|
||||
{
|
||||
if (_adapterControl != null) { _adapterControl.startSetupCenterNotifyReceiver(); }
|
||||
}
|
||||
|
||||
public void stopSetupCenterNotifyReceiver()
|
||||
{
|
||||
if (_adapterControl != null) { _adapterControl.stopSetupCenterNotifyReceiver(); }
|
||||
}
|
||||
|
||||
public void startMonitoringReceiver()
|
||||
{
|
||||
_adapterControl.startMonitoringReceiver();
|
||||
}
|
||||
|
||||
public void stopMonitoringReceiver()
|
||||
{
|
||||
_adapterControl.stopMonitoringReceiver();
|
||||
}
|
||||
|
||||
public bool ping()
|
||||
{
|
||||
return _adapterControl.ping();
|
||||
}
|
||||
|
||||
public bool isSetupStation()
|
||||
{
|
||||
return _adapterControl.isSetupStation();
|
||||
}
|
||||
|
||||
public void setInterfaceHost(int port, string ipAddress, string canonicalHostName, string hostName)
|
||||
{
|
||||
_adapterControl.setInterfaceHost(port, ipAddress, canonicalHostName, hostName);
|
||||
}
|
||||
|
||||
public void setChannelName(string channelName)
|
||||
{
|
||||
_adapterControl.setChannelName(channelName);
|
||||
}
|
||||
|
||||
public void startTraceReceiver()
|
||||
{
|
||||
_adapterControl.startTraceReceiver();
|
||||
}
|
||||
|
||||
public void stopTraceReceiver()
|
||||
{
|
||||
_adapterControl.stopTraceReceiver();
|
||||
}
|
||||
|
||||
public void startBoardGateKeeper()
|
||||
{
|
||||
_adapterControl.startBoardGateKeeper();
|
||||
}
|
||||
|
||||
public void stopBoardGateKeeper()
|
||||
{
|
||||
_adapterControl.stopBoardGateKeeper();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISiplacePro Member
|
||||
|
||||
public BoardCheckInRequest completeCheckinData(BoardCheckInRequest checkinData)
|
||||
{
|
||||
return SiplacePro.completeCheckinData(checkinData);
|
||||
}
|
||||
|
||||
public BoardElement[] getPlacementForBoard(String boardFullName)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SiplacePro.getPlacementForBoard(" + boardFullName + ")");
|
||||
BoardElement[] placeInfo = null;
|
||||
try
|
||||
{
|
||||
placeInfo = SiplacePro.getPlacementForBoard(boardFullName);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call to SiplacePro.getPlacementForBoard(" + boardFullName + ") returned ");
|
||||
Evaluate(placeInfo);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "java call to SiplacePro.getPlacementForBoard failed", e);
|
||||
}
|
||||
return placeInfo;
|
||||
}
|
||||
|
||||
// beim starten des interface ermittelt sich das Interface darueber einmalig den Status und die Rüstng der Linie, und
|
||||
// kann damit die Rüstung neu aufbauen
|
||||
oib.client.customextensions.LineChangeoverEventArgs ISiplacePro.getCurrentLineProductionData()
|
||||
{
|
||||
if (ChangeoverReceiver == null) { return null; }
|
||||
return ChangeoverReceiver.getCurrentLineProductionData();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Logging Utils
|
||||
|
||||
private void Evaluate(Object arg)
|
||||
{
|
||||
if (_messageWriter != null)
|
||||
{
|
||||
_messageWriter.output(arg);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (OibLineControlAccess != null)
|
||||
OibLineControlAccess.Dispose();
|
||||
if (OibSetupCenterAccess != null)
|
||||
OibSetupCenterAccess.Dispose();
|
||||
if (OibLineControlAccess != null)
|
||||
OibLineControlAccess.Dispose();
|
||||
if (OibLineControlAccess != null)
|
||||
OibLineControlAccess.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public void sendMessageByLinePathAllStations(string linePath, string messageText, string extendedDescription, AcknowledgementType acknowledgementType,
|
||||
bool callbackRequest, SeverityLevel severityLevel)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SendMessageByLinePathAllStations");
|
||||
// wenn default-Wert (*) dann den konfigurierten Wert für die Linie benutzen
|
||||
if (linePath == null || linePath.Length == 0 || linePath.Equals("*"))
|
||||
{
|
||||
linePath = configuredLineFullPath;
|
||||
}
|
||||
try
|
||||
{
|
||||
Asm.As.Oib.DisplayService.Proxy.Architecture.Objects.DisplayServiceClient displaySession = DisplayServiceAccess.DisplayServiceSession;
|
||||
Asm.As.Oib.DisplayService.Contracts.Data.Types.AcknowledgementType ackType = AcknowledgementTypeMapper.get(acknowledgementType);
|
||||
Asm.As.Oib.DisplayService.Contracts.Data.Types.SeverityLevel severity = SeverityLevelMapper.get(severityLevel);
|
||||
Asm.As.Oib.DisplayService.Contracts.Messages.SendMessageResponse sendMessageResponse = displaySession.
|
||||
SendMessageByLinePathAllStations(linePath, messageText, extendedDescription, ackType, callbackRequest, 0, severity, null, null);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SendMessageByStationPath finished");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "java call to SendMessageByStationPath finished", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendMessageByLinePathFirstStation(string linePath, string messageText, string extendedDescription, AcknowledgementType acknowledgementType,
|
||||
bool callbackRequest, SeverityLevel severityLevel)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SendMessageByLinePathFirstStation");
|
||||
if (linePath.Equals("*"))
|
||||
{
|
||||
linePath = configuredLineFullPath;
|
||||
}
|
||||
try
|
||||
{
|
||||
Asm.As.Oib.DisplayService.Proxy.Architecture.Objects.DisplayServiceClient displaySession = DisplayServiceAccess.DisplayServiceSession;
|
||||
Asm.As.Oib.DisplayService.Contracts.Data.Types.AcknowledgementType ackType = AcknowledgementTypeMapper.get(acknowledgementType);
|
||||
Asm.As.Oib.DisplayService.Contracts.Data.Types.SeverityLevel severity = SeverityLevelMapper.get(severityLevel);
|
||||
Asm.As.Oib.DisplayService.Contracts.Messages.SendMessageResponse sendMessageResponse = displaySession.
|
||||
SendMessageByLinePathFirstStation(linePath, messageText, extendedDescription, ackType, callbackRequest, 0, severity, null, null);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SendMessageByLinePathFirstStation finished");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "java call to SendMessageByLinePathFirstStation finished", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendMessageByStationPath(string stationPath, string messageText, string extendedDescription, AcknowledgementType acknowledgementType,
|
||||
bool callbackRequest, SeverityLevel severityLevel, Answer[] answerList)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SendMessageByStationPath");
|
||||
if (stationPath.Equals("*"))
|
||||
{
|
||||
stationPath = firstMachineInLine;
|
||||
}
|
||||
else if (stationPath.Equals("#"))
|
||||
{
|
||||
stationPath = lastMachineInLine;
|
||||
}
|
||||
try
|
||||
{
|
||||
Asm.As.Oib.DisplayService.Proxy.Architecture.Objects.DisplayServiceClient displaySession = DisplayServiceAccess.DisplayServiceSession;
|
||||
|
||||
Asm.As.Oib.DisplayService.Contracts.Data.Types.AcknowledgementType ackType = AcknowledgementTypeMapper.get(acknowledgementType);
|
||||
Asm.As.Oib.DisplayService.Contracts.Data.Types.SeverityLevel severity = SeverityLevelMapper.get(severityLevel);
|
||||
|
||||
List<Asm.As.Oib.DisplayService.Contracts.Data.Answer> asmAnswerList = new List<Asm.As.Oib.DisplayService.Contracts.Data.Answer>();
|
||||
|
||||
Asm.As.Oib.DisplayService.Contracts.Messages.SendMessageResponse sendMessageResponse = displaySession.
|
||||
SendMessageByStationPath(stationPath, messageText, extendedDescription, ackType, callbackRequest, 0, severity, asmAnswerList, null);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "java call to SendMessageByStationPath finished with failure");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "java call to SendMessageByStationPath finished", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Runtime.Remoting.Proxies;
|
||||
using System.Threading;
|
||||
using com.itac.artes.ihap;
|
||||
using com.itac.mes.domain;
|
||||
|
||||
|
||||
// Handler der das callen von Methoden des DataInterface aus dem iTAC.OIB.Adapter übernimmt
|
||||
namespace com.itac.mes.proxy.sockets
|
||||
{
|
||||
|
||||
public delegate void PropertyChangeListener(object sender, string channelName, string message);
|
||||
|
||||
|
||||
public class IhapEventChannel : RealProxy
|
||||
{
|
||||
|
||||
private static int CONNECTION_CHECK_MILLIES = 500;
|
||||
|
||||
private TcpClient _client;
|
||||
private IhapOutputStream _ios;
|
||||
private IhapInputStream _iis;
|
||||
private bool _isShutdown;
|
||||
public string channelName { get; set; }
|
||||
private long lastCall = DateTime.Now.Ticks;
|
||||
private Object lockObject = new Object();
|
||||
private Thread aliveThread;
|
||||
|
||||
public event PropertyChangeListener connectionStateChangeListener;
|
||||
|
||||
public IhapEventChannel(TcpClient client, String channelName)
|
||||
: base(typeof(OIBEvents))
|
||||
{
|
||||
lock (typeof(IhapHandler))
|
||||
{
|
||||
}
|
||||
this.channelName = channelName;
|
||||
this._client = client;
|
||||
_ios = new IhapOutputStream(_client.GetStream());
|
||||
_iis = new IhapInputStream(_client.GetStream());
|
||||
|
||||
aliveThread = new Thread(new ThreadStart(aliveThreadRun));
|
||||
}
|
||||
|
||||
public void shutdown()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "closing channel" + channelName);
|
||||
_isShutdown = true;
|
||||
try
|
||||
{
|
||||
_client.Close();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Warning, "closing channel" + channelName + " failed");
|
||||
}
|
||||
}
|
||||
|
||||
public long getLastCall()
|
||||
{
|
||||
return lastCall;
|
||||
}
|
||||
|
||||
public bool isConnected()
|
||||
{
|
||||
return _client.Client.Connected;
|
||||
}
|
||||
|
||||
public bool isShutdownInProgress()
|
||||
{
|
||||
return _isShutdown;
|
||||
}
|
||||
|
||||
public override IMessage Invoke(IMessage message)
|
||||
{
|
||||
lastCall = new DateTime().Ticks;
|
||||
IMethodCallMessage methodMsg = (IMethodCallMessage)message;
|
||||
try
|
||||
{
|
||||
MethodInfo methodInfo = typeof(OIBEvents).GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
|
||||
Type[] interfaces = typeof(OIBEvents).GetInterfaces();
|
||||
foreach (Type t in interfaces)
|
||||
{
|
||||
methodInfo = t.GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
if (methodInfo != null)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, String.Format("found method {0} in interface {1}", methodInfo.Name, t.Name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (methodInfo == null)
|
||||
{
|
||||
throw new Exception("IHapEventChannel: methode '" + methodMsg.MethodName + "' not found in any of the interfaces");
|
||||
}
|
||||
|
||||
object[] args = methodMsg.Args;
|
||||
if (methodMsg.MethodName.Equals("Equals"))
|
||||
{
|
||||
return new ReturnMessage(args[0].Equals(this), args, 0, methodMsg.LogicalCallContext, methodMsg);
|
||||
}
|
||||
else if (methodMsg.MethodName.Equals("GetHashCode"))
|
||||
{
|
||||
return new ReturnMessage(this.GetHashCode(), args, 0, methodMsg.LogicalCallContext, methodMsg);
|
||||
}
|
||||
else if (methodMsg.MethodName.Equals("shutdown"))
|
||||
{
|
||||
shutdown();
|
||||
stopAliveThread();
|
||||
connectionClosed();
|
||||
return new ReturnMessage(null, args, 0, methodMsg.LogicalCallContext, methodMsg);
|
||||
}
|
||||
else if (methodMsg.MethodName.Equals("startup"))
|
||||
{
|
||||
aliveThread.Start();
|
||||
return new ReturnMessage(null, args, 0, methodMsg.LogicalCallContext, methodMsg);
|
||||
}
|
||||
Object retValue = sendCall(methodInfo, args);
|
||||
return new ReturnMessage(retValue, args, 0, methodMsg.LogicalCallContext, methodMsg);
|
||||
}
|
||||
catch (TargetInvocationException ite)
|
||||
{
|
||||
return new ReturnMessage(ite.GetBaseException(), methodMsg);
|
||||
}
|
||||
catch (Exception ite)
|
||||
{
|
||||
return new ReturnMessage(ite.GetBaseException(), methodMsg);
|
||||
}
|
||||
}
|
||||
|
||||
private Object sendCall(MethodInfo method, Object[] args)
|
||||
{
|
||||
lock (lockObject)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "Send event '" + method.Name + "' to socket " + _client.Client.RemoteEndPoint + " on " + channelName);
|
||||
Object result = null;
|
||||
try
|
||||
{
|
||||
_ios.writeBoolean(false);
|
||||
_ios.call(method, args);
|
||||
_ios.Flush();
|
||||
IhapReply reply = _iis.readReply();
|
||||
if (reply is IhapSuccessReply)
|
||||
{
|
||||
result = ((IhapSuccessReply)reply).getReturnValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
IhapFaultReply fault = (IhapFaultReply)reply;
|
||||
switch (fault.getFaultCode())
|
||||
{
|
||||
case FaultCode.NoSuchMethodException:
|
||||
throw new NotImplementedException(fault.getMessage());
|
||||
case FaultCode.ProtocolException:
|
||||
throw new IhapProtocolException(fault.getMessage(), null);
|
||||
default:
|
||||
throw new IhapProtocolException(fault.getMessage(), null);
|
||||
//(Exception)fault.getException();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "Error while sending event call on " + channelName + ":" + e.Message + "\n" + e.StackTrace);
|
||||
shutdown();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void connectionClosed()
|
||||
{
|
||||
// Hier wird überprüft, ob ein Eintrag in der Aufruf-Liste vorhanden ist.
|
||||
if (this.connectionStateChangeListener != null)
|
||||
{
|
||||
// Hier wird jeder Delegat, der sich für den Event registriert hat, aufgerufen.
|
||||
this.connectionStateChangeListener(this, channelName, "connectionClosed");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void stopAliveThread()
|
||||
{
|
||||
if (aliveThread.IsAlive && (aliveThread.ThreadState != System.Threading.ThreadState.Running))
|
||||
{
|
||||
aliveThread.Interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void aliveThreadRun()
|
||||
{
|
||||
while (!_isShutdown && aliveThread.ThreadState == System.Threading.ThreadState.Running)
|
||||
{
|
||||
// wenn der letzte Call länger als .. her ist...
|
||||
try
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// wenn beim schliessen der Verbindung noch was passiert ist das nicht schlimm
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "interrupted for " + channelName);
|
||||
}
|
||||
if (DateTime.Now.Ticks - lastCall > CONNECTION_CHECK_MILLIES)
|
||||
{
|
||||
try
|
||||
{
|
||||
// versuchen den Server zu pingen
|
||||
// wenn das fehlschlägt ist die Verbindung kaputt
|
||||
lock (lockObject)
|
||||
{ // das erfolgreiche Schreiben eines booleschen Wertes ist aus Kommunikationssicht zu sehen wie der
|
||||
// erfolgreiche Aufruf einer Methode
|
||||
if (!_isShutdown && (aliveThread.ThreadState == System.Threading.ThreadState.Running))
|
||||
{
|
||||
// nur wenn die Verbindung nicht bereits gestoppt wurde...
|
||||
_ios.writeBoolean(true);
|
||||
_ios.Flush();
|
||||
lastCall = DateTime.Now.Ticks;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
try
|
||||
{
|
||||
_isShutdown = true;
|
||||
_client.Close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// wenn beim schliessen der Verbindung noch was passiert ist das nicht schlimm
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "shutdown connection problem for " + channelName, e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// die Schreibverbindung ist kaputt, also diese Connection töten...
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "detected broken connection for " + channelName
|
||||
+ " because Server closed port");
|
||||
connectionClosed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// wenn beim schliessen der Verbindung noch was passiert ist das nicht schlimm
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "channel shut down finished for " + channelName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,348 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Runtime.Remoting.Proxies;
|
||||
using System.Threading;
|
||||
using com.itac.artes.ihap;
|
||||
using com.itac.artes.ihap.serialize;
|
||||
using com.itac.mes.domain;
|
||||
using com.itac.mes.proxy.business;
|
||||
using com.itac.oib;
|
||||
using com.itac.oib.boardgatekeeper.service;
|
||||
using com.itac.oib.linecontrol.service;
|
||||
using com.itac.oib.monitoring.service;
|
||||
using com.itac.oib.siplacesetupcenter.service;
|
||||
using com.itac.oib.traceability.service;
|
||||
|
||||
namespace com.itac.mes.proxy.sockets
|
||||
{
|
||||
|
||||
public delegate void ClientDisconnectedHandler(IhapHandler handler);
|
||||
|
||||
public class IhapHandler : RealProxy
|
||||
{
|
||||
private static IDictionary<String, MethodInfo> _methodMap;
|
||||
private static int handlerCounter;
|
||||
|
||||
private Object lockObject = new Object();
|
||||
|
||||
private int handlerNr;
|
||||
private TcpClient _client;
|
||||
private IhapOutputStream _ios;
|
||||
private IhapInputStream _iis;
|
||||
private OIBServiceImpl _serviceImpl;
|
||||
private bool _isShutdown;
|
||||
private long lastCall = DateTime.Now.Ticks;
|
||||
|
||||
|
||||
public IhapHandler(TcpClient client, OIBServiceImpl oibServiceImpl)
|
||||
: base(typeof(OIBEvents))
|
||||
{
|
||||
lock (typeof(IhapHandler))
|
||||
{
|
||||
handlerCounter++;
|
||||
this.handlerNr = handlerCounter;
|
||||
}
|
||||
this._client = client;
|
||||
this._serviceImpl = oibServiceImpl;
|
||||
|
||||
// damit zum testen callbacks aufgerufen werden koennen
|
||||
initMethodMap();
|
||||
Thread thread = new Thread(new ThreadStart(Run));
|
||||
thread.Start();
|
||||
}
|
||||
|
||||
public event ClientDisconnectedHandler ClientDisconnected;
|
||||
|
||||
private static void initMethodMap()
|
||||
{
|
||||
if (_methodMap != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_methodMap = new Dictionary<String, MethodInfo>();
|
||||
ProtocolMapping protocolMapping = new ProtocolMapping_v1();
|
||||
MethodInfo[] methods = typeof(OIBService).GetMethods();
|
||||
foreach (MethodInfo method in methods)
|
||||
{
|
||||
_methodMap.Add(protocolMapping.getOverloadMethodName(method), method);
|
||||
}
|
||||
|
||||
// Alle Methoden aller implmentierten Interface eintragen...
|
||||
Type[] array = typeof(OIBService).GetInterfaces();
|
||||
foreach (Type innerType in array)
|
||||
{
|
||||
methods = innerType.GetMethods();
|
||||
foreach (MethodInfo method in methods)
|
||||
{
|
||||
_methodMap.Add(protocolMapping.getOverloadMethodName(method), method);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void shutdown()
|
||||
{
|
||||
_isShutdown = true;
|
||||
try
|
||||
{
|
||||
_serviceImpl.Shutdown();
|
||||
_client.Close();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public long getLastCall()
|
||||
{
|
||||
return lastCall;
|
||||
}
|
||||
|
||||
public bool isConnected()
|
||||
{
|
||||
return _client.Client.Connected;
|
||||
}
|
||||
|
||||
public string getName()
|
||||
{
|
||||
return "IhapHandler" + handlerNr;
|
||||
}
|
||||
|
||||
public bool isShutdownInProgress()
|
||||
{
|
||||
return _isShutdown;
|
||||
}
|
||||
|
||||
public override IMessage Invoke(IMessage message)
|
||||
{
|
||||
lastCall = new DateTime().Ticks;
|
||||
IMethodCallMessage methodMsg = (IMethodCallMessage)message;
|
||||
try
|
||||
{
|
||||
MethodInfo methodInfo = typeof(OIBEvents).GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
// der Reihe nach alle Interface durchgehen, die als Callback implementiert sind
|
||||
if (methodInfo == null)
|
||||
{
|
||||
methodInfo = typeof(ISiplaceSetupCenterNotify).GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
}
|
||||
if (methodInfo == null)
|
||||
{
|
||||
methodInfo = typeof(ITraceability).GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
}
|
||||
if (methodInfo == null)
|
||||
{
|
||||
methodInfo = typeof(ISetupCenterExternalControl).GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
}
|
||||
if (methodInfo == null)
|
||||
{
|
||||
methodInfo = typeof(IMonitoringReceiver).GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
}
|
||||
if (methodInfo == null)
|
||||
{
|
||||
methodInfo = typeof(ILineControlReceiver).GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
}
|
||||
if (methodInfo == null)
|
||||
{
|
||||
methodInfo = typeof(IAdapterNotify).GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
}
|
||||
if (methodInfo == null)
|
||||
{
|
||||
methodInfo = typeof(IBoardGateKeeper).GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
}
|
||||
if (methodInfo == null)
|
||||
{
|
||||
methodInfo = typeof(IDekPrinterExternalControl).GetMethod(methodMsg.MethodName);
|
||||
methodInfo = typeof(IDekPrinterExternalControl).GetMethod(methodMsg.MethodName, (Type[])methodMsg.MethodSignature);
|
||||
}
|
||||
|
||||
|
||||
if (methodInfo == null)
|
||||
{
|
||||
throw new Exception("IHapHandler.cs: methode nicht in den Interfacen gefunden");
|
||||
}
|
||||
|
||||
object[] args = methodMsg.Args;
|
||||
if (methodMsg.MethodName.Equals("Equals"))
|
||||
{
|
||||
return new ReturnMessage(args[0].Equals(this), args, 0, methodMsg.LogicalCallContext, methodMsg);
|
||||
}
|
||||
else if (methodMsg.MethodName.Equals("GetHashCode"))
|
||||
{
|
||||
return new ReturnMessage(this.GetHashCode(), args, 0, methodMsg.LogicalCallContext, methodMsg);
|
||||
}
|
||||
Object retValue = sendCall(methodInfo, args);
|
||||
return new ReturnMessage(retValue, args, 0, methodMsg.LogicalCallContext, methodMsg);
|
||||
}
|
||||
catch (TargetInvocationException ite)
|
||||
{
|
||||
return new ReturnMessage(ite.GetBaseException(), methodMsg);
|
||||
}
|
||||
catch (Exception ite)
|
||||
{
|
||||
return new ReturnMessage(ite.GetBaseException(), methodMsg);
|
||||
}
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
Thread.CurrentThread.Name = "IhapHandler-" + handlerNr;
|
||||
_ios = new IhapOutputStream(_client.GetStream());
|
||||
_iis = new IhapInputStream(_client.GetStream());
|
||||
try
|
||||
{
|
||||
while (!_isShutdown && isConnected())
|
||||
{
|
||||
receiveCall();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void receiveCall()
|
||||
{
|
||||
lock (lockObject)
|
||||
{
|
||||
try
|
||||
{
|
||||
Exception fault = null;
|
||||
Object returnValue = null;
|
||||
String methodName = null;
|
||||
try
|
||||
{
|
||||
if (!_iis.readBoolean())
|
||||
{
|
||||
IhapCall lCall = _iis.readCall();
|
||||
methodName = lCall.getOverloadMethodName();
|
||||
if (_methodMap.ContainsKey(methodName))
|
||||
{
|
||||
MethodInfo lMethod = _methodMap[methodName];
|
||||
Object[] args = lCall.getArgs();
|
||||
returnValue = lMethod.Invoke(_serviceImpl, args);
|
||||
lastCall = DateTime.Now.Ticks;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//ping...
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (IhapProtocolException pe)
|
||||
{
|
||||
if (pe.Message.EndsWith("end of file"))
|
||||
{
|
||||
throw pe;
|
||||
}
|
||||
fault = new ArtesRemoteException("Unable to read client request on " + getName(), pe);
|
||||
_ios.writeFaultReply(FaultCode.ProtocolException, fault);
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
fault = new ArtesRemoteException("Unknown method '" + methodName + "'");
|
||||
_ios.writeFaultReply(FaultCode.NoSuchMethodException, fault);
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
throw ioe;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (e is TargetInvocationException)
|
||||
{
|
||||
e = ((TargetInvocationException)e).InnerException;
|
||||
}
|
||||
fault = e;
|
||||
_ios.writeFaultReply(FaultCode.ServiceException, fault);
|
||||
}
|
||||
if (fault == null)
|
||||
{
|
||||
_ios.writeSuccessReply(returnValue);
|
||||
}
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
if (ioe.Message.EndsWith("end of file"))
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "Socket " + _client.Client.RemoteEndPoint + " disconnected for " + getName());
|
||||
ClientDisconnected(this);
|
||||
shutdown();
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "Error receiving call for " + getName() + ":" + ioe.Message);
|
||||
ClientDisconnected(this);
|
||||
}
|
||||
throw ioe;
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
_ios.Flush();
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Object sendCall(MethodInfo method, Object[] args)
|
||||
{
|
||||
lock (lockObject)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "Send event '" + method.Name + "' to socket " + _client.Client.RemoteEndPoint + " for " + getName());
|
||||
Object result = null;
|
||||
try
|
||||
{
|
||||
_ios.writeBoolean(false);
|
||||
_ios.call(method, args);
|
||||
_ios.Flush();
|
||||
IhapReply reply = _iis.readReply();
|
||||
if (reply is IhapSuccessReply)
|
||||
{
|
||||
result = ((IhapSuccessReply)reply).getReturnValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
IhapFaultReply fault = (IhapFaultReply)reply;
|
||||
switch (fault.getFaultCode())
|
||||
{
|
||||
case FaultCode.NoSuchMethodException:
|
||||
throw new NotImplementedException(fault.getMessage());
|
||||
case FaultCode.ProtocolException:
|
||||
throw new IhapProtocolException(fault.getMessage(), null);
|
||||
default:
|
||||
throw new IhapProtocolException(fault.getMessage(), null); // (Exception)fault.getException();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "Error while sending event call for " + getName() + " . " + e.Message + "\n" + e.StackTrace);
|
||||
shutdown();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public void setAdapterControl(IAdapterControl adapterControl)
|
||||
{
|
||||
_serviceImpl.SetAdapterControl(adapterControl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
#region Namespace
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
|
||||
using com.itac.mes.proxy.business;
|
||||
using com.itac.oib;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace com.itac.mes.proxy.sockets
|
||||
{
|
||||
|
||||
public class SocketAdapter
|
||||
{
|
||||
|
||||
private readonly IList<IhapHandler> _channels = new List<IhapHandler>();
|
||||
private readonly TcpListener _listener;
|
||||
|
||||
private readonly IAdapterControl _adapterControl;
|
||||
private readonly OIBServiceImpl _serviceImpl;
|
||||
|
||||
private bool _isShutdown = false;
|
||||
|
||||
// Wenn ein IHapHandler ein Disconnect feststellt wird eine Verbindung entfernt...
|
||||
public void ClientDisconnected(IhapHandler iHapHandler)
|
||||
{
|
||||
// remove handler with disconnected sockets
|
||||
for (int i = _channels.Count - 1; i >= 0; i--)
|
||||
{
|
||||
IhapHandler element = _channels[i];
|
||||
if (element == iHapHandler)
|
||||
{
|
||||
_channels[i].shutdown();
|
||||
_channels.RemoveAt(i);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "Remove socket connection.");
|
||||
}
|
||||
}
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "Nr of active connections: " + _channels.Count);
|
||||
}
|
||||
|
||||
public SocketAdapter(int listeningPort, IAdapterControl adapterControl, OIBServiceImpl serviceImpl)
|
||||
{
|
||||
_listener = new TcpListener(IPAddress.Any, listeningPort);
|
||||
_listener.Start();
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "Listen on port " + listeningPort);
|
||||
_adapterControl = adapterControl;
|
||||
_serviceImpl = serviceImpl;
|
||||
|
||||
var thread = new Thread(Run);
|
||||
thread.Start();
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "Startup " + Constants.SERVICE_NAME + " finished.");
|
||||
|
||||
//
|
||||
// neuen Thread aufmachen, der immer wieder nachguckt, wie oft die IHapHandler benutzt werden. und unbenutzte Verbindungen entfernt
|
||||
var checkAliveThread = new Thread(RunCheckAlive);
|
||||
checkAliveThread.Start();
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
Thread.CurrentThread.Name = "SocketAdapter";
|
||||
while (!_isShutdown)
|
||||
{
|
||||
TcpClient client;
|
||||
try
|
||||
{
|
||||
client = _listener.AcceptTcpClient();
|
||||
}
|
||||
catch (SocketException se)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Critical, "Accepting new socket connection failed", se);
|
||||
continue;
|
||||
}
|
||||
var handler = new IhapHandler(client, _serviceImpl);
|
||||
handler.setAdapterControl(_adapterControl);
|
||||
|
||||
handler.ClientDisconnected += ClientDisconnected;
|
||||
|
||||
_channels.Add(handler);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "Incoming socket connection from " + client.Client.RemoteEndPoint);
|
||||
}
|
||||
}
|
||||
|
||||
public void RunCheckAlive()
|
||||
{
|
||||
Thread.CurrentThread.Name = "CheckAliveThread";
|
||||
while (!_isShutdown)
|
||||
{
|
||||
bool removed = false;
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "registered incoming socket connections: " + _channels.Count);
|
||||
try
|
||||
{
|
||||
for (int i = _channels.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var channel = _channels[i];
|
||||
if (!channel.isConnected())
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "remove disconnected incoming socket connection for " + channel.getName());
|
||||
_channels.Remove(channel);
|
||||
removed = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "" + channel.getName() + " channel last used: " + new DateTime(channel.getLastCall()));
|
||||
if ((channel.getLastCall() + 36001000L) < DateTime.Now.Ticks) // eine Stunde...
|
||||
{
|
||||
// Verbindung schliessen, wenn Sie länger als ... nicht benutzt wurde
|
||||
// channel.shutdown();
|
||||
}
|
||||
}
|
||||
if (removed)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "remaining open incoming socket connections after cleanup: " + _channels.Count);
|
||||
}
|
||||
}
|
||||
catch (Exception )
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "service channel listing interrupted");
|
||||
}
|
||||
|
||||
// LG: Why this??
|
||||
Thread.Sleep(60000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Shutdown()
|
||||
{
|
||||
_isShutdown = true;
|
||||
try
|
||||
{
|
||||
_listener.Stop();
|
||||
foreach (var channel in _channels)
|
||||
{
|
||||
if (channel.isConnected())
|
||||
{
|
||||
channel.shutdown();
|
||||
}
|
||||
}
|
||||
_channels.Clear();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "Listen port closed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,391 @@
|
||||
#region Namespace
|
||||
using Asm.As.Oib.Client;
|
||||
using com.itac.mes.domain;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.sockets;
|
||||
using Itac.Oib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Diagnostics;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace com.itac.oib
|
||||
{
|
||||
// remote-Methoden zum steuern der einzelnen Teile der Anwendung
|
||||
public class AdapterControl : IAdapterControl, IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
||||
// Zugriff auf die folgenden Maps muss synchronisiert erfolgen
|
||||
static readonly object _locker = new object();
|
||||
// In dieser Map sind alle offenen Verbindungen zum DataInterface enthalten
|
||||
private Dictionary<String, IhapEventChannel> openClientChannels = new Dictionary<String, IhapEventChannel>();
|
||||
// pro Verbindung wird gez?hlt wie viele Connections es schon gab...
|
||||
private Dictionary<String, Int32> channelNameCounter = new Dictionary<String, Int32>();
|
||||
|
||||
// Verbindungsparameter zum DataInterface. Diese werden nach dem Start des DataInterface an den Adapter ?bertragen
|
||||
private int _port = 0;
|
||||
private string _ipAddress = "";
|
||||
private string _hostName = "";
|
||||
private string _canonicalHostName = "";
|
||||
|
||||
// die folgenden Werte werden beim Initialisieren des iTAC.OIB.Adapter gesetzt
|
||||
private int _own_itac_oib_adapter_port = 0;
|
||||
private string _own_ip_address = "";
|
||||
private string _own_host_name = "";
|
||||
private string _own_canonical_host_name = "";
|
||||
|
||||
#endregion
|
||||
|
||||
// die eigentlichen OIB-Event-Receiver
|
||||
public SetupCenterReceiver SetupCenterReceiver { set; get; }
|
||||
public SetupCenterExternalControlReceiver SetupCenterExternalControlReceiver { set; get; }
|
||||
public MonitoringReceiver MonitoringReceiver { set; get; }
|
||||
public TraceabilityReceiver TraceReceiver { set; get; }
|
||||
public SpiReceiver SpiReceiver { get; set; }
|
||||
public ChangeoverReceiver ChangeoverReceiver { get; set; }
|
||||
public OibClient OibClient { get; set; }
|
||||
public BoardGateKeeperReceiver BoardGateKeeperReceiver { set; get; }
|
||||
|
||||
public bool _isSetupStation;
|
||||
public List<KeyValue> productVersions { get; set; }
|
||||
|
||||
public AdapterControl()
|
||||
{
|
||||
var config = new AppSettingsReader();
|
||||
try
|
||||
{
|
||||
// Der Port an dem der Adapter auf eingehende Verbindungen des iTAC DataInterface lauscht
|
||||
_own_itac_oib_adapter_port = (int)config.GetValue("ListenPort", typeof(int));
|
||||
_own_host_name = Environment.MachineName;
|
||||
var hostInfo = Dns.GetHostEntry(_own_host_name);
|
||||
_own_canonical_host_name = hostInfo.HostName;
|
||||
var addresslist = Dns.GetHostAddresses(_own_host_name);
|
||||
// die eigene IP-Adresse raussuchen
|
||||
var theaddress = addresslist[0];
|
||||
// jetzt versuchen eine gueltige V4 Adresse zu finden, diese bevorzugen
|
||||
foreach (var IPA in addresslist)
|
||||
{
|
||||
if (IPA.AddressFamily.ToString() == "InterNetwork")
|
||||
{
|
||||
theaddress = IPA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, theaddress.ToString());
|
||||
_own_ip_address = theaddress.ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// eine neue socket zum DataInterface als Client aufmachen. ?ber diese Verbindung werden alle Events zum
|
||||
// Datainterface ?bertragen
|
||||
// Returned nie einen Null-Wert
|
||||
public IhapEventChannel GetDataInterfaceConnection(string channelName)
|
||||
{
|
||||
// sind die n?tigen Parameter gesetzt (_ipAddress, _hostname), damit eine Verbindung aufgebaut werden kann?
|
||||
if (_ipAddress.Equals("") || _hostName.Equals("") || _canonicalHostName.Equals(""))
|
||||
{
|
||||
//Fehlerausgabe
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Critical, "ADAPTER: communication parameter unknown:\n" +
|
||||
"DataInterface IP Address = " + _ipAddress + "\n" +
|
||||
"DataInterface Host Name = " + _hostName + "\n" +
|
||||
"DataInterface Canonical Host Name = " + _canonicalHostName + "\n");
|
||||
// Ende
|
||||
throw new Exception("iTAC.OIB.Adapter is not configured properly");
|
||||
}
|
||||
|
||||
// F?r jeden Kanal eine neue eigene Verbindung aufmachen. Pro Verbindung eine laufende Nummer z?hlen...
|
||||
var channelNameWithNumber = "";
|
||||
|
||||
// gab es f?r diesen channelName bereits eine Connection
|
||||
var counter = 0;
|
||||
lock (_locker)
|
||||
{
|
||||
if (channelNameCounter.ContainsKey(channelName))
|
||||
{
|
||||
counter = channelNameCounter[channelName];
|
||||
counter++;
|
||||
if (counter > 100000) { counter = 1; }
|
||||
channelNameCounter.Remove(channelName);
|
||||
channelNameCounter.Add(channelName, counter);
|
||||
}
|
||||
else
|
||||
{
|
||||
channelNameCounter.Add(channelName, counter);
|
||||
}
|
||||
channelNameWithNumber = channelName + "#" + counter;
|
||||
}
|
||||
// Neue Verbindung zum DataInterface aufmachen
|
||||
var tcpClient = new TcpClient(_canonicalHostName, _port);
|
||||
// eine neue TCp-Client-Verbindung
|
||||
var iHapEventChannel = new IhapEventChannel(tcpClient, channelNameWithNumber);
|
||||
if (iHapEventChannel == null)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "ADAPTER: iHapEventChannel not created");
|
||||
throw new Exception("ADAPTER: iHapEventChannel not created");
|
||||
}
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: before adding " + channelNameWithNumber);
|
||||
lock (_locker)
|
||||
{
|
||||
if (openClientChannels.ContainsKey(channelNameWithNumber))
|
||||
{
|
||||
openClientChannels.Remove(channelNameWithNumber);
|
||||
}
|
||||
openClientChannels.Add(channelNameWithNumber, iHapEventChannel);
|
||||
}
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: " + channelNameWithNumber + " added");
|
||||
|
||||
iHapEventChannel.channelName = channelNameWithNumber;
|
||||
// Listener installieren, um zu reagieren, wenn das Data-Interface die Verbindung abgebrochen hat
|
||||
iHapEventChannel.connectionStateChangeListener += new PropertyChangeListener(iHapEventChannel_connectionStateChangeListener);
|
||||
|
||||
var oibEvents = (OIBEvents)iHapEventChannel.GetTransparentProxy();
|
||||
if (oibEvents == null)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "ADAPTER: iHapEventChannel.transparentProxy not created");
|
||||
throw new Exception("ADAPTER: iHapEventChannel.transparentProxy not created");
|
||||
}
|
||||
oibEvents.setChannelName(channelNameWithNumber);
|
||||
oibEvents.startup();
|
||||
return iHapEventChannel;
|
||||
}
|
||||
|
||||
|
||||
#region IAdapterControl Member
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions starten
|
||||
/// </summary>
|
||||
public void startMonitoringReceiver()
|
||||
{
|
||||
genericStart("Monitoring Receiver", MonitoringReceiver);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions anhalten und austragen
|
||||
/// </summary>
|
||||
public void stopMonitoringReceiver()
|
||||
{
|
||||
genericStop("Monitoring Receiver", MonitoringReceiver);
|
||||
}
|
||||
|
||||
public void startSetupCenterNotifyReceiver()
|
||||
{
|
||||
genericStart("SetupCenterReceiver", SetupCenterReceiver);
|
||||
genericStart("SetupCenterExternalControlReceiver", SetupCenterExternalControlReceiver);
|
||||
}
|
||||
|
||||
public void stopSetupCenterNotifyReceiver()
|
||||
{
|
||||
genericStop("SetupCenterReceiver", SetupCenterReceiver);
|
||||
genericStop("SetupCenterExternalControlReceiver", SetupCenterExternalControlReceiver);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions starten
|
||||
/// </summary>
|
||||
public void startTraceReceiver()
|
||||
{
|
||||
genericStart("TraceReceiver", TraceReceiver);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions anhalten und austragen
|
||||
/// </summary>
|
||||
public void stopTraceReceiver()
|
||||
{
|
||||
genericStop("TraceReceiver", TraceReceiver);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions starten
|
||||
/// </summary>
|
||||
public void startBoardGateKeeper()
|
||||
{
|
||||
genericStart("BoardGateKeeperReceiver", BoardGateKeeperReceiver);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions anhalten und austragen
|
||||
/// </summary>
|
||||
public void stopBoardGateKeeper()
|
||||
{
|
||||
genericStop("BoardGateKeeperReceiver", BoardGateKeeperReceiver);
|
||||
}
|
||||
|
||||
public bool ping()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "ADAPTER: ping");
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool isSetupStation()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: isSetupStation()");
|
||||
return _isSetupStation;
|
||||
}
|
||||
|
||||
public void setInterfaceHost(int port, string ipAddress, string canonicalHostName, string hostName)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: setInterfaceHost() called");
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: set DataInterface port: " + port);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: set DataInterface ipAddress: " + ipAddress);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: set DataInterface canonical hostname : " + canonicalHostName);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: set DataInterface hostname : " + hostName);
|
||||
// setzen der Parameter ist immer moeglich, wenn die Parameter noch nicht gesetzt wurden.
|
||||
if (_port != 0 && !_hostName.Equals(""))
|
||||
{
|
||||
// eine Änderung des Hostnamen ist nicht erlaubt, so lange der AdapterProzess besteht.
|
||||
if (!_hostName.Equals(hostName) || !_ipAddress.Equals(ipAddress) || !_canonicalHostName.Equals(canonicalHostName))
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: current port: " + _port + ": new port :" + port);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: current ipAddress: " + _ipAddress + ": new ipAddress :" + ipAddress);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: current canonical hostname : " + _canonicalHostName + ": new canonical hostname : " + canonicalHostName);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: current hostname : " + _hostName + ": new hostname:" + hostName);
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Warning, "ADAPTER: changing DataInterface communication parameter not allowed and not changed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_port = port;
|
||||
_ipAddress = ipAddress;
|
||||
_hostName = hostName;
|
||||
_canonicalHostName = canonicalHostName;
|
||||
try
|
||||
{
|
||||
IhapEventChannel interfaceControlChannel = GetDataInterfaceConnection("interfaceControlChannel");
|
||||
// die Methode "DataInterfaceShutdown" wird aufgerufen, wenn das Interface diese Clientverbindung abbricht
|
||||
// hierf?r wird ein zus?tzlicher Handler installiert
|
||||
// interfaceControlChannel.connectionStateChangeListener += new PropertyChangeListener(DataInterfaceShutdown);
|
||||
//interfaceControlChannel.connectionStateChangeListener += new PropertyChangeListener(iHapEventChannel_connectionStateChangeListener);
|
||||
|
||||
var channel = (OIBEvents)interfaceControlChannel.GetTransparentProxy();
|
||||
channel.RegisterAdapter(_own_itac_oib_adapter_port, _own_ip_address, _own_canonical_host_name, _own_host_name);
|
||||
|
||||
var versionList = new List<KeyValue>();
|
||||
channel.setVersionInfo(versionList.ToArray());
|
||||
closeHandler(channel);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: setInterfaceHost() call failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setChannelName(string channelName)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: setting channel name(" + channelName + ")");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
// die Verbindung zum DataInterface aktiv abbauen
|
||||
internal void closeChannel(IhapEventChannel eventChannel)
|
||||
{
|
||||
lock (_locker)
|
||||
{
|
||||
openClientChannels.Remove(eventChannel.channelName);
|
||||
eventChannel.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
// die eingehende Verbindung aktiv schliessen
|
||||
internal void closeHandler(OIBEvents eventHandler)
|
||||
{
|
||||
eventHandler.shutdown();
|
||||
}
|
||||
|
||||
// Listener f?r ausgehende Verbindungen; wird aufgerufen, wenn f?r eine ausgehende Verbindung das schreiben fehlschl?gt (also durch das
|
||||
// DataInterface die Verbindung abgebrochen wurde
|
||||
internal void iHapEventChannel_connectionStateChangeListener(Object source, string channelName, string message)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: " + channelName + " " + message);
|
||||
closeChannel((IhapEventChannel)source);
|
||||
if (openClientChannels.Count > 0)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "shutdown " + openClientChannels.Count + " remaining open connections from iTAC.OIB.Adpater to DataInterface");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "no remaining open connections from iTAC.OIB.Adpater to DataInterface");
|
||||
}
|
||||
}
|
||||
|
||||
// Wenn ein IHapHandler ein Disconnect feststellt wird eine Verbindung entfernt...
|
||||
public void DataInterfaceShutdown(object sender, string channelName, string message)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, channelName + " disconnected");
|
||||
_port = 0;
|
||||
_ipAddress = "";
|
||||
_canonicalHostName = "";
|
||||
_hostName = "";
|
||||
// alle client-Verbindungen muessen abgebaut werden...
|
||||
if (openClientChannels.Count > 0)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "shutdown " + openClientChannels.Count + " remaining open connections from iTAC.OIB.Adpater to DataInterface");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "no remaining open connections from iTAC.OIB.Adpater to DataInterface");
|
||||
}
|
||||
|
||||
// ge?ffnete Eventing Queues stoppen
|
||||
stopMonitoringReceiver();
|
||||
stopSetupCenterNotifyReceiver();
|
||||
}
|
||||
|
||||
protected void genericStop(String serviceName, IReceiver service)
|
||||
{
|
||||
if (service == null)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: " + serviceName + " will not be stopped because it was not initialized");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: Stop " + serviceName + "");
|
||||
service.Stop();
|
||||
}
|
||||
}
|
||||
public void genericStart(String serviceName, IReceiver service)
|
||||
{
|
||||
if (service == null)
|
||||
{
|
||||
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: " + serviceName + " will not be started because it was not initialized");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "ADAPTER: Start " + serviceName + "");
|
||||
service.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (SetupCenterReceiver != null)
|
||||
SetupCenterReceiver.Dispose();
|
||||
if (SetupCenterExternalControlReceiver != null)
|
||||
SetupCenterExternalControlReceiver.Dispose();
|
||||
if (MonitoringReceiver != null)
|
||||
MonitoringReceiver.Dispose();
|
||||
if (TraceReceiver != null)
|
||||
TraceReceiver.Dispose();
|
||||
if (SpiReceiver != null)
|
||||
SpiReceiver.Dispose();
|
||||
if (BoardGateKeeperReceiver != null)
|
||||
BoardGateKeeperReceiver.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
namespace com.itac.oib
|
||||
{
|
||||
// remote-Methoden zum testen der Anwendung...
|
||||
public interface IAdapterControl
|
||||
{
|
||||
|
||||
//bool addEventFilter(string filterExpr);
|
||||
//void clearFilter();
|
||||
|
||||
void startSetupCenterNotifyReceiver();
|
||||
void stopSetupCenterNotifyReceiver();
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions starten
|
||||
/// </summary>
|
||||
void startMonitoringReceiver();
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions anhalten und austragen
|
||||
/// </summary>
|
||||
void stopMonitoringReceiver();
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions starten
|
||||
/// </summary>
|
||||
void startTraceReceiver();
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions anhalten und austragen
|
||||
/// </summary>
|
||||
void stopTraceReceiver();
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions starten
|
||||
/// </summary>
|
||||
void startBoardGateKeeper();
|
||||
|
||||
/// <summary>
|
||||
/// subscriptions anhalten und austragen
|
||||
/// </summary>
|
||||
void stopBoardGateKeeper();
|
||||
|
||||
bool ping();
|
||||
|
||||
/// <summary>
|
||||
/// liefert true, wenn dieser Adapter für eine SetupStation (Vorrüstplatz) konfiguriert ist.
|
||||
/// In diesem Fall muss die Client Applikation beim start keine Board Daten lesen
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool isSetupStation();
|
||||
|
||||
/// <summary>
|
||||
/// dem Adapter die Interface-Konfiguration mitteilen
|
||||
/// </summary>
|
||||
/// @param ipAddress
|
||||
/// die Adresse, auf der das Interface zu erreichen ist
|
||||
/// @param hostName
|
||||
/// der host, auf dem das Interface zu erreichen ist
|
||||
void setInterfaceHost(int port, string ipAddress, string canonicalHostName, string hostName);
|
||||
|
||||
void setChannelName(string channelName);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace com.itac.oib
|
||||
{
|
||||
|
||||
//public class KeyValue
|
||||
//{
|
||||
// public string key { get; set; }
|
||||
// public string value { get; set; }
|
||||
//}
|
||||
|
||||
// Meldungen, die der Adapter an das DataInterface senden kann
|
||||
public interface IAdapterNotify
|
||||
{
|
||||
// Diese Nachricht wird immer dann vom iTAC.OIB.Adapter zum DataInterface gesendet, wenn eine MessageQueue durch den Adapter neu gestartet wurde.
|
||||
void MessageQueueRestartet(string queueEndpoint);
|
||||
void SendQueueInfo(QueueInfo queueInfo);
|
||||
|
||||
// wenn der iTAC.OIB.Adapter vom DataInterface angesprochen wird und eine neue Konfiguration erhält
|
||||
// (Endpunkt/Port, wo das Interface zu finden ist) schickt der Adapter eine Meldung an das Interface wo er selbst zu finden ist.
|
||||
void RegisterAdapter(int port, string ipAddress, string canonicalHostName, string hostName);
|
||||
|
||||
void shutdown();
|
||||
void setChannelName(string channelName);
|
||||
void startup();
|
||||
void setVersionInfo(KeyValue[] keyValueArray);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace com.itac.oib
|
||||
{
|
||||
public class ItacXmlSerializer
|
||||
{
|
||||
|
||||
private static int MAX_INDENT_LEVEL = 15;
|
||||
private static int indentationWidth = 2;
|
||||
|
||||
private int indentationLevel = 0;
|
||||
private bool formatting = true;
|
||||
private StringBuilder writer;
|
||||
private static String[] indentStrings;
|
||||
private bool logXmlFormat = true;// Eine Möglichkeit auch nicht-XML zu loggen
|
||||
|
||||
|
||||
static ItacXmlSerializer()
|
||||
{
|
||||
indentStrings = new String[MAX_INDENT_LEVEL];
|
||||
for (int level = 0; level < MAX_INDENT_LEVEL; level++)
|
||||
{
|
||||
StringBuilder indentBuffer = new StringBuilder();
|
||||
int count = level * indentationWidth;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
indentBuffer.Append(' ');
|
||||
}
|
||||
indentStrings[level] = indentBuffer.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// [MethodImpl(MethodImplOptions.Synchronized)]
|
||||
public StringBuilder serialize(Object source)
|
||||
{
|
||||
writer = new StringBuilder();
|
||||
if (source != null)
|
||||
{
|
||||
if (source.GetType().IsArray)
|
||||
{
|
||||
writeArray("", source);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeStart(source.GetType().Name, true);
|
||||
writeStructure(source);
|
||||
writeEnd(source.GetType().Name, true, true);
|
||||
}
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
|
||||
private void indent()
|
||||
{
|
||||
if (formatting)
|
||||
{
|
||||
indentationLevel += 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void unindent()
|
||||
{
|
||||
if (formatting && indentationLevel > 0)
|
||||
{
|
||||
indentationLevel -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void writeArray(String fieldName, Object fieldvalue)
|
||||
{
|
||||
Object[] array = (Object[])fieldvalue;
|
||||
// do not print empty arrays
|
||||
if (array != null && array.Length > 0)
|
||||
{
|
||||
if (!fieldName.Equals(""))
|
||||
{
|
||||
writeStart(fieldName, true);
|
||||
}
|
||||
String simpleClassName = fieldvalue.GetType().Name.Substring(0, fieldvalue.GetType().Name.Length - 2);
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
writeStart(simpleClassName, true);
|
||||
writeStructure(array[i]);
|
||||
writeEnd(simpleClassName, true, false);
|
||||
}
|
||||
|
||||
if (!fieldName.Equals(""))
|
||||
{
|
||||
writeEnd(fieldName, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void allClassProperties(List<PropertyInfo> fieldList, Type clazz)
|
||||
{
|
||||
// über alle Felder aller parent Interfaces, solange das Interface nicht Object ist.
|
||||
if (clazz == null || clazz == typeof(Object))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// fields: all public fields
|
||||
PropertyInfo[] fields = clazz.GetProperties();
|
||||
foreach (PropertyInfo field in fields)
|
||||
{
|
||||
fieldList.Add(field);
|
||||
}
|
||||
}
|
||||
|
||||
private void allClassFields(List<FieldInfo> fieldList, Type clazz)
|
||||
{
|
||||
// über alle Felder aller parent Interfaces, solange das Interface nicht Object ist.
|
||||
if (clazz == null || clazz == typeof(Object))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// fields: all public fields
|
||||
FieldInfo[] fields = clazz.GetFields();
|
||||
foreach (FieldInfo field in fields)
|
||||
{
|
||||
fieldList.Add(field);
|
||||
}
|
||||
}
|
||||
|
||||
private void writeStructure(Object source)
|
||||
{
|
||||
List<PropertyInfo> propertyList = new List<PropertyInfo>();
|
||||
allClassProperties(propertyList, source.GetType());
|
||||
|
||||
List<FieldInfo> fieldList = new List<FieldInfo>();
|
||||
allClassFields(fieldList, source.GetType());
|
||||
foreach (PropertyInfo field2 in propertyList)
|
||||
{
|
||||
try
|
||||
{
|
||||
Object fieldvalue = field2.GetValue(source, null);
|
||||
writeObject(field2.Name, fieldvalue);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
writeObject(field2.Name, "property write failed");
|
||||
}
|
||||
}
|
||||
|
||||
foreach (FieldInfo field2 in fieldList)
|
||||
{
|
||||
try
|
||||
{
|
||||
Object fieldvalue = field2.GetValue(source);
|
||||
writeObject(field2.Name, fieldvalue);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
writeObject(field2.Name, "field write failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject(String fieldName, object fieldvalue)
|
||||
{
|
||||
if (fieldvalue == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (fieldvalue.GetType() == typeof(String))
|
||||
{
|
||||
writeString(fieldName, (String)fieldvalue);
|
||||
}
|
||||
else if (fieldvalue.GetType() == typeof(DateTime))
|
||||
{
|
||||
writeDate(fieldName, (DateTime)fieldvalue);
|
||||
}
|
||||
else if (fieldvalue.GetType() == typeof(bool) || fieldvalue.GetType() == typeof(Boolean))
|
||||
{
|
||||
if (((bool)fieldvalue)) { writeString(fieldName, "true"); } else { writeString(fieldName, "false"); }
|
||||
}
|
||||
else if (fieldvalue.GetType() == typeof(byte) || fieldvalue.GetType() == typeof(int) || fieldvalue.GetType() == typeof(Int16) || fieldvalue.GetType() == typeof(Int32)
|
||||
|| fieldvalue.GetType() == typeof(Int64))
|
||||
{
|
||||
writeIntNumber(fieldName, (Object)fieldvalue);
|
||||
}
|
||||
else if (fieldvalue.GetType() == typeof(double) || fieldvalue.GetType() == typeof(float))
|
||||
{
|
||||
writeNumber(fieldName, (Object)fieldvalue);
|
||||
}
|
||||
else if (fieldvalue.GetType() == typeof(Double))
|
||||
{
|
||||
writeNumber(fieldName, (Object)fieldvalue);
|
||||
}
|
||||
else if (fieldvalue.GetType().IsArray)
|
||||
{
|
||||
writeArray(fieldName, fieldvalue);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Strukturierten Wert schreiben
|
||||
writeStart(fieldName, true);
|
||||
writeStructure(fieldvalue);
|
||||
writeEnd(fieldName, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void writeDate(String fieldName, DateTime fieldvalue)
|
||||
{
|
||||
writeStart(fieldName, false);
|
||||
writer.Append(fieldvalue.ToString("o"));
|
||||
writeEnd(fieldName, false, false);
|
||||
}
|
||||
|
||||
private void writeStart(string fieldName, bool endLineAndIndent)
|
||||
{
|
||||
startLine();
|
||||
if (logXmlFormat)
|
||||
{
|
||||
writer.Append("<");
|
||||
writer.Append(fieldName);
|
||||
writer.Append(">");
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Append(fieldName);
|
||||
writer.Append(": ");
|
||||
}
|
||||
if (endLineAndIndent)
|
||||
{
|
||||
endLine();
|
||||
indent();
|
||||
}
|
||||
}
|
||||
private void writeEnd(string fieldName, bool indenting, bool newLine)
|
||||
{
|
||||
if (logXmlFormat)
|
||||
{
|
||||
if (indenting)
|
||||
{
|
||||
unindent();
|
||||
startLine();
|
||||
}
|
||||
writer.Append("</");
|
||||
writer.Append(fieldName);
|
||||
writer.Append(">");
|
||||
endLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (indenting)
|
||||
{
|
||||
unindent();
|
||||
}
|
||||
if (newLine)
|
||||
{
|
||||
endLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void writeNumber(String fieldName, Object fieldvalue)
|
||||
{
|
||||
writeStart(fieldName, false);
|
||||
writer.Append(fieldvalue.ToString());
|
||||
writeEnd(fieldName, false, true);
|
||||
}
|
||||
|
||||
private void writeIntNumber(String fieldName, Object fieldvalue)
|
||||
{
|
||||
writeStart(fieldName, false);
|
||||
writer.Append(fieldvalue.ToString());
|
||||
writeEnd(fieldName, false, true);
|
||||
}
|
||||
|
||||
private void writeString(String fieldName, String value)
|
||||
{
|
||||
writeStart(fieldName, false);
|
||||
writer.Append(value);
|
||||
writeEnd(fieldName, false, true);
|
||||
}
|
||||
|
||||
private void endLine()
|
||||
{
|
||||
if (formatting)
|
||||
{
|
||||
writer.Append("\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
private void startLine()
|
||||
{
|
||||
if (formatting)
|
||||
{
|
||||
writer.Append(indentStrings[Math.Min(indentationLevel, MAX_INDENT_LEVEL)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
namespace com.itac.oib
|
||||
{
|
||||
public class KeyValue
|
||||
{
|
||||
public string key
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public string value
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using com.itac.mes.proxy;
|
||||
|
||||
namespace com.itac.oib
|
||||
{
|
||||
public class MessageWriter
|
||||
{
|
||||
static int counter = 0;
|
||||
bool xmlExport = false;
|
||||
bool xmlLogging = false;
|
||||
HashSet<String> writeXmlForType = new HashSet<String>();
|
||||
|
||||
public void init()
|
||||
{
|
||||
|
||||
AppSettingsReader config = new AppSettingsReader();
|
||||
try
|
||||
{
|
||||
//<add key="xmlExport" value="true"/>
|
||||
xmlExport = (bool)config.GetValue("xmlExport", typeof(bool));
|
||||
xmlLogging = (bool)config.GetValue("xmlLogging", typeof(bool));
|
||||
|
||||
// pruefen, dass das Ausgabeverzeichnis ./output existiert
|
||||
bool exists = System.IO.Directory.Exists(@".\output");
|
||||
if (!exists && xmlExport)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Critical, "xmlExport set to true, but output folder (./output) does not exist!");
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "flag xmlExport modified, is set to false now!");
|
||||
xmlExport = false;
|
||||
}
|
||||
|
||||
//<!-- definieren, welche Messages ausgegeben werden sollen -->
|
||||
if (xmlExport)
|
||||
{
|
||||
if ((bool)config.GetValue("TraceabilityData", typeof(bool))) { writeXmlForType.Add("TraceabilityData"); }
|
||||
if ((bool)config.GetValue("DownloadData", typeof(bool))) { writeXmlForType.Add("DownloadData"); }
|
||||
if ((bool)config.GetValue("CheckInData", typeof(bool))) { writeXmlForType.Add("CheckInData"); }
|
||||
if ((bool)config.GetValue("StationEventComposite", typeof(bool))) { writeXmlForType.Add("StationEventComposite"); }
|
||||
if ((bool)config.GetValue("PackagingUnitLocation", typeof(bool))) { writeXmlForType.Add("PackagingUnitLocation"); }
|
||||
if ((bool)config.GetValue("ExternalControlResult", typeof(bool))) { writeXmlForType.Add("ExternalControlResult"); }
|
||||
if ((bool)config.GetValue("MaterialMovedReport", typeof(bool))) { writeXmlForType.Add("MaterialMovedReport"); }
|
||||
if ((bool)config.GetValue("SetupChangedReport", typeof(bool))) { writeXmlForType.Add("SetupChangedReport"); }
|
||||
if ((bool)config.GetValue("FeederPlacedReport", typeof(bool))) { writeXmlForType.Add("FeederPlacedReport"); }
|
||||
if ((bool)config.GetValue("TablePlacedReport", typeof(bool))) { writeXmlForType.Add("TablePlacedReport"); }
|
||||
if ((bool)config.GetValue("TableRemovedReport", typeof(bool))) { writeXmlForType.Add("TableRemovedReport"); }
|
||||
if ((bool)config.GetValue("BoardProcessedData", typeof(bool))) { writeXmlForType.Add("BoardProcessedData"); }
|
||||
if ((bool)config.GetValue("FeederRemovedReport", typeof(bool))) { writeXmlForType.Add("FeederRemovedReport"); }
|
||||
if ((bool)config.GetValue("PackagingUnitConsumedReport", typeof(bool))) { writeXmlForType.Add("PackagingUnitConsumedReport"); }
|
||||
if ((bool)config.GetValue("PackagingUnitCreatedReport", typeof(bool))) { writeXmlForType.Add("PackagingUnitCreatedReport"); }
|
||||
if ((bool)config.GetValue("LockStateChangedReport", typeof(bool))) { writeXmlForType.Add("LockStateChangedReport"); }
|
||||
if ((bool)config.GetValue("LineChangeoverEvent", typeof(bool))) { writeXmlForType.Add("LineChangeoverEventArgs"); }
|
||||
if ((bool)config.GetValue("BoardRequestData", typeof(bool))) { writeXmlForType.Add("BoardRequestData"); }
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Critical, "Initialization failed! " + e.Message, e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public void output(Object outputObject)
|
||||
{
|
||||
if (outputObject == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
DateTime starttime = DateTime.Now;
|
||||
counter++;
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "start serializing message");
|
||||
String typeName = outputObject.GetType().Name;
|
||||
// bei Array-Typen die Klammern im Typnamen weglassen
|
||||
if (typeName.EndsWith("[]"))
|
||||
{
|
||||
typeName = typeName.Substring(0, typeName.Length - 2);
|
||||
}
|
||||
String XmlizedString = null;
|
||||
if (xmlLogging)
|
||||
{
|
||||
ItacXmlSerializer itacSerializer = new ItacXmlSerializer();
|
||||
try
|
||||
{
|
||||
XmlizedString = itacSerializer.serialize(outputObject).ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
XmlizedString = "serializing data for " + typeName + " failed!";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlizedString = "<" + typeName + ">...";
|
||||
}
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, XmlizedString);
|
||||
if (xmlExport)
|
||||
{
|
||||
try
|
||||
{
|
||||
String fileName = counter + "_" + DateTime.Now.Ticks + "_" + typeName + ".xml";
|
||||
string newPath = Path.Combine(@".\output", fileName);
|
||||
bool writeFile = writeXmlForType.Contains(typeName);
|
||||
if (writeFile && counter < 65535)
|
||||
{
|
||||
Stream fileStream = new FileStream(newPath, FileMode.Create, FileAccess.Write);
|
||||
using (StreamWriter outfile = new StreamWriter(fileStream))
|
||||
{
|
||||
outfile.Write(XmlizedString);
|
||||
outfile.Flush();
|
||||
outfile.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "writing xml file failed for " + typeName);
|
||||
}
|
||||
}
|
||||
TimeSpan duration = DateTime.Now - starttime;
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Verbose, "serializing message done in " + duration.Milliseconds + " millies");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
namespace com.itac.oib
|
||||
{
|
||||
public class QueueInfo
|
||||
{
|
||||
public int OutStandingMessages { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string QueueName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
namespace com.itac.oib.client
|
||||
{
|
||||
// property: assembly: ASM.AS.OIB.Client, Version: 3.0.0.0
|
||||
public class OibClientService {
|
||||
|
||||
// canRead:True, canWrite:False
|
||||
private string displayName;
|
||||
|
||||
public void setDisplayName(string displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
// field DisplayName without setMethod
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
using com.itac.oib.linecontrol.service;
|
||||
using System;
|
||||
|
||||
namespace com.itac.oib.client
|
||||
{
|
||||
// property: assembly: ASM.AS.OIB.Client, Version: 3.0.0.0
|
||||
public class OibLineControlAccess : OibService {
|
||||
|
||||
// property: assembly: ASM.AS.OIB.SIPLACEPro.LineControl.Proxy, Version: 5.1.0.84
|
||||
// canRead:True, canWrite:False
|
||||
private OibLineControlAccess lineControlSession;
|
||||
// property: assembly: mscorlib, Version: 4.0.0.0
|
||||
// canRead:True, canWrite:False
|
||||
private Nullable<bool> isServiceAlive;
|
||||
|
||||
public void setLineControlSession(OibLineControlAccess lineControlSession) {
|
||||
this.lineControlSession = lineControlSession;
|
||||
}
|
||||
// field LineControlSession without setMethod
|
||||
|
||||
public void setIsServiceAlive(Nullable<bool> isServiceAlive) {
|
||||
this.isServiceAlive = isServiceAlive;
|
||||
}
|
||||
// field IsServiceAlive without setMethod
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
namespace com.itac.oib.client
|
||||
{
|
||||
// property: assembly: ASM.AS.OIB.Client, Version: 3.0.0.0
|
||||
public class OibService : OibClientService {
|
||||
|
||||
// canRead:True, canWrite:False
|
||||
private string serviceName;
|
||||
|
||||
public void setServiceName(string serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
// field ServiceName without setMethod
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
#region Namespace
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Diagnostics;
|
||||
using com.itac.mes.proxy;
|
||||
using com.itac.mes.proxy.business;
|
||||
using Asm.As.Oib.Client;
|
||||
using com.itac.oib.client.customextensions;
|
||||
using com.itac.oib.traceability.contracts.data;
|
||||
|
||||
using OibSpiArchInt = Asm.As.Oib.SiplacePro.Proxy.Architecture.Interfaces;
|
||||
using OibSpiArchObj = Asm.As.Oib.SiplacePro.Proxy.Architecture.Objects;
|
||||
using OibSpiBizObj = Asm.As.Oib.SiplacePro.Proxy.Business.Objects;
|
||||
using OibSpiTypes = Asm.As.Oib.SiplacePro.Proxy.Types;
|
||||
using OibSpiNotify = Asm.As.Oib.SiplacePro.Proxy.Architecture.Notifications.SubscriptionService;
|
||||
|
||||
using Asm.As.Oib.SiplacePro.Contracts.Data.Business.Objects;
|
||||
using com.itac.oib.siplacepro.contracts.data;
|
||||
using com.itac.oib.monitoring.contracts.data;
|
||||
#endregion
|
||||
|
||||
namespace com.itac.oib.siplacepro.service
|
||||
{
|
||||
/// <summary>
|
||||
/// Diese Klasse enthält eine Referenz auf eine Siplace pro Session, über die auf die SiplacePro Schnittstelle zugegriffen werden kann.
|
||||
/// </summary>
|
||||
public class SiplacePro : ISiplacePro
|
||||
{
|
||||
#region Fields
|
||||
|
||||
// Eventhandler zur übergabe des Events an Java Server.
|
||||
public OIBEventHandler _eventHandler { set; get; }
|
||||
|
||||
public OibSpiAccess oibSpiAccess { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISiplacePro Member
|
||||
|
||||
public void RegisterCallback()
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "subscribe SiplacePro events");
|
||||
try
|
||||
{
|
||||
if (oibSpiAccess.Session != null)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "SiplacePro Adapter Version: " + oibSpiAccess.Session.OibSiplaceProAdapterVersion);
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "SiplacePro Proxy Version: " + oibSpiAccess.Session.OibSiplaceProProxyVersion);
|
||||
|
||||
oibSpiAccess.Session.ServiceUnreachable += SpiSessionOnServiceUnreachable;
|
||||
oibSpiAccess.Session.ServiceReconnect += SpiSessionOnServiceReconnect;
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "SiplacePro events subscribed ");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "Got exception during setting up Subcription mode: ", ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SPI Event Handling
|
||||
|
||||
private void SpiSessionOnServiceReconnect(string endpoint, string comment)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "*** SERVICE RECONNECT ***");
|
||||
if (_eventHandler != null)
|
||||
_eventHandler.onServiceReconnect();
|
||||
}
|
||||
|
||||
private void SpiSessionOnServiceUnreachable(string endpoint, string comment)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "*** SERVICE UNREACHABLE ***");
|
||||
if (_eventHandler != null)
|
||||
_eventHandler.onServiceDisconnect();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISiplacePro Member
|
||||
|
||||
public contracts.data.BoardElement[] getPlacementForBoard(String boardFullName)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET get Board");
|
||||
contracts.data.BoardElement[] placementInfo = new contracts.data.BoardElement[0];
|
||||
OibSpiBizObj.Board board = oibSpiAccess.Session.GetObject(boardFullName, OibSpiTypes.ObjectServerType.Board) as OibSpiBizObj.Board;
|
||||
// List<com.itac.oib.siplacepro.contracts.data.BoardElement> itacBoardElementList = new List<com.itac.oib.siplacepro.contracts.data.BoardElement>();
|
||||
|
||||
// com.itac.oib.siplacepro.contracts.data.BoardElement itacBoardElement = new com.itac.oib.siplacepro.contracts.data.BoardElement();
|
||||
// com.itac.oib.siplacepro.contracts.data.Board itacBoard = BoardMapper.get((Asm.As.Oib.SiplacePro.Contracts.Data.Business.Objects.Board)board);
|
||||
|
||||
// itacBoardElement.setBoard(itacBoard);// board = BoardElementHelper.DoBoard(board);
|
||||
// itacBoard.producedSide = board.BoardSideProduced.ToString();
|
||||
// itacBoardElementList.Add(itacBoardElement);
|
||||
|
||||
// placementInfo.boardElements = itacBoardElementList.ToArray();
|
||||
|
||||
return placementInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// diese Methode im Download Event ausführen und Ergebnis zurückliefern
|
||||
internal static contracts.data.BoardElement[] GetPlacementForRecipe(OibSpiBizObj.Recipe recipe)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET get Recipe");
|
||||
contracts.data.BoardElement[] placementInfo = new contracts.data.BoardElement[0];
|
||||
// var itacBoardElementList = new List<BoardElement>();
|
||||
try
|
||||
{
|
||||
foreach (var boardelement in recipe.BoardElements)
|
||||
{
|
||||
// itacBoardElementList.Add(BoardElementHelper.DoBoardElement(boardelement));
|
||||
}
|
||||
// placementInfo.boardElements = itacBoardElementList.ToArray();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// bei allen Exceptions Ausgabe machen und null liefern!!!
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Error, "converting board information failed, can't continue properly", ex);
|
||||
return null;
|
||||
}
|
||||
return placementInfo;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ISiplacePro Member
|
||||
|
||||
public BoardCheckInRequest completeCheckinData(BoardCheckInRequest checkinData)
|
||||
{
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "complete CheckInData");
|
||||
if (checkinData == null) { return null; }
|
||||
// Line und Recipe ermitteln, die fehlenden Werte in die übergebene Struktur eintragen und zurückliefern
|
||||
var result = checkinData;
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call getRecipe");
|
||||
// var recipe = oibSpiAccess.Session.GetObject(checkinData.getRecipeName(), OibSpiTypes.ObjectServerType.Recipe) as OibSpiBizObj.Recipe;
|
||||
// result.setRecipeName(monitoring.contracts.data.RecipeMapper.get(recipe));
|
||||
// LogHandler.log(Constants.LOGGER, TraceEventType.Information, ".NET call getLine");
|
||||
// var line = oibSpiAccess.Session.GetObject(checkinData.getLineName(), OibSpiTypes.ObjectServerType.Line) as OibSpiBizObj.Line;
|
||||
// result.setLineName( LineMapper.get(line));
|
||||
LogHandler.log(Constants.LOGGER, TraceEventType.Information, "complete CheckInData finished");
|
||||
return checkinData;
|
||||
}
|
||||
|
||||
private static OibSpiArchObj.Identity GetStationIdentity(OibSpiBizObj.DownloadData downloadData, OibSpiBizObj.ProductionDataManager pdm)
|
||||
{
|
||||
foreach (var dd in pdm.LineControlData.DownloadData)
|
||||
{
|
||||
if (dd.Value.OID == downloadData.OID)
|
||||
{
|
||||
return dd.Key;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
internal void Download(Asm.As.Oib.SiplacePro.Contracts.Data.Business.Objects.DownloadData downloadData)
|
||||
{
|
||||
if (_eventHandler != null)
|
||||
{
|
||||
// TODO richtiges download nehmen _eventHandler.DownloadEvent(downloadData);
|
||||
}
|
||||
}
|
||||
|
||||
public LineChangeoverEventArgs getCurrentLineProductionData()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
180388
interface/asm/dotnet/Oib5xGUI/src/main/csharp/proxySIPLACEPro.SPI.cs
Normal file
180388
interface/asm/dotnet/Oib5xGUI/src/main/csharp/proxySIPLACEPro.SPI.cs
Normal file
File diff suppressed because it is too large
Load Diff
1195
interface/asm/dotnet/Oib5xGUI/src/main/csharp/proxyServiceLocator.cs
Normal file
1195
interface/asm/dotnet/Oib5xGUI/src/main/csharp/proxyServiceLocator.cs
Normal file
File diff suppressed because it is too large
Load Diff
2531
interface/asm/dotnet/Oib5xGUI/src/main/csharp/proxyWSEventing.cs
Normal file
2531
interface/asm/dotnet/Oib5xGUI/src/main/csharp/proxyWSEventing.cs
Normal file
File diff suppressed because it is too large
Load Diff
269
interface/asm/dotnet/Oib5xGUI/src/main/resources/Readme.txt
Normal file
269
interface/asm/dotnet/Oib5xGUI/src/main/resources/Readme.txt
Normal file
@@ -0,0 +1,269 @@
|
||||
Version 1.1.0.8
|
||||
---------------
|
||||
Import and export of messages as xml file
|
||||
|
||||
|
||||
Version 1.1.0.9
|
||||
---------------
|
||||
importing invalid xml file; avoid iTAC.OIB.Adapter crash
|
||||
|
||||
|
||||
Version 1.2.0.0
|
||||
---------------
|
||||
Configuration changed
|
||||
filtering for line names implemented
|
||||
support for PreSetupStation added
|
||||
|
||||
|
||||
Version 1.2.0.1
|
||||
---------------
|
||||
Avoid crash if OIB core is down for maintainance. automatically re-establish connection
|
||||
logging improved
|
||||
|
||||
|
||||
Version 1.2.0.2
|
||||
---------------
|
||||
exception handling in setupCenterNotifyReceiver optimized.
|
||||
field test version
|
||||
|
||||
|
||||
Version 1.2.0.3
|
||||
---------------
|
||||
xml file writing for PackagingUnitLocation and ExternalControlResult, Configuration change necessary.
|
||||
<!-- the following two are for synchronous call on scanning packaging units -->
|
||||
<add key="PackagingUnitLocation" value="true"/>
|
||||
<add key="ExternalControlResult" value="true"/>
|
||||
|
||||
Version 1.3.0.0
|
||||
---------------
|
||||
new libs for OIB 2.5 and SC 4.2
|
||||
more Exception handling, general exception handler for uncaught exceptions
|
||||
new function GetNewPackagingUnit (SC requests a packaging unit from MES)
|
||||
PackagingUnitConsumedReport contains additional information about locations and remaining packaging units
|
||||
|
||||
Version 1.3.0.1
|
||||
---------------
|
||||
Adapter can read DownloadData from xml file and send it to Client
|
||||
added consumedComponents information in TraceabilityData
|
||||
|
||||
Version 1.3.0.2
|
||||
---------------
|
||||
always create new input and output streams to java connector (requires java equivalent)
|
||||
|
||||
Version 1.3.0.3
|
||||
---------------
|
||||
A few more Packaging Unit fields: brightness class, ..
|
||||
|
||||
Version 1.3.0.4
|
||||
---------------
|
||||
Missing monitoring endpoint does not kill process
|
||||
|
||||
Version 1.3.0.5
|
||||
---------------
|
||||
Assembly Version still remains 1.3.0.4 from now to prevent oib configuration change
|
||||
additionally startup information about FileVersion, which is now 1.3.0.5
|
||||
compatible with Data Interface Version 6.10.02.374
|
||||
|
||||
Version 1.3.0.6
|
||||
---------------
|
||||
New Communication structure, DataInterface tells iTAC.OIB.Adapter on startup a remote port
|
||||
Every data set opens a new connection
|
||||
line control receiver configured only with port (changed adapter-configuration)
|
||||
compatible with Data Interface Version 6.10.02.384
|
||||
|
||||
Version 1.3.0.7
|
||||
---------------
|
||||
catch Exception on logging(was not thread safe)
|
||||
printing lineControl and setupCenter endpoints on startup
|
||||
|
||||
Version 1.3.0.8
|
||||
---------------
|
||||
LineName trim()
|
||||
Events from Monitoring Queue and SetupCenter Queue sent by a thread and return immediately, preventing timeouts
|
||||
|
||||
Version 1.3.0.9
|
||||
---------------
|
||||
Exception inserting values in Hashmap fixed
|
||||
possibly NullPointer prevented on MaterialMovedEvent
|
||||
|
||||
Version 1.3.0.10
|
||||
---------------
|
||||
return own address as IPv4 instead of undefined
|
||||
config file modified timeout-times (now 2 minutes)
|
||||
|
||||
Version 1.3.0.11
|
||||
---------------
|
||||
Capability of reading PackagingUnitConsumedReport from file (internal feature)
|
||||
Capability of reading MaterialMovedReport from file (internal feature)
|
||||
management of connections to DataInterface now thread safe
|
||||
|
||||
Version 1.3.0.12
|
||||
---------------
|
||||
logging events NewSetupActive and SetupChangedReport (20120424)
|
||||
config changed; new setting for NewSetupActive logging (20120424)
|
||||
requesting DataInterface connection synchronized (20120425)
|
||||
|
||||
Version 1.3.0.13
|
||||
---------------
|
||||
changed log level for XML-Message-Logging from INFO to DEBUG (20120523)
|
||||
changed time stamp format in logging, 3 digits for fractions of seconds (20120523)
|
||||
logging configuration changed, adjustable log level for console logger (20120523)
|
||||
new Parameter for Logging Xml into Console(20120523)
|
||||
XML-Serialization performance improved (20120523)
|
||||
|
||||
Version 1.3.0.14
|
||||
----------------
|
||||
Capability of reading StationEventcomposite from file (internal feature 20120525)
|
||||
Logging StationEventComposite corrected (20123105)
|
||||
|
||||
// from here we have two version for OIB 2.5 and 3.0
|
||||
|
||||
Version 2.5.0.15 / Version 3.0.0.15
|
||||
-----------------------------------
|
||||
internal structural changes
|
||||
|
||||
Version 2.5.0.16 / Version 3.0.0.16
|
||||
-----------------------------------
|
||||
preparing data structure (ComponentLocation) corrected (missing location info).
|
||||
SiplacePro logging modified.
|
||||
|
||||
Version 2.5.0.17 / Version 3.0.0.17
|
||||
-----------------------------------
|
||||
skips all older BoardProcessedData messages, requires new Configuration value (20120815)
|
||||
<!-- maximum age for boardProcessedMessages to be processed, in 'hours:minutes:seconds' -->
|
||||
<add key="BoardProcessedDataMaxAge" value="00:30:00"/>
|
||||
|
||||
Version 3.0.1.18
|
||||
-----------------------------------
|
||||
new mechanism for line changeover eventBased Mode (20121017)
|
||||
skips all older Stationevents messages, optional new Configuration value (20121017)
|
||||
<!-- maximum age for StationEventMessages to be processed, in 'hours:minutes:seconds' -->
|
||||
<add key="StationEventMaxAge" value="00:30:00"/>
|
||||
ignored if value is not configured or invalid
|
||||
|
||||
Version 3.0.1.19
|
||||
-----------------------------------
|
||||
correction in SetupCenterReceiver (20121023)
|
||||
|
||||
Version 3.0.1.20
|
||||
-----------------------------------
|
||||
check receive time in MonitoringReceiver with UTC time (StationEvent and BoardProcessed) (20121106)
|
||||
|
||||
Version 3.0.1.21
|
||||
-----------------------------------
|
||||
use stationFullPath instead of stationTypeFullPath in downloadEvent (20121127)
|
||||
|
||||
// latest version usable with OIB 3.0.1.x
|
||||
|
||||
// from here minimum required OIB Version is 3.1.0.101
|
||||
|
||||
Version 3.1.0.22
|
||||
-----------------------------------
|
||||
Initial support of OIB 3.1; OIB Client 3.0.x is no longer supported by this Adapter. (20130307)
|
||||
|
||||
Version 3.1.0.23
|
||||
-----------------------------------
|
||||
Adapter starts even if DisplayService is not available, but in this case without Traceability function. (20130821)
|
||||
|
||||
Version 3.1.0.24
|
||||
-----------------------------------
|
||||
new ASM DLL V2.1.0.1 including BoardGateKeeper (20130919)
|
||||
TraceReceiver will not be created/started if configured port is 0
|
||||
Display Service Receiver will not be started if configured port is 0
|
||||
|
||||
Version 3.1.0.25
|
||||
-----------------------------------
|
||||
new ASM DLL V2.1.0.2 including modified BoardGateKeeper (20131011)
|
||||
Adapter starts even if DisplayService is not available/reachable (20131011)
|
||||
BoardGateKeeper will not be started if configured port is 0
|
||||
sligthly changed format of xml output (bool values lower case, different date format)
|
||||
|
||||
Version 3.1.0.26
|
||||
-----------------------------------
|
||||
new ASM DLL V2.1.0.3 including modified BoardGateKeeper (20131018)
|
||||
sligthly changed format of xml output (bool values lower case, different date format)
|
||||
read xml files for VirtualInkspotData
|
||||
|
||||
Version 3.1.0.26
|
||||
-----------------------------------
|
||||
new ASM DLL V2.1.0.11 Virtual Inkspot Handling tested (20131025)
|
||||
new configuration values "OnVIHDataRejected.ShowMessage" and "OnVIHDataRejected.StationStop" (20131025)
|
||||
|
||||
Version 3.1.0.27
|
||||
-----------------------------------
|
||||
new ASM DLL V2.1.0.14 implemented (20131120)
|
||||
provide a new placementRecipeName to the line, new function startPlacementRecipe (20131022)
|
||||
|
||||
Version 3.1.0.28
|
||||
-----------------------------------
|
||||
deny board when communication break whilst VirtualInkspotRequest is active(20131204)
|
||||
accept BoardProcessedData messages as xml files (20131206)
|
||||
|
||||
Version 3.1.0.29
|
||||
-----------------------------------
|
||||
get ASM OIB Product Versions (20131217)
|
||||
|
||||
Version 3.1.0.30
|
||||
-----------------------------------
|
||||
new ASM DLL V2.1.0.16 (20140113)
|
||||
|
||||
// from here:
|
||||
// minimum required OIB Version 3.2.0.135
|
||||
|
||||
|
||||
Version 3.2.0.31
|
||||
-----------------------------------
|
||||
new ASM DLL V2.2.0.1 (20140114)
|
||||
use ASM OIB V3.2 (20140114)
|
||||
|
||||
Version 3.2.0.32
|
||||
-----------------------------------
|
||||
use recipeFullPath in LineChangeOverEvents instead of recipeName (20140120)
|
||||
correct namespace for startJobResult (20140124)
|
||||
setupCenterQueue subscription corrected (find correct stations of line) (20140120)
|
||||
|
||||
Version 3.2.0.33
|
||||
-----------------------------------
|
||||
logging on connection breakdown (20140827)
|
||||
new ASM DLL V2.2.1.4 (20140909)
|
||||
use ASM OIB V3.2 HF3 (3.2.0.152) (20140909)
|
||||
|
||||
Version 3.2.0.34
|
||||
-----------------------------------
|
||||
new ASM DLL V2.2.1.6, DLL backward compatible with older adapter versions (20141021)
|
||||
provide additional info to displayService on rejected Tracebilitydata (20141021)
|
||||
|
||||
Version 3.2.0.35
|
||||
-----------------------------------
|
||||
ignore download events from any except the configured line (20141118)
|
||||
|
||||
Version 3.2.0.36
|
||||
-----------------------------------
|
||||
skip StationEventComposite messages without stateTransitions (20150706)
|
||||
|
||||
Version 3.2.0.37
|
||||
-----------------------------------
|
||||
accept Component to be null even if designator is set in BoardData/improved logging (20150909)
|
||||
|
||||
Version 3.2.0.38
|
||||
-----------------------------------
|
||||
new internal API Version (AsmApi.dll) / ASM Release 80 (20151209)
|
||||
|
||||
Version 3.2.0.39
|
||||
-----------------------------------
|
||||
return timestamp values as UTC (like 2016-10-07T12:33:05.0000000Z instead of 2016-10-07T12:33:05.0000000) (20162110)
|
||||
|
||||
Version 3.2.0.40
|
||||
-----------------------------------
|
||||
new asm client lib 2.3.0.1 (20170215)
|
||||
|
||||
Version 3.2.0.41
|
||||
-----------------------------------
|
||||
new asm client lib 2.3.0.2
|
||||
new optional config parameter to configure inkspot fiducial handling
|
||||
added all optional parameters to configuration file (20170706)
|
||||
use date 01.01.0001 for any date from iTAC <= 01.01.1970 in PackagingUnitControl (20180201)
|
||||
|
||||
Version 3.2.0.42
|
||||
-----------------------------------
|
||||
new asm client lib 2.3.0.3 (20180809)
|
||||
145
interface/asm/dotnet/Oib5xGUI/src/main/resources/app.config
Normal file
145
interface/asm/dotnet/Oib5xGUI/src/main/resources/app.config
Normal file
@@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
|
||||
</configSections>
|
||||
|
||||
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
|
||||
</startup>
|
||||
|
||||
|
||||
<appSettings>
|
||||
<!-- The name or the IP address of the OIB Core Host -->
|
||||
<add key="OIBCoreHostName" value="192.168.5.51" />
|
||||
|
||||
<!-- this iTAC.OIB.Adapter should work for this line. -->
|
||||
<!-- the line Name is appended to the endpoint urls to distinguish the endpoints in oib -->
|
||||
<!--add key="LineName" value="Line1\Line1sync"/>
|
||||
<add key="LineName" value="Line4\Line 4.2"/-->
|
||||
<add key="LineName" value="Line1\Line1sync"/>
|
||||
<add key ="isSetupStation" value="false"/>
|
||||
|
||||
<!-- set to true for iTAC failure analysis only -->
|
||||
<add key ="offlineMode" value="false"/>
|
||||
|
||||
<!-- The listen port is the port the adapter will listen for Java connections -->
|
||||
<add key="ListenPort" value="33020"/>
|
||||
|
||||
<!-- every iTAC.OIB.Adapter endpoint has a separate URL and port. together with the service name results a uniqe URL -->
|
||||
<!-- the endpoint-url may contain special characters!!! -->
|
||||
<!-- e.g. http://OibAdapterPc:33334/Itac.Oib.SetupCenterExternalControl/Line1 -->
|
||||
<add key="SiplaceProEventPort" value="9500"/>
|
||||
<add key="DisplayServiceEventPort" value="9600"/>
|
||||
<!-- default port 9600 -->
|
||||
<add key="SetupCenterNotifyPort" value="33333"/>
|
||||
<add key="SetupCenterExternalControlPort" value="33334"/>
|
||||
<add key="TraceServicePort" value="33335"/>
|
||||
<add key="MonitoringReceiverPort" value="33336"/>
|
||||
<add key="LineControlReceiverPort" value="33338"/>
|
||||
<add key="BoardGateKeeperEventPort" value="33339"/>
|
||||
<add key="DekPrinterExternalControlPort" value="33337"/>
|
||||
|
||||
<!-- define wether messages should be logged or not. -->
|
||||
<add key="xmlExport" value="true"/>
|
||||
<add key="xmlLogging" value="true"/>
|
||||
<!-- define, which messages should be logged -->
|
||||
<add key="TraceabilityData" value="true"/>
|
||||
<add key="DownloadData" value="false"/>
|
||||
<add key="StationEventComposite" value="false"/>
|
||||
<add key="MaterialMovedReport" value="true"/>
|
||||
<add key="SetupChangedReport" value="false"/>
|
||||
<add key="FeederPlacedReport" value="false"/>
|
||||
<add key="TablePlacedReport" value="false"/>
|
||||
<add key="TableRemovedReport" value="false"/>
|
||||
<add key="BoardProcessedData" value="false"/>
|
||||
<add key="CheckInData" value="true"/>
|
||||
<add key="FeederRemovedReport" value="false"/>
|
||||
<add key="PackagingUnitConsumedReport" value="true"/>
|
||||
<add key="PackagingUnitCreatedReport" value="false"/>
|
||||
<add key="LockStateChangedReport" value="false"/>
|
||||
<add key="LineChangeoverEvent" value="true"/>
|
||||
<!-- the following two are for synchronous call on scanning packaging units -->
|
||||
<add key="PackagingUnitLocation" value="true"/>
|
||||
<add key="ExternalControlResult" value="true"/>
|
||||
<add key="BoardRequestData" value="true"/>
|
||||
|
||||
<!-- maximum age for boardProcessedMessages to be processed, in 'hours:minutes:seconds' -->
|
||||
<add key="BoardProcessedDataMaxAge" value="00:30:00"/>
|
||||
<add key="StationEventMaxAge" value="00:05:00"/>
|
||||
|
||||
<!-- This setting allows to stop the line if the trace data is rejected by iTac MES Suite -->
|
||||
<!-- In this case the input conveyor of the last station is stopped -->
|
||||
<add key="Asm.As.Oib.Client.Extensions.StopLineOnTraceDataRejected" value="true"/>
|
||||
<add key="Asm.As.Oib.Client.Extensions.OnVIHDataRejected.ShowMessage" value="true"/>
|
||||
<add key="Asm.As.Oib.Client.Extensions.OnVIHDataRejected.StationStop" value="true"/>
|
||||
<!-- timing values for event based mode -->
|
||||
<add key="Asm.As.Oib.Client.Extensions.ChangeoverIncompleteWarningSeconds" value="120"/>
|
||||
<add key="Asm.As.Oib.Client.Extensions.ChangeoverIncompleteRepeatWarningSeconds" value="120"/>
|
||||
<!-- from 2.3.0.2: Virtual Inkspot handling definition
|
||||
True: VirtualInkspotHandler will only request iTAC if a BarcodeFiducial is configured for the board in SiplacePro. ("Customer-Case")
|
||||
False: VirtualInkspotHandler will request iTAC always.
|
||||
Default: true -->
|
||||
<add key="Asm.As.Oib.Client.Extensions.VirtualInkspotHandlerConsidersBarcodeFiducial" value="true"/>
|
||||
|
||||
<!--These are values a user can override if neccessary (for info see MSDN for binding parameters), if not provided the defaults are used-->
|
||||
<!-- <add key="Siemens.Siplace.OIB.SiplacePro.Proxies.ReliableChannel.MaxNumberOfRetryAttempts" value="1" />-->
|
||||
<!-- <add key="Siemens.Siplace.OIB.SiplacePro.Proxies.ReliableChannel.RetryFrequency" value="2000" />-->
|
||||
<!-- This is the interval in ms when the proxy checks the connection to the Service,-->
|
||||
<!-- it must be greater or equal to 1000ms; if this is not present, a default value of 1 minute is used -->
|
||||
<!-- <add key="Siemens.Siplace.OIB.SiplacePro.Proxies.ReliableChannel.CheckAliveFrequency" value="60000" />-->
|
||||
|
||||
</appSettings>
|
||||
|
||||
<log4net>
|
||||
<appender name="LogFileAppenderFull" type="log4net.Appender.RollingFileAppender">
|
||||
<file value=".\Log\itac.oib.proxy.full.log" />
|
||||
<appendToFile value="true" />
|
||||
<rollingStyle value="Size" />
|
||||
<maxSizeRollBackups value="10" />
|
||||
<maximumFileSize value="10MB" />
|
||||
<staticLogFileName value="true" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<header value="" />
|
||||
<footer value="" />
|
||||
<conversionPattern value="%date{dd.MM.yyyy HH:mm:ss,f} %8.10c %-5p %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
<appender name="LogFileAppenderError" type="log4net.Appender.RollingFileAppender">
|
||||
<file value=".\Log\itac.oib.proxy.error.log" />
|
||||
<appendToFile value="true" />
|
||||
<rollingStyle value="Size" />
|
||||
<maxSizeRollBackups value="3" />
|
||||
<maximumFileSize value="10MB" />
|
||||
<staticLogFileName value="true" />
|
||||
<filter type="log4net.Filter.LevelRangeFilter">
|
||||
<levelMin value="WARN" />
|
||||
<levelMax value="FATAL" />
|
||||
</filter>
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<header value="" />
|
||||
<footer value="" />
|
||||
<conversionPattern value="%date{dd.MM.yyyy HH:mm:ss,f} %8.10c %-5p %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<header value="[Header]\r\n" />
|
||||
<footer value="[Footer]\r\n" />
|
||||
<conversionPattern value="%date{dd.MM.yyyy HH:mm:ss,f} %8.10c %-5p %m%n" />
|
||||
</layout>
|
||||
<filter type="log4net.Filter.LevelRangeFilter">
|
||||
<levelMin value="DEBUG" />
|
||||
<levelMax value="FATAL" />
|
||||
</filter>
|
||||
</appender>
|
||||
<root>
|
||||
<level value="DEBUG" />
|
||||
<appender-ref ref="LogFileAppenderFull" />
|
||||
<appender-ref ref="LogFileAppenderError" />
|
||||
<appender-ref ref="ConsoleAppender" />
|
||||
</root>
|
||||
</log4net>
|
||||
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user