diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..63052248 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.cs text diff --git a/EDSEditorGUI/DeviceInfoView.Designer.cs b/EDSEditorGUI/DeviceInfoView.Designer.cs index e88a0725..ce68a85c 100644 --- a/EDSEditorGUI/DeviceInfoView.Designer.cs +++ b/EDSEditorGUI/DeviceInfoView.Designer.cs @@ -28,847 +28,847 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.panel1 = new System.Windows.Forms.Panel(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.label4 = new System.Windows.Forms.Label(); - this.textBox_mdFileName = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.textBox_xddfilenameStripped = new System.Windows.Forms.TextBox(); - this.textBox_canopennodeFileVersion = new System.Windows.Forms.TextBox(); - this.textBox_projectFileVersion = new System.Windows.Forms.TextBox(); - this.textBox_devicedcfname = new System.Windows.Forms.TextBox(); - this.label14 = new System.Windows.Forms.Label(); - this.label15 = new System.Windows.Forms.Label(); - this.textBox_canopennodeFileName = new System.Windows.Forms.TextBox(); - this.label16 = new System.Windows.Forms.Label(); - this.label31 = new System.Windows.Forms.Label(); - this.textBox_projectFileName = new System.Windows.Forms.TextBox(); - this.textBox_deviceedsname = new System.Windows.Forms.TextBox(); - this.groupBox6 = new System.Windows.Forms.GroupBox(); - this.label3 = new System.Windows.Forms.Label(); - this.textBox_lssserial = new System.Windows.Forms.TextBox(); - this.label9 = new System.Windows.Forms.Label(); - this.checkBox_canopenmanager = new System.Windows.Forms.CheckBox(); - this.label8 = new System.Windows.Forms.Label(); - this.textBox_netname = new System.Windows.Forms.TextBox(); - this.label7 = new System.Windows.Forms.Label(); - this.textBox_netnum = new System.Windows.Forms.TextBox(); - this.label6 = new System.Windows.Forms.Label(); - this.textBox_baudrate = new System.Windows.Forms.TextBox(); - this.label5 = new System.Windows.Forms.Label(); - this.textBox_nodename = new System.Windows.Forms.TextBox(); - this.label32 = new System.Windows.Forms.Label(); - this.textBox_concretenodeid = new System.Windows.Forms.TextBox(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.textBox_productnumber = new System.Windows.Forms.TextBox(); - this.textBox_productname = new System.Windows.Forms.TextBox(); - this.textBox_vendornumber = new System.Windows.Forms.TextBox(); - this.textBox_vendorname = new System.Windows.Forms.TextBox(); - this.label29 = new System.Windows.Forms.Label(); - this.label28 = new System.Windows.Forms.Label(); - this.label27 = new System.Windows.Forms.Label(); - this.label26 = new System.Windows.Forms.Label(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_baud_auto = new System.Windows.Forms.CheckBox(); - this.checkBox_baud_125 = new System.Windows.Forms.CheckBox(); - this.checkBox_baud_10 = new System.Windows.Forms.CheckBox(); - this.checkBox_baud_20 = new System.Windows.Forms.CheckBox(); - this.checkBox_baud_50 = new System.Windows.Forms.CheckBox(); - this.checkBox_baud_250 = new System.Windows.Forms.CheckBox(); - this.checkBox_baud_1000 = new System.Windows.Forms.CheckBox(); - this.checkBox_baud_500 = new System.Windows.Forms.CheckBox(); - this.checkBox_baud_800 = new System.Windows.Forms.CheckBox(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.textBox_NG_NumOfNodes = new System.Windows.Forms.TextBox(); - this.label10 = new System.Windows.Forms.Label(); - this.checkBox_ngMaster = new System.Windows.Forms.CheckBox(); - this.checkBox_ngSlave = new System.Windows.Forms.CheckBox(); - this.textBox_granularity = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.textBox_txpdos = new System.Windows.Forms.TextBox(); - this.checkBox_lssMaster = new System.Windows.Forms.CheckBox(); - this.label30 = new System.Windows.Forms.Label(); - this.textBox_rxpdos = new System.Windows.Forms.TextBox(); - this.label17 = new System.Windows.Forms.Label(); - this.checkBox_lss = new System.Windows.Forms.CheckBox(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.textBox_modifiedby = new System.Windows.Forms.TextBox(); - this.textBox_modified_datetime = new System.Windows.Forms.TextBox(); - this.textBox_createdby = new System.Windows.Forms.TextBox(); - this.textBox_create_datetime = new System.Windows.Forms.TextBox(); - this.textBox_di_description = new System.Windows.Forms.TextBox(); - this.textBox_fileversion = new System.Windows.Forms.TextBox(); - this.label25 = new System.Windows.Forms.Label(); - this.label24 = new System.Windows.Forms.Label(); - this.label23 = new System.Windows.Forms.Label(); - this.label22 = new System.Windows.Forms.Label(); - this.label20 = new System.Windows.Forms.Label(); - this.label18 = new System.Windows.Forms.Label(); - this.panel1.SuspendLayout(); - this.groupBox5.SuspendLayout(); - this.groupBox6.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.Controls.Add(this.groupBox5); - this.panel1.Controls.Add(this.groupBox6); - this.panel1.Controls.Add(this.groupBox4); - this.panel1.Controls.Add(this.groupBox1); - this.panel1.Controls.Add(this.groupBox2); - this.panel1.Controls.Add(this.groupBox3); - this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(773, 537); - this.panel1.TabIndex = 60; - // - // groupBox5 - // - this.groupBox5.Controls.Add(this.label4); - this.groupBox5.Controls.Add(this.textBox_mdFileName); - this.groupBox5.Controls.Add(this.label2); - this.groupBox5.Controls.Add(this.textBox_xddfilenameStripped); - this.groupBox5.Controls.Add(this.textBox_canopennodeFileVersion); - this.groupBox5.Controls.Add(this.textBox_projectFileVersion); - this.groupBox5.Controls.Add(this.textBox_devicedcfname); - this.groupBox5.Controls.Add(this.label14); - this.groupBox5.Controls.Add(this.label15); - this.groupBox5.Controls.Add(this.textBox_canopennodeFileName); - this.groupBox5.Controls.Add(this.label16); - this.groupBox5.Controls.Add(this.label31); - this.groupBox5.Controls.Add(this.textBox_projectFileName); - this.groupBox5.Controls.Add(this.textBox_deviceedsname); - this.groupBox5.Location = new System.Drawing.Point(12, 332); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(377, 182); - this.groupBox5.TabIndex = 63; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "Project Info"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(10, 153); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(95, 13); - this.label4.TabIndex = 70; - this.label4.Text = "Documentation file"; - // - // textBox_mdFileName - // - this.textBox_mdFileName.Location = new System.Drawing.Point(139, 150); - this.textBox_mdFileName.Name = "textBox_mdFileName"; - this.textBox_mdFileName.ReadOnly = true; - this.textBox_mdFileName.Size = new System.Drawing.Size(226, 20); - this.textBox_mdFileName.TabIndex = 69; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(10, 49); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(116, 13); - this.label2.TabIndex = 68; - this.label2.Text = "XDD v1.1 file - stripped"; - // - // textBox_xddfilenameStripped - // - this.textBox_xddfilenameStripped.Location = new System.Drawing.Point(139, 46); - this.textBox_xddfilenameStripped.Name = "textBox_xddfilenameStripped"; - this.textBox_xddfilenameStripped.ReadOnly = true; - this.textBox_xddfilenameStripped.Size = new System.Drawing.Size(226, 20); - this.textBox_xddfilenameStripped.TabIndex = 67; - // - // textBox_canopennodeFileVersion - // - this.textBox_canopennodeFileVersion.Location = new System.Drawing.Point(330, 124); - this.textBox_canopennodeFileVersion.Name = "textBox_canopennodeFileVersion"; - this.textBox_canopennodeFileVersion.ReadOnly = true; - this.textBox_canopennodeFileVersion.Size = new System.Drawing.Size(35, 20); - this.textBox_canopennodeFileVersion.TabIndex = 66; - // - // textBox_projectFileVersion - // - this.textBox_projectFileVersion.Location = new System.Drawing.Point(330, 20); - this.textBox_projectFileVersion.Name = "textBox_projectFileVersion"; - this.textBox_projectFileVersion.ReadOnly = true; - this.textBox_projectFileVersion.Size = new System.Drawing.Size(35, 20); - this.textBox_projectFileVersion.TabIndex = 65; - // - // textBox_devicedcfname - // - this.textBox_devicedcfname.Location = new System.Drawing.Point(139, 98); - this.textBox_devicedcfname.Name = "textBox_devicedcfname"; - this.textBox_devicedcfname.ReadOnly = true; - this.textBox_devicedcfname.Size = new System.Drawing.Size(226, 20); - this.textBox_devicedcfname.TabIndex = 8; - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(10, 127); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(119, 13); - this.label14.TabIndex = 21; - this.label14.Text = "CANopenNode file (ver)"; - // - // label15 - // - this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(10, 101); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(44, 13); - this.label15.TabIndex = 20; - this.label15.Text = "DCF file"; - // - // textBox_canopennodeFileName - // - this.textBox_canopennodeFileName.Location = new System.Drawing.Point(139, 124); - this.textBox_canopennodeFileName.Name = "textBox_canopennodeFileName"; - this.textBox_canopennodeFileName.ReadOnly = true; - this.textBox_canopennodeFileName.Size = new System.Drawing.Size(185, 20); - this.textBox_canopennodeFileName.TabIndex = 9; - // - // label16 - // - this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(10, 75); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(45, 13); - this.label16.TabIndex = 19; - this.label16.Text = "EDS file"; - // - // label31 - // - this.label31.AutoSize = true; - this.label31.Location = new System.Drawing.Point(10, 23); - this.label31.Name = "label31"; - this.label31.Size = new System.Drawing.Size(99, 13); - this.label31.TabIndex = 18; - this.label31.Text = "Project file (version)"; - // - // textBox_projectFileName - // - this.textBox_projectFileName.Location = new System.Drawing.Point(139, 20); - this.textBox_projectFileName.Name = "textBox_projectFileName"; - this.textBox_projectFileName.ReadOnly = true; - this.textBox_projectFileName.Size = new System.Drawing.Size(185, 20); - this.textBox_projectFileName.TabIndex = 6; - // - // textBox_deviceedsname - // - this.textBox_deviceedsname.Location = new System.Drawing.Point(139, 72); - this.textBox_deviceedsname.Name = "textBox_deviceedsname"; - this.textBox_deviceedsname.ReadOnly = true; - this.textBox_deviceedsname.Size = new System.Drawing.Size(226, 20); - this.textBox_deviceedsname.TabIndex = 7; - // - // groupBox6 - // - this.groupBox6.Controls.Add(this.label3); - this.groupBox6.Controls.Add(this.textBox_lssserial); - this.groupBox6.Controls.Add(this.label9); - this.groupBox6.Controls.Add(this.checkBox_canopenmanager); - this.groupBox6.Controls.Add(this.label8); - this.groupBox6.Controls.Add(this.textBox_netname); - this.groupBox6.Controls.Add(this.label7); - this.groupBox6.Controls.Add(this.textBox_netnum); - this.groupBox6.Controls.Add(this.label6); - this.groupBox6.Controls.Add(this.textBox_baudrate); - this.groupBox6.Controls.Add(this.label5); - this.groupBox6.Controls.Add(this.textBox_nodename); - this.groupBox6.Controls.Add(this.label32); - this.groupBox6.Controls.Add(this.textBox_concretenodeid); - this.groupBox6.Location = new System.Drawing.Point(395, 313); - this.groupBox6.Name = "groupBox6"; - this.groupBox6.Size = new System.Drawing.Size(339, 202); - this.groupBox6.TabIndex = 5; - this.groupBox6.TabStop = false; - this.groupBox6.Text = "Device commissioning"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(7, 149); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(98, 13); - this.label3.TabIndex = 63; - this.label3.Text = "CANopen Manager"; - // - // textBox_lssserial - // - this.textBox_lssserial.BackColor = System.Drawing.Color.PeachPuff; - this.textBox_lssserial.Location = new System.Drawing.Point(111, 171); - this.textBox_lssserial.Name = "textBox_lssserial"; - this.textBox_lssserial.Size = new System.Drawing.Size(218, 20); - this.textBox_lssserial.TabIndex = 7; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(7, 174); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(71, 13); - this.label9.TabIndex = 6; - this.label9.Text = "LSS Serial no"; - // - // checkBox_canopenmanager - // - this.checkBox_canopenmanager.AutoSize = true; - this.checkBox_canopenmanager.BackColor = System.Drawing.Color.PeachPuff; - this.checkBox_canopenmanager.Location = new System.Drawing.Point(111, 148); - this.checkBox_canopenmanager.Name = "checkBox_canopenmanager"; - this.checkBox_canopenmanager.Padding = new System.Windows.Forms.Padding(0, 0, 202, 0); - this.checkBox_canopenmanager.Size = new System.Drawing.Size(217, 14); - this.checkBox_canopenmanager.TabIndex = 5; - this.checkBox_canopenmanager.UseVisualStyleBackColor = false; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(7, 125); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(53, 13); - this.label8.TabIndex = 62; - this.label8.Text = "Net name"; - // - // textBox_netname - // - this.textBox_netname.BackColor = System.Drawing.Color.PeachPuff; - this.textBox_netname.Location = new System.Drawing.Point(111, 122); - this.textBox_netname.Name = "textBox_netname"; - this.textBox_netname.Size = new System.Drawing.Size(218, 20); - this.textBox_netname.TabIndex = 4; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(7, 99); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(62, 13); - this.label7.TabIndex = 60; - this.label7.Text = "Net number"; - // - // textBox_netnum - // - this.textBox_netnum.BackColor = System.Drawing.Color.PeachPuff; - this.textBox_netnum.Location = new System.Drawing.Point(111, 96); - this.textBox_netnum.Name = "textBox_netnum"; - this.textBox_netnum.Size = new System.Drawing.Size(218, 20); - this.textBox_netnum.TabIndex = 3; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(7, 74); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(50, 13); - this.label6.TabIndex = 58; - this.label6.Text = "Baudrate"; - // - // textBox_baudrate - // - this.textBox_baudrate.BackColor = System.Drawing.Color.PeachPuff; - this.textBox_baudrate.Location = new System.Drawing.Point(111, 71); - this.textBox_baudrate.Name = "textBox_baudrate"; - this.textBox_baudrate.Size = new System.Drawing.Size(218, 20); - this.textBox_baudrate.TabIndex = 2; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(7, 48); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(62, 13); - this.label5.TabIndex = 56; - this.label5.Text = "Node name"; - // - // textBox_nodename - // - this.textBox_nodename.BackColor = System.Drawing.Color.PeachPuff; - this.textBox_nodename.Location = new System.Drawing.Point(111, 45); - this.textBox_nodename.Name = "textBox_nodename"; - this.textBox_nodename.Size = new System.Drawing.Size(218, 20); - this.textBox_nodename.TabIndex = 1; - // - // label32 - // - this.label32.AutoSize = true; - this.label32.Location = new System.Drawing.Point(7, 22); - this.label32.Name = "label32"; - this.label32.Size = new System.Drawing.Size(91, 13); - this.label32.TabIndex = 53; - this.label32.Text = "Concrete node ID"; - // - // textBox_concretenodeid - // - this.textBox_concretenodeid.BackColor = System.Drawing.Color.PeachPuff; - this.textBox_concretenodeid.Location = new System.Drawing.Point(111, 19); - this.textBox_concretenodeid.Name = "textBox_concretenodeid"; - this.textBox_concretenodeid.Size = new System.Drawing.Size(218, 20); - this.textBox_concretenodeid.TabIndex = 0; - // - // groupBox4 - // - this.groupBox4.Controls.Add(this.textBox_productnumber); - this.groupBox4.Controls.Add(this.textBox_productname); - this.groupBox4.Controls.Add(this.textBox_vendornumber); - this.groupBox4.Controls.Add(this.textBox_vendorname); - this.groupBox4.Controls.Add(this.label29); - this.groupBox4.Controls.Add(this.label28); - this.groupBox4.Controls.Add(this.label27); - this.groupBox4.Controls.Add(this.label26); - this.groupBox4.Location = new System.Drawing.Point(12, 14); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(377, 126); - this.groupBox4.TabIndex = 0; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "Device Info"; - // - // textBox_productnumber - // - this.textBox_productnumber.Location = new System.Drawing.Point(139, 46); - this.textBox_productnumber.Name = "textBox_productnumber"; - this.textBox_productnumber.Size = new System.Drawing.Size(226, 20); - this.textBox_productnumber.TabIndex = 1; - // - // textBox_productname - // - this.textBox_productname.Location = new System.Drawing.Point(139, 20); - this.textBox_productname.Name = "textBox_productname"; - this.textBox_productname.Size = new System.Drawing.Size(226, 20); - this.textBox_productname.TabIndex = 0; - // - // textBox_vendornumber - // - this.textBox_vendornumber.Location = new System.Drawing.Point(139, 98); - this.textBox_vendornumber.Name = "textBox_vendornumber"; - this.textBox_vendornumber.Size = new System.Drawing.Size(226, 20); - this.textBox_vendornumber.TabIndex = 3; - // - // textBox_vendorname - // - this.textBox_vendorname.Location = new System.Drawing.Point(139, 72); - this.textBox_vendorname.Name = "textBox_vendorname"; - this.textBox_vendorname.Size = new System.Drawing.Size(226, 20); - this.textBox_vendorname.TabIndex = 2; - // - // label29 - // - this.label29.AutoSize = true; - this.label29.Location = new System.Drawing.Point(10, 49); - this.label29.Name = "label29"; - this.label29.Size = new System.Drawing.Size(58, 13); - this.label29.TabIndex = 37; - this.label29.Text = "Product ID"; - // - // label28 - // - this.label28.AutoSize = true; - this.label28.Location = new System.Drawing.Point(10, 23); - this.label28.Name = "label28"; - this.label28.Size = new System.Drawing.Size(73, 13); - this.label28.TabIndex = 36; - this.label28.Text = "Product name"; - // - // label27 - // - this.label27.AutoSize = true; - this.label27.Location = new System.Drawing.Point(10, 101); - this.label27.Name = "label27"; - this.label27.Size = new System.Drawing.Size(55, 13); - this.label27.TabIndex = 35; - this.label27.Text = "Vendor ID"; - // - // label26 - // - this.label26.AutoSize = true; - this.label26.Location = new System.Drawing.Point(10, 75); - this.label26.Name = "label26"; - this.label26.Size = new System.Drawing.Size(70, 13); - this.label26.TabIndex = 34; - this.label26.Text = "Vendor name"; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.checkBox_baud_auto); - this.groupBox1.Controls.Add(this.checkBox_baud_125); - this.groupBox1.Controls.Add(this.checkBox_baud_10); - this.groupBox1.Controls.Add(this.checkBox_baud_20); - this.groupBox1.Controls.Add(this.checkBox_baud_50); - this.groupBox1.Controls.Add(this.checkBox_baud_250); - this.groupBox1.Controls.Add(this.checkBox_baud_1000); - this.groupBox1.Controls.Add(this.checkBox_baud_500); - this.groupBox1.Controls.Add(this.checkBox_baud_800); - this.groupBox1.Location = new System.Drawing.Point(395, 14); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(120, 220); - this.groupBox1.TabIndex = 3; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Baudrates"; - // - // checkBox_baud_auto - // - this.checkBox_baud_auto.AutoSize = true; - this.checkBox_baud_auto.Location = new System.Drawing.Point(10, 163); - this.checkBox_baud_auto.Name = "checkBox_baud_auto"; - this.checkBox_baud_auto.Size = new System.Drawing.Size(47, 17); - this.checkBox_baud_auto.TabIndex = 8; - this.checkBox_baud_auto.Text = "auto"; - this.checkBox_baud_auto.UseVisualStyleBackColor = true; - // - // checkBox_baud_125 - // - this.checkBox_baud_125.AutoSize = true; - this.checkBox_baud_125.Location = new System.Drawing.Point(10, 72); - this.checkBox_baud_125.Name = "checkBox_baud_125"; - this.checkBox_baud_125.Size = new System.Drawing.Size(70, 17); - this.checkBox_baud_125.TabIndex = 3; - this.checkBox_baud_125.Text = "125 kbps"; - this.checkBox_baud_125.UseVisualStyleBackColor = true; - // - // checkBox_baud_10 - // - this.checkBox_baud_10.AutoSize = true; - this.checkBox_baud_10.Location = new System.Drawing.Point(10, 20); - this.checkBox_baud_10.Name = "checkBox_baud_10"; - this.checkBox_baud_10.Size = new System.Drawing.Size(64, 17); - this.checkBox_baud_10.TabIndex = 0; - this.checkBox_baud_10.Text = "10 kbps"; - this.checkBox_baud_10.UseVisualStyleBackColor = true; - // - // checkBox_baud_20 - // - this.checkBox_baud_20.AutoSize = true; - this.checkBox_baud_20.Location = new System.Drawing.Point(10, 37); - this.checkBox_baud_20.Name = "checkBox_baud_20"; - this.checkBox_baud_20.Size = new System.Drawing.Size(64, 17); - this.checkBox_baud_20.TabIndex = 1; - this.checkBox_baud_20.Text = "20 kbps"; - this.checkBox_baud_20.UseVisualStyleBackColor = true; - // - // checkBox_baud_50 - // - this.checkBox_baud_50.AutoSize = true; - this.checkBox_baud_50.Location = new System.Drawing.Point(10, 54); - this.checkBox_baud_50.Name = "checkBox_baud_50"; - this.checkBox_baud_50.Size = new System.Drawing.Size(64, 17); - this.checkBox_baud_50.TabIndex = 2; - this.checkBox_baud_50.Text = "50 kbps"; - this.checkBox_baud_50.UseVisualStyleBackColor = true; - // - // checkBox_baud_250 - // - this.checkBox_baud_250.AutoSize = true; - this.checkBox_baud_250.Location = new System.Drawing.Point(10, 90); - this.checkBox_baud_250.Name = "checkBox_baud_250"; - this.checkBox_baud_250.Size = new System.Drawing.Size(70, 17); - this.checkBox_baud_250.TabIndex = 4; - this.checkBox_baud_250.Text = "250 kbps"; - this.checkBox_baud_250.UseVisualStyleBackColor = true; - // - // checkBox_baud_1000 - // - this.checkBox_baud_1000.AutoSize = true; - this.checkBox_baud_1000.Location = new System.Drawing.Point(10, 145); - this.checkBox_baud_1000.Name = "checkBox_baud_1000"; - this.checkBox_baud_1000.Size = new System.Drawing.Size(76, 17); - this.checkBox_baud_1000.TabIndex = 7; - this.checkBox_baud_1000.Text = "1000 kbps"; - this.checkBox_baud_1000.UseVisualStyleBackColor = true; - // - // checkBox_baud_500 - // - this.checkBox_baud_500.AutoSize = true; - this.checkBox_baud_500.Location = new System.Drawing.Point(10, 109); - this.checkBox_baud_500.Name = "checkBox_baud_500"; - this.checkBox_baud_500.Size = new System.Drawing.Size(70, 17); - this.checkBox_baud_500.TabIndex = 5; - this.checkBox_baud_500.Text = "500 kbps"; - this.checkBox_baud_500.UseVisualStyleBackColor = true; - // - // checkBox_baud_800 - // - this.checkBox_baud_800.AutoSize = true; - this.checkBox_baud_800.Location = new System.Drawing.Point(10, 127); - this.checkBox_baud_800.Name = "checkBox_baud_800"; - this.checkBox_baud_800.Size = new System.Drawing.Size(70, 17); - this.checkBox_baud_800.TabIndex = 6; - this.checkBox_baud_800.Text = "800 kbps"; - this.checkBox_baud_800.UseVisualStyleBackColor = true; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.textBox_NG_NumOfNodes); - this.groupBox2.Controls.Add(this.label10); - this.groupBox2.Controls.Add(this.checkBox_ngMaster); - this.groupBox2.Controls.Add(this.checkBox_ngSlave); - this.groupBox2.Controls.Add(this.textBox_granularity); - this.groupBox2.Controls.Add(this.label1); - this.groupBox2.Controls.Add(this.textBox_txpdos); - this.groupBox2.Controls.Add(this.checkBox_lssMaster); - this.groupBox2.Controls.Add(this.label30); - this.groupBox2.Controls.Add(this.textBox_rxpdos); - this.groupBox2.Controls.Add(this.label17); - this.groupBox2.Controls.Add(this.checkBox_lss); - this.groupBox2.Location = new System.Drawing.Point(521, 14); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(213, 220); - this.groupBox2.TabIndex = 4; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "General and Master Features"; - // - // textBox_NG_NumOfNodes - // - this.textBox_NG_NumOfNodes.BackColor = System.Drawing.SystemColors.Window; - this.textBox_NG_NumOfNodes.Location = new System.Drawing.Point(124, 193); - this.textBox_NG_NumOfNodes.Name = "textBox_NG_NumOfNodes"; - this.textBox_NG_NumOfNodes.Size = new System.Drawing.Size(80, 20); - this.textBox_NG_NumOfNodes.TabIndex = 44; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(10, 196); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(114, 13); - this.label10.TabIndex = 45; - this.label10.Text = "No of monitored nodes"; - // - // checkBox_ngMaster - // - this.checkBox_ngMaster.AutoSize = true; - this.checkBox_ngMaster.Location = new System.Drawing.Point(10, 176); - this.checkBox_ngMaster.Name = "checkBox_ngMaster"; - this.checkBox_ngMaster.Size = new System.Drawing.Size(131, 17); - this.checkBox_ngMaster.TabIndex = 43; - this.checkBox_ngMaster.Text = "Node guarding Master"; - this.checkBox_ngMaster.UseVisualStyleBackColor = true; - // - // checkBox_ngSlave - // - this.checkBox_ngSlave.AutoSize = true; - this.checkBox_ngSlave.Location = new System.Drawing.Point(10, 158); - this.checkBox_ngSlave.Name = "checkBox_ngSlave"; - this.checkBox_ngSlave.Size = new System.Drawing.Size(126, 17); - this.checkBox_ngSlave.TabIndex = 42; - this.checkBox_ngSlave.Text = "Node guarding Slave"; - this.checkBox_ngSlave.UseVisualStyleBackColor = true; - // - // textBox_granularity - // - this.textBox_granularity.Location = new System.Drawing.Point(102, 20); - this.textBox_granularity.Name = "textBox_granularity"; - this.textBox_granularity.Size = new System.Drawing.Size(101, 20); - this.textBox_granularity.TabIndex = 41; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(10, 23); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(57, 13); - this.label1.TabIndex = 40; - this.label1.Text = "Granularity"; - // - // textBox_txpdos - // - this.textBox_txpdos.Location = new System.Drawing.Point(102, 72); - this.textBox_txpdos.Name = "textBox_txpdos"; - this.textBox_txpdos.ReadOnly = true; - this.textBox_txpdos.Size = new System.Drawing.Size(101, 20); - this.textBox_txpdos.TabIndex = 1; - // - // checkBox_lssMaster - // - this.checkBox_lssMaster.AutoSize = true; - this.checkBox_lssMaster.Location = new System.Drawing.Point(10, 128); - this.checkBox_lssMaster.Name = "checkBox_lssMaster"; - this.checkBox_lssMaster.Size = new System.Drawing.Size(81, 17); - this.checkBox_lssMaster.TabIndex = 10; - this.checkBox_lssMaster.Text = "LSS Master"; - this.checkBox_lssMaster.UseVisualStyleBackColor = true; - // - // label30 - // - this.label30.AutoSize = true; - this.label30.Location = new System.Drawing.Point(10, 75); - this.label30.Name = "label30"; - this.label30.Size = new System.Drawing.Size(67, 13); - this.label30.TabIndex = 39; - this.label30.Text = "TPDO count"; - // - // textBox_rxpdos - // - this.textBox_rxpdos.Location = new System.Drawing.Point(102, 46); - this.textBox_rxpdos.Name = "textBox_rxpdos"; - this.textBox_rxpdos.ReadOnly = true; - this.textBox_rxpdos.Size = new System.Drawing.Size(101, 20); - this.textBox_rxpdos.TabIndex = 0; - // - // label17 - // - this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(10, 49); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(68, 13); - this.label17.TabIndex = 38; - this.label17.Text = "RPDO count"; - // - // checkBox_lss - // - this.checkBox_lss.AutoSize = true; - this.checkBox_lss.Location = new System.Drawing.Point(10, 110); - this.checkBox_lss.Name = "checkBox_lss"; - this.checkBox_lss.Size = new System.Drawing.Size(76, 17); - this.checkBox_lss.TabIndex = 6; - this.checkBox_lss.Text = "LSS Slave"; - this.checkBox_lss.UseVisualStyleBackColor = true; - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.textBox_modifiedby); - this.groupBox3.Controls.Add(this.textBox_modified_datetime); - this.groupBox3.Controls.Add(this.textBox_createdby); - this.groupBox3.Controls.Add(this.textBox_create_datetime); - this.groupBox3.Controls.Add(this.textBox_di_description); - this.groupBox3.Controls.Add(this.textBox_fileversion); - this.groupBox3.Controls.Add(this.label25); - this.groupBox3.Controls.Add(this.label24); - this.groupBox3.Controls.Add(this.label23); - this.groupBox3.Controls.Add(this.label22); - this.groupBox3.Controls.Add(this.label20); - this.groupBox3.Controls.Add(this.label18); - this.groupBox3.Location = new System.Drawing.Point(12, 146); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(377, 180); - this.groupBox3.TabIndex = 1; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "File Info"; - // - // textBox_modifiedby - // - this.textBox_modifiedby.Location = new System.Drawing.Point(139, 150); - this.textBox_modifiedby.Name = "textBox_modifiedby"; - this.textBox_modifiedby.Size = new System.Drawing.Size(226, 20); - this.textBox_modifiedby.TabIndex = 7; - // - // textBox_modified_datetime - // - this.textBox_modified_datetime.Location = new System.Drawing.Point(139, 124); - this.textBox_modified_datetime.Name = "textBox_modified_datetime"; - this.textBox_modified_datetime.ReadOnly = true; - this.textBox_modified_datetime.Size = new System.Drawing.Size(226, 20); - this.textBox_modified_datetime.TabIndex = 6; - // - // textBox_createdby - // - this.textBox_createdby.Location = new System.Drawing.Point(139, 98); - this.textBox_createdby.Name = "textBox_createdby"; - this.textBox_createdby.Size = new System.Drawing.Size(226, 20); - this.textBox_createdby.TabIndex = 5; - // - // textBox_create_datetime - // - this.textBox_create_datetime.Location = new System.Drawing.Point(139, 72); - this.textBox_create_datetime.Name = "textBox_create_datetime"; - this.textBox_create_datetime.Size = new System.Drawing.Size(226, 20); - this.textBox_create_datetime.TabIndex = 4; - // - // textBox_di_description - // - this.textBox_di_description.Location = new System.Drawing.Point(139, 46); - this.textBox_di_description.Name = "textBox_di_description"; - this.textBox_di_description.Size = new System.Drawing.Size(226, 20); - this.textBox_di_description.TabIndex = 3; - // - // textBox_fileversion - // - this.textBox_fileversion.Location = new System.Drawing.Point(139, 20); - this.textBox_fileversion.Name = "textBox_fileversion"; - this.textBox_fileversion.Size = new System.Drawing.Size(226, 20); - this.textBox_fileversion.TabIndex = 0; - // - // label25 - // - this.label25.AutoSize = true; - this.label25.Location = new System.Drawing.Point(10, 153); - this.label25.Name = "label25"; - this.label25.Size = new System.Drawing.Size(61, 13); - this.label25.TabIndex = 25; - this.label25.Text = "Modified by"; - // - // label24 - // - this.label24.AutoSize = true; - this.label24.Location = new System.Drawing.Point(10, 127); - this.label24.Name = "label24"; - this.label24.Size = new System.Drawing.Size(118, 13); - this.label24.TabIndex = 24; - this.label24.Text = "Modification Date/Time"; - // - // label23 - // - this.label23.AutoSize = true; - this.label23.Location = new System.Drawing.Point(10, 101); - this.label23.Name = "label23"; - this.label23.Size = new System.Drawing.Size(59, 13); - this.label23.TabIndex = 23; - this.label23.Text = "Created By"; - // - // label22 - // - this.label22.AutoSize = true; - this.label22.Location = new System.Drawing.Point(10, 75); - this.label22.Name = "label22"; - this.label22.Size = new System.Drawing.Size(100, 13); - this.label22.TabIndex = 22; - this.label22.Text = "Creation Date/Time"; - // - // label20 - // - this.label20.AutoSize = true; - this.label20.Location = new System.Drawing.Point(10, 49); - this.label20.Name = "label20"; - this.label20.Size = new System.Drawing.Size(60, 13); - this.label20.TabIndex = 20; - this.label20.Text = "Description"; - // - // label18 - // - this.label18.AutoSize = true; - this.label18.Location = new System.Drawing.Point(10, 23); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(60, 13); - this.label18.TabIndex = 18; - this.label18.Text = "File version"; - // - // DeviceInfoView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.panel1); - this.Name = "DeviceInfoView"; - this.Size = new System.Drawing.Size(773, 537); - this.panel1.ResumeLayout(false); - this.groupBox5.ResumeLayout(false); - this.groupBox5.PerformLayout(); - this.groupBox6.ResumeLayout(false); - this.groupBox6.PerformLayout(); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.groupBox3.ResumeLayout(false); - this.groupBox3.PerformLayout(); - this.ResumeLayout(false); - + this.panel1 = new System.Windows.Forms.Panel(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.label4 = new System.Windows.Forms.Label(); + this.textBox_mdFileName = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.textBox_xddfilenameStripped = new System.Windows.Forms.TextBox(); + this.textBox_canopennodeFileVersion = new System.Windows.Forms.TextBox(); + this.textBox_projectFileVersion = new System.Windows.Forms.TextBox(); + this.textBox_devicedcfname = new System.Windows.Forms.TextBox(); + this.label14 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.textBox_canopennodeFileName = new System.Windows.Forms.TextBox(); + this.label16 = new System.Windows.Forms.Label(); + this.label31 = new System.Windows.Forms.Label(); + this.textBox_projectFileName = new System.Windows.Forms.TextBox(); + this.textBox_deviceedsname = new System.Windows.Forms.TextBox(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.label3 = new System.Windows.Forms.Label(); + this.textBox_lssserial = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.checkBox_canopenmanager = new System.Windows.Forms.CheckBox(); + this.label8 = new System.Windows.Forms.Label(); + this.textBox_netname = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.textBox_netnum = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.textBox_baudrate = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.textBox_nodename = new System.Windows.Forms.TextBox(); + this.label32 = new System.Windows.Forms.Label(); + this.textBox_concretenodeid = new System.Windows.Forms.TextBox(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.textBox_productnumber = new System.Windows.Forms.TextBox(); + this.textBox_productname = new System.Windows.Forms.TextBox(); + this.textBox_vendornumber = new System.Windows.Forms.TextBox(); + this.textBox_vendorname = new System.Windows.Forms.TextBox(); + this.label29 = new System.Windows.Forms.Label(); + this.label28 = new System.Windows.Forms.Label(); + this.label27 = new System.Windows.Forms.Label(); + this.label26 = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.checkBox_baud_auto = new System.Windows.Forms.CheckBox(); + this.checkBox_baud_125 = new System.Windows.Forms.CheckBox(); + this.checkBox_baud_10 = new System.Windows.Forms.CheckBox(); + this.checkBox_baud_20 = new System.Windows.Forms.CheckBox(); + this.checkBox_baud_50 = new System.Windows.Forms.CheckBox(); + this.checkBox_baud_250 = new System.Windows.Forms.CheckBox(); + this.checkBox_baud_1000 = new System.Windows.Forms.CheckBox(); + this.checkBox_baud_500 = new System.Windows.Forms.CheckBox(); + this.checkBox_baud_800 = new System.Windows.Forms.CheckBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.textBox_NG_NumOfNodes = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.checkBox_ngMaster = new System.Windows.Forms.CheckBox(); + this.checkBox_ngSlave = new System.Windows.Forms.CheckBox(); + this.textBox_granularity = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.textBox_txpdos = new System.Windows.Forms.TextBox(); + this.checkBox_lssMaster = new System.Windows.Forms.CheckBox(); + this.label30 = new System.Windows.Forms.Label(); + this.textBox_rxpdos = new System.Windows.Forms.TextBox(); + this.label17 = new System.Windows.Forms.Label(); + this.checkBox_lss = new System.Windows.Forms.CheckBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.textBox_modifiedby = new System.Windows.Forms.TextBox(); + this.textBox_modified_datetime = new System.Windows.Forms.TextBox(); + this.textBox_createdby = new System.Windows.Forms.TextBox(); + this.textBox_create_datetime = new System.Windows.Forms.TextBox(); + this.textBox_di_description = new System.Windows.Forms.TextBox(); + this.textBox_fileversion = new System.Windows.Forms.TextBox(); + this.label25 = new System.Windows.Forms.Label(); + this.label24 = new System.Windows.Forms.Label(); + this.label23 = new System.Windows.Forms.Label(); + this.label22 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + this.groupBox5.SuspendLayout(); + this.groupBox6.SuspendLayout(); + this.groupBox4.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.Controls.Add(this.groupBox5); + this.panel1.Controls.Add(this.groupBox6); + this.panel1.Controls.Add(this.groupBox4); + this.panel1.Controls.Add(this.groupBox1); + this.panel1.Controls.Add(this.groupBox2); + this.panel1.Controls.Add(this.groupBox3); + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(773, 537); + this.panel1.TabIndex = 60; + // + // groupBox5 + // + this.groupBox5.Controls.Add(this.label4); + this.groupBox5.Controls.Add(this.textBox_mdFileName); + this.groupBox5.Controls.Add(this.label2); + this.groupBox5.Controls.Add(this.textBox_xddfilenameStripped); + this.groupBox5.Controls.Add(this.textBox_canopennodeFileVersion); + this.groupBox5.Controls.Add(this.textBox_projectFileVersion); + this.groupBox5.Controls.Add(this.textBox_devicedcfname); + this.groupBox5.Controls.Add(this.label14); + this.groupBox5.Controls.Add(this.label15); + this.groupBox5.Controls.Add(this.textBox_canopennodeFileName); + this.groupBox5.Controls.Add(this.label16); + this.groupBox5.Controls.Add(this.label31); + this.groupBox5.Controls.Add(this.textBox_projectFileName); + this.groupBox5.Controls.Add(this.textBox_deviceedsname); + this.groupBox5.Location = new System.Drawing.Point(12, 332); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(377, 182); + this.groupBox5.TabIndex = 63; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "Project Info"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(10, 153); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(95, 13); + this.label4.TabIndex = 70; + this.label4.Text = "Documentation file"; + // + // textBox_mdFileName + // + this.textBox_mdFileName.Location = new System.Drawing.Point(139, 150); + this.textBox_mdFileName.Name = "textBox_mdFileName"; + this.textBox_mdFileName.ReadOnly = true; + this.textBox_mdFileName.Size = new System.Drawing.Size(226, 20); + this.textBox_mdFileName.TabIndex = 69; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(10, 49); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(116, 13); + this.label2.TabIndex = 68; + this.label2.Text = "XDD v1.1 file - stripped"; + // + // textBox_xddfilenameStripped + // + this.textBox_xddfilenameStripped.Location = new System.Drawing.Point(139, 46); + this.textBox_xddfilenameStripped.Name = "textBox_xddfilenameStripped"; + this.textBox_xddfilenameStripped.ReadOnly = true; + this.textBox_xddfilenameStripped.Size = new System.Drawing.Size(226, 20); + this.textBox_xddfilenameStripped.TabIndex = 67; + // + // textBox_canopennodeFileVersion + // + this.textBox_canopennodeFileVersion.Location = new System.Drawing.Point(330, 124); + this.textBox_canopennodeFileVersion.Name = "textBox_canopennodeFileVersion"; + this.textBox_canopennodeFileVersion.ReadOnly = true; + this.textBox_canopennodeFileVersion.Size = new System.Drawing.Size(35, 20); + this.textBox_canopennodeFileVersion.TabIndex = 66; + // + // textBox_projectFileVersion + // + this.textBox_projectFileVersion.Location = new System.Drawing.Point(330, 20); + this.textBox_projectFileVersion.Name = "textBox_projectFileVersion"; + this.textBox_projectFileVersion.ReadOnly = true; + this.textBox_projectFileVersion.Size = new System.Drawing.Size(35, 20); + this.textBox_projectFileVersion.TabIndex = 65; + // + // textBox_devicedcfname + // + this.textBox_devicedcfname.Location = new System.Drawing.Point(139, 98); + this.textBox_devicedcfname.Name = "textBox_devicedcfname"; + this.textBox_devicedcfname.ReadOnly = true; + this.textBox_devicedcfname.Size = new System.Drawing.Size(226, 20); + this.textBox_devicedcfname.TabIndex = 8; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(10, 127); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(119, 13); + this.label14.TabIndex = 21; + this.label14.Text = "CANopenNode file (ver)"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(10, 101); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(44, 13); + this.label15.TabIndex = 20; + this.label15.Text = "DCF file"; + // + // textBox_canopennodeFileName + // + this.textBox_canopennodeFileName.Location = new System.Drawing.Point(139, 124); + this.textBox_canopennodeFileName.Name = "textBox_canopennodeFileName"; + this.textBox_canopennodeFileName.ReadOnly = true; + this.textBox_canopennodeFileName.Size = new System.Drawing.Size(185, 20); + this.textBox_canopennodeFileName.TabIndex = 9; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(10, 75); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(45, 13); + this.label16.TabIndex = 19; + this.label16.Text = "EDS file"; + // + // label31 + // + this.label31.AutoSize = true; + this.label31.Location = new System.Drawing.Point(10, 23); + this.label31.Name = "label31"; + this.label31.Size = new System.Drawing.Size(99, 13); + this.label31.TabIndex = 18; + this.label31.Text = "Project file (version)"; + // + // textBox_projectFileName + // + this.textBox_projectFileName.Location = new System.Drawing.Point(139, 20); + this.textBox_projectFileName.Name = "textBox_projectFileName"; + this.textBox_projectFileName.ReadOnly = true; + this.textBox_projectFileName.Size = new System.Drawing.Size(185, 20); + this.textBox_projectFileName.TabIndex = 6; + // + // textBox_deviceedsname + // + this.textBox_deviceedsname.Location = new System.Drawing.Point(139, 72); + this.textBox_deviceedsname.Name = "textBox_deviceedsname"; + this.textBox_deviceedsname.ReadOnly = true; + this.textBox_deviceedsname.Size = new System.Drawing.Size(226, 20); + this.textBox_deviceedsname.TabIndex = 7; + // + // groupBox6 + // + this.groupBox6.Controls.Add(this.label3); + this.groupBox6.Controls.Add(this.textBox_lssserial); + this.groupBox6.Controls.Add(this.label9); + this.groupBox6.Controls.Add(this.checkBox_canopenmanager); + this.groupBox6.Controls.Add(this.label8); + this.groupBox6.Controls.Add(this.textBox_netname); + this.groupBox6.Controls.Add(this.label7); + this.groupBox6.Controls.Add(this.textBox_netnum); + this.groupBox6.Controls.Add(this.label6); + this.groupBox6.Controls.Add(this.textBox_baudrate); + this.groupBox6.Controls.Add(this.label5); + this.groupBox6.Controls.Add(this.textBox_nodename); + this.groupBox6.Controls.Add(this.label32); + this.groupBox6.Controls.Add(this.textBox_concretenodeid); + this.groupBox6.Location = new System.Drawing.Point(395, 313); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(339, 202); + this.groupBox6.TabIndex = 5; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "Device commissioning"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(7, 149); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(98, 13); + this.label3.TabIndex = 63; + this.label3.Text = "CANopen Manager"; + // + // textBox_lssserial + // + this.textBox_lssserial.BackColor = System.Drawing.Color.PeachPuff; + this.textBox_lssserial.Location = new System.Drawing.Point(111, 171); + this.textBox_lssserial.Name = "textBox_lssserial"; + this.textBox_lssserial.Size = new System.Drawing.Size(218, 20); + this.textBox_lssserial.TabIndex = 7; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(7, 174); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(71, 13); + this.label9.TabIndex = 6; + this.label9.Text = "LSS Serial no"; + // + // checkBox_canopenmanager + // + this.checkBox_canopenmanager.AutoSize = true; + this.checkBox_canopenmanager.BackColor = System.Drawing.Color.PeachPuff; + this.checkBox_canopenmanager.Location = new System.Drawing.Point(111, 148); + this.checkBox_canopenmanager.Name = "checkBox_canopenmanager"; + this.checkBox_canopenmanager.Padding = new System.Windows.Forms.Padding(0, 0, 202, 0); + this.checkBox_canopenmanager.Size = new System.Drawing.Size(217, 14); + this.checkBox_canopenmanager.TabIndex = 5; + this.checkBox_canopenmanager.UseVisualStyleBackColor = false; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(7, 125); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(53, 13); + this.label8.TabIndex = 62; + this.label8.Text = "Net name"; + // + // textBox_netname + // + this.textBox_netname.BackColor = System.Drawing.Color.PeachPuff; + this.textBox_netname.Location = new System.Drawing.Point(111, 122); + this.textBox_netname.Name = "textBox_netname"; + this.textBox_netname.Size = new System.Drawing.Size(218, 20); + this.textBox_netname.TabIndex = 4; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(7, 99); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(62, 13); + this.label7.TabIndex = 60; + this.label7.Text = "Net number"; + // + // textBox_netnum + // + this.textBox_netnum.BackColor = System.Drawing.Color.PeachPuff; + this.textBox_netnum.Location = new System.Drawing.Point(111, 96); + this.textBox_netnum.Name = "textBox_netnum"; + this.textBox_netnum.Size = new System.Drawing.Size(218, 20); + this.textBox_netnum.TabIndex = 3; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(7, 74); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(50, 13); + this.label6.TabIndex = 58; + this.label6.Text = "Baudrate"; + // + // textBox_baudrate + // + this.textBox_baudrate.BackColor = System.Drawing.Color.PeachPuff; + this.textBox_baudrate.Location = new System.Drawing.Point(111, 71); + this.textBox_baudrate.Name = "textBox_baudrate"; + this.textBox_baudrate.Size = new System.Drawing.Size(218, 20); + this.textBox_baudrate.TabIndex = 2; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(7, 48); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(62, 13); + this.label5.TabIndex = 56; + this.label5.Text = "Node name"; + // + // textBox_nodename + // + this.textBox_nodename.BackColor = System.Drawing.Color.PeachPuff; + this.textBox_nodename.Location = new System.Drawing.Point(111, 45); + this.textBox_nodename.Name = "textBox_nodename"; + this.textBox_nodename.Size = new System.Drawing.Size(218, 20); + this.textBox_nodename.TabIndex = 1; + // + // label32 + // + this.label32.AutoSize = true; + this.label32.Location = new System.Drawing.Point(7, 22); + this.label32.Name = "label32"; + this.label32.Size = new System.Drawing.Size(91, 13); + this.label32.TabIndex = 53; + this.label32.Text = "Concrete node ID"; + // + // textBox_concretenodeid + // + this.textBox_concretenodeid.BackColor = System.Drawing.Color.PeachPuff; + this.textBox_concretenodeid.Location = new System.Drawing.Point(111, 19); + this.textBox_concretenodeid.Name = "textBox_concretenodeid"; + this.textBox_concretenodeid.Size = new System.Drawing.Size(218, 20); + this.textBox_concretenodeid.TabIndex = 0; + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.textBox_productnumber); + this.groupBox4.Controls.Add(this.textBox_productname); + this.groupBox4.Controls.Add(this.textBox_vendornumber); + this.groupBox4.Controls.Add(this.textBox_vendorname); + this.groupBox4.Controls.Add(this.label29); + this.groupBox4.Controls.Add(this.label28); + this.groupBox4.Controls.Add(this.label27); + this.groupBox4.Controls.Add(this.label26); + this.groupBox4.Location = new System.Drawing.Point(12, 14); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(377, 126); + this.groupBox4.TabIndex = 0; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "Device Info"; + // + // textBox_productnumber + // + this.textBox_productnumber.Location = new System.Drawing.Point(139, 46); + this.textBox_productnumber.Name = "textBox_productnumber"; + this.textBox_productnumber.Size = new System.Drawing.Size(226, 20); + this.textBox_productnumber.TabIndex = 1; + // + // textBox_productname + // + this.textBox_productname.Location = new System.Drawing.Point(139, 20); + this.textBox_productname.Name = "textBox_productname"; + this.textBox_productname.Size = new System.Drawing.Size(226, 20); + this.textBox_productname.TabIndex = 0; + // + // textBox_vendornumber + // + this.textBox_vendornumber.Location = new System.Drawing.Point(139, 98); + this.textBox_vendornumber.Name = "textBox_vendornumber"; + this.textBox_vendornumber.Size = new System.Drawing.Size(226, 20); + this.textBox_vendornumber.TabIndex = 3; + // + // textBox_vendorname + // + this.textBox_vendorname.Location = new System.Drawing.Point(139, 72); + this.textBox_vendorname.Name = "textBox_vendorname"; + this.textBox_vendorname.Size = new System.Drawing.Size(226, 20); + this.textBox_vendorname.TabIndex = 2; + // + // label29 + // + this.label29.AutoSize = true; + this.label29.Location = new System.Drawing.Point(10, 49); + this.label29.Name = "label29"; + this.label29.Size = new System.Drawing.Size(58, 13); + this.label29.TabIndex = 37; + this.label29.Text = "Product ID"; + // + // label28 + // + this.label28.AutoSize = true; + this.label28.Location = new System.Drawing.Point(10, 23); + this.label28.Name = "label28"; + this.label28.Size = new System.Drawing.Size(73, 13); + this.label28.TabIndex = 36; + this.label28.Text = "Product name"; + // + // label27 + // + this.label27.AutoSize = true; + this.label27.Location = new System.Drawing.Point(10, 101); + this.label27.Name = "label27"; + this.label27.Size = new System.Drawing.Size(55, 13); + this.label27.TabIndex = 35; + this.label27.Text = "Vendor ID"; + // + // label26 + // + this.label26.AutoSize = true; + this.label26.Location = new System.Drawing.Point(10, 75); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(70, 13); + this.label26.TabIndex = 34; + this.label26.Text = "Vendor name"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.checkBox_baud_auto); + this.groupBox1.Controls.Add(this.checkBox_baud_125); + this.groupBox1.Controls.Add(this.checkBox_baud_10); + this.groupBox1.Controls.Add(this.checkBox_baud_20); + this.groupBox1.Controls.Add(this.checkBox_baud_50); + this.groupBox1.Controls.Add(this.checkBox_baud_250); + this.groupBox1.Controls.Add(this.checkBox_baud_1000); + this.groupBox1.Controls.Add(this.checkBox_baud_500); + this.groupBox1.Controls.Add(this.checkBox_baud_800); + this.groupBox1.Location = new System.Drawing.Point(395, 14); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(120, 220); + this.groupBox1.TabIndex = 3; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Baudrates"; + // + // checkBox_baud_auto + // + this.checkBox_baud_auto.AutoSize = true; + this.checkBox_baud_auto.Location = new System.Drawing.Point(10, 163); + this.checkBox_baud_auto.Name = "checkBox_baud_auto"; + this.checkBox_baud_auto.Size = new System.Drawing.Size(47, 17); + this.checkBox_baud_auto.TabIndex = 8; + this.checkBox_baud_auto.Text = "auto"; + this.checkBox_baud_auto.UseVisualStyleBackColor = true; + // + // checkBox_baud_125 + // + this.checkBox_baud_125.AutoSize = true; + this.checkBox_baud_125.Location = new System.Drawing.Point(10, 72); + this.checkBox_baud_125.Name = "checkBox_baud_125"; + this.checkBox_baud_125.Size = new System.Drawing.Size(70, 17); + this.checkBox_baud_125.TabIndex = 3; + this.checkBox_baud_125.Text = "125 kbps"; + this.checkBox_baud_125.UseVisualStyleBackColor = true; + // + // checkBox_baud_10 + // + this.checkBox_baud_10.AutoSize = true; + this.checkBox_baud_10.Location = new System.Drawing.Point(10, 20); + this.checkBox_baud_10.Name = "checkBox_baud_10"; + this.checkBox_baud_10.Size = new System.Drawing.Size(64, 17); + this.checkBox_baud_10.TabIndex = 0; + this.checkBox_baud_10.Text = "10 kbps"; + this.checkBox_baud_10.UseVisualStyleBackColor = true; + // + // checkBox_baud_20 + // + this.checkBox_baud_20.AutoSize = true; + this.checkBox_baud_20.Location = new System.Drawing.Point(10, 37); + this.checkBox_baud_20.Name = "checkBox_baud_20"; + this.checkBox_baud_20.Size = new System.Drawing.Size(64, 17); + this.checkBox_baud_20.TabIndex = 1; + this.checkBox_baud_20.Text = "20 kbps"; + this.checkBox_baud_20.UseVisualStyleBackColor = true; + // + // checkBox_baud_50 + // + this.checkBox_baud_50.AutoSize = true; + this.checkBox_baud_50.Location = new System.Drawing.Point(10, 54); + this.checkBox_baud_50.Name = "checkBox_baud_50"; + this.checkBox_baud_50.Size = new System.Drawing.Size(64, 17); + this.checkBox_baud_50.TabIndex = 2; + this.checkBox_baud_50.Text = "50 kbps"; + this.checkBox_baud_50.UseVisualStyleBackColor = true; + // + // checkBox_baud_250 + // + this.checkBox_baud_250.AutoSize = true; + this.checkBox_baud_250.Location = new System.Drawing.Point(10, 90); + this.checkBox_baud_250.Name = "checkBox_baud_250"; + this.checkBox_baud_250.Size = new System.Drawing.Size(70, 17); + this.checkBox_baud_250.TabIndex = 4; + this.checkBox_baud_250.Text = "250 kbps"; + this.checkBox_baud_250.UseVisualStyleBackColor = true; + // + // checkBox_baud_1000 + // + this.checkBox_baud_1000.AutoSize = true; + this.checkBox_baud_1000.Location = new System.Drawing.Point(10, 145); + this.checkBox_baud_1000.Name = "checkBox_baud_1000"; + this.checkBox_baud_1000.Size = new System.Drawing.Size(76, 17); + this.checkBox_baud_1000.TabIndex = 7; + this.checkBox_baud_1000.Text = "1000 kbps"; + this.checkBox_baud_1000.UseVisualStyleBackColor = true; + // + // checkBox_baud_500 + // + this.checkBox_baud_500.AutoSize = true; + this.checkBox_baud_500.Location = new System.Drawing.Point(10, 109); + this.checkBox_baud_500.Name = "checkBox_baud_500"; + this.checkBox_baud_500.Size = new System.Drawing.Size(70, 17); + this.checkBox_baud_500.TabIndex = 5; + this.checkBox_baud_500.Text = "500 kbps"; + this.checkBox_baud_500.UseVisualStyleBackColor = true; + // + // checkBox_baud_800 + // + this.checkBox_baud_800.AutoSize = true; + this.checkBox_baud_800.Location = new System.Drawing.Point(10, 127); + this.checkBox_baud_800.Name = "checkBox_baud_800"; + this.checkBox_baud_800.Size = new System.Drawing.Size(70, 17); + this.checkBox_baud_800.TabIndex = 6; + this.checkBox_baud_800.Text = "800 kbps"; + this.checkBox_baud_800.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.textBox_NG_NumOfNodes); + this.groupBox2.Controls.Add(this.label10); + this.groupBox2.Controls.Add(this.checkBox_ngMaster); + this.groupBox2.Controls.Add(this.checkBox_ngSlave); + this.groupBox2.Controls.Add(this.textBox_granularity); + this.groupBox2.Controls.Add(this.label1); + this.groupBox2.Controls.Add(this.textBox_txpdos); + this.groupBox2.Controls.Add(this.checkBox_lssMaster); + this.groupBox2.Controls.Add(this.label30); + this.groupBox2.Controls.Add(this.textBox_rxpdos); + this.groupBox2.Controls.Add(this.label17); + this.groupBox2.Controls.Add(this.checkBox_lss); + this.groupBox2.Location = new System.Drawing.Point(521, 14); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(213, 220); + this.groupBox2.TabIndex = 4; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "General and Master Features"; + // + // textBox_NG_NumOfNodes + // + this.textBox_NG_NumOfNodes.BackColor = System.Drawing.SystemColors.Window; + this.textBox_NG_NumOfNodes.Location = new System.Drawing.Point(124, 193); + this.textBox_NG_NumOfNodes.Name = "textBox_NG_NumOfNodes"; + this.textBox_NG_NumOfNodes.Size = new System.Drawing.Size(80, 20); + this.textBox_NG_NumOfNodes.TabIndex = 44; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(10, 196); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(114, 13); + this.label10.TabIndex = 45; + this.label10.Text = "No of monitored nodes"; + // + // checkBox_ngMaster + // + this.checkBox_ngMaster.AutoSize = true; + this.checkBox_ngMaster.Location = new System.Drawing.Point(10, 176); + this.checkBox_ngMaster.Name = "checkBox_ngMaster"; + this.checkBox_ngMaster.Size = new System.Drawing.Size(131, 17); + this.checkBox_ngMaster.TabIndex = 43; + this.checkBox_ngMaster.Text = "Node guarding Master"; + this.checkBox_ngMaster.UseVisualStyleBackColor = true; + // + // checkBox_ngSlave + // + this.checkBox_ngSlave.AutoSize = true; + this.checkBox_ngSlave.Location = new System.Drawing.Point(10, 158); + this.checkBox_ngSlave.Name = "checkBox_ngSlave"; + this.checkBox_ngSlave.Size = new System.Drawing.Size(126, 17); + this.checkBox_ngSlave.TabIndex = 42; + this.checkBox_ngSlave.Text = "Node guarding Slave"; + this.checkBox_ngSlave.UseVisualStyleBackColor = true; + // + // textBox_granularity + // + this.textBox_granularity.Location = new System.Drawing.Point(102, 20); + this.textBox_granularity.Name = "textBox_granularity"; + this.textBox_granularity.Size = new System.Drawing.Size(101, 20); + this.textBox_granularity.TabIndex = 41; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(10, 23); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(57, 13); + this.label1.TabIndex = 40; + this.label1.Text = "Granularity"; + // + // textBox_txpdos + // + this.textBox_txpdos.Location = new System.Drawing.Point(102, 72); + this.textBox_txpdos.Name = "textBox_txpdos"; + this.textBox_txpdos.ReadOnly = true; + this.textBox_txpdos.Size = new System.Drawing.Size(101, 20); + this.textBox_txpdos.TabIndex = 1; + // + // checkBox_lssMaster + // + this.checkBox_lssMaster.AutoSize = true; + this.checkBox_lssMaster.Location = new System.Drawing.Point(10, 128); + this.checkBox_lssMaster.Name = "checkBox_lssMaster"; + this.checkBox_lssMaster.Size = new System.Drawing.Size(81, 17); + this.checkBox_lssMaster.TabIndex = 10; + this.checkBox_lssMaster.Text = "LSS Master"; + this.checkBox_lssMaster.UseVisualStyleBackColor = true; + // + // label30 + // + this.label30.AutoSize = true; + this.label30.Location = new System.Drawing.Point(10, 75); + this.label30.Name = "label30"; + this.label30.Size = new System.Drawing.Size(67, 13); + this.label30.TabIndex = 39; + this.label30.Text = "TPDO count"; + // + // textBox_rxpdos + // + this.textBox_rxpdos.Location = new System.Drawing.Point(102, 46); + this.textBox_rxpdos.Name = "textBox_rxpdos"; + this.textBox_rxpdos.ReadOnly = true; + this.textBox_rxpdos.Size = new System.Drawing.Size(101, 20); + this.textBox_rxpdos.TabIndex = 0; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(10, 49); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(68, 13); + this.label17.TabIndex = 38; + this.label17.Text = "RPDO count"; + // + // checkBox_lss + // + this.checkBox_lss.AutoSize = true; + this.checkBox_lss.Location = new System.Drawing.Point(10, 110); + this.checkBox_lss.Name = "checkBox_lss"; + this.checkBox_lss.Size = new System.Drawing.Size(76, 17); + this.checkBox_lss.TabIndex = 6; + this.checkBox_lss.Text = "LSS Slave"; + this.checkBox_lss.UseVisualStyleBackColor = true; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.textBox_modifiedby); + this.groupBox3.Controls.Add(this.textBox_modified_datetime); + this.groupBox3.Controls.Add(this.textBox_createdby); + this.groupBox3.Controls.Add(this.textBox_create_datetime); + this.groupBox3.Controls.Add(this.textBox_di_description); + this.groupBox3.Controls.Add(this.textBox_fileversion); + this.groupBox3.Controls.Add(this.label25); + this.groupBox3.Controls.Add(this.label24); + this.groupBox3.Controls.Add(this.label23); + this.groupBox3.Controls.Add(this.label22); + this.groupBox3.Controls.Add(this.label20); + this.groupBox3.Controls.Add(this.label18); + this.groupBox3.Location = new System.Drawing.Point(12, 146); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(377, 180); + this.groupBox3.TabIndex = 1; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "File Info"; + // + // textBox_modifiedby + // + this.textBox_modifiedby.Location = new System.Drawing.Point(139, 150); + this.textBox_modifiedby.Name = "textBox_modifiedby"; + this.textBox_modifiedby.Size = new System.Drawing.Size(226, 20); + this.textBox_modifiedby.TabIndex = 7; + // + // textBox_modified_datetime + // + this.textBox_modified_datetime.Location = new System.Drawing.Point(139, 124); + this.textBox_modified_datetime.Name = "textBox_modified_datetime"; + this.textBox_modified_datetime.ReadOnly = true; + this.textBox_modified_datetime.Size = new System.Drawing.Size(226, 20); + this.textBox_modified_datetime.TabIndex = 6; + // + // textBox_createdby + // + this.textBox_createdby.Location = new System.Drawing.Point(139, 98); + this.textBox_createdby.Name = "textBox_createdby"; + this.textBox_createdby.Size = new System.Drawing.Size(226, 20); + this.textBox_createdby.TabIndex = 5; + // + // textBox_create_datetime + // + this.textBox_create_datetime.Location = new System.Drawing.Point(139, 72); + this.textBox_create_datetime.Name = "textBox_create_datetime"; + this.textBox_create_datetime.Size = new System.Drawing.Size(226, 20); + this.textBox_create_datetime.TabIndex = 4; + // + // textBox_di_description + // + this.textBox_di_description.Location = new System.Drawing.Point(139, 46); + this.textBox_di_description.Name = "textBox_di_description"; + this.textBox_di_description.Size = new System.Drawing.Size(226, 20); + this.textBox_di_description.TabIndex = 3; + // + // textBox_fileversion + // + this.textBox_fileversion.Location = new System.Drawing.Point(139, 20); + this.textBox_fileversion.Name = "textBox_fileversion"; + this.textBox_fileversion.Size = new System.Drawing.Size(226, 20); + this.textBox_fileversion.TabIndex = 0; + // + // label25 + // + this.label25.AutoSize = true; + this.label25.Location = new System.Drawing.Point(10, 153); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(61, 13); + this.label25.TabIndex = 25; + this.label25.Text = "Modified by"; + // + // label24 + // + this.label24.AutoSize = true; + this.label24.Location = new System.Drawing.Point(10, 127); + this.label24.Name = "label24"; + this.label24.Size = new System.Drawing.Size(118, 13); + this.label24.TabIndex = 24; + this.label24.Text = "Modification Date/Time"; + // + // label23 + // + this.label23.AutoSize = true; + this.label23.Location = new System.Drawing.Point(10, 101); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(59, 13); + this.label23.TabIndex = 23; + this.label23.Text = "Created By"; + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(10, 75); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(100, 13); + this.label22.TabIndex = 22; + this.label22.Text = "Creation Date/Time"; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(10, 49); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(60, 13); + this.label20.TabIndex = 20; + this.label20.Text = "Description"; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(10, 23); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(60, 13); + this.label18.TabIndex = 18; + this.label18.Text = "File version"; + // + // DeviceInfoView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.panel1); + this.Name = "DeviceInfoView"; + this.Size = new System.Drawing.Size(773, 537); + this.panel1.ResumeLayout(false); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.ResumeLayout(false); + } #endregion @@ -944,10 +944,10 @@ private void InitializeComponent() private System.Windows.Forms.TextBox textBox_xddfilenameStripped; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox textBox_mdFileName; - private System.Windows.Forms.TextBox textBox_NG_NumOfNodes; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox checkBox_ngMaster; - private System.Windows.Forms.CheckBox checkBox_ngSlave; + private System.Windows.Forms.TextBox textBox_mdFileName; + private System.Windows.Forms.TextBox textBox_NG_NumOfNodes; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.CheckBox checkBox_ngMaster; + private System.Windows.Forms.CheckBox checkBox_ngSlave; } } diff --git a/EDSEditorGUI/DeviceInfoView.cs b/EDSEditorGUI/DeviceInfoView.cs index 1f8f96de..20ef719d 100644 --- a/EDSEditorGUI/DeviceInfoView.cs +++ b/EDSEditorGUI/DeviceInfoView.cs @@ -21,9 +21,9 @@ You should have received a copy of the GNU General Public License using System.Windows.Forms; using libEDSsharp; using System.IO; -using System.Runtime.CompilerServices; -using System.Drawing; - +using System.Runtime.CompilerServices; +using System.Drawing; + namespace ODEditor { public partial class DeviceInfoView : MyTabUserControl @@ -66,19 +66,19 @@ public void populatedeviceinfo() textBox_rxpdos.Text = eds.di.NrOfRXPDO.ToString(); textBox_txpdos.Text = eds.di.NrOfTXPDO.ToString(); checkBox_lss.Checked = eds.di.LSS_Supported; - checkBox_lssMaster.Checked = eds.di.LSS_Master; - - checkBox_ngSlave.Checked = eds.di.NG_Slave; - checkBox_ngMaster.Checked = eds.di.NG_Master; - - if (textBox_NG_NumOfNodes.Enabled) + checkBox_lssMaster.Checked = eds.di.LSS_Master; + + checkBox_ngSlave.Checked = eds.di.NG_Slave; + checkBox_ngMaster.Checked = eds.di.NG_Master; + + if (textBox_NG_NumOfNodes.Enabled) textBox_NG_NumOfNodes.Text = eds.di.NrOfNG_MonitoredNodes.ToString(); - else - { - textBox_NG_NumOfNodes.Text = ""; - eds.di.NrOfNG_MonitoredNodes = 0; - } - + else + { + textBox_NG_NumOfNodes.Text = ""; + eds.di.NrOfNG_MonitoredNodes = 0; + } + textBox_projectFileName.Text = Path.GetFileName(eds.projectFilename); if (eds.xddfilename_1_1 != "") textBox_projectFileVersion.Text = "v1.1"; @@ -102,33 +102,33 @@ public void populatedeviceinfo() textBox_netnum.Text = eds.dc.NetNumber.ToString(); checkBox_canopenmanager.Checked = eds.dc.CANopenManager; textBox_lssserial.Text = eds.dc.LSS_SerialNumber.ToString(); - } - - AddOnChangeHandlerToInputControls(this.Controls); - - } - - - - void AddOnChangeHandlerToInputControls(ControlCollection ctrl) - { - foreach (Control subctrl in ctrl) - { - if (subctrl is TextBox) - ((TextBox)subctrl).TextChanged += - new EventHandler(InputControls_OnChange); - else - if (subctrl is CheckBox) - ((CheckBox)subctrl).CheckedChanged += - new EventHandler(InputControls_OnChange); - else - { - if (subctrl.Controls.Count > 0) - this.AddOnChangeHandlerToInputControls(subctrl.Controls); - } - } - } - + } + + AddOnChangeHandlerToInputControls(this.Controls); + + } + + + + void AddOnChangeHandlerToInputControls(ControlCollection ctrl) + { + foreach (Control subctrl in ctrl) + { + if (subctrl is TextBox) + ((TextBox)subctrl).TextChanged += + new EventHandler(InputControls_OnChange); + else + if (subctrl is CheckBox) + ((CheckBox)subctrl).CheckedChanged += + new EventHandler(InputControls_OnChange); + else + { + if (subctrl.Controls.Count > 0) + this.AddOnChangeHandlerToInputControls(subctrl.Controls); + } + } + } + private void update_devfile_info() { if (eds == null) @@ -159,23 +159,23 @@ private void update_devfile_info() eds.di.Granularity = Convert.ToByte(textBox_granularity.Text); eds.di.LSS_Supported = checkBox_lss.Checked; - eds.di.LSS_Master = checkBox_lssMaster.Checked; - - // ToDO: Node guarding ist confiured manually, but should reflect the OD settings - // NG_Slave active if heartbeat producer time (0x1017) == 0 and Guardtime (0x100C) != 0 - // NG_Master active (according DSP302) if consumer time (0x1016) == 0 and NodeID is in network list (0x1F81) and Guardtime (0x100C) != 0 - // NrOfNG_MonitoredNodes should be the sum of all NodeIDs that are in network list (0x1F81) if heartbeat consumer time (0x1016) == 0 and Guardtime (0x100C) != 0 - textBox_NG_NumOfNodes.Enabled = checkBox_ngMaster.Checked; - eds.di.NG_Slave = checkBox_ngSlave.Checked; - eds.di.NG_Master = checkBox_ngMaster.Checked; - System.UInt16.TryParse(textBox_NG_NumOfNodes.Text,out eds.di.NrOfNG_MonitoredNodes); - if (eds.di.NrOfNG_MonitoredNodes > 127) - { - MessageBox.Show("Number of monitored nodes must be between 0 and 127"); - } - - doUpdatePDOs(); - + eds.di.LSS_Master = checkBox_lssMaster.Checked; + + // ToDO: Node guarding ist confiured manually, but should reflect the OD settings + // NG_Slave active if heartbeat producer time (0x1017) == 0 and Guardtime (0x100C) != 0 + // NG_Master active (according DSP302) if consumer time (0x1016) == 0 and NodeID is in network list (0x1F81) and Guardtime (0x100C) != 0 + // NrOfNG_MonitoredNodes should be the sum of all NodeIDs that are in network list (0x1F81) if heartbeat consumer time (0x1016) == 0 and Guardtime (0x100C) != 0 + textBox_NG_NumOfNodes.Enabled = checkBox_ngMaster.Checked; + eds.di.NG_Slave = checkBox_ngSlave.Checked; + eds.di.NG_Master = checkBox_ngMaster.Checked; + System.UInt16.TryParse(textBox_NG_NumOfNodes.Text,out eds.di.NrOfNG_MonitoredNodes); + if (eds.di.NrOfNG_MonitoredNodes > 127) + { + MessageBox.Show("Number of monitored nodes must be between 0 and 127"); + } + + doUpdatePDOs(); + //These are read only and auto calculated //textBox_rxpdos.Text = eds.di.NrOfRXPDO.ToString(); //textBox_txpdos.Text = eds.di.NrOfTXPDO.ToString(); @@ -195,12 +195,12 @@ private void update_devfile_info() { MessageBox.Show("Update failed, reason :-\n" + ex.ToString()); } - } - - void InputControls_OnChange(object sender, EventArgs e) - { - // Changes detected: Update the device info - update_devfile_info(); - } + } + + void InputControls_OnChange(object sender, EventArgs e) + { + // Changes detected: Update the device info + update_devfile_info(); + } } } diff --git a/EDSEditorGUI/DeviceODView.Designer.cs b/EDSEditorGUI/DeviceODView.Designer.cs index 75f379cb..11eb304d 100644 --- a/EDSEditorGUI/DeviceODView.Designer.cs +++ b/EDSEditorGUI/DeviceODView.Designer.cs @@ -28,946 +28,946 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.listView_communication_objects = new System.Windows.Forms.ListView(); - this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.label1 = new System.Windows.Forms.Label(); - this.splitContainer3 = new System.Windows.Forms.SplitContainer(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.label2 = new System.Windows.Forms.Label(); - this.listView_manufacturer_objects = new System.Windows.Forms.ListView(); - this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); - this.label3 = new System.Windows.Forms.Label(); - this.listView_deviceProfile_objects = new System.Windows.Forms.ListView(); - this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.splitContainer4 = new System.Windows.Forms.SplitContainer(); - this.listView_subObjects = new System.Windows.Forms.ListView(); - this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader9 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader11 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader12 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader13 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader14 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.textBox_subIndex = new System.Windows.Forms.TextBox(); - this.label23 = new System.Windows.Forms.Label(); - this.textBox_index = new System.Windows.Forms.TextBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.checkBox_autosave = new System.Windows.Forms.CheckBox(); - this.textBox_stringLengthMin = new System.Windows.Forms.TextBox(); - this.label22 = new System.Windows.Forms.Label(); - this.label20 = new System.Windows.Forms.Label(); - this.comboBox_countLabel = new System.Windows.Forms.ComboBox(); - this.label19 = new System.Windows.Forms.Label(); - this.comboBox_accessSRDO = new System.Windows.Forms.ComboBox(); - this.textBox_actualValue = new System.Windows.Forms.TextBox(); - this.textBox_lowLimit = new System.Windows.Forms.TextBox(); - this.textBox_highLimit = new System.Windows.Forms.TextBox(); - this.label18 = new System.Windows.Forms.Label(); - this.label17 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.button_saveChanges = new System.Windows.Forms.Button(); - this.label16 = new System.Windows.Forms.Label(); - this.comboBox_storageGroup = new System.Windows.Forms.ComboBox(); - this.label15 = new System.Windows.Forms.Label(); - this.checkBox_enabled = new System.Windows.Forms.CheckBox(); - this.label7 = new System.Windows.Forms.Label(); - this.comboBox_objectType = new System.Windows.Forms.ComboBox(); - this.label8 = new System.Windows.Forms.Label(); - this.comboBox_dataType = new System.Windows.Forms.ComboBox(); - this.label_pdoFlags = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.checkBox_pdoFlags = new System.Windows.Forms.CheckBox(); - this.comboBox_accessSDO = new System.Windows.Forms.ComboBox(); - this.textBox_defaultValue = new System.Windows.Forms.TextBox(); - this.label10 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.comboBox_accessPDO = new System.Windows.Forms.ComboBox(); - this.textBox_denotation = new System.Windows.Forms.TextBox(); - this.label13 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.textBox_name = new System.Windows.Forms.TextBox(); - this.textBox_description = new System.Windows.Forms.TextBox(); - this.contextMenu_object = new System.Windows.Forms.ContextMenuStrip(this.components); - this.contextMenu_object_addNewObjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenu_object_deleteObjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenu_object_toggleObjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenu_subObject = new System.Windows.Forms.ContextMenuStrip(this.components); - this.contextMenu_subObject_addSubItemToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenu_subObject_removeSubItemToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); - this.splitContainer2.SuspendLayout(); - this.tableLayoutPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); - this.splitContainer3.Panel1.SuspendLayout(); - this.splitContainer3.Panel2.SuspendLayout(); - this.splitContainer3.SuspendLayout(); - this.tableLayoutPanel2.SuspendLayout(); - this.tableLayoutPanel3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); - this.splitContainer4.Panel1.SuspendLayout(); - this.splitContainer4.Panel2.SuspendLayout(); - this.splitContainer4.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.contextMenu_object.SuspendLayout(); - this.contextMenu_subObject.SuspendLayout(); - this.SuspendLayout(); - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.splitContainer4); - this.splitContainer1.Size = new System.Drawing.Size(1138, 745); - this.splitContainer1.SplitterDistance = 280; - this.splitContainer1.TabIndex = 2; - this.splitContainer1.TabStop = false; - // - // splitContainer2 - // - this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.tableLayoutPanel1); - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.splitContainer3); - this.splitContainer2.Size = new System.Drawing.Size(280, 745); - this.splitContainer2.SplitterDistance = 245; - this.splitContainer2.TabIndex = 0; - this.splitContainer2.TabStop = false; - // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.ColumnCount = 1; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Controls.Add(this.listView_communication_objects, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); - this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 2; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(278, 243); - this.tableLayoutPanel1.TabIndex = 6; - // - // listView_communication_objects - // - this.listView_communication_objects.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1, - this.columnHeader2}); - this.listView_communication_objects.Dock = System.Windows.Forms.DockStyle.Fill; - this.listView_communication_objects.FullRowSelect = true; - this.listView_communication_objects.HideSelection = false; - this.listView_communication_objects.Location = new System.Drawing.Point(3, 23); - this.listView_communication_objects.Name = "listView_communication_objects"; - this.listView_communication_objects.Size = new System.Drawing.Size(272, 217); - this.listView_communication_objects.TabIndex = 0; - this.listView_communication_objects.UseCompatibleStateImageBehavior = false; - this.listView_communication_objects.View = System.Windows.Forms.View.Details; - this.listView_communication_objects.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.ListView_objects_ColumnClick); - this.listView_communication_objects.SelectedIndexChanged += new System.EventHandler(this.ListView_objects_SelectedIndexChanged); - this.listView_communication_objects.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ListView_objects_MouseClick); - // - // columnHeader1 - // - this.columnHeader1.Text = "Index"; - // - // columnHeader2 - // - this.columnHeader2.Text = "Name"; - this.columnHeader2.Width = 185; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(3, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(176, 13); - this.label1.TabIndex = 3; - this.label1.Text = "Communication Specific Parameters"; - // - // splitContainer3 - // - this.splitContainer3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer3.Location = new System.Drawing.Point(0, 0); - this.splitContainer3.Name = "splitContainer3"; - this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer3.Panel1 - // - this.splitContainer3.Panel1.Controls.Add(this.tableLayoutPanel2); - // - // splitContainer3.Panel2 - // - this.splitContainer3.Panel2.Controls.Add(this.tableLayoutPanel3); - this.splitContainer3.Size = new System.Drawing.Size(280, 496); - this.splitContainer3.SplitterDistance = 244; - this.splitContainer3.TabIndex = 0; - this.splitContainer3.TabStop = false; - // - // tableLayoutPanel2 - // - this.tableLayoutPanel2.ColumnCount = 1; - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Controls.Add(this.label2, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.listView_manufacturer_objects, 0, 1); - this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 2; - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(278, 242); - this.tableLayoutPanel2.TabIndex = 7; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(3, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(167, 13); - this.label2.TabIndex = 4; - this.label2.Text = "Manufacturer Specific Parameters"; - // - // listView_manufacturer_objects - // - this.listView_manufacturer_objects.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader3, - this.columnHeader4}); - this.listView_manufacturer_objects.Dock = System.Windows.Forms.DockStyle.Fill; - this.listView_manufacturer_objects.FullRowSelect = true; - this.listView_manufacturer_objects.HideSelection = false; - this.listView_manufacturer_objects.Location = new System.Drawing.Point(3, 23); - this.listView_manufacturer_objects.Name = "listView_manufacturer_objects"; - this.listView_manufacturer_objects.Size = new System.Drawing.Size(272, 216); - this.listView_manufacturer_objects.TabIndex = 0; - this.listView_manufacturer_objects.UseCompatibleStateImageBehavior = false; - this.listView_manufacturer_objects.View = System.Windows.Forms.View.Details; - this.listView_manufacturer_objects.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.ListView_objects_ColumnClick); - this.listView_manufacturer_objects.SelectedIndexChanged += new System.EventHandler(this.ListView_objects_SelectedIndexChanged); - this.listView_manufacturer_objects.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ListView_objects_MouseClick); - // - // columnHeader3 - // - this.columnHeader3.Text = "Index"; - // - // columnHeader4 - // - this.columnHeader4.Text = "Name"; - this.columnHeader4.Width = 200; - // - // tableLayoutPanel3 - // - this.tableLayoutPanel3.ColumnCount = 1; - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.Controls.Add(this.label3, 0, 0); - this.tableLayoutPanel3.Controls.Add(this.listView_deviceProfile_objects, 0, 1); - this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel3.Name = "tableLayoutPanel3"; - this.tableLayoutPanel3.RowCount = 2; - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(278, 246); - this.tableLayoutPanel3.TabIndex = 8; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(3, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(170, 13); - this.label3.TabIndex = 5; - this.label3.Text = "Device Profile Specific Parameters"; - // - // listView_deviceProfile_objects - // - this.listView_deviceProfile_objects.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader5, - this.columnHeader6}); - this.listView_deviceProfile_objects.Dock = System.Windows.Forms.DockStyle.Fill; - this.listView_deviceProfile_objects.FullRowSelect = true; - this.listView_deviceProfile_objects.HideSelection = false; - this.listView_deviceProfile_objects.Location = new System.Drawing.Point(3, 23); - this.listView_deviceProfile_objects.Name = "listView_deviceProfile_objects"; - this.listView_deviceProfile_objects.Size = new System.Drawing.Size(272, 220); - this.listView_deviceProfile_objects.TabIndex = 0; - this.listView_deviceProfile_objects.UseCompatibleStateImageBehavior = false; - this.listView_deviceProfile_objects.View = System.Windows.Forms.View.Details; - this.listView_deviceProfile_objects.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.ListView_objects_ColumnClick); - this.listView_deviceProfile_objects.SelectedIndexChanged += new System.EventHandler(this.ListView_objects_SelectedIndexChanged); - this.listView_deviceProfile_objects.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ListView_objects_MouseClick); - // - // columnHeader5 - // - this.columnHeader5.Text = "Index"; - // - // columnHeader6 - // - this.columnHeader6.Text = "Name"; - this.columnHeader6.Width = 200; - // - // splitContainer4 - // - this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer4.Location = new System.Drawing.Point(0, 0); - this.splitContainer4.Name = "splitContainer4"; - this.splitContainer4.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer4.Panel1 - // - this.splitContainer4.Panel1.Controls.Add(this.listView_subObjects); - // - // splitContainer4.Panel2 - // - this.splitContainer4.Panel2.Controls.Add(this.textBox_subIndex); - this.splitContainer4.Panel2.Controls.Add(this.label23); - this.splitContainer4.Panel2.Controls.Add(this.textBox_index); - this.splitContainer4.Panel2.Controls.Add(this.groupBox1); - this.splitContainer4.Panel2.Controls.Add(this.textBox_denotation); - this.splitContainer4.Panel2.Controls.Add(this.label13); - this.splitContainer4.Panel2.Controls.Add(this.label4); - this.splitContainer4.Panel2.Controls.Add(this.label5); - this.splitContainer4.Panel2.Controls.Add(this.label6); - this.splitContainer4.Panel2.Controls.Add(this.textBox_name); - this.splitContainer4.Panel2.Controls.Add(this.textBox_description); - this.splitContainer4.Size = new System.Drawing.Size(854, 745); - this.splitContainer4.SplitterDistance = 224; - this.splitContainer4.TabIndex = 28; - this.splitContainer4.TabStop = false; - // - // listView_subObjects - // - this.listView_subObjects.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.listView_subObjects.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader7, - this.columnHeader8, - this.columnHeader9, - this.columnHeader10, - this.columnHeader11, - this.columnHeader12, - this.columnHeader13, - this.columnHeader14}); - this.listView_subObjects.FullRowSelect = true; - this.listView_subObjects.HideSelection = false; - this.listView_subObjects.Location = new System.Drawing.Point(0, 0); - this.listView_subObjects.Name = "listView_subObjects"; - this.listView_subObjects.Size = new System.Drawing.Size(851, 223); - this.listView_subObjects.TabIndex = 0; - this.listView_subObjects.UseCompatibleStateImageBehavior = false; - this.listView_subObjects.View = System.Windows.Forms.View.Details; - this.listView_subObjects.SelectedIndexChanged += new System.EventHandler(this.ListView_subObjects_SelectedIndexChanged); - this.listView_subObjects.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ListView_subObjects_MouseClick); - // - // columnHeader7 - // - this.columnHeader7.Text = "Sub"; - this.columnHeader7.Width = 40; - // - // columnHeader8 - // - this.columnHeader8.Text = "Name"; - this.columnHeader8.Width = 200; - // - // columnHeader9 - // - this.columnHeader9.Text = "Obj Type"; - this.columnHeader9.Width = 65; - // - // columnHeader10 - // - this.columnHeader10.Text = "Data Type"; - this.columnHeader10.Width = 120; - // - // columnHeader11 - // - this.columnHeader11.Text = "SDO"; - this.columnHeader11.Width = 50; - // - // columnHeader12 - // - this.columnHeader12.Text = "PDO"; - this.columnHeader12.Width = 50; - // - // columnHeader13 - // - this.columnHeader13.Text = "SRDO"; - this.columnHeader13.Width = 50; - // - // columnHeader14 - // - this.columnHeader14.Text = "Default Value"; - this.columnHeader14.Width = 190; - // - // textBox_subIndex - // - this.textBox_subIndex.Location = new System.Drawing.Point(260, 8); - this.textBox_subIndex.Name = "textBox_subIndex"; - this.textBox_subIndex.ReadOnly = true; - this.textBox_subIndex.Size = new System.Drawing.Size(100, 20); - this.textBox_subIndex.TabIndex = 0; - this.textBox_subIndex.TabStop = false; - // - // label23 - // - this.label23.AutoSize = true; - this.label23.Location = new System.Drawing.Point(199, 11); - this.label23.Name = "label23"; - this.label23.Size = new System.Drawing.Size(55, 13); - this.label23.TabIndex = 34; - this.label23.Text = "Sub Index"; - // - // textBox_index - // - this.textBox_index.Location = new System.Drawing.Point(90, 8); - this.textBox_index.Name = "textBox_index"; - this.textBox_index.ReadOnly = true; - this.textBox_index.Size = new System.Drawing.Size(100, 20); - this.textBox_index.TabIndex = 0; - this.textBox_index.TabStop = false; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.checkBox_autosave); - this.groupBox1.Controls.Add(this.textBox_stringLengthMin); - this.groupBox1.Controls.Add(this.label22); - this.groupBox1.Controls.Add(this.label20); - this.groupBox1.Controls.Add(this.comboBox_countLabel); - this.groupBox1.Controls.Add(this.label19); - this.groupBox1.Controls.Add(this.comboBox_accessSRDO); - this.groupBox1.Controls.Add(this.textBox_actualValue); - this.groupBox1.Controls.Add(this.textBox_lowLimit); - this.groupBox1.Controls.Add(this.textBox_highLimit); - this.groupBox1.Controls.Add(this.label18); - this.groupBox1.Controls.Add(this.label17); - this.groupBox1.Controls.Add(this.label14); - this.groupBox1.Controls.Add(this.button_saveChanges); - this.groupBox1.Controls.Add(this.label16); - this.groupBox1.Controls.Add(this.comboBox_storageGroup); - this.groupBox1.Controls.Add(this.label15); - this.groupBox1.Controls.Add(this.checkBox_enabled); - this.groupBox1.Controls.Add(this.label7); - this.groupBox1.Controls.Add(this.comboBox_objectType); - this.groupBox1.Controls.Add(this.label8); - this.groupBox1.Controls.Add(this.comboBox_dataType); - this.groupBox1.Controls.Add(this.label_pdoFlags); - this.groupBox1.Controls.Add(this.label9); - this.groupBox1.Controls.Add(this.checkBox_pdoFlags); - this.groupBox1.Controls.Add(this.comboBox_accessSDO); - this.groupBox1.Controls.Add(this.textBox_defaultValue); - this.groupBox1.Controls.Add(this.label10); - this.groupBox1.Controls.Add(this.label11); - this.groupBox1.Controls.Add(this.comboBox_accessPDO); - this.groupBox1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.groupBox1.Location = new System.Drawing.Point(0, 329); - this.groupBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.groupBox1.Size = new System.Drawing.Size(854, 188); - this.groupBox1.TabIndex = 33; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Object settings"; - // - // checkBox_autosave - // - this.checkBox_autosave.Location = new System.Drawing.Point(634, 146); - this.checkBox_autosave.Name = "checkBox_autosave"; - this.checkBox_autosave.Size = new System.Drawing.Size(116, 21); - this.checkBox_autosave.TabIndex = 35; - this.checkBox_autosave.Text = "Autosave changes"; - this.checkBox_autosave.UseVisualStyleBackColor = true; - // - // textBox_stringLengthMin - // - this.textBox_stringLengthMin.Location = new System.Drawing.Point(340, 99); - this.textBox_stringLengthMin.Name = "textBox_stringLengthMin"; - this.textBox_stringLengthMin.Size = new System.Drawing.Size(122, 20); - this.textBox_stringLengthMin.TabIndex = 24; - this.textBox_stringLengthMin.TextChanged += new System.EventHandler(this.DataDirty); - // - // label22 - // - this.label22.AutoSize = true; - this.label22.Location = new System.Drawing.Point(248, 102); - this.label22.Name = "label22"; - this.label22.Size = new System.Drawing.Size(75, 13); - this.label22.TabIndex = 39; - this.label22.Text = "String Len Min"; - // - // label20 - // - this.label20.AutoSize = true; - this.label20.Location = new System.Drawing.Point(482, 21); - this.label20.Name = "label20"; - this.label20.Size = new System.Drawing.Size(64, 13); - this.label20.TabIndex = 36; - this.label20.Text = "Count Label"; - // - // comboBox_countLabel - // - this.comboBox_countLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox_countLabel.FormattingEnabled = true; - this.comboBox_countLabel.Location = new System.Drawing.Point(574, 18); - this.comboBox_countLabel.Name = "comboBox_countLabel"; - this.comboBox_countLabel.Size = new System.Drawing.Size(122, 21); - this.comboBox_countLabel.TabIndex = 30; - this.comboBox_countLabel.SelectedIndexChanged += new System.EventHandler(this.DataDirty); - // - // label19 - // - this.label19.AutoSize = true; - this.label19.Location = new System.Drawing.Point(13, 129); - this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(76, 13); - this.label19.TabIndex = 34; - this.label19.Text = "Access SRDO"; - // - // comboBox_accessSRDO - // - this.comboBox_accessSRDO.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox_accessSRDO.FormattingEnabled = true; - this.comboBox_accessSRDO.Location = new System.Drawing.Point(108, 126); - this.comboBox_accessSRDO.Name = "comboBox_accessSRDO"; - this.comboBox_accessSRDO.Size = new System.Drawing.Size(122, 21); - this.comboBox_accessSRDO.TabIndex = 14; - this.comboBox_accessSRDO.SelectedIndexChanged += new System.EventHandler(this.DataDirty); - // - // textBox_actualValue - // - this.textBox_actualValue.BackColor = System.Drawing.Color.PeachPuff; - this.textBox_actualValue.Location = new System.Drawing.Point(340, 72); - this.textBox_actualValue.Name = "textBox_actualValue"; - this.textBox_actualValue.Size = new System.Drawing.Size(122, 20); - this.textBox_actualValue.TabIndex = 23; - this.textBox_actualValue.TextChanged += new System.EventHandler(this.DataDirty); - // - // textBox_lowLimit - // - this.textBox_lowLimit.Location = new System.Drawing.Point(340, 45); - this.textBox_lowLimit.Name = "textBox_lowLimit"; - this.textBox_lowLimit.Size = new System.Drawing.Size(122, 20); - this.textBox_lowLimit.TabIndex = 22; - this.textBox_lowLimit.TextChanged += new System.EventHandler(this.DataDirty); - // - // textBox_highLimit - // - this.textBox_highLimit.Location = new System.Drawing.Point(340, 18); - this.textBox_highLimit.Name = "textBox_highLimit"; - this.textBox_highLimit.Size = new System.Drawing.Size(122, 20); - this.textBox_highLimit.TabIndex = 21; - this.textBox_highLimit.TextChanged += new System.EventHandler(this.DataDirty); - // - // label18 - // - this.label18.AutoSize = true; - this.label18.Location = new System.Drawing.Point(248, 75); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(67, 13); - this.label18.TabIndex = 32; - this.label18.Text = "Actual Value"; - // - // label17 - // - this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(248, 48); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(48, 13); - this.label17.TabIndex = 31; - this.label17.Text = "LowLimit"; - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(248, 21); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(50, 13); - this.label14.TabIndex = 30; - this.label14.Text = "HighLimit"; - // - // button_saveChanges - // - this.button_saveChanges.Image = global::ODEditor.Properties.Resources.Save_6530; - this.button_saveChanges.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.button_saveChanges.Location = new System.Drawing.Point(485, 138); - this.button_saveChanges.Name = "button_saveChanges"; - this.button_saveChanges.Size = new System.Drawing.Size(143, 35); - this.button_saveChanges.TabIndex = 50; - this.button_saveChanges.Text = "Save Changes"; - this.button_saveChanges.UseVisualStyleBackColor = true; - this.button_saveChanges.Click += new System.EventHandler(this.Button_saveChanges_Click); - // - // label16 - // - this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(482, 48); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(76, 13); - this.label16.TabIndex = 26; - this.label16.Text = "Storage Group"; - // - // comboBox_storageGroup - // - this.comboBox_storageGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox_storageGroup.FormattingEnabled = true; - this.comboBox_storageGroup.Location = new System.Drawing.Point(574, 45); - this.comboBox_storageGroup.Name = "comboBox_storageGroup"; - this.comboBox_storageGroup.Size = new System.Drawing.Size(122, 21); - this.comboBox_storageGroup.TabIndex = 31; - this.comboBox_storageGroup.SelectedIndexChanged += new System.EventHandler(this.DataDirty); - // - // label15 - // - this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(482, 72); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(46, 13); - this.label15.TabIndex = 24; - this.label15.Text = "Enabled"; - // - // checkBox_enabled - // - this.checkBox_enabled.AutoSize = true; - this.checkBox_enabled.Location = new System.Drawing.Point(574, 72); - this.checkBox_enabled.Name = "checkBox_enabled"; - this.checkBox_enabled.Size = new System.Drawing.Size(15, 14); - this.checkBox_enabled.TabIndex = 32; - this.checkBox_enabled.UseVisualStyleBackColor = true; - this.checkBox_enabled.CheckedChanged += new System.EventHandler(this.DataDirty); - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(13, 21); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(65, 13); - this.label7.TabIndex = 7; - this.label7.Text = "Object Type"; - // - // comboBox_objectType - // - this.comboBox_objectType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox_objectType.Enabled = false; - this.comboBox_objectType.FormattingEnabled = true; - this.comboBox_objectType.Location = new System.Drawing.Point(108, 18); - this.comboBox_objectType.Name = "comboBox_objectType"; - this.comboBox_objectType.Size = new System.Drawing.Size(122, 21); - this.comboBox_objectType.TabIndex = 10; - this.comboBox_objectType.SelectedIndexChanged += new System.EventHandler(this.DataDirty); - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(13, 48); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(57, 13); - this.label8.TabIndex = 9; - this.label8.Text = "Data Type"; - // - // comboBox_dataType - // - this.comboBox_dataType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox_dataType.FormattingEnabled = true; - this.comboBox_dataType.Location = new System.Drawing.Point(108, 45); - this.comboBox_dataType.Name = "comboBox_dataType"; - this.comboBox_dataType.Size = new System.Drawing.Size(122, 21); - this.comboBox_dataType.TabIndex = 11; - this.comboBox_dataType.SelectedIndexChanged += new System.EventHandler(this.DataDirty); - // - // label_pdoFlags - // - this.label_pdoFlags.AutoSize = true; - this.label_pdoFlags.Location = new System.Drawing.Point(482, 92); - this.label_pdoFlags.Name = "label_pdoFlags"; - this.label_pdoFlags.Size = new System.Drawing.Size(62, 13); - this.label_pdoFlags.TabIndex = 18; - this.label_pdoFlags.Text = "TPDO COS"; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(13, 75); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(68, 13); - this.label9.TabIndex = 11; - this.label9.Text = "Access SDO"; - // - // checkBox_pdoFlags - // - this.checkBox_pdoFlags.AutoSize = true; - this.checkBox_pdoFlags.Location = new System.Drawing.Point(574, 92); - this.checkBox_pdoFlags.Name = "checkBox_pdoFlags"; - this.checkBox_pdoFlags.Size = new System.Drawing.Size(15, 14); - this.checkBox_pdoFlags.TabIndex = 34; - this.checkBox_pdoFlags.UseVisualStyleBackColor = true; - this.checkBox_pdoFlags.CheckedChanged += new System.EventHandler(this.DataDirty); - // - // comboBox_accessSDO - // - this.comboBox_accessSDO.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox_accessSDO.FormattingEnabled = true; - this.comboBox_accessSDO.Location = new System.Drawing.Point(108, 72); - this.comboBox_accessSDO.Name = "comboBox_accessSDO"; - this.comboBox_accessSDO.Size = new System.Drawing.Size(122, 21); - this.comboBox_accessSDO.TabIndex = 12; - this.comboBox_accessSDO.SelectedIndexChanged += new System.EventHandler(this.DataDirty); - // - // textBox_defaultValue - // - this.textBox_defaultValue.Location = new System.Drawing.Point(108, 153); - this.textBox_defaultValue.Name = "textBox_defaultValue"; - this.textBox_defaultValue.Size = new System.Drawing.Size(354, 20); - this.textBox_defaultValue.TabIndex = 20; - this.textBox_defaultValue.TextChanged += new System.EventHandler(this.DataDirty); - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(13, 102); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(68, 13); - this.label10.TabIndex = 13; - this.label10.Text = "Access PDO"; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(13, 156); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(70, 13); - this.label11.TabIndex = 15; - this.label11.Text = "Default value"; - // - // comboBox_accessPDO - // - this.comboBox_accessPDO.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBox_accessPDO.FormattingEnabled = true; - this.comboBox_accessPDO.Location = new System.Drawing.Point(108, 99); - this.comboBox_accessPDO.Name = "comboBox_accessPDO"; - this.comboBox_accessPDO.Size = new System.Drawing.Size(122, 21); - this.comboBox_accessPDO.TabIndex = 13; - this.comboBox_accessPDO.SelectedIndexChanged += new System.EventHandler(this.DataDirty); - // - // textBox_denotation - // - this.textBox_denotation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox_denotation.BackColor = System.Drawing.Color.PeachPuff; - this.textBox_denotation.Location = new System.Drawing.Point(90, 60); - this.textBox_denotation.Name = "textBox_denotation"; - this.textBox_denotation.Size = new System.Drawing.Size(761, 20); - this.textBox_denotation.TabIndex = 3; - this.textBox_denotation.TextChanged += new System.EventHandler(this.DataDirty); - // - // label13 - // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(13, 63); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(59, 13); - this.label13.TabIndex = 28; - this.label13.Text = "Denotation"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(13, 11); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(33, 13); - this.label4.TabIndex = 1; - this.label4.Text = "Index"; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(13, 37); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(35, 13); - this.label5.TabIndex = 2; - this.label5.Text = "Name"; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(13, 89); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(60, 13); - this.label6.TabIndex = 3; - this.label6.Text = "Description"; - // - // textBox_name - // - this.textBox_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox_name.Location = new System.Drawing.Point(90, 34); - this.textBox_name.Name = "textBox_name"; - this.textBox_name.Size = new System.Drawing.Size(761, 20); - this.textBox_name.TabIndex = 2; - this.textBox_name.TextChanged += new System.EventHandler(this.DataDirty); - // - // textBox_description - // - this.textBox_description.AcceptsReturn = true; - this.textBox_description.AcceptsTab = true; - this.textBox_description.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox_description.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.textBox_description.Location = new System.Drawing.Point(90, 86); - this.textBox_description.Multiline = true; - this.textBox_description.Name = "textBox_description"; - this.textBox_description.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.textBox_description.Size = new System.Drawing.Size(761, 227); - this.textBox_description.TabIndex = 4; - this.textBox_description.TextChanged += new System.EventHandler(this.DataDirty); - // - // contextMenu_object - // - this.contextMenu_object.ImageScalingSize = new System.Drawing.Size(20, 20); - this.contextMenu_object.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.contextMenu_object_addNewObjectToolStripMenuItem, - this.addToolStripMenuItem, - this.contextMenu_object_deleteObjectToolStripMenuItem, - this.contextMenu_object_toggleObjectToolStripMenuItem}); - this.contextMenu_object.Name = "contextMenuStrip1"; - this.contextMenu_object.Size = new System.Drawing.Size(121, 108); - // - // contextMenu_object_addNewObjectToolStripMenuItem - // - this.contextMenu_object_addNewObjectToolStripMenuItem.Name = "contextMenu_object_addNewObjectToolStripMenuItem"; - this.contextMenu_object_addNewObjectToolStripMenuItem.Size = new System.Drawing.Size(120, 26); - this.contextMenu_object_addNewObjectToolStripMenuItem.Text = "&Clone..."; - this.contextMenu_object_addNewObjectToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_object_clone_ToolStripMenuItem_Click); - // - // addToolStripMenuItem - // - this.addToolStripMenuItem.Image = global::ODEditor.Properties.Resources.action_add_16xLG; - this.addToolStripMenuItem.Name = "addToolStripMenuItem"; - this.addToolStripMenuItem.Size = new System.Drawing.Size(120, 26); - this.addToolStripMenuItem.Text = "Add..."; - this.addToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_object_add_ToolStripMenuItem_Click); - // - // contextMenu_object_deleteObjectToolStripMenuItem - // - this.contextMenu_object_deleteObjectToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Remove_16xLG; - this.contextMenu_object_deleteObjectToolStripMenuItem.Name = "contextMenu_object_deleteObjectToolStripMenuItem"; - this.contextMenu_object_deleteObjectToolStripMenuItem.Size = new System.Drawing.Size(120, 26); - this.contextMenu_object_deleteObjectToolStripMenuItem.Text = "&Delete..."; - this.contextMenu_object_deleteObjectToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_object_delete_ToolStripMenuItem_Click); - // - // contextMenu_object_toggleObjectToolStripMenuItem - // - this.contextMenu_object_toggleObjectToolStripMenuItem.Name = "contextMenu_object_toggleObjectToolStripMenuItem"; - this.contextMenu_object_toggleObjectToolStripMenuItem.Size = new System.Drawing.Size(120, 26); - this.contextMenu_object_toggleObjectToolStripMenuItem.Text = "&Toggle"; - this.contextMenu_object_toggleObjectToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_object_toggle_ToolStripMenuItem_Click); - // - // contextMenu_subObject - // - this.contextMenu_subObject.ImageScalingSize = new System.Drawing.Size(20, 20); - this.contextMenu_subObject.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.contextMenu_subObject_addSubItemToolStripMenuItem, - this.contextMenu_subObject_removeSubItemToolStripMenuItem, - this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem}); - this.contextMenu_subObject.Name = "contextMenu_array"; - this.contextMenu_subObject.Size = new System.Drawing.Size(183, 82); - // - // contextMenu_subObject_addSubItemToolStripMenuItem - // - this.contextMenu_subObject_addSubItemToolStripMenuItem.Image = global::ODEditor.Properties.Resources.action_add_16xLG; - this.contextMenu_subObject_addSubItemToolStripMenuItem.Name = "contextMenu_subObject_addSubItemToolStripMenuItem"; - this.contextMenu_subObject_addSubItemToolStripMenuItem.Size = new System.Drawing.Size(182, 26); - this.contextMenu_subObject_addSubItemToolStripMenuItem.Text = "Add"; - this.contextMenu_subObject_addSubItemToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_subObject_add_ToolStripMenuItem_Click); - // - // contextMenu_subObject_removeSubItemToolStripMenuItem - // - this.contextMenu_subObject_removeSubItemToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Remove_16xLG; - this.contextMenu_subObject_removeSubItemToolStripMenuItem.Name = "contextMenu_subObject_removeSubItemToolStripMenuItem"; - this.contextMenu_subObject_removeSubItemToolStripMenuItem.Size = new System.Drawing.Size(182, 26); - this.contextMenu_subObject_removeSubItemToolStripMenuItem.Text = "Remove (shift up)"; - this.contextMenu_subObject_removeSubItemToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_subObject_remove_ToolStripMenuItem_Click); - // - // contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem - // - this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Remove_16xLG; - this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Name = "contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem"; - this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Size = new System.Drawing.Size(182, 26); - this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Text = "Remove (leave gap)"; - this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_subObject_remove_ToolStripMenuItem_Click); - // - // DeviceODView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.splitContainer1); - this.Name = "DeviceODView"; - this.Size = new System.Drawing.Size(1138, 745); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); - this.splitContainer1.ResumeLayout(false); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); - this.splitContainer2.ResumeLayout(false); - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel1.PerformLayout(); - this.splitContainer3.Panel1.ResumeLayout(false); - this.splitContainer3.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); - this.splitContainer3.ResumeLayout(false); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - this.tableLayoutPanel3.ResumeLayout(false); - this.tableLayoutPanel3.PerformLayout(); - this.splitContainer4.Panel1.ResumeLayout(false); - this.splitContainer4.Panel2.ResumeLayout(false); - this.splitContainer4.Panel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); - this.splitContainer4.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.contextMenu_object.ResumeLayout(false); - this.contextMenu_subObject.ResumeLayout(false); - this.ResumeLayout(false); - + this.components = new System.ComponentModel.Container(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.listView_communication_objects = new System.Windows.Forms.ListView(); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.label1 = new System.Windows.Forms.Label(); + this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.label2 = new System.Windows.Forms.Label(); + this.listView_manufacturer_objects = new System.Windows.Forms.ListView(); + this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.label3 = new System.Windows.Forms.Label(); + this.listView_deviceProfile_objects = new System.Windows.Forms.ListView(); + this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.splitContainer4 = new System.Windows.Forms.SplitContainer(); + this.listView_subObjects = new System.Windows.Forms.ListView(); + this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader9 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader11 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader12 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader13 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader14 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.textBox_subIndex = new System.Windows.Forms.TextBox(); + this.label23 = new System.Windows.Forms.Label(); + this.textBox_index = new System.Windows.Forms.TextBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.checkBox_autosave = new System.Windows.Forms.CheckBox(); + this.textBox_stringLengthMin = new System.Windows.Forms.TextBox(); + this.label22 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.comboBox_countLabel = new System.Windows.Forms.ComboBox(); + this.label19 = new System.Windows.Forms.Label(); + this.comboBox_accessSRDO = new System.Windows.Forms.ComboBox(); + this.textBox_actualValue = new System.Windows.Forms.TextBox(); + this.textBox_lowLimit = new System.Windows.Forms.TextBox(); + this.textBox_highLimit = new System.Windows.Forms.TextBox(); + this.label18 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.button_saveChanges = new System.Windows.Forms.Button(); + this.label16 = new System.Windows.Forms.Label(); + this.comboBox_storageGroup = new System.Windows.Forms.ComboBox(); + this.label15 = new System.Windows.Forms.Label(); + this.checkBox_enabled = new System.Windows.Forms.CheckBox(); + this.label7 = new System.Windows.Forms.Label(); + this.comboBox_objectType = new System.Windows.Forms.ComboBox(); + this.label8 = new System.Windows.Forms.Label(); + this.comboBox_dataType = new System.Windows.Forms.ComboBox(); + this.label_pdoFlags = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.checkBox_pdoFlags = new System.Windows.Forms.CheckBox(); + this.comboBox_accessSDO = new System.Windows.Forms.ComboBox(); + this.textBox_defaultValue = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.comboBox_accessPDO = new System.Windows.Forms.ComboBox(); + this.textBox_denotation = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.textBox_name = new System.Windows.Forms.TextBox(); + this.textBox_description = new System.Windows.Forms.TextBox(); + this.contextMenu_object = new System.Windows.Forms.ContextMenuStrip(this.components); + this.contextMenu_object_addNewObjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenu_object_deleteObjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenu_object_toggleObjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenu_subObject = new System.Windows.Forms.ContextMenuStrip(this.components); + this.contextMenu_subObject_addSubItemToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenu_subObject_removeSubItemToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); + this.splitContainer3.Panel1.SuspendLayout(); + this.splitContainer3.Panel2.SuspendLayout(); + this.splitContainer3.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); + this.splitContainer4.Panel1.SuspendLayout(); + this.splitContainer4.Panel2.SuspendLayout(); + this.splitContainer4.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.contextMenu_object.SuspendLayout(); + this.contextMenu_subObject.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.splitContainer4); + this.splitContainer1.Size = new System.Drawing.Size(1138, 745); + this.splitContainer1.SplitterDistance = 280; + this.splitContainer1.TabIndex = 2; + this.splitContainer1.TabStop = false; + // + // splitContainer2 + // + this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.tableLayoutPanel1); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.splitContainer3); + this.splitContainer2.Size = new System.Drawing.Size(280, 745); + this.splitContainer2.SplitterDistance = 245; + this.splitContainer2.TabIndex = 0; + this.splitContainer2.TabStop = false; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.listView_communication_objects, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(278, 243); + this.tableLayoutPanel1.TabIndex = 6; + // + // listView_communication_objects + // + this.listView_communication_objects.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2}); + this.listView_communication_objects.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView_communication_objects.FullRowSelect = true; + this.listView_communication_objects.HideSelection = false; + this.listView_communication_objects.Location = new System.Drawing.Point(3, 23); + this.listView_communication_objects.Name = "listView_communication_objects"; + this.listView_communication_objects.Size = new System.Drawing.Size(272, 217); + this.listView_communication_objects.TabIndex = 0; + this.listView_communication_objects.UseCompatibleStateImageBehavior = false; + this.listView_communication_objects.View = System.Windows.Forms.View.Details; + this.listView_communication_objects.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.ListView_objects_ColumnClick); + this.listView_communication_objects.SelectedIndexChanged += new System.EventHandler(this.ListView_objects_SelectedIndexChanged); + this.listView_communication_objects.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ListView_objects_MouseClick); + // + // columnHeader1 + // + this.columnHeader1.Text = "Index"; + // + // columnHeader2 + // + this.columnHeader2.Text = "Name"; + this.columnHeader2.Width = 185; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(176, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Communication Specific Parameters"; + // + // splitContainer3 + // + this.splitContainer3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer3.Location = new System.Drawing.Point(0, 0); + this.splitContainer3.Name = "splitContainer3"; + this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer3.Panel1 + // + this.splitContainer3.Panel1.Controls.Add(this.tableLayoutPanel2); + // + // splitContainer3.Panel2 + // + this.splitContainer3.Panel2.Controls.Add(this.tableLayoutPanel3); + this.splitContainer3.Size = new System.Drawing.Size(280, 496); + this.splitContainer3.SplitterDistance = 244; + this.splitContainer3.TabIndex = 0; + this.splitContainer3.TabStop = false; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 1; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Controls.Add(this.label2, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.listView_manufacturer_objects, 0, 1); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 2; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(278, 242); + this.tableLayoutPanel2.TabIndex = 7; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(3, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(167, 13); + this.label2.TabIndex = 4; + this.label2.Text = "Manufacturer Specific Parameters"; + // + // listView_manufacturer_objects + // + this.listView_manufacturer_objects.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader3, + this.columnHeader4}); + this.listView_manufacturer_objects.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView_manufacturer_objects.FullRowSelect = true; + this.listView_manufacturer_objects.HideSelection = false; + this.listView_manufacturer_objects.Location = new System.Drawing.Point(3, 23); + this.listView_manufacturer_objects.Name = "listView_manufacturer_objects"; + this.listView_manufacturer_objects.Size = new System.Drawing.Size(272, 216); + this.listView_manufacturer_objects.TabIndex = 0; + this.listView_manufacturer_objects.UseCompatibleStateImageBehavior = false; + this.listView_manufacturer_objects.View = System.Windows.Forms.View.Details; + this.listView_manufacturer_objects.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.ListView_objects_ColumnClick); + this.listView_manufacturer_objects.SelectedIndexChanged += new System.EventHandler(this.ListView_objects_SelectedIndexChanged); + this.listView_manufacturer_objects.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ListView_objects_MouseClick); + // + // columnHeader3 + // + this.columnHeader3.Text = "Index"; + // + // columnHeader4 + // + this.columnHeader4.Text = "Name"; + this.columnHeader4.Width = 200; + // + // tableLayoutPanel3 + // + this.tableLayoutPanel3.ColumnCount = 1; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Controls.Add(this.label3, 0, 0); + this.tableLayoutPanel3.Controls.Add(this.listView_deviceProfile_objects, 0, 1); + this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 2; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(278, 246); + this.tableLayoutPanel3.TabIndex = 8; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(3, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(170, 13); + this.label3.TabIndex = 5; + this.label3.Text = "Device Profile Specific Parameters"; + // + // listView_deviceProfile_objects + // + this.listView_deviceProfile_objects.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader5, + this.columnHeader6}); + this.listView_deviceProfile_objects.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView_deviceProfile_objects.FullRowSelect = true; + this.listView_deviceProfile_objects.HideSelection = false; + this.listView_deviceProfile_objects.Location = new System.Drawing.Point(3, 23); + this.listView_deviceProfile_objects.Name = "listView_deviceProfile_objects"; + this.listView_deviceProfile_objects.Size = new System.Drawing.Size(272, 220); + this.listView_deviceProfile_objects.TabIndex = 0; + this.listView_deviceProfile_objects.UseCompatibleStateImageBehavior = false; + this.listView_deviceProfile_objects.View = System.Windows.Forms.View.Details; + this.listView_deviceProfile_objects.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.ListView_objects_ColumnClick); + this.listView_deviceProfile_objects.SelectedIndexChanged += new System.EventHandler(this.ListView_objects_SelectedIndexChanged); + this.listView_deviceProfile_objects.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ListView_objects_MouseClick); + // + // columnHeader5 + // + this.columnHeader5.Text = "Index"; + // + // columnHeader6 + // + this.columnHeader6.Text = "Name"; + this.columnHeader6.Width = 200; + // + // splitContainer4 + // + this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer4.Location = new System.Drawing.Point(0, 0); + this.splitContainer4.Name = "splitContainer4"; + this.splitContainer4.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer4.Panel1 + // + this.splitContainer4.Panel1.Controls.Add(this.listView_subObjects); + // + // splitContainer4.Panel2 + // + this.splitContainer4.Panel2.Controls.Add(this.textBox_subIndex); + this.splitContainer4.Panel2.Controls.Add(this.label23); + this.splitContainer4.Panel2.Controls.Add(this.textBox_index); + this.splitContainer4.Panel2.Controls.Add(this.groupBox1); + this.splitContainer4.Panel2.Controls.Add(this.textBox_denotation); + this.splitContainer4.Panel2.Controls.Add(this.label13); + this.splitContainer4.Panel2.Controls.Add(this.label4); + this.splitContainer4.Panel2.Controls.Add(this.label5); + this.splitContainer4.Panel2.Controls.Add(this.label6); + this.splitContainer4.Panel2.Controls.Add(this.textBox_name); + this.splitContainer4.Panel2.Controls.Add(this.textBox_description); + this.splitContainer4.Size = new System.Drawing.Size(854, 745); + this.splitContainer4.SplitterDistance = 224; + this.splitContainer4.TabIndex = 28; + this.splitContainer4.TabStop = false; + // + // listView_subObjects + // + this.listView_subObjects.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listView_subObjects.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader7, + this.columnHeader8, + this.columnHeader9, + this.columnHeader10, + this.columnHeader11, + this.columnHeader12, + this.columnHeader13, + this.columnHeader14}); + this.listView_subObjects.FullRowSelect = true; + this.listView_subObjects.HideSelection = false; + this.listView_subObjects.Location = new System.Drawing.Point(0, 0); + this.listView_subObjects.Name = "listView_subObjects"; + this.listView_subObjects.Size = new System.Drawing.Size(851, 223); + this.listView_subObjects.TabIndex = 0; + this.listView_subObjects.UseCompatibleStateImageBehavior = false; + this.listView_subObjects.View = System.Windows.Forms.View.Details; + this.listView_subObjects.SelectedIndexChanged += new System.EventHandler(this.ListView_subObjects_SelectedIndexChanged); + this.listView_subObjects.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ListView_subObjects_MouseClick); + // + // columnHeader7 + // + this.columnHeader7.Text = "Sub"; + this.columnHeader7.Width = 40; + // + // columnHeader8 + // + this.columnHeader8.Text = "Name"; + this.columnHeader8.Width = 200; + // + // columnHeader9 + // + this.columnHeader9.Text = "Obj Type"; + this.columnHeader9.Width = 65; + // + // columnHeader10 + // + this.columnHeader10.Text = "Data Type"; + this.columnHeader10.Width = 120; + // + // columnHeader11 + // + this.columnHeader11.Text = "SDO"; + this.columnHeader11.Width = 50; + // + // columnHeader12 + // + this.columnHeader12.Text = "PDO"; + this.columnHeader12.Width = 50; + // + // columnHeader13 + // + this.columnHeader13.Text = "SRDO"; + this.columnHeader13.Width = 50; + // + // columnHeader14 + // + this.columnHeader14.Text = "Default Value"; + this.columnHeader14.Width = 190; + // + // textBox_subIndex + // + this.textBox_subIndex.Location = new System.Drawing.Point(260, 8); + this.textBox_subIndex.Name = "textBox_subIndex"; + this.textBox_subIndex.ReadOnly = true; + this.textBox_subIndex.Size = new System.Drawing.Size(100, 20); + this.textBox_subIndex.TabIndex = 0; + this.textBox_subIndex.TabStop = false; + // + // label23 + // + this.label23.AutoSize = true; + this.label23.Location = new System.Drawing.Point(199, 11); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(55, 13); + this.label23.TabIndex = 34; + this.label23.Text = "Sub Index"; + // + // textBox_index + // + this.textBox_index.Location = new System.Drawing.Point(90, 8); + this.textBox_index.Name = "textBox_index"; + this.textBox_index.ReadOnly = true; + this.textBox_index.Size = new System.Drawing.Size(100, 20); + this.textBox_index.TabIndex = 0; + this.textBox_index.TabStop = false; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.checkBox_autosave); + this.groupBox1.Controls.Add(this.textBox_stringLengthMin); + this.groupBox1.Controls.Add(this.label22); + this.groupBox1.Controls.Add(this.label20); + this.groupBox1.Controls.Add(this.comboBox_countLabel); + this.groupBox1.Controls.Add(this.label19); + this.groupBox1.Controls.Add(this.comboBox_accessSRDO); + this.groupBox1.Controls.Add(this.textBox_actualValue); + this.groupBox1.Controls.Add(this.textBox_lowLimit); + this.groupBox1.Controls.Add(this.textBox_highLimit); + this.groupBox1.Controls.Add(this.label18); + this.groupBox1.Controls.Add(this.label17); + this.groupBox1.Controls.Add(this.label14); + this.groupBox1.Controls.Add(this.button_saveChanges); + this.groupBox1.Controls.Add(this.label16); + this.groupBox1.Controls.Add(this.comboBox_storageGroup); + this.groupBox1.Controls.Add(this.label15); + this.groupBox1.Controls.Add(this.checkBox_enabled); + this.groupBox1.Controls.Add(this.label7); + this.groupBox1.Controls.Add(this.comboBox_objectType); + this.groupBox1.Controls.Add(this.label8); + this.groupBox1.Controls.Add(this.comboBox_dataType); + this.groupBox1.Controls.Add(this.label_pdoFlags); + this.groupBox1.Controls.Add(this.label9); + this.groupBox1.Controls.Add(this.checkBox_pdoFlags); + this.groupBox1.Controls.Add(this.comboBox_accessSDO); + this.groupBox1.Controls.Add(this.textBox_defaultValue); + this.groupBox1.Controls.Add(this.label10); + this.groupBox1.Controls.Add(this.label11); + this.groupBox1.Controls.Add(this.comboBox_accessPDO); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.groupBox1.Location = new System.Drawing.Point(0, 329); + this.groupBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.groupBox1.Size = new System.Drawing.Size(854, 188); + this.groupBox1.TabIndex = 33; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Object settings"; + // + // checkBox_autosave + // + this.checkBox_autosave.Location = new System.Drawing.Point(634, 146); + this.checkBox_autosave.Name = "checkBox_autosave"; + this.checkBox_autosave.Size = new System.Drawing.Size(116, 21); + this.checkBox_autosave.TabIndex = 35; + this.checkBox_autosave.Text = "Autosave changes"; + this.checkBox_autosave.UseVisualStyleBackColor = true; + // + // textBox_stringLengthMin + // + this.textBox_stringLengthMin.Location = new System.Drawing.Point(340, 99); + this.textBox_stringLengthMin.Name = "textBox_stringLengthMin"; + this.textBox_stringLengthMin.Size = new System.Drawing.Size(122, 20); + this.textBox_stringLengthMin.TabIndex = 24; + this.textBox_stringLengthMin.TextChanged += new System.EventHandler(this.DataDirty); + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(248, 102); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(75, 13); + this.label22.TabIndex = 39; + this.label22.Text = "String Len Min"; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(482, 21); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(64, 13); + this.label20.TabIndex = 36; + this.label20.Text = "Count Label"; + // + // comboBox_countLabel + // + this.comboBox_countLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox_countLabel.FormattingEnabled = true; + this.comboBox_countLabel.Location = new System.Drawing.Point(574, 18); + this.comboBox_countLabel.Name = "comboBox_countLabel"; + this.comboBox_countLabel.Size = new System.Drawing.Size(122, 21); + this.comboBox_countLabel.TabIndex = 30; + this.comboBox_countLabel.SelectedIndexChanged += new System.EventHandler(this.DataDirty); + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(13, 129); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(76, 13); + this.label19.TabIndex = 34; + this.label19.Text = "Access SRDO"; + // + // comboBox_accessSRDO + // + this.comboBox_accessSRDO.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox_accessSRDO.FormattingEnabled = true; + this.comboBox_accessSRDO.Location = new System.Drawing.Point(108, 126); + this.comboBox_accessSRDO.Name = "comboBox_accessSRDO"; + this.comboBox_accessSRDO.Size = new System.Drawing.Size(122, 21); + this.comboBox_accessSRDO.TabIndex = 14; + this.comboBox_accessSRDO.SelectedIndexChanged += new System.EventHandler(this.DataDirty); + // + // textBox_actualValue + // + this.textBox_actualValue.BackColor = System.Drawing.Color.PeachPuff; + this.textBox_actualValue.Location = new System.Drawing.Point(340, 72); + this.textBox_actualValue.Name = "textBox_actualValue"; + this.textBox_actualValue.Size = new System.Drawing.Size(122, 20); + this.textBox_actualValue.TabIndex = 23; + this.textBox_actualValue.TextChanged += new System.EventHandler(this.DataDirty); + // + // textBox_lowLimit + // + this.textBox_lowLimit.Location = new System.Drawing.Point(340, 45); + this.textBox_lowLimit.Name = "textBox_lowLimit"; + this.textBox_lowLimit.Size = new System.Drawing.Size(122, 20); + this.textBox_lowLimit.TabIndex = 22; + this.textBox_lowLimit.TextChanged += new System.EventHandler(this.DataDirty); + // + // textBox_highLimit + // + this.textBox_highLimit.Location = new System.Drawing.Point(340, 18); + this.textBox_highLimit.Name = "textBox_highLimit"; + this.textBox_highLimit.Size = new System.Drawing.Size(122, 20); + this.textBox_highLimit.TabIndex = 21; + this.textBox_highLimit.TextChanged += new System.EventHandler(this.DataDirty); + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(248, 75); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(67, 13); + this.label18.TabIndex = 32; + this.label18.Text = "Actual Value"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(248, 48); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(48, 13); + this.label17.TabIndex = 31; + this.label17.Text = "LowLimit"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(248, 21); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(50, 13); + this.label14.TabIndex = 30; + this.label14.Text = "HighLimit"; + // + // button_saveChanges + // + this.button_saveChanges.Image = global::ODEditor.Properties.Resources.Save_6530; + this.button_saveChanges.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.button_saveChanges.Location = new System.Drawing.Point(485, 138); + this.button_saveChanges.Name = "button_saveChanges"; + this.button_saveChanges.Size = new System.Drawing.Size(143, 35); + this.button_saveChanges.TabIndex = 50; + this.button_saveChanges.Text = "Save Changes"; + this.button_saveChanges.UseVisualStyleBackColor = true; + this.button_saveChanges.Click += new System.EventHandler(this.Button_saveChanges_Click); + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(482, 48); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(76, 13); + this.label16.TabIndex = 26; + this.label16.Text = "Storage Group"; + // + // comboBox_storageGroup + // + this.comboBox_storageGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox_storageGroup.FormattingEnabled = true; + this.comboBox_storageGroup.Location = new System.Drawing.Point(574, 45); + this.comboBox_storageGroup.Name = "comboBox_storageGroup"; + this.comboBox_storageGroup.Size = new System.Drawing.Size(122, 21); + this.comboBox_storageGroup.TabIndex = 31; + this.comboBox_storageGroup.SelectedIndexChanged += new System.EventHandler(this.DataDirty); + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(482, 72); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(46, 13); + this.label15.TabIndex = 24; + this.label15.Text = "Enabled"; + // + // checkBox_enabled + // + this.checkBox_enabled.AutoSize = true; + this.checkBox_enabled.Location = new System.Drawing.Point(574, 72); + this.checkBox_enabled.Name = "checkBox_enabled"; + this.checkBox_enabled.Size = new System.Drawing.Size(15, 14); + this.checkBox_enabled.TabIndex = 32; + this.checkBox_enabled.UseVisualStyleBackColor = true; + this.checkBox_enabled.CheckedChanged += new System.EventHandler(this.DataDirty); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(13, 21); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(65, 13); + this.label7.TabIndex = 7; + this.label7.Text = "Object Type"; + // + // comboBox_objectType + // + this.comboBox_objectType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox_objectType.Enabled = false; + this.comboBox_objectType.FormattingEnabled = true; + this.comboBox_objectType.Location = new System.Drawing.Point(108, 18); + this.comboBox_objectType.Name = "comboBox_objectType"; + this.comboBox_objectType.Size = new System.Drawing.Size(122, 21); + this.comboBox_objectType.TabIndex = 10; + this.comboBox_objectType.SelectedIndexChanged += new System.EventHandler(this.DataDirty); + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(13, 48); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(57, 13); + this.label8.TabIndex = 9; + this.label8.Text = "Data Type"; + // + // comboBox_dataType + // + this.comboBox_dataType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox_dataType.FormattingEnabled = true; + this.comboBox_dataType.Location = new System.Drawing.Point(108, 45); + this.comboBox_dataType.Name = "comboBox_dataType"; + this.comboBox_dataType.Size = new System.Drawing.Size(122, 21); + this.comboBox_dataType.TabIndex = 11; + this.comboBox_dataType.SelectedIndexChanged += new System.EventHandler(this.DataDirty); + // + // label_pdoFlags + // + this.label_pdoFlags.AutoSize = true; + this.label_pdoFlags.Location = new System.Drawing.Point(482, 92); + this.label_pdoFlags.Name = "label_pdoFlags"; + this.label_pdoFlags.Size = new System.Drawing.Size(62, 13); + this.label_pdoFlags.TabIndex = 18; + this.label_pdoFlags.Text = "TPDO COS"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(13, 75); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(68, 13); + this.label9.TabIndex = 11; + this.label9.Text = "Access SDO"; + // + // checkBox_pdoFlags + // + this.checkBox_pdoFlags.AutoSize = true; + this.checkBox_pdoFlags.Location = new System.Drawing.Point(574, 92); + this.checkBox_pdoFlags.Name = "checkBox_pdoFlags"; + this.checkBox_pdoFlags.Size = new System.Drawing.Size(15, 14); + this.checkBox_pdoFlags.TabIndex = 34; + this.checkBox_pdoFlags.UseVisualStyleBackColor = true; + this.checkBox_pdoFlags.CheckedChanged += new System.EventHandler(this.DataDirty); + // + // comboBox_accessSDO + // + this.comboBox_accessSDO.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox_accessSDO.FormattingEnabled = true; + this.comboBox_accessSDO.Location = new System.Drawing.Point(108, 72); + this.comboBox_accessSDO.Name = "comboBox_accessSDO"; + this.comboBox_accessSDO.Size = new System.Drawing.Size(122, 21); + this.comboBox_accessSDO.TabIndex = 12; + this.comboBox_accessSDO.SelectedIndexChanged += new System.EventHandler(this.DataDirty); + // + // textBox_defaultValue + // + this.textBox_defaultValue.Location = new System.Drawing.Point(108, 153); + this.textBox_defaultValue.Name = "textBox_defaultValue"; + this.textBox_defaultValue.Size = new System.Drawing.Size(354, 20); + this.textBox_defaultValue.TabIndex = 20; + this.textBox_defaultValue.TextChanged += new System.EventHandler(this.DataDirty); + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(13, 102); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(68, 13); + this.label10.TabIndex = 13; + this.label10.Text = "Access PDO"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(13, 156); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(70, 13); + this.label11.TabIndex = 15; + this.label11.Text = "Default value"; + // + // comboBox_accessPDO + // + this.comboBox_accessPDO.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox_accessPDO.FormattingEnabled = true; + this.comboBox_accessPDO.Location = new System.Drawing.Point(108, 99); + this.comboBox_accessPDO.Name = "comboBox_accessPDO"; + this.comboBox_accessPDO.Size = new System.Drawing.Size(122, 21); + this.comboBox_accessPDO.TabIndex = 13; + this.comboBox_accessPDO.SelectedIndexChanged += new System.EventHandler(this.DataDirty); + // + // textBox_denotation + // + this.textBox_denotation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox_denotation.BackColor = System.Drawing.Color.PeachPuff; + this.textBox_denotation.Location = new System.Drawing.Point(90, 60); + this.textBox_denotation.Name = "textBox_denotation"; + this.textBox_denotation.Size = new System.Drawing.Size(761, 20); + this.textBox_denotation.TabIndex = 3; + this.textBox_denotation.TextChanged += new System.EventHandler(this.DataDirty); + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(13, 63); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(59, 13); + this.label13.TabIndex = 28; + this.label13.Text = "Denotation"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(13, 11); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(33, 13); + this.label4.TabIndex = 1; + this.label4.Text = "Index"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(13, 37); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(35, 13); + this.label5.TabIndex = 2; + this.label5.Text = "Name"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(13, 89); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(60, 13); + this.label6.TabIndex = 3; + this.label6.Text = "Description"; + // + // textBox_name + // + this.textBox_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox_name.Location = new System.Drawing.Point(90, 34); + this.textBox_name.Name = "textBox_name"; + this.textBox_name.Size = new System.Drawing.Size(761, 20); + this.textBox_name.TabIndex = 2; + this.textBox_name.TextChanged += new System.EventHandler(this.DataDirty); + // + // textBox_description + // + this.textBox_description.AcceptsReturn = true; + this.textBox_description.AcceptsTab = true; + this.textBox_description.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox_description.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBox_description.Location = new System.Drawing.Point(90, 86); + this.textBox_description.Multiline = true; + this.textBox_description.Name = "textBox_description"; + this.textBox_description.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.textBox_description.Size = new System.Drawing.Size(761, 227); + this.textBox_description.TabIndex = 4; + this.textBox_description.TextChanged += new System.EventHandler(this.DataDirty); + // + // contextMenu_object + // + this.contextMenu_object.ImageScalingSize = new System.Drawing.Size(20, 20); + this.contextMenu_object.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.contextMenu_object_addNewObjectToolStripMenuItem, + this.addToolStripMenuItem, + this.contextMenu_object_deleteObjectToolStripMenuItem, + this.contextMenu_object_toggleObjectToolStripMenuItem}); + this.contextMenu_object.Name = "contextMenuStrip1"; + this.contextMenu_object.Size = new System.Drawing.Size(121, 108); + // + // contextMenu_object_addNewObjectToolStripMenuItem + // + this.contextMenu_object_addNewObjectToolStripMenuItem.Name = "contextMenu_object_addNewObjectToolStripMenuItem"; + this.contextMenu_object_addNewObjectToolStripMenuItem.Size = new System.Drawing.Size(120, 26); + this.contextMenu_object_addNewObjectToolStripMenuItem.Text = "&Clone..."; + this.contextMenu_object_addNewObjectToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_object_clone_ToolStripMenuItem_Click); + // + // addToolStripMenuItem + // + this.addToolStripMenuItem.Image = global::ODEditor.Properties.Resources.action_add_16xLG; + this.addToolStripMenuItem.Name = "addToolStripMenuItem"; + this.addToolStripMenuItem.Size = new System.Drawing.Size(120, 26); + this.addToolStripMenuItem.Text = "Add..."; + this.addToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_object_add_ToolStripMenuItem_Click); + // + // contextMenu_object_deleteObjectToolStripMenuItem + // + this.contextMenu_object_deleteObjectToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Remove_16xLG; + this.contextMenu_object_deleteObjectToolStripMenuItem.Name = "contextMenu_object_deleteObjectToolStripMenuItem"; + this.contextMenu_object_deleteObjectToolStripMenuItem.Size = new System.Drawing.Size(120, 26); + this.contextMenu_object_deleteObjectToolStripMenuItem.Text = "&Delete..."; + this.contextMenu_object_deleteObjectToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_object_delete_ToolStripMenuItem_Click); + // + // contextMenu_object_toggleObjectToolStripMenuItem + // + this.contextMenu_object_toggleObjectToolStripMenuItem.Name = "contextMenu_object_toggleObjectToolStripMenuItem"; + this.contextMenu_object_toggleObjectToolStripMenuItem.Size = new System.Drawing.Size(120, 26); + this.contextMenu_object_toggleObjectToolStripMenuItem.Text = "&Toggle"; + this.contextMenu_object_toggleObjectToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_object_toggle_ToolStripMenuItem_Click); + // + // contextMenu_subObject + // + this.contextMenu_subObject.ImageScalingSize = new System.Drawing.Size(20, 20); + this.contextMenu_subObject.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.contextMenu_subObject_addSubItemToolStripMenuItem, + this.contextMenu_subObject_removeSubItemToolStripMenuItem, + this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem}); + this.contextMenu_subObject.Name = "contextMenu_array"; + this.contextMenu_subObject.Size = new System.Drawing.Size(183, 82); + // + // contextMenu_subObject_addSubItemToolStripMenuItem + // + this.contextMenu_subObject_addSubItemToolStripMenuItem.Image = global::ODEditor.Properties.Resources.action_add_16xLG; + this.contextMenu_subObject_addSubItemToolStripMenuItem.Name = "contextMenu_subObject_addSubItemToolStripMenuItem"; + this.contextMenu_subObject_addSubItemToolStripMenuItem.Size = new System.Drawing.Size(182, 26); + this.contextMenu_subObject_addSubItemToolStripMenuItem.Text = "Add"; + this.contextMenu_subObject_addSubItemToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_subObject_add_ToolStripMenuItem_Click); + // + // contextMenu_subObject_removeSubItemToolStripMenuItem + // + this.contextMenu_subObject_removeSubItemToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Remove_16xLG; + this.contextMenu_subObject_removeSubItemToolStripMenuItem.Name = "contextMenu_subObject_removeSubItemToolStripMenuItem"; + this.contextMenu_subObject_removeSubItemToolStripMenuItem.Size = new System.Drawing.Size(182, 26); + this.contextMenu_subObject_removeSubItemToolStripMenuItem.Text = "Remove (shift up)"; + this.contextMenu_subObject_removeSubItemToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_subObject_remove_ToolStripMenuItem_Click); + // + // contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem + // + this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Remove_16xLG; + this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Name = "contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem"; + this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Size = new System.Drawing.Size(182, 26); + this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Text = "Remove (leave gap)"; + this.contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Click += new System.EventHandler(this.ContextMenu_subObject_remove_ToolStripMenuItem_Click); + // + // DeviceODView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer1); + this.Name = "DeviceODView"; + this.Size = new System.Drawing.Size(1138, 745); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.splitContainer3.Panel1.ResumeLayout(false); + this.splitContainer3.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); + this.splitContainer3.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.tableLayoutPanel3.ResumeLayout(false); + this.tableLayoutPanel3.PerformLayout(); + this.splitContainer4.Panel1.ResumeLayout(false); + this.splitContainer4.Panel2.ResumeLayout(false); + this.splitContainer4.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); + this.splitContainer4.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.contextMenu_object.ResumeLayout(false); + this.contextMenu_subObject.ResumeLayout(false); + this.ResumeLayout(false); + } #endregion @@ -1049,6 +1049,6 @@ private void InitializeComponent() private System.Windows.Forms.TextBox textBox_subIndex; private System.Windows.Forms.Label label23; private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem; - private System.Windows.Forms.CheckBox checkBox_autosave; + private System.Windows.Forms.CheckBox checkBox_autosave; } } diff --git a/EDSEditorGUI/DeviceODView.cs b/EDSEditorGUI/DeviceODView.cs index b7ded4ce..fcc18215 100644 --- a/EDSEditorGUI/DeviceODView.cs +++ b/EDSEditorGUI/DeviceODView.cs @@ -24,149 +24,149 @@ You should have received a copy of the GNU General Public License using System.Windows.Forms; using System.Reflection; using System.Text.RegularExpressions; -using libEDSsharp; - - +using libEDSsharp; + + namespace ODEditor { public partial class DeviceODView : MyTabUserControl { EDSsharp eds = null; - public List network; + public List network; ODentry selectedObject; ODentry lastSelectedObject; ListView selectedList; - bool justUpdating = false; - bool ExporterOld = false; - bool ExporterV4 = false; - - public event EventHandler UpdateODViewForEDS; - + bool justUpdating = false; + bool ExporterOld = false; + bool ExporterV4 = false; + + public event EventHandler UpdateODViewForEDS; + public DeviceODView() { - InitializeComponent(); - RebuildControls(); - - // other elements may be added in PopulateObjectLists() - comboBox_countLabel.Items.Add(""); - comboBox_countLabel.Items.Add("Add..."); - comboBox_countLabel.SelectedIndexChanged += new System.EventHandler(this.ComboBox_countLabel_Add); - comboBox_storageGroup.Items.Add("Add..."); - comboBox_storageGroup.SelectedIndexChanged += new System.EventHandler(this.ComboBox_storageGroup_Add); - - listView_communication_objects.DoubleBuffering(true); - listView_deviceProfile_objects.DoubleBuffering(true); - listView_manufacturer_objects.DoubleBuffering(true); - listView_subObjects.DoubleBuffering(true); - } - - - public void RebuildControls() - { - if (ExporterTypeV4()) - { - comboBox_dataType.Items.Clear(); - comboBox_dataType.Items.Add(DataType.BOOLEAN.ToString()); - comboBox_dataType.Items.Add(DataType.INTEGER8.ToString()); - comboBox_dataType.Items.Add(DataType.INTEGER16.ToString()); - comboBox_dataType.Items.Add(DataType.INTEGER32.ToString()); - comboBox_dataType.Items.Add(DataType.INTEGER64.ToString()); - comboBox_dataType.Items.Add(DataType.UNSIGNED8.ToString()); - comboBox_dataType.Items.Add(DataType.UNSIGNED16.ToString()); - comboBox_dataType.Items.Add(DataType.UNSIGNED32.ToString()); - comboBox_dataType.Items.Add(DataType.UNSIGNED64.ToString()); - comboBox_dataType.Items.Add(DataType.REAL32.ToString()); - comboBox_dataType.Items.Add(DataType.REAL64.ToString()); - comboBox_dataType.Items.Add(DataType.VISIBLE_STRING.ToString()); - comboBox_dataType.Items.Add(DataType.OCTET_STRING.ToString()); - comboBox_dataType.Items.Add(DataType.UNICODE_STRING.ToString()); - comboBox_dataType.Items.Add(DataType.DOMAIN.ToString()); - - comboBox_objectType.Items.Clear(); - comboBox_objectType.Items.Add(ObjectType.VAR.ToString()); - comboBox_objectType.Items.Add(ObjectType.ARRAY.ToString()); - comboBox_objectType.Items.Add(ObjectType.RECORD.ToString()); - - comboBox_accessSDO.Items.Clear(); - foreach (AccessSDO foo in Enum.GetValues(typeof(AccessSDO))) - comboBox_accessSDO.Items.Add(foo.ToString()); - - comboBox_accessPDO.Items.Clear(); - foreach (AccessPDO foo in Enum.GetValues(typeof(AccessPDO))) - comboBox_accessPDO.Items.Add(foo.ToString()); - - label_pdoFlags.Visible = false; - checkBox_pdoFlags.Visible = false; - } - else - { - comboBox_dataType.Items.Clear(); - foreach (DataType foo in Enum.GetValues(typeof(DataType))) - comboBox_dataType.Items.Add(foo.ToString()); - comboBox_objectType.Items.Clear(); - foreach (ObjectType foo in Enum.GetValues(typeof(ObjectType))) - comboBox_objectType.Items.Add(foo.ToString()); - comboBox_accessSDO.Items.Clear(); - foreach (EDSsharp.AccessType foo in Enum.GetValues(typeof(EDSsharp.AccessType))) - comboBox_accessSDO.Items.Add(foo.ToString()); - comboBox_accessPDO.Items.Clear(); - foreach (PDOMappingType foo in Enum.GetValues(typeof(PDOMappingType))) - comboBox_accessPDO.Items.Add(foo.ToString()); - - label_pdoFlags.Visible = true; - checkBox_pdoFlags.Visible = true; - } - - comboBox_accessSRDO.Items.Clear(); - foreach (AccessSRDO foo in Enum.GetValues(typeof(AccessSRDO))) - comboBox_accessSRDO.Items.Add(foo.ToString()); - - - } - private bool ExporterTypeV4() { - ExporterFactory.Exporter type = (ExporterFactory.Exporter)Properties.Settings.Default.ExporterType; - return (type == ExporterFactory.Exporter.CANOPENNODE_V4); - } - - private bool Checkdirty() - { - var result = false; - - if (button_saveChanges.BackColor == Color.Red) - { - - var answer = checkBox_autosave.Checked - ? DialogResult.No - : MessageBox.Show(String.Format("Unsaved changes on Index 0x{0:X4}/{1:X2}.\nDo you wish to switch object and loose your changes?\n\nYes = Lose changes\nNo = Save\nCancel = Go back and stay on the object", lastSelectedObject.Index, lastSelectedObject.Subindex), "Unsaved changes", MessageBoxButtons.YesNoCancel); ; - - - switch (answer) - { - case DialogResult.Cancel: - default: - result = lastSelectedObject != null; - break; - - case DialogResult.Yes: - result = false; - break; - - case DialogResult.No: - if (lastSelectedObject != null) - { - ObjectSave(); - result = false; - } - break; - } - - button_saveChanges.BackColor = default; - } - - return result; + InitializeComponent(); + RebuildControls(); + + // other elements may be added in PopulateObjectLists() + comboBox_countLabel.Items.Add(""); + comboBox_countLabel.Items.Add("Add..."); + comboBox_countLabel.SelectedIndexChanged += new System.EventHandler(this.ComboBox_countLabel_Add); + comboBox_storageGroup.Items.Add("Add..."); + comboBox_storageGroup.SelectedIndexChanged += new System.EventHandler(this.ComboBox_storageGroup_Add); + + listView_communication_objects.DoubleBuffering(true); + listView_deviceProfile_objects.DoubleBuffering(true); + listView_manufacturer_objects.DoubleBuffering(true); + listView_subObjects.DoubleBuffering(true); + } + + + public void RebuildControls() + { + if (ExporterTypeV4()) + { + comboBox_dataType.Items.Clear(); + comboBox_dataType.Items.Add(DataType.BOOLEAN.ToString()); + comboBox_dataType.Items.Add(DataType.INTEGER8.ToString()); + comboBox_dataType.Items.Add(DataType.INTEGER16.ToString()); + comboBox_dataType.Items.Add(DataType.INTEGER32.ToString()); + comboBox_dataType.Items.Add(DataType.INTEGER64.ToString()); + comboBox_dataType.Items.Add(DataType.UNSIGNED8.ToString()); + comboBox_dataType.Items.Add(DataType.UNSIGNED16.ToString()); + comboBox_dataType.Items.Add(DataType.UNSIGNED32.ToString()); + comboBox_dataType.Items.Add(DataType.UNSIGNED64.ToString()); + comboBox_dataType.Items.Add(DataType.REAL32.ToString()); + comboBox_dataType.Items.Add(DataType.REAL64.ToString()); + comboBox_dataType.Items.Add(DataType.VISIBLE_STRING.ToString()); + comboBox_dataType.Items.Add(DataType.OCTET_STRING.ToString()); + comboBox_dataType.Items.Add(DataType.UNICODE_STRING.ToString()); + comboBox_dataType.Items.Add(DataType.DOMAIN.ToString()); + + comboBox_objectType.Items.Clear(); + comboBox_objectType.Items.Add(ObjectType.VAR.ToString()); + comboBox_objectType.Items.Add(ObjectType.ARRAY.ToString()); + comboBox_objectType.Items.Add(ObjectType.RECORD.ToString()); + + comboBox_accessSDO.Items.Clear(); + foreach (AccessSDO foo in Enum.GetValues(typeof(AccessSDO))) + comboBox_accessSDO.Items.Add(foo.ToString()); + + comboBox_accessPDO.Items.Clear(); + foreach (AccessPDO foo in Enum.GetValues(typeof(AccessPDO))) + comboBox_accessPDO.Items.Add(foo.ToString()); + + label_pdoFlags.Visible = false; + checkBox_pdoFlags.Visible = false; + } + else + { + comboBox_dataType.Items.Clear(); + foreach (DataType foo in Enum.GetValues(typeof(DataType))) + comboBox_dataType.Items.Add(foo.ToString()); + comboBox_objectType.Items.Clear(); + foreach (ObjectType foo in Enum.GetValues(typeof(ObjectType))) + comboBox_objectType.Items.Add(foo.ToString()); + comboBox_accessSDO.Items.Clear(); + foreach (EDSsharp.AccessType foo in Enum.GetValues(typeof(EDSsharp.AccessType))) + comboBox_accessSDO.Items.Add(foo.ToString()); + comboBox_accessPDO.Items.Clear(); + foreach (PDOMappingType foo in Enum.GetValues(typeof(PDOMappingType))) + comboBox_accessPDO.Items.Add(foo.ToString()); + + label_pdoFlags.Visible = true; + checkBox_pdoFlags.Visible = true; + } + + comboBox_accessSRDO.Items.Clear(); + foreach (AccessSRDO foo in Enum.GetValues(typeof(AccessSRDO))) + comboBox_accessSRDO.Items.Add(foo.ToString()); + + + } + private bool ExporterTypeV4() { + ExporterFactory.Exporter type = (ExporterFactory.Exporter)Properties.Settings.Default.ExporterType; + return (type == ExporterFactory.Exporter.CANOPENNODE_V4); + } + + private bool Checkdirty() + { + var result = false; + + if (button_saveChanges.BackColor == Color.Red) + { + + var answer = checkBox_autosave.Checked + ? DialogResult.No + : MessageBox.Show(String.Format("Unsaved changes on Index 0x{0:X4}/{1:X2}.\nDo you wish to switch object and loose your changes?\n\nYes = Lose changes\nNo = Save\nCancel = Go back and stay on the object", lastSelectedObject.Index, lastSelectedObject.Subindex), "Unsaved changes", MessageBoxButtons.YesNoCancel); ; + + + switch (answer) + { + case DialogResult.Cancel: + default: + result = lastSelectedObject != null; + break; + + case DialogResult.Yes: + result = false; + break; + + case DialogResult.No: + if (lastSelectedObject != null) + { + ObjectSave(); + result = false; + } + break; + } + + button_saveChanges.BackColor = default; + } + + return result; } private void ComboBoxSet(ComboBox comboBox, string item) @@ -259,7 +259,7 @@ public void PopulateSubList() listView_subObjects.Items.Clear(); if (selectedObject == null) - return; + return; ODentry od = selectedObject.parent ?? selectedObject; if (od.objecttype == ObjectType.VAR) @@ -312,10 +312,10 @@ public void PopulateObject() { ExporterV4 = ExporterTypeV4(); - if (ExporterOld != ExporterV4) + if (ExporterOld != ExporterV4) { RebuildControls(); - ExporterOld = ExporterV4; + ExporterOld = ExporterV4; } justUpdating = true; @@ -360,15 +360,15 @@ public void PopulateObject() : od.datatype.ToString(); ComboBoxSet(comboBox_dataType, dataType); - if (ExporterV4) - { - comboBox_accessSDO.SelectedItem = od.AccessSDO().ToString(); - comboBox_accessPDO.SelectedItem = od.AccessPDO().ToString(); + if (ExporterV4) + { + comboBox_accessSDO.SelectedItem = od.AccessSDO().ToString(); + comboBox_accessPDO.SelectedItem = od.AccessPDO().ToString(); } - else - { - comboBox_accessSDO.SelectedItem = od.accesstype.ToString(); - comboBox_accessPDO.SelectedItem = od.PDOtype.ToString(); + else + { + comboBox_accessSDO.SelectedItem = od.accesstype.ToString(); + comboBox_accessPDO.SelectedItem = od.PDOtype.ToString(); } comboBox_accessSRDO.SelectedItem = od.prop.CO_accessSRDO.ToString(); @@ -439,17 +439,17 @@ private void DataDirty(object sender, EventArgs e) } private void Button_saveChanges_Click(object sender, EventArgs e) - { - ObjectSave(); - } + { + ObjectSave(); + } - private void ObjectSave() - { + private void ObjectSave() + { ExporterV4 = ExporterTypeV4(); - if (ExporterOld != ExporterV4) + if (ExporterOld != ExporterV4) { RebuildControls(); - ExporterOld = ExporterV4; + ExporterOld = ExporterV4; } if (selectedObject == null) @@ -475,56 +475,56 @@ private void ObjectSave() od.datatype = DataType.UNKNOWN; } - if (ExporterV4) - { - AccessSDO accessSDO; - try - { - accessSDO = (AccessSDO)Enum.Parse(typeof(AccessSDO), comboBox_accessSDO.SelectedItem.ToString()); - } - catch (Exception) - { - accessSDO = AccessSDO.ro; - } - - AccessPDO accessPDO; - try - { - accessPDO = (AccessPDO)Enum.Parse(typeof(AccessPDO), comboBox_accessPDO.SelectedItem.ToString()); - } - catch (Exception) - { - accessPDO = AccessPDO.no; - } - - od.AccessSDO(accessSDO, accessPDO); - od.AccessPDO(accessPDO); + if (ExporterV4) + { + AccessSDO accessSDO; + try + { + accessSDO = (AccessSDO)Enum.Parse(typeof(AccessSDO), comboBox_accessSDO.SelectedItem.ToString()); + } + catch (Exception) + { + accessSDO = AccessSDO.ro; + } + + AccessPDO accessPDO; + try + { + accessPDO = (AccessPDO)Enum.Parse(typeof(AccessPDO), comboBox_accessPDO.SelectedItem.ToString()); + } + catch (Exception) + { + accessPDO = AccessPDO.no; + } + + od.AccessSDO(accessSDO, accessPDO); + od.AccessPDO(accessPDO); } - else - { - try - { - od.accesstype = (EDSsharp.AccessType)Enum.Parse(typeof(EDSsharp.AccessType), comboBox_accessSDO.SelectedItem.ToString()); - } - catch (Exception) - { - od.accesstype = EDSsharp.AccessType.ro; - } - - try - { - od.PDOtype = (PDOMappingType)Enum.Parse(typeof(PDOMappingType), comboBox_accessPDO.SelectedItem.ToString()); - } - catch (Exception) - { - od.PDOtype = PDOMappingType.no; - } + else + { + try + { + od.accesstype = (EDSsharp.AccessType)Enum.Parse(typeof(EDSsharp.AccessType), comboBox_accessSDO.SelectedItem.ToString()); + } + catch (Exception) + { + od.accesstype = EDSsharp.AccessType.ro; + } + + try + { + od.PDOtype = (PDOMappingType)Enum.Parse(typeof(PDOMappingType), comboBox_accessPDO.SelectedItem.ToString()); + } + catch (Exception) + { + od.PDOtype = PDOMappingType.no; + } } // CO_accessSRDO try { - if(comboBox_accessSRDO.SelectedItem != null) + if(comboBox_accessSRDO.SelectedItem != null) od.prop.CO_accessSRDO = (AccessSRDO)Enum.Parse(typeof(AccessSRDO), comboBox_accessSRDO.SelectedItem.ToString()); } catch (Exception) @@ -590,9 +590,9 @@ private void ObjectSave() private void ListView_objects_MouseClick(object sender, MouseEventArgs e) { ListView listview = (ListView)sender; - - if (listview.SelectedItems.Count <= 0) - return; + + if (listview.SelectedItems.Count <= 0) + return; ODentry od = (ODentry)listview.SelectedItems[0].Tag; @@ -608,10 +608,10 @@ private void ListView_objects_MouseClick(object sender, MouseEventArgs e) PopulateObject(); PopulateSubList(); - } - else { + } + else { //selectedObject = lastSelectedObject; - //od = selectedObject; + //od = selectedObject; //selectedList.Select(); //string indesnew = "0x" + Convert.ToString(selectedObject.Index, 16); //ListViewItem itemnew = selectedList.FindItemWithText(indesnew); @@ -625,7 +625,7 @@ private void ListView_objects_MouseClick(object sender, MouseEventArgs e) } private void ListView_objects_SelectedIndexChanged(object sender, EventArgs e) - { + { ListView_objects_MouseClick(sender, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0)); } @@ -654,7 +654,7 @@ private void ListView_subObjects_MouseClick(object sender, MouseEventArgs e) contextMenu_subObject_removeSubItemToolStripMenuItem.Enabled = od.Subindex > 0 && od.parent != null; contextMenu_subObject_removeSubItemLeaveGapToolStripMenuItem.Enabled = parent.objecttype == ObjectType.RECORD && od.Subindex > 0 && od.parent != null; - if (isClickOnItem(e.Location)) + if (isClickOnItem(e.Location)) { contextMenu_subObject.Show(Cursor.Position); } @@ -663,24 +663,24 @@ private void ListView_subObjects_MouseClick(object sender, MouseEventArgs e) selectedObject = od; PopulateObject(); } - } - - private bool isClickOnItem(Point location) - { - if (listView_subObjects.FocusedItem != null) - { - return listView_subObjects.FocusedItem.Bounds.Contains(location); - } - - foreach (ListViewItem item in listView_subObjects.Items) - { - if (item.Bounds.Contains(location)) - { - return true; - } - } - - return false; + } + + private bool isClickOnItem(Point location) + { + if (listView_subObjects.FocusedItem != null) + { + return listView_subObjects.FocusedItem.Bounds.Contains(location); + } + + foreach (ListViewItem item in listView_subObjects.Items) + { + if (item.Bounds.Contains(location)) + { + return true; + } + } + + return false; } private void ListView_subObjects_SelectedIndexChanged(object sender, EventArgs e) @@ -731,23 +731,23 @@ private void ContextMenu_object_clone_ToolStripMenuItem_Click(object sender, Eve if (srcObjects.Count > 0) { - InsertObjects insObjForm = new InsertObjects(eds, network, srcObjects, "1"); + InsertObjects insObjForm = new InsertObjects(eds, network, srcObjects, "1"); if (insObjForm.ShowDialog() == DialogResult.OK) { selectedObject = null; - EDSsharp modifiedEds = insObjForm.GetModifiedEDS(); - modifiedEds.Dirty = true; - if(modifiedEds == this.eds) - { + EDSsharp modifiedEds = insObjForm.GetModifiedEDS(); + modifiedEds.Dirty = true; + if(modifiedEds == this.eds) + { PopulateObjectLists(eds); PopulateSubList(); PopulateObject(); - } - else - { - UpdateODViewForEDS?.Invoke(this, new UpdateODViewEventArgs(modifiedEds)); - } + } + else + { + UpdateODViewForEDS?.Invoke(this, new UpdateODViewEventArgs(modifiedEds)); + } } } } diff --git a/EDSEditorGUI/DevicePDOView2.Designer.cs b/EDSEditorGUI/DevicePDOView2.Designer.cs index ba03f81e..b94639a0 100644 --- a/EDSEditorGUI/DevicePDOView2.Designer.cs +++ b/EDSEditorGUI/DevicePDOView2.Designer.cs @@ -28,391 +28,391 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.button_addPDO = new System.Windows.Forms.Button(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.textBox_mapping = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.checkBox_invalidpdo = new System.Windows.Forms.CheckBox(); - this.textBox_slot = new System.Windows.Forms.TextBox(); - this.textBox_syncstart = new System.Windows.Forms.TextBox(); - this.textBox_eventtimer = new System.Windows.Forms.TextBox(); - this.textBox_inhibit = new System.Windows.Forms.TextBox(); - this.textBox_type = new System.Windows.Forms.TextBox(); - this.label7 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.textBox_cob = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.button_savepdochanges = new System.Windows.Forms.Button(); - this.button_deletePDO = new System.Windows.Forms.Button(); - this.listView_TXPDO = new System.Windows.Forms.ListView(); - this.columnHeader13 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader15 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader16 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader17 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.button_up = new System.Windows.Forms.Button(); - this.contextMenuStrip_removeitem = new System.Windows.Forms.ContextMenuStrip(this.components); - this.toolStripMenuItem_removeitem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem_insert = new System.Windows.Forms.ToolStripMenuItem(); - this.grid1 = new SourceGrid.Grid(); - this.button_down = new System.Windows.Forms.Button(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.groupBox1.SuspendLayout(); - this.contextMenuStrip_removeitem.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.SuspendLayout(); - // - // button_addPDO - // - this.button_addPDO.Image = global::ODEditor.Properties.Resources.action_add_16xLG; - this.button_addPDO.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.button_addPDO.Location = new System.Drawing.Point(912, 101); - this.button_addPDO.Name = "button_addPDO"; - this.button_addPDO.Size = new System.Drawing.Size(101, 27); - this.button_addPDO.TabIndex = 9; - this.button_addPDO.Text = "Add new PDO"; - this.button_addPDO.UseVisualStyleBackColor = true; - this.button_addPDO.Click += new System.EventHandler(this.button_addPDO_Click); - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.textBox_mapping); - this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Controls.Add(this.checkBox_invalidpdo); - this.groupBox1.Controls.Add(this.textBox_slot); - this.groupBox1.Controls.Add(this.textBox_syncstart); - this.groupBox1.Controls.Add(this.textBox_eventtimer); - this.groupBox1.Controls.Add(this.textBox_inhibit); - this.groupBox1.Controls.Add(this.textBox_type); - this.groupBox1.Controls.Add(this.label7); - this.groupBox1.Controls.Add(this.label6); - this.groupBox1.Controls.Add(this.label5); - this.groupBox1.Controls.Add(this.label4); - this.groupBox1.Controls.Add(this.textBox_cob); - this.groupBox1.Controls.Add(this.label3); - this.groupBox1.Controls.Add(this.label2); - this.groupBox1.Location = new System.Drawing.Point(612, 7); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(283, 206); - this.groupBox1.TabIndex = 16; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Communication parameters"; - // - // textBox_mapping - // - this.textBox_mapping.Location = new System.Drawing.Point(98, 47); - this.textBox_mapping.Name = "textBox_mapping"; - this.textBox_mapping.ReadOnly = true; - this.textBox_mapping.Size = new System.Drawing.Size(96, 20); - this.textBox_mapping.TabIndex = 2; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(8, 50); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(48, 13); - this.label1.TabIndex = 10; - this.label1.Text = "Mapping"; - // - // checkBox_invalidpdo - // - this.checkBox_invalidpdo.AutoSize = true; - this.checkBox_invalidpdo.Location = new System.Drawing.Point(214, 183); - this.checkBox_invalidpdo.Name = "checkBox_invalidpdo"; - this.checkBox_invalidpdo.Size = new System.Drawing.Size(57, 17); - this.checkBox_invalidpdo.TabIndex = 8; - this.checkBox_invalidpdo.Text = "Invalid"; - this.checkBox_invalidpdo.UseVisualStyleBackColor = true; - this.checkBox_invalidpdo.CheckedChanged += new System.EventHandler(this.checkBox_invalidpdo_CheckedChanged); - // - // textBox_slot - // - this.textBox_slot.Location = new System.Drawing.Point(98, 20); - this.textBox_slot.Name = "textBox_slot"; - this.textBox_slot.Size = new System.Drawing.Size(96, 20); - this.textBox_slot.TabIndex = 1; - // - // textBox_syncstart - // - this.textBox_syncstart.Location = new System.Drawing.Point(98, 181); - this.textBox_syncstart.Name = "textBox_syncstart"; - this.textBox_syncstart.Size = new System.Drawing.Size(96, 20); - this.textBox_syncstart.TabIndex = 7; - // - // textBox_eventtimer - // - this.textBox_eventtimer.Location = new System.Drawing.Point(98, 154); - this.textBox_eventtimer.Name = "textBox_eventtimer"; - this.textBox_eventtimer.Size = new System.Drawing.Size(96, 20); - this.textBox_eventtimer.TabIndex = 6; - // - // textBox_inhibit - // - this.textBox_inhibit.Location = new System.Drawing.Point(98, 128); - this.textBox_inhibit.Name = "textBox_inhibit"; - this.textBox_inhibit.Size = new System.Drawing.Size(96, 20); - this.textBox_inhibit.TabIndex = 5; - // - // textBox_type - // - this.textBox_type.Location = new System.Drawing.Point(98, 101); - this.textBox_type.Name = "textBox_type"; - this.textBox_type.Size = new System.Drawing.Size(96, 20); - this.textBox_type.TabIndex = 4; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(10, 184); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(54, 13); - this.label7.TabIndex = 6; - this.label7.Text = "Sync start"; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(10, 131); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(35, 13); - this.label6.TabIndex = 5; - this.label6.Text = "Inhibit"; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(10, 158); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(64, 13); - this.label5.TabIndex = 4; - this.label5.Text = "Event Timer"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(10, 104); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(31, 13); - this.label4.TabIndex = 3; - this.label4.Text = "Type"; - // - // textBox_cob - // - this.textBox_cob.Location = new System.Drawing.Point(98, 74); - this.textBox_cob.Name = "textBox_cob"; - this.textBox_cob.Size = new System.Drawing.Size(96, 20); - this.textBox_cob.TabIndex = 3; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(10, 77); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(29, 13); - this.label3.TabIndex = 1; - this.label3.Text = "COB"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(8, 24); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(79, 13); - this.label2.TabIndex = 0; - this.label2.Text = "Communication"; - // - // button_savepdochanges - // - this.button_savepdochanges.Image = global::ODEditor.Properties.Resources.Save_6530; - this.button_savepdochanges.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.button_savepdochanges.Location = new System.Drawing.Point(912, 177); - this.button_savepdochanges.Name = "button_savepdochanges"; - this.button_savepdochanges.Size = new System.Drawing.Size(101, 27); - this.button_savepdochanges.TabIndex = 11; - this.button_savepdochanges.Text = "Save "; - this.button_savepdochanges.UseVisualStyleBackColor = true; - this.button_savepdochanges.Click += new System.EventHandler(this.button_savepdochanges_Click_1); - // - // button_deletePDO - // - this.button_deletePDO.Image = global::ODEditor.Properties.Resources.Remove_16xLG; - this.button_deletePDO.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.button_deletePDO.Location = new System.Drawing.Point(912, 138); - this.button_deletePDO.Name = "button_deletePDO"; - this.button_deletePDO.Size = new System.Drawing.Size(101, 27); - this.button_deletePDO.TabIndex = 10; - this.button_deletePDO.Text = "Delete PDO"; - this.button_deletePDO.UseVisualStyleBackColor = true; - this.button_deletePDO.Click += new System.EventHandler(this.button_deletePDO_Click); - // - // listView_TXPDO - // - this.listView_TXPDO.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader13, - this.columnHeader15, - this.columnHeader16, - this.columnHeader17, - this.columnHeader1}); - this.listView_TXPDO.FullRowSelect = true; - this.listView_TXPDO.HideSelection = false; - this.listView_TXPDO.Location = new System.Drawing.Point(6, 19); - this.listView_TXPDO.MultiSelect = false; - this.listView_TXPDO.Name = "listView_TXPDO"; - this.listView_TXPDO.Size = new System.Drawing.Size(587, 182); - this.listView_TXPDO.TabIndex = 0; - this.listView_TXPDO.UseCompatibleStateImageBehavior = false; - this.listView_TXPDO.View = System.Windows.Forms.View.Details; - this.listView_TXPDO.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.listView_TXPDO_ItemDrag); - this.listView_TXPDO.SelectedIndexChanged += new System.EventHandler(this.listView_TXPDO_SelectedIndexChanged); - // - // columnHeader13 - // - this.columnHeader13.Text = "Index"; - this.columnHeader13.Width = 55; - // - // columnHeader15 - // - this.columnHeader15.Text = "Sub"; - this.columnHeader15.Width = 40; - // - // columnHeader16 - // - this.columnHeader16.Text = "Name"; - this.columnHeader16.Width = 206; - // - // columnHeader17 - // - this.columnHeader17.Text = "Datatype"; - this.columnHeader17.Width = 183; - // - // columnHeader1 - // - this.columnHeader1.Text = "Bits"; - // - // button_up - // - this.button_up.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.button_up.Location = new System.Drawing.Point(2, 409); - this.button_up.Margin = new System.Windows.Forms.Padding(2); - this.button_up.Name = "button_up"; - this.button_up.Size = new System.Drawing.Size(85, 30); - this.button_up.TabIndex = 13; - this.button_up.Text = "Zoom In"; - this.button_up.UseVisualStyleBackColor = true; - this.button_up.Click += new System.EventHandler(this.button_up_Click); - // - // contextMenuStrip_removeitem - // - this.contextMenuStrip_removeitem.ImageScalingSize = new System.Drawing.Size(20, 20); - this.contextMenuStrip_removeitem.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripMenuItem_removeitem, - this.toolStripMenuItem_insert}); - this.contextMenuStrip_removeitem.Name = "contextMenuStrip_removeitem"; - this.contextMenuStrip_removeitem.Size = new System.Drawing.Size(145, 48); - this.contextMenuStrip_removeitem.Text = "Remove Item"; - // - // toolStripMenuItem_removeitem - // - this.toolStripMenuItem_removeitem.Name = "toolStripMenuItem_removeitem"; - this.toolStripMenuItem_removeitem.Size = new System.Drawing.Size(144, 22); - this.toolStripMenuItem_removeitem.Tag = "remove"; - this.toolStripMenuItem_removeitem.Text = "Remove Item"; - // - // toolStripMenuItem_insert - // - this.toolStripMenuItem_insert.Name = "toolStripMenuItem_insert"; - this.toolStripMenuItem_insert.Size = new System.Drawing.Size(144, 22); - this.toolStripMenuItem_insert.Tag = "insert"; - this.toolStripMenuItem_insert.Text = "Insert Item"; - // - // grid1 - // - this.grid1.AllowDrop = true; - this.grid1.AutoSize = true; - this.grid1.DefaultWidth = 18; - this.grid1.Dock = System.Windows.Forms.DockStyle.Fill; - this.grid1.EnableSort = false; - this.grid1.Location = new System.Drawing.Point(3, 16); - this.grid1.Margin = new System.Windows.Forms.Padding(2); - this.grid1.Name = "grid1"; - this.grid1.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; - this.grid1.SelectionMode = SourceGrid.GridSelectionMode.Cell; - this.grid1.Size = new System.Drawing.Size(1004, 166); - this.grid1.TabIndex = 12; - this.grid1.TabStop = true; - this.grid1.ToolTipText = ""; - this.grid1.DragDrop += new System.Windows.Forms.DragEventHandler(this.grid1_DragDrop); - this.grid1.DragEnter += new System.Windows.Forms.DragEventHandler(this.grid1_DragEnter); - this.grid1.DragOver += new System.Windows.Forms.DragEventHandler(this.grid1_DragOver); - // - // button_down - // - this.button_down.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.button_down.Location = new System.Drawing.Point(91, 409); - this.button_down.Margin = new System.Windows.Forms.Padding(2); - this.button_down.Name = "button_down"; - this.button_down.Size = new System.Drawing.Size(102, 31); - this.button_down.TabIndex = 14; - this.button_down.Text = "Zoom Out"; - this.button_down.UseVisualStyleBackColor = true; - this.button_down.Click += new System.EventHandler(this.button_down_Click); - // - // groupBox2 - // - this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox2.AutoSize = true; - this.groupBox2.Controls.Add(this.grid1); - this.groupBox2.Location = new System.Drawing.Point(5, 219); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(1010, 185); - this.groupBox2.TabIndex = 17; - this.groupBox2.TabStop = false; - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.listView_TXPDO); - this.groupBox3.Location = new System.Drawing.Point(5, 7); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(593, 205); - this.groupBox3.TabIndex = 15; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Available Objects for PDO"; - // - // DevicePDOView2 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoScroll = true; - this.AutoSize = true; - this.Controls.Add(this.groupBox3); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.button_addPDO); - this.Controls.Add(this.button_savepdochanges); - this.Controls.Add(this.button_deletePDO); - this.Controls.Add(this.groupBox2); - this.Controls.Add(this.button_up); - this.Controls.Add(this.button_down); - this.Margin = new System.Windows.Forms.Padding(2); - this.Name = "DevicePDOView2"; - this.Size = new System.Drawing.Size(1021, 441); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.contextMenuStrip_removeitem.ResumeLayout(false); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.groupBox3.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - + this.components = new System.ComponentModel.Container(); + this.button_addPDO = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.textBox_mapping = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.checkBox_invalidpdo = new System.Windows.Forms.CheckBox(); + this.textBox_slot = new System.Windows.Forms.TextBox(); + this.textBox_syncstart = new System.Windows.Forms.TextBox(); + this.textBox_eventtimer = new System.Windows.Forms.TextBox(); + this.textBox_inhibit = new System.Windows.Forms.TextBox(); + this.textBox_type = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.textBox_cob = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.button_savepdochanges = new System.Windows.Forms.Button(); + this.button_deletePDO = new System.Windows.Forms.Button(); + this.listView_TXPDO = new System.Windows.Forms.ListView(); + this.columnHeader13 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader15 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader16 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader17 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.button_up = new System.Windows.Forms.Button(); + this.contextMenuStrip_removeitem = new System.Windows.Forms.ContextMenuStrip(this.components); + this.toolStripMenuItem_removeitem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem_insert = new System.Windows.Forms.ToolStripMenuItem(); + this.grid1 = new SourceGrid.Grid(); + this.button_down = new System.Windows.Forms.Button(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.groupBox1.SuspendLayout(); + this.contextMenuStrip_removeitem.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // button_addPDO + // + this.button_addPDO.Image = global::ODEditor.Properties.Resources.action_add_16xLG; + this.button_addPDO.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.button_addPDO.Location = new System.Drawing.Point(912, 101); + this.button_addPDO.Name = "button_addPDO"; + this.button_addPDO.Size = new System.Drawing.Size(101, 27); + this.button_addPDO.TabIndex = 9; + this.button_addPDO.Text = "Add new PDO"; + this.button_addPDO.UseVisualStyleBackColor = true; + this.button_addPDO.Click += new System.EventHandler(this.button_addPDO_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.textBox_mapping); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.checkBox_invalidpdo); + this.groupBox1.Controls.Add(this.textBox_slot); + this.groupBox1.Controls.Add(this.textBox_syncstart); + this.groupBox1.Controls.Add(this.textBox_eventtimer); + this.groupBox1.Controls.Add(this.textBox_inhibit); + this.groupBox1.Controls.Add(this.textBox_type); + this.groupBox1.Controls.Add(this.label7); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.textBox_cob); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Location = new System.Drawing.Point(612, 7); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(283, 206); + this.groupBox1.TabIndex = 16; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Communication parameters"; + // + // textBox_mapping + // + this.textBox_mapping.Location = new System.Drawing.Point(98, 47); + this.textBox_mapping.Name = "textBox_mapping"; + this.textBox_mapping.ReadOnly = true; + this.textBox_mapping.Size = new System.Drawing.Size(96, 20); + this.textBox_mapping.TabIndex = 2; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(8, 50); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(48, 13); + this.label1.TabIndex = 10; + this.label1.Text = "Mapping"; + // + // checkBox_invalidpdo + // + this.checkBox_invalidpdo.AutoSize = true; + this.checkBox_invalidpdo.Location = new System.Drawing.Point(214, 183); + this.checkBox_invalidpdo.Name = "checkBox_invalidpdo"; + this.checkBox_invalidpdo.Size = new System.Drawing.Size(57, 17); + this.checkBox_invalidpdo.TabIndex = 8; + this.checkBox_invalidpdo.Text = "Invalid"; + this.checkBox_invalidpdo.UseVisualStyleBackColor = true; + this.checkBox_invalidpdo.CheckedChanged += new System.EventHandler(this.checkBox_invalidpdo_CheckedChanged); + // + // textBox_slot + // + this.textBox_slot.Location = new System.Drawing.Point(98, 20); + this.textBox_slot.Name = "textBox_slot"; + this.textBox_slot.Size = new System.Drawing.Size(96, 20); + this.textBox_slot.TabIndex = 1; + // + // textBox_syncstart + // + this.textBox_syncstart.Location = new System.Drawing.Point(98, 181); + this.textBox_syncstart.Name = "textBox_syncstart"; + this.textBox_syncstart.Size = new System.Drawing.Size(96, 20); + this.textBox_syncstart.TabIndex = 7; + // + // textBox_eventtimer + // + this.textBox_eventtimer.Location = new System.Drawing.Point(98, 154); + this.textBox_eventtimer.Name = "textBox_eventtimer"; + this.textBox_eventtimer.Size = new System.Drawing.Size(96, 20); + this.textBox_eventtimer.TabIndex = 6; + // + // textBox_inhibit + // + this.textBox_inhibit.Location = new System.Drawing.Point(98, 128); + this.textBox_inhibit.Name = "textBox_inhibit"; + this.textBox_inhibit.Size = new System.Drawing.Size(96, 20); + this.textBox_inhibit.TabIndex = 5; + // + // textBox_type + // + this.textBox_type.Location = new System.Drawing.Point(98, 101); + this.textBox_type.Name = "textBox_type"; + this.textBox_type.Size = new System.Drawing.Size(96, 20); + this.textBox_type.TabIndex = 4; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(10, 184); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(54, 13); + this.label7.TabIndex = 6; + this.label7.Text = "Sync start"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(10, 131); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(35, 13); + this.label6.TabIndex = 5; + this.label6.Text = "Inhibit"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(10, 158); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(64, 13); + this.label5.TabIndex = 4; + this.label5.Text = "Event Timer"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(10, 104); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(31, 13); + this.label4.TabIndex = 3; + this.label4.Text = "Type"; + // + // textBox_cob + // + this.textBox_cob.Location = new System.Drawing.Point(98, 74); + this.textBox_cob.Name = "textBox_cob"; + this.textBox_cob.Size = new System.Drawing.Size(96, 20); + this.textBox_cob.TabIndex = 3; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(10, 77); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(29, 13); + this.label3.TabIndex = 1; + this.label3.Text = "COB"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(8, 24); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(79, 13); + this.label2.TabIndex = 0; + this.label2.Text = "Communication"; + // + // button_savepdochanges + // + this.button_savepdochanges.Image = global::ODEditor.Properties.Resources.Save_6530; + this.button_savepdochanges.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.button_savepdochanges.Location = new System.Drawing.Point(912, 177); + this.button_savepdochanges.Name = "button_savepdochanges"; + this.button_savepdochanges.Size = new System.Drawing.Size(101, 27); + this.button_savepdochanges.TabIndex = 11; + this.button_savepdochanges.Text = "Save "; + this.button_savepdochanges.UseVisualStyleBackColor = true; + this.button_savepdochanges.Click += new System.EventHandler(this.button_savepdochanges_Click_1); + // + // button_deletePDO + // + this.button_deletePDO.Image = global::ODEditor.Properties.Resources.Remove_16xLG; + this.button_deletePDO.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.button_deletePDO.Location = new System.Drawing.Point(912, 138); + this.button_deletePDO.Name = "button_deletePDO"; + this.button_deletePDO.Size = new System.Drawing.Size(101, 27); + this.button_deletePDO.TabIndex = 10; + this.button_deletePDO.Text = "Delete PDO"; + this.button_deletePDO.UseVisualStyleBackColor = true; + this.button_deletePDO.Click += new System.EventHandler(this.button_deletePDO_Click); + // + // listView_TXPDO + // + this.listView_TXPDO.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader13, + this.columnHeader15, + this.columnHeader16, + this.columnHeader17, + this.columnHeader1}); + this.listView_TXPDO.FullRowSelect = true; + this.listView_TXPDO.HideSelection = false; + this.listView_TXPDO.Location = new System.Drawing.Point(6, 19); + this.listView_TXPDO.MultiSelect = false; + this.listView_TXPDO.Name = "listView_TXPDO"; + this.listView_TXPDO.Size = new System.Drawing.Size(587, 182); + this.listView_TXPDO.TabIndex = 0; + this.listView_TXPDO.UseCompatibleStateImageBehavior = false; + this.listView_TXPDO.View = System.Windows.Forms.View.Details; + this.listView_TXPDO.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.listView_TXPDO_ItemDrag); + this.listView_TXPDO.SelectedIndexChanged += new System.EventHandler(this.listView_TXPDO_SelectedIndexChanged); + // + // columnHeader13 + // + this.columnHeader13.Text = "Index"; + this.columnHeader13.Width = 55; + // + // columnHeader15 + // + this.columnHeader15.Text = "Sub"; + this.columnHeader15.Width = 40; + // + // columnHeader16 + // + this.columnHeader16.Text = "Name"; + this.columnHeader16.Width = 206; + // + // columnHeader17 + // + this.columnHeader17.Text = "Datatype"; + this.columnHeader17.Width = 183; + // + // columnHeader1 + // + this.columnHeader1.Text = "Bits"; + // + // button_up + // + this.button_up.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.button_up.Location = new System.Drawing.Point(2, 409); + this.button_up.Margin = new System.Windows.Forms.Padding(2); + this.button_up.Name = "button_up"; + this.button_up.Size = new System.Drawing.Size(85, 30); + this.button_up.TabIndex = 13; + this.button_up.Text = "Zoom In"; + this.button_up.UseVisualStyleBackColor = true; + this.button_up.Click += new System.EventHandler(this.button_up_Click); + // + // contextMenuStrip_removeitem + // + this.contextMenuStrip_removeitem.ImageScalingSize = new System.Drawing.Size(20, 20); + this.contextMenuStrip_removeitem.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItem_removeitem, + this.toolStripMenuItem_insert}); + this.contextMenuStrip_removeitem.Name = "contextMenuStrip_removeitem"; + this.contextMenuStrip_removeitem.Size = new System.Drawing.Size(145, 48); + this.contextMenuStrip_removeitem.Text = "Remove Item"; + // + // toolStripMenuItem_removeitem + // + this.toolStripMenuItem_removeitem.Name = "toolStripMenuItem_removeitem"; + this.toolStripMenuItem_removeitem.Size = new System.Drawing.Size(144, 22); + this.toolStripMenuItem_removeitem.Tag = "remove"; + this.toolStripMenuItem_removeitem.Text = "Remove Item"; + // + // toolStripMenuItem_insert + // + this.toolStripMenuItem_insert.Name = "toolStripMenuItem_insert"; + this.toolStripMenuItem_insert.Size = new System.Drawing.Size(144, 22); + this.toolStripMenuItem_insert.Tag = "insert"; + this.toolStripMenuItem_insert.Text = "Insert Item"; + // + // grid1 + // + this.grid1.AllowDrop = true; + this.grid1.AutoSize = true; + this.grid1.DefaultWidth = 18; + this.grid1.Dock = System.Windows.Forms.DockStyle.Fill; + this.grid1.EnableSort = false; + this.grid1.Location = new System.Drawing.Point(3, 16); + this.grid1.Margin = new System.Windows.Forms.Padding(2); + this.grid1.Name = "grid1"; + this.grid1.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; + this.grid1.SelectionMode = SourceGrid.GridSelectionMode.Cell; + this.grid1.Size = new System.Drawing.Size(1004, 166); + this.grid1.TabIndex = 12; + this.grid1.TabStop = true; + this.grid1.ToolTipText = ""; + this.grid1.DragDrop += new System.Windows.Forms.DragEventHandler(this.grid1_DragDrop); + this.grid1.DragEnter += new System.Windows.Forms.DragEventHandler(this.grid1_DragEnter); + this.grid1.DragOver += new System.Windows.Forms.DragEventHandler(this.grid1_DragOver); + // + // button_down + // + this.button_down.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.button_down.Location = new System.Drawing.Point(91, 409); + this.button_down.Margin = new System.Windows.Forms.Padding(2); + this.button_down.Name = "button_down"; + this.button_down.Size = new System.Drawing.Size(102, 31); + this.button_down.TabIndex = 14; + this.button_down.Text = "Zoom Out"; + this.button_down.UseVisualStyleBackColor = true; + this.button_down.Click += new System.EventHandler(this.button_down_Click); + // + // groupBox2 + // + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.AutoSize = true; + this.groupBox2.Controls.Add(this.grid1); + this.groupBox2.Location = new System.Drawing.Point(5, 219); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(1010, 185); + this.groupBox2.TabIndex = 17; + this.groupBox2.TabStop = false; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.listView_TXPDO); + this.groupBox3.Location = new System.Drawing.Point(5, 7); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(593, 205); + this.groupBox3.TabIndex = 15; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Available Objects for PDO"; + // + // DevicePDOView2 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScroll = true; + this.AutoSize = true; + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.button_addPDO); + this.Controls.Add(this.button_savepdochanges); + this.Controls.Add(this.button_deletePDO); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.button_up); + this.Controls.Add(this.button_down); + this.Margin = new System.Windows.Forms.Padding(2); + this.Name = "DevicePDOView2"; + this.Size = new System.Drawing.Size(1021, 441); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.contextMenuStrip_removeitem.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + } #endregion @@ -444,10 +444,10 @@ private void InitializeComponent() private System.Windows.Forms.TextBox textBox_mapping; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button button_savepdochanges; - private System.Windows.Forms.ColumnHeader columnHeader1; - private SourceGrid.Grid grid1; - private System.Windows.Forms.Button button_down; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.ColumnHeader columnHeader1; + private SourceGrid.Grid grid1; + private System.Windows.Forms.Button button_down; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.GroupBox groupBox3; } } diff --git a/EDSEditorGUI/DevicePDOView2.cs b/EDSEditorGUI/DevicePDOView2.cs index ed6b2842..71934fce 100644 --- a/EDSEditorGUI/DevicePDOView2.cs +++ b/EDSEditorGUI/DevicePDOView2.cs @@ -22,9 +22,9 @@ public partial class DevicePDOView2 : MyTabUserControl StringCollection TXchoices = new StringCollection(); string[] srray; - PDOSlot selectedslot = null; - - CellBackColorAlternate viewNormal = new CellBackColorAlternate(Color.Khaki, Color.DarkKhaki); + PDOSlot selectedslot = null; + + CellBackColorAlternate viewNormal = new CellBackColorAlternate(Color.Khaki, Color.DarkKhaki); CellBackColorAlternate viewEmpty = new CellBackColorAlternate(Color.Gray, Color.Gray); CellBackColorAlternate viewCOB = new CellBackColorAlternate(Color.LightBlue, Color.Blue); @@ -66,8 +66,8 @@ public DevicePDOView2() } - grid1.Rows[0].Height = 30; - + grid1.Rows[0].Height = 30; + contextMenuStrip_removeitem.ItemClicked += ContextMenuStrip_removeitem_ItemClicked; Invalidated += DevicePDOView2_Invalidated; @@ -97,13 +97,13 @@ private void ContextMenuStrip_removeitem_ItemClicked(object sender, ToolStripIte switch (e.ClickedItem.Tag) { - case "remove": - location.slot.Mapping.Remove(location.entry); - + case "remove": + location.slot.Mapping.Remove(location.entry); + break; - case "insert": - ODentry od = new ODentry(); + case "insert": + ODentry od = new ODentry(); location.slot.Mapping.Insert(location.ordinal, eds.dummy_ods[0x002]); break; @@ -118,9 +118,9 @@ private void ContextMenuStrip_removeitem_ItemClicked(object sender, ToolStripIte private void Vcc_ValueChangedEvent(object sender, EventArgs e) { - SourceGrid.CellContext cell = (SourceGrid.CellContext)sender; - - // "0x3100/05/BUTTONS2" + SourceGrid.CellContext cell = (SourceGrid.CellContext)sender; + + // "0x3100/05/BUTTONS2" string[] bits = cell.Value.ToString().Split('/'); UInt16 newindex = EDSsharp.ConvertToUInt16(bits[0]); @@ -133,12 +133,12 @@ private void Vcc_ValueChangedEvent(object sender, EventArgs e) PDOlocator location = (PDOlocator)((SourceGrid.Cells.Cell)cell.Cell).Tag; PDOSlot slot = location.slot; - ODentry newentry = null; - + ODentry newentry = null; + if (eds.tryGetODEntry(newindex, out newentry)) { if (newsubindex != 0) - newentry = newentry.subobjects[newsubindex]; + newentry = newentry.subobjects[newsubindex]; } else { @@ -179,9 +179,9 @@ SourceGrid.Cells.ICellVirtual getItemAtGridPoint(Point P, out int foundrow, out int x2 = 0; foundcol = 0; int outofview = 0; - for (int i = 0; i < grid1.HScrollBar.Value; i++) - { - outofview += grid1.Columns.GetWidth(i); + for (int i = 0; i < grid1.HScrollBar.Value; i++) + { + outofview += grid1.Columns.GetWidth(i); } x2 = -outofview; @@ -194,8 +194,8 @@ SourceGrid.Cells.ICellVirtual getItemAtGridPoint(Point P, out int foundrow, out foundcol = col.Index; } x2 += col.Width; - } - + } + Console.WriteLine(string.Format("Found grid at {0}x{1}", foundcol, foundrow)); SourceGrid.Cells.ICellVirtual v = grid1.GetCell(foundrow, foundcol); @@ -212,19 +212,19 @@ private void Grid1_Click(object sender, EventArgs e) int foundrow, foundcol; SourceGrid.Cells.ICellVirtual v = getItemAtGridPoint(ma.Location, out foundrow, out foundcol); - - //// DEBUG code: Create ToolTip with col, row and hscroll.value - //ToolTip toolTip1 = new ToolTip(); - //if (ma.Button == MouseButtons.Left) - //{ - // Point loc = new Point(0, 0); - // loc.X = foundcol; - // loc.Y = foundrow; - // // Force the ToolTip text to be displayed whether or not the form is active. - // toolTip1.ShowAlways = true; - // toolTip1.Show(loc.ToString() + ", " + grid1.HScrollBar.Value.ToString(), grid1, ma.Location); - //} - + + //// DEBUG code: Create ToolTip with col, row and hscroll.value + //ToolTip toolTip1 = new ToolTip(); + //if (ma.Button == MouseButtons.Left) + //{ + // Point loc = new Point(0, 0); + // loc.X = foundcol; + // loc.Y = foundrow; + // // Force the ToolTip text to be displayed whether or not the form is active. + // toolTip1.ShowAlways = true; + // toolTip1.Show(loc.ToString() + ", " + grid1.HScrollBar.Value.ToString(), grid1, ma.Location); + //} + grid1.Selection.ResetSelection(false); grid1.Selection.SelectRow(foundrow, true); @@ -249,7 +249,7 @@ private void Grid1_Click(object sender, EventArgs e) { textBox_inhibit.Enabled = true; textBox_syncstart.Enabled = true; - } + } textBox_eventtimer.Enabled = true; textBox_type.Enabled = true; textBox_cob.Enabled = true; @@ -258,10 +258,10 @@ private void Grid1_Click(object sender, EventArgs e) button_savepdochanges.Enabled = true; //Is invalid bit set - checkBox_invalidpdo.Checked = slot.invalid; - - - + checkBox_invalidpdo.Checked = slot.invalid; + + + } } @@ -280,9 +280,9 @@ public void Init(bool isTX) } } - public libEDSsharp.EDSsharp eds; - - + public libEDSsharp.EDSsharp eds; + + public void addPDOchoices() { @@ -363,11 +363,11 @@ public void UpdatePDOinfo(bool updatechoices = true) { int savVScrollValue = 0; - if (!updatechoices) - savVScrollValue = grid1.VScrollBar.Value; - - button_savepdochanges.Enabled = (textBox_slot.Text != ""); - + if (!updatechoices) + savVScrollValue = grid1.VScrollBar.Value; + + button_savepdochanges.Enabled = (textBox_slot.Text != ""); + updateslotdisplay(); if (eds == null) @@ -377,9 +377,9 @@ public void UpdatePDOinfo(bool updatechoices = true) addPDOchoices(); if (grid1.RowsCount > 2) - grid1.Rows.RemoveRange(2, grid1.RowsCount - 2); - - + grid1.Rows.RemoveRange(2, grid1.RowsCount - 2); + + TXchoices.Clear(); foreach (ODentry od in eds.dummy_ods.Values) @@ -458,7 +458,7 @@ public void UpdatePDOinfo(bool updatechoices = true) int ordinal = 0; foreach (ODentry entry in slot.Mapping) { - { + { string target = slot.getTargetName(entry); grid1[row + 2, bitoff + 3] = new SourceGrid.Cells.Cell(target, comboStandard); grid1[row + 2, bitoff + 3].ColumnSpan = entry.Sizeofdatatype(); @@ -478,12 +478,12 @@ public void UpdatePDOinfo(bool updatechoices = true) grid1[row + 2, bitoff + 3].AddController(vcc); bitoff += entry.Sizeofdatatype(); - } - + } + ordinal++; - if (bitoff > 64) { - MessageBox.Show(string.Format("Invalid TXPDO mapping parameters in 0x{0:X}. Trying to map more than 64 bit (8 Bytes). CAN message maximum lenght is 8 Byte", slot.ConfigurationIndex)); + if (bitoff > 64) { + MessageBox.Show(string.Format("Invalid TXPDO mapping parameters in 0x{0:X}. Trying to map more than 64 bit (8 Bytes). CAN message maximum lenght is 8 Byte", slot.ConfigurationIndex)); break; } @@ -513,9 +513,9 @@ public void UpdatePDOinfo(bool updatechoices = true) } row++; - } - - if (!updatechoices) + } + + if (!updatechoices) grid1.VScrollBar.Value = savVScrollValue; } @@ -526,8 +526,8 @@ private void ComboStandard_Changed(object sender, EventArgs e) } public void redrawtable() - { - + { + } private class MyHeader : SourceGrid.Cells.ColumnHeader @@ -637,9 +637,9 @@ protected override void PrepareView(SourceGrid.CellContext context) } private void listView_TXPDO_ItemDrag(object sender, ItemDragEventArgs e) - { - - + { + + List entries = new List(); foreach (ListViewItem item in listView_TXPDO.SelectedItems) @@ -652,10 +652,10 @@ private void listView_TXPDO_ItemDrag(object sender, ItemDragEventArgs e) data.SetData(entries.ToArray()); listView_TXPDO.DoDragDrop(data, DragDropEffects.Copy); - } - - - + } + + + private void grid1_DragOver(object sender, DragEventArgs e) { Point p = grid1.PointToClient(new Point(e.X, e.Y)); @@ -692,7 +692,7 @@ private void grid1_DragDrop(object sender, DragEventArgs e) foreach (ODentry entry in entries) { - location.slot.insertMapping(location.ordinal, entry); + location.slot.insertMapping(location.ordinal, entry); } helper.buildmappingsfromlists((ExporterFactory.Exporter)Properties.Settings.Default.ExporterType == ExporterFactory.Exporter.CANOPENNODE_V4); @@ -716,8 +716,8 @@ public override void OnValueChanged(CellContext sender, EventArgs e) handler?.Invoke(sender, e); base.OnValueChanged(sender, e); - } - + } + } private void button_deletePDO_Click(object sender, EventArgs e) @@ -817,12 +817,12 @@ private void button_savepdochanges_Click_1(object sender, EventArgs e) doUpdateOD(); UpdatePDOinfo(); - } - - private void listView_TXPDO_SelectedIndexChanged(object sender, EventArgs e) - { - } - } + + private void listView_TXPDO_SelectedIndexChanged(object sender, EventArgs e) + { + + } + } } \ No newline at end of file diff --git a/EDSEditorGUI/DeviceView.Designer.cs b/EDSEditorGUI/DeviceView.Designer.cs index 946aa401..80cde950 100644 --- a/EDSEditorGUI/DeviceView.Designer.cs +++ b/EDSEditorGUI/DeviceView.Designer.cs @@ -1,195 +1,195 @@ -namespace ODEditor -{ - partial class DeviceView - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeviceView)); - this.imageList1 = new System.Windows.Forms.ImageList(this.components); - this.tabPage4 = new System.Windows.Forms.TabPage(); - this.devicePDOView2 = new ODEditor.DevicePDOView2(); - this.tabPage3 = new System.Windows.Forms.TabPage(); - this.devicePDOView1 = new ODEditor.DevicePDOView2(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.deviceODView1 = new ODEditor.DeviceODView(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.deviceInfoView = new ODEditor.DeviceInfoView(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage4.SuspendLayout(); - this.tabPage3.SuspendLayout(); - this.tabPage2.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.tabControl1.SuspendLayout(); - this.SuspendLayout(); - // - // imageList1 - // - this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); - this.imageList1.TransparentColor = System.Drawing.Color.Transparent; - this.imageList1.Images.SetKeyName(0, "ListBox_686.png"); - this.imageList1.Images.SetKeyName(1, "notebook_16xLG.png"); - this.imageList1.Images.SetKeyName(2, "Output_16xLG.png"); - this.imageList1.Images.SetKeyName(3, "SingleInput_8170_16x.png"); - // - // tabPage4 - // - this.tabPage4.Controls.Add(this.devicePDOView2); - this.tabPage4.ImageIndex = 3; - this.tabPage4.Location = new System.Drawing.Point(4, 25); - this.tabPage4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.tabPage4.Name = "tabPage4"; - this.tabPage4.Size = new System.Drawing.Size(1114, 746); - this.tabPage4.TabIndex = 3; - this.tabPage4.Text = "RX PDO Mapping"; - this.tabPage4.UseVisualStyleBackColor = true; - // - // devicePDOView2 - // - this.devicePDOView2.AutoScroll = true; - this.devicePDOView2.AutoSize = true; - this.devicePDOView2.Dock = System.Windows.Forms.DockStyle.Fill; - this.devicePDOView2.Location = new System.Drawing.Point(0, 0); - this.devicePDOView2.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); - this.devicePDOView2.Name = "devicePDOView2"; - this.devicePDOView2.Size = new System.Drawing.Size(1114, 746); - this.devicePDOView2.TabIndex = 0; - // - // tabPage3 - // - this.tabPage3.Controls.Add(this.devicePDOView1); - this.tabPage3.ImageIndex = 2; - this.tabPage3.Location = new System.Drawing.Point(4, 25); - this.tabPage3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.tabPage3.Name = "tabPage3"; - this.tabPage3.Size = new System.Drawing.Size(1030, 746); - this.tabPage3.TabIndex = 2; - this.tabPage3.Text = "TX PDO Mapping"; - this.tabPage3.UseVisualStyleBackColor = true; - // - // devicePDOView1 - // - this.devicePDOView1.AutoScroll = true; - this.devicePDOView1.AutoSize = true; - this.devicePDOView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.devicePDOView1.Location = new System.Drawing.Point(0, 0); - this.devicePDOView1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); - this.devicePDOView1.Name = "devicePDOView1"; - this.devicePDOView1.Size = new System.Drawing.Size(1030, 746); - this.devicePDOView1.TabIndex = 0; - // - // tabPage2 - // - this.tabPage2.Controls.Add(this.deviceODView1); - this.tabPage2.ImageIndex = 0; - this.tabPage2.Location = new System.Drawing.Point(4, 25); - this.tabPage2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.tabPage2.Size = new System.Drawing.Size(1114, 746); - this.tabPage2.TabIndex = 0; - this.tabPage2.Text = "Object Dictionary"; - this.tabPage2.UseVisualStyleBackColor = true; - // - // deviceODView1 - // - this.deviceODView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.deviceODView1.Location = new System.Drawing.Point(4, 4); - this.deviceODView1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); - this.deviceODView1.Name = "deviceODView1"; - this.deviceODView1.Size = new System.Drawing.Size(1108, 740); - this.deviceODView1.TabIndex = 0; - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.deviceInfoView); - this.tabPage1.ImageIndex = 1; - this.tabPage1.Location = new System.Drawing.Point(4, 25); - this.tabPage1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.tabPage1.Size = new System.Drawing.Size(1114, 746); - this.tabPage1.TabIndex = 1; - this.tabPage1.Text = "Device Info"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // deviceInfoView - // - this.deviceInfoView.Dock = System.Windows.Forms.DockStyle.Fill; - this.deviceInfoView.Location = new System.Drawing.Point(4, 4); - this.deviceInfoView.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); - this.deviceInfoView.Name = "deviceInfoView"; - this.deviceInfoView.Size = new System.Drawing.Size(1108, 740); - this.deviceInfoView.TabIndex = 0; - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Controls.Add(this.tabPage2); - this.tabControl1.Controls.Add(this.tabPage3); - this.tabControl1.Controls.Add(this.tabPage4); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.ImageList = this.imageList1; - this.tabControl1.Location = new System.Drawing.Point(0, 0); - this.tabControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(1038, 773); - this.tabControl1.TabIndex = 1; - // - // DeviceView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.tabControl1); - this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.Name = "DeviceView"; - this.Size = new System.Drawing.Size(1038, 773); - this.tabPage4.ResumeLayout(false); - this.tabPage4.PerformLayout(); - this.tabPage3.ResumeLayout(false); - this.tabPage3.PerformLayout(); - this.tabPage2.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.tabControl1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - private System.Windows.Forms.ImageList imageList1; - private System.Windows.Forms.TabPage tabPage4; - private DevicePDOView2 devicePDOView2; - private System.Windows.Forms.TabPage tabPage3; - private DevicePDOView2 devicePDOView1; - private System.Windows.Forms.TabPage tabPage2; - private DeviceODView deviceODView1; - private System.Windows.Forms.TabPage tabPage1; - private DeviceInfoView deviceInfoView; - private System.Windows.Forms.TabControl tabControl1; - } -} +namespace ODEditor +{ + partial class DeviceView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeviceView)); + this.imageList1 = new System.Windows.Forms.ImageList(this.components); + this.tabPage4 = new System.Windows.Forms.TabPage(); + this.devicePDOView2 = new ODEditor.DevicePDOView2(); + this.tabPage3 = new System.Windows.Forms.TabPage(); + this.devicePDOView1 = new ODEditor.DevicePDOView2(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.deviceODView1 = new ODEditor.DeviceODView(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.deviceInfoView = new ODEditor.DeviceInfoView(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage4.SuspendLayout(); + this.tabPage3.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.SuspendLayout(); + // + // imageList1 + // + this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); + this.imageList1.TransparentColor = System.Drawing.Color.Transparent; + this.imageList1.Images.SetKeyName(0, "ListBox_686.png"); + this.imageList1.Images.SetKeyName(1, "notebook_16xLG.png"); + this.imageList1.Images.SetKeyName(2, "Output_16xLG.png"); + this.imageList1.Images.SetKeyName(3, "SingleInput_8170_16x.png"); + // + // tabPage4 + // + this.tabPage4.Controls.Add(this.devicePDOView2); + this.tabPage4.ImageIndex = 3; + this.tabPage4.Location = new System.Drawing.Point(4, 25); + this.tabPage4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabPage4.Name = "tabPage4"; + this.tabPage4.Size = new System.Drawing.Size(1114, 746); + this.tabPage4.TabIndex = 3; + this.tabPage4.Text = "RX PDO Mapping"; + this.tabPage4.UseVisualStyleBackColor = true; + // + // devicePDOView2 + // + this.devicePDOView2.AutoScroll = true; + this.devicePDOView2.AutoSize = true; + this.devicePDOView2.Dock = System.Windows.Forms.DockStyle.Fill; + this.devicePDOView2.Location = new System.Drawing.Point(0, 0); + this.devicePDOView2.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.devicePDOView2.Name = "devicePDOView2"; + this.devicePDOView2.Size = new System.Drawing.Size(1114, 746); + this.devicePDOView2.TabIndex = 0; + // + // tabPage3 + // + this.tabPage3.Controls.Add(this.devicePDOView1); + this.tabPage3.ImageIndex = 2; + this.tabPage3.Location = new System.Drawing.Point(4, 25); + this.tabPage3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Size = new System.Drawing.Size(1030, 746); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "TX PDO Mapping"; + this.tabPage3.UseVisualStyleBackColor = true; + // + // devicePDOView1 + // + this.devicePDOView1.AutoScroll = true; + this.devicePDOView1.AutoSize = true; + this.devicePDOView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.devicePDOView1.Location = new System.Drawing.Point(0, 0); + this.devicePDOView1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.devicePDOView1.Name = "devicePDOView1"; + this.devicePDOView1.Size = new System.Drawing.Size(1030, 746); + this.devicePDOView1.TabIndex = 0; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.deviceODView1); + this.tabPage2.ImageIndex = 0; + this.tabPage2.Location = new System.Drawing.Point(4, 25); + this.tabPage2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabPage2.Size = new System.Drawing.Size(1114, 746); + this.tabPage2.TabIndex = 0; + this.tabPage2.Text = "Object Dictionary"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // deviceODView1 + // + this.deviceODView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.deviceODView1.Location = new System.Drawing.Point(4, 4); + this.deviceODView1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.deviceODView1.Name = "deviceODView1"; + this.deviceODView1.Size = new System.Drawing.Size(1108, 740); + this.deviceODView1.TabIndex = 0; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.deviceInfoView); + this.tabPage1.ImageIndex = 1; + this.tabPage1.Location = new System.Drawing.Point(4, 25); + this.tabPage1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabPage1.Size = new System.Drawing.Size(1114, 746); + this.tabPage1.TabIndex = 1; + this.tabPage1.Text = "Device Info"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // deviceInfoView + // + this.deviceInfoView.Dock = System.Windows.Forms.DockStyle.Fill; + this.deviceInfoView.Location = new System.Drawing.Point(4, 4); + this.deviceInfoView.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.deviceInfoView.Name = "deviceInfoView"; + this.deviceInfoView.Size = new System.Drawing.Size(1108, 740); + this.deviceInfoView.TabIndex = 0; + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Controls.Add(this.tabPage3); + this.tabControl1.Controls.Add(this.tabPage4); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.ImageList = this.imageList1; + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(1038, 773); + this.tabControl1.TabIndex = 1; + // + // DeviceView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.tabControl1); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.Name = "DeviceView"; + this.Size = new System.Drawing.Size(1038, 773); + this.tabPage4.ResumeLayout(false); + this.tabPage4.PerformLayout(); + this.tabPage3.ResumeLayout(false); + this.tabPage3.PerformLayout(); + this.tabPage2.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabControl1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + private System.Windows.Forms.ImageList imageList1; + private System.Windows.Forms.TabPage tabPage4; + private DevicePDOView2 devicePDOView2; + private System.Windows.Forms.TabPage tabPage3; + private DevicePDOView2 devicePDOView1; + private System.Windows.Forms.TabPage tabPage2; + private DeviceODView deviceODView1; + private System.Windows.Forms.TabPage tabPage1; + private DeviceInfoView deviceInfoView; + private System.Windows.Forms.TabControl tabControl1; + } +} diff --git a/EDSEditorGUI/Form1.Designer.cs b/EDSEditorGUI/Form1.Designer.cs index 21d3b870..6ef5774d 100644 --- a/EDSEditorGUI/Form1.Designer.cs +++ b/EDSEditorGUI/Form1.Designer.cs @@ -28,308 +28,308 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ODEditor_MainForm)); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openCanOpenNodeXMLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); - this.loadNetworkXmlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveNetworkXmlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); - this.mnuRecentlyUsed = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.exportDeviceFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.exportCanOpenNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveExportAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.closeFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.quitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.insertToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.reportsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.documentationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.networkPDOToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.menuStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // menuStrip1 - // - this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.insertToolStripMenuItem, - this.reportsToolStripMenuItem, - this.toolsToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(1599, 28); - this.menuStrip1.TabIndex = 1; - this.menuStrip1.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newToolStripMenuItem, - this.openCanOpenNodeXMLToolStripMenuItem, - this.saveProjectToolStripMenuItem, - this.saveAsToolStripMenuItem, - this.toolStripSeparator3, - this.loadNetworkXmlToolStripMenuItem, - this.saveNetworkXmlToolStripMenuItem, - this.toolStripSeparator6, - this.mnuRecentlyUsed, - this.toolStripSeparator1, - this.exportDeviceFileToolStripMenuItem, - this.exportCanOpenNodeToolStripMenuItem, - this.saveExportAllToolStripMenuItem, - this.toolStripSeparator2, - this.closeFileToolStripMenuItem, - this.toolStripSeparator4, - this.quitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); - this.fileToolStripMenuItem.Text = "&File"; - // - // newToolStripMenuItem - // - this.newToolStripMenuItem.Image = global::ODEditor.Properties.Resources.NewFile_6276; - this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.newToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.newToolStripMenuItem.Text = "&New"; - this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); - // - // openCanOpenNodeXMLToolStripMenuItem - // - this.openCanOpenNodeXMLToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Open_6529; - this.openCanOpenNodeXMLToolStripMenuItem.Name = "openCanOpenNodeXMLToolStripMenuItem"; - this.openCanOpenNodeXMLToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openCanOpenNodeXMLToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.openCanOpenNodeXMLToolStripMenuItem.Text = "&Open"; - this.openCanOpenNodeXMLToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); - // - // saveProjectToolStripMenuItem - // - this.saveProjectToolStripMenuItem.Enabled = false; - this.saveProjectToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Save_6530; - this.saveProjectToolStripMenuItem.Name = "saveProjectToolStripMenuItem"; - this.saveProjectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveProjectToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.saveProjectToolStripMenuItem.Text = "&Save Project"; - this.saveProjectToolStripMenuItem.Click += new System.EventHandler(this.saveProjectToolStripMenuItem_Click); - // - // saveAsToolStripMenuItem - // - this.saveAsToolStripMenuItem.Enabled = false; - this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) - | System.Windows.Forms.Keys.S))); - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.saveAsToolStripMenuItem.Text = "Save &Project As..."; - this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(356, 6); - // - // loadNetworkXmlToolStripMenuItem - // - this.loadNetworkXmlToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Open_6529; - this.loadNetworkXmlToolStripMenuItem.Name = "loadNetworkXmlToolStripMenuItem"; - this.loadNetworkXmlToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.loadNetworkXmlToolStripMenuItem.Text = "Open &Network XML"; - this.loadNetworkXmlToolStripMenuItem.Click += new System.EventHandler(this.loadNetworkXmlToolStripMenuItem_Click); - // - // saveNetworkXmlToolStripMenuItem - // - this.saveNetworkXmlToolStripMenuItem.Enabled = false; - this.saveNetworkXmlToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Save_6530; - this.saveNetworkXmlToolStripMenuItem.Name = "saveNetworkXmlToolStripMenuItem"; - this.saveNetworkXmlToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.saveNetworkXmlToolStripMenuItem.Text = "Save Networ&k XML"; - this.saveNetworkXmlToolStripMenuItem.Click += new System.EventHandler(this.saveNetworkXmlToolStripMenuItem_Click); - // - // toolStripSeparator6 - // - this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(356, 6); - // - // mnuRecentlyUsed - // - this.mnuRecentlyUsed.Name = "mnuRecentlyUsed"; - this.mnuRecentlyUsed.Size = new System.Drawing.Size(359, 26); - this.mnuRecentlyUsed.Text = "&Recent Files"; - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(356, 6); - // - // exportDeviceFileToolStripMenuItem - // - this.exportDeviceFileToolStripMenuItem.Enabled = false; - this.exportDeviceFileToolStripMenuItem.Name = "exportDeviceFileToolStripMenuItem"; - this.exportDeviceFileToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); - this.exportDeviceFileToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.exportDeviceFileToolStripMenuItem.Text = "&Export..."; - this.exportDeviceFileToolStripMenuItem.Click += new System.EventHandler(this.exportDeviceFileToolStripMenuItem_Click); - // - // exportCanOpenNodeToolStripMenuItem - // - this.exportCanOpenNodeToolStripMenuItem.Enabled = false; - this.exportCanOpenNodeToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("exportCanOpenNodeToolStripMenuItem.Image"))); - this.exportCanOpenNodeToolStripMenuItem.Name = "exportCanOpenNodeToolStripMenuItem"; - this.exportCanOpenNodeToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.exportCanOpenNodeToolStripMenuItem.Text = "E&xport CanOpenNode..."; - this.exportCanOpenNodeToolStripMenuItem.Click += new System.EventHandler(this.exportCanOpenNodeToolStripMenuItem_Click); - // - // saveExportAllToolStripMenuItem - // - this.saveExportAllToolStripMenuItem.Enabled = false; - this.saveExportAllToolStripMenuItem.Name = "saveExportAllToolStripMenuItem"; - this.saveExportAllToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.saveExportAllToolStripMenuItem.Text = "Save &All"; - this.saveExportAllToolStripMenuItem.Click += new System.EventHandler(this.saveExportAllToolStripMenuItem_Click); - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(356, 6); - // - // closeFileToolStripMenuItem - // - this.closeFileToolStripMenuItem.Enabled = false; - this.closeFileToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Close_6519; - this.closeFileToolStripMenuItem.Name = "closeFileToolStripMenuItem"; - this.closeFileToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.closeFileToolStripMenuItem.Text = "&Close file"; - this.closeFileToolStripMenuItem.Click += new System.EventHandler(this.closeFileToolStripMenuItem_Click); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(356, 6); - // - // quitToolStripMenuItem - // - this.quitToolStripMenuItem.Image = global::ODEditor.Properties.Resources._305_Close_16x16_72; - this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; - this.quitToolStripMenuItem.Size = new System.Drawing.Size(359, 26); - this.quitToolStripMenuItem.Text = "&Quit"; - this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); - // - // insertToolStripMenuItem - // - this.insertToolStripMenuItem.Name = "insertToolStripMenuItem"; - this.insertToolStripMenuItem.Size = new System.Drawing.Size(106, 24); - this.insertToolStripMenuItem.Text = "&Insert Profile"; - // - // reportsToolStripMenuItem - // - this.reportsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.documentationToolStripMenuItem, - this.networkPDOToolStripMenuItem}); - this.reportsToolStripMenuItem.Name = "reportsToolStripMenuItem"; - this.reportsToolStripMenuItem.Size = new System.Drawing.Size(74, 24); - this.reportsToolStripMenuItem.Text = "&Reports"; - // - // documentationToolStripMenuItem - // - this.documentationToolStripMenuItem.Enabled = false; - this.documentationToolStripMenuItem.Image = global::ODEditor.Properties.Resources.ExporttoScript_9881; - this.documentationToolStripMenuItem.Name = "documentationToolStripMenuItem"; - this.documentationToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); - this.documentationToolStripMenuItem.Size = new System.Drawing.Size(339, 26); - this.documentationToolStripMenuItem.Text = "&Documentation"; - this.documentationToolStripMenuItem.Click += new System.EventHandler(this.documentationToolStripMenuItem_Click); - // - // networkPDOToolStripMenuItem - // - this.networkPDOToolStripMenuItem.Enabled = false; - this.networkPDOToolStripMenuItem.Image = global::ODEditor.Properties.Resources.ExporttoScript_9881; - this.networkPDOToolStripMenuItem.Name = "networkPDOToolStripMenuItem"; - this.networkPDOToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) - | System.Windows.Forms.Keys.P))); - this.networkPDOToolStripMenuItem.Size = new System.Drawing.Size(339, 26); - this.networkPDOToolStripMenuItem.Text = "&Network PDO"; - this.networkPDOToolStripMenuItem.Click += new System.EventHandler(this.networkPDOToolStripMenuItem_Click); - // - // toolsToolStripMenuItem - // - this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.preferencesToolStripMenuItem}); - this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - this.toolsToolStripMenuItem.Size = new System.Drawing.Size(58, 24); - this.toolsToolStripMenuItem.Text = "Tools"; - // - // preferencesToolStripMenuItem - // - this.preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem"; - this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(168, 26); - this.preferencesToolStripMenuItem.Text = "Preferences"; - this.preferencesToolStripMenuItem.Click += new System.EventHandler(this.preferencesToolStripMenuItem_Click); - // - // tabControl1 - // - this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Left; - this.tabControl1.AllowDrop = true; - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; - this.tabControl1.ItemSize = new System.Drawing.Size(24, 120); - this.tabControl1.Location = new System.Drawing.Point(0, 28); - this.tabControl1.Margin = new System.Windows.Forms.Padding(4); - this.tabControl1.Multiline = true; - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(1599, 909); - this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; - this.tabControl1.TabIndex = 2; - this.tabControl1.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControl1_DrawItem); - this.tabControl1.ControlAdded += new System.Windows.Forms.ControlEventHandler(this.tabControl1_ControlsChanged); - this.tabControl1.ControlRemoved += new System.Windows.Forms.ControlEventHandler(this.tabControl1_Controlsremoved); - this.tabControl1.DragDrop += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragDrop); - this.tabControl1.DragEnter += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragEnter); - this.tabControl1.DragOver += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragOver); - this.tabControl1.DragLeave += new System.EventHandler(this.ODEditor_MainForm_DragLeave); - this.tabControl1.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.ODEditor_MainForm_QueryContinueDrag); - // - // ODEditor_MainForm - // - this.AllowDrop = true; - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1599, 937); - this.Controls.Add(this.tabControl1); - this.Controls.Add(this.menuStrip1); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(4); - this.MinimumSize = new System.Drawing.Size(1560, 750); - this.Name = "ODEditor_MainForm"; - this.Text = "Object Dictionary Editor "; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ODEditor_MainForm_FormClosing); - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ODEditor_MainForm_FormClosed); - this.Load += new System.EventHandler(this.ODEditor_MainForm_Load); - this.DragDrop += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragDrop); - this.DragEnter += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragEnter); - this.DragOver += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragOver); - this.DragLeave += new System.EventHandler(this.ODEditor_MainForm_DragLeave); - this.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.ODEditor_MainForm_QueryContinueDrag); - this.MouseCaptureChanged += new System.EventHandler(this.ODEditor_MainForm_Leave); - this.MouseLeave += new System.EventHandler(this.ODEditor_MainForm_Leave); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ODEditor_MainForm)); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openCanOpenNodeXMLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveProjectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.loadNetworkXmlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveNetworkXmlToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); + this.mnuRecentlyUsed = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.exportDeviceFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportCanOpenNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveExportAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.closeFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.quitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.insertToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.reportsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.documentationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.networkPDOToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.insertToolStripMenuItem, + this.reportsToolStripMenuItem, + this.toolsToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(1599, 28); + this.menuStrip1.TabIndex = 1; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newToolStripMenuItem, + this.openCanOpenNodeXMLToolStripMenuItem, + this.saveProjectToolStripMenuItem, + this.saveAsToolStripMenuItem, + this.toolStripSeparator3, + this.loadNetworkXmlToolStripMenuItem, + this.saveNetworkXmlToolStripMenuItem, + this.toolStripSeparator6, + this.mnuRecentlyUsed, + this.toolStripSeparator1, + this.exportDeviceFileToolStripMenuItem, + this.exportCanOpenNodeToolStripMenuItem, + this.saveExportAllToolStripMenuItem, + this.toolStripSeparator2, + this.closeFileToolStripMenuItem, + this.toolStripSeparator4, + this.quitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); + this.fileToolStripMenuItem.Text = "&File"; + // + // newToolStripMenuItem + // + this.newToolStripMenuItem.Image = global::ODEditor.Properties.Resources.NewFile_6276; + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); + this.newToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.newToolStripMenuItem.Text = "&New"; + this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); + // + // openCanOpenNodeXMLToolStripMenuItem + // + this.openCanOpenNodeXMLToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Open_6529; + this.openCanOpenNodeXMLToolStripMenuItem.Name = "openCanOpenNodeXMLToolStripMenuItem"; + this.openCanOpenNodeXMLToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.openCanOpenNodeXMLToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.openCanOpenNodeXMLToolStripMenuItem.Text = "&Open"; + this.openCanOpenNodeXMLToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // saveProjectToolStripMenuItem + // + this.saveProjectToolStripMenuItem.Enabled = false; + this.saveProjectToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Save_6530; + this.saveProjectToolStripMenuItem.Name = "saveProjectToolStripMenuItem"; + this.saveProjectToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.saveProjectToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.saveProjectToolStripMenuItem.Text = "&Save Project"; + this.saveProjectToolStripMenuItem.Click += new System.EventHandler(this.saveProjectToolStripMenuItem_Click); + // + // saveAsToolStripMenuItem + // + this.saveAsToolStripMenuItem.Enabled = false; + this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + this.saveAsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.S))); + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.saveAsToolStripMenuItem.Text = "Save &Project As..."; + this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(356, 6); + // + // loadNetworkXmlToolStripMenuItem + // + this.loadNetworkXmlToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Open_6529; + this.loadNetworkXmlToolStripMenuItem.Name = "loadNetworkXmlToolStripMenuItem"; + this.loadNetworkXmlToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.loadNetworkXmlToolStripMenuItem.Text = "Open &Network XML"; + this.loadNetworkXmlToolStripMenuItem.Click += new System.EventHandler(this.loadNetworkXmlToolStripMenuItem_Click); + // + // saveNetworkXmlToolStripMenuItem + // + this.saveNetworkXmlToolStripMenuItem.Enabled = false; + this.saveNetworkXmlToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Save_6530; + this.saveNetworkXmlToolStripMenuItem.Name = "saveNetworkXmlToolStripMenuItem"; + this.saveNetworkXmlToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.saveNetworkXmlToolStripMenuItem.Text = "Save Networ&k XML"; + this.saveNetworkXmlToolStripMenuItem.Click += new System.EventHandler(this.saveNetworkXmlToolStripMenuItem_Click); + // + // toolStripSeparator6 + // + this.toolStripSeparator6.Name = "toolStripSeparator6"; + this.toolStripSeparator6.Size = new System.Drawing.Size(356, 6); + // + // mnuRecentlyUsed + // + this.mnuRecentlyUsed.Name = "mnuRecentlyUsed"; + this.mnuRecentlyUsed.Size = new System.Drawing.Size(359, 26); + this.mnuRecentlyUsed.Text = "&Recent Files"; + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(356, 6); + // + // exportDeviceFileToolStripMenuItem + // + this.exportDeviceFileToolStripMenuItem.Enabled = false; + this.exportDeviceFileToolStripMenuItem.Name = "exportDeviceFileToolStripMenuItem"; + this.exportDeviceFileToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); + this.exportDeviceFileToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.exportDeviceFileToolStripMenuItem.Text = "&Export..."; + this.exportDeviceFileToolStripMenuItem.Click += new System.EventHandler(this.exportDeviceFileToolStripMenuItem_Click); + // + // exportCanOpenNodeToolStripMenuItem + // + this.exportCanOpenNodeToolStripMenuItem.Enabled = false; + this.exportCanOpenNodeToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("exportCanOpenNodeToolStripMenuItem.Image"))); + this.exportCanOpenNodeToolStripMenuItem.Name = "exportCanOpenNodeToolStripMenuItem"; + this.exportCanOpenNodeToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.exportCanOpenNodeToolStripMenuItem.Text = "E&xport CanOpenNode..."; + this.exportCanOpenNodeToolStripMenuItem.Click += new System.EventHandler(this.exportCanOpenNodeToolStripMenuItem_Click); + // + // saveExportAllToolStripMenuItem + // + this.saveExportAllToolStripMenuItem.Enabled = false; + this.saveExportAllToolStripMenuItem.Name = "saveExportAllToolStripMenuItem"; + this.saveExportAllToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.saveExportAllToolStripMenuItem.Text = "Save &All"; + this.saveExportAllToolStripMenuItem.Click += new System.EventHandler(this.saveExportAllToolStripMenuItem_Click); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(356, 6); + // + // closeFileToolStripMenuItem + // + this.closeFileToolStripMenuItem.Enabled = false; + this.closeFileToolStripMenuItem.Image = global::ODEditor.Properties.Resources.Close_6519; + this.closeFileToolStripMenuItem.Name = "closeFileToolStripMenuItem"; + this.closeFileToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.closeFileToolStripMenuItem.Text = "&Close file"; + this.closeFileToolStripMenuItem.Click += new System.EventHandler(this.closeFileToolStripMenuItem_Click); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(356, 6); + // + // quitToolStripMenuItem + // + this.quitToolStripMenuItem.Image = global::ODEditor.Properties.Resources._305_Close_16x16_72; + this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; + this.quitToolStripMenuItem.Size = new System.Drawing.Size(359, 26); + this.quitToolStripMenuItem.Text = "&Quit"; + this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); + // + // insertToolStripMenuItem + // + this.insertToolStripMenuItem.Name = "insertToolStripMenuItem"; + this.insertToolStripMenuItem.Size = new System.Drawing.Size(106, 24); + this.insertToolStripMenuItem.Text = "&Insert Profile"; + // + // reportsToolStripMenuItem + // + this.reportsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.documentationToolStripMenuItem, + this.networkPDOToolStripMenuItem}); + this.reportsToolStripMenuItem.Name = "reportsToolStripMenuItem"; + this.reportsToolStripMenuItem.Size = new System.Drawing.Size(74, 24); + this.reportsToolStripMenuItem.Text = "&Reports"; + // + // documentationToolStripMenuItem + // + this.documentationToolStripMenuItem.Enabled = false; + this.documentationToolStripMenuItem.Image = global::ODEditor.Properties.Resources.ExporttoScript_9881; + this.documentationToolStripMenuItem.Name = "documentationToolStripMenuItem"; + this.documentationToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P))); + this.documentationToolStripMenuItem.Size = new System.Drawing.Size(339, 26); + this.documentationToolStripMenuItem.Text = "&Documentation"; + this.documentationToolStripMenuItem.Click += new System.EventHandler(this.documentationToolStripMenuItem_Click); + // + // networkPDOToolStripMenuItem + // + this.networkPDOToolStripMenuItem.Enabled = false; + this.networkPDOToolStripMenuItem.Image = global::ODEditor.Properties.Resources.ExporttoScript_9881; + this.networkPDOToolStripMenuItem.Name = "networkPDOToolStripMenuItem"; + this.networkPDOToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.P))); + this.networkPDOToolStripMenuItem.Size = new System.Drawing.Size(339, 26); + this.networkPDOToolStripMenuItem.Text = "&Network PDO"; + this.networkPDOToolStripMenuItem.Click += new System.EventHandler(this.networkPDOToolStripMenuItem_Click); + // + // toolsToolStripMenuItem + // + this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.preferencesToolStripMenuItem}); + this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; + this.toolsToolStripMenuItem.Size = new System.Drawing.Size(58, 24); + this.toolsToolStripMenuItem.Text = "Tools"; + // + // preferencesToolStripMenuItem + // + this.preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem"; + this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(168, 26); + this.preferencesToolStripMenuItem.Text = "Preferences"; + this.preferencesToolStripMenuItem.Click += new System.EventHandler(this.preferencesToolStripMenuItem_Click); + // + // tabControl1 + // + this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Left; + this.tabControl1.AllowDrop = true; + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; + this.tabControl1.ItemSize = new System.Drawing.Size(24, 120); + this.tabControl1.Location = new System.Drawing.Point(0, 28); + this.tabControl1.Margin = new System.Windows.Forms.Padding(4); + this.tabControl1.Multiline = true; + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(1599, 909); + this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + this.tabControl1.TabIndex = 2; + this.tabControl1.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControl1_DrawItem); + this.tabControl1.ControlAdded += new System.Windows.Forms.ControlEventHandler(this.tabControl1_ControlsChanged); + this.tabControl1.ControlRemoved += new System.Windows.Forms.ControlEventHandler(this.tabControl1_Controlsremoved); + this.tabControl1.DragDrop += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragDrop); + this.tabControl1.DragEnter += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragEnter); + this.tabControl1.DragOver += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragOver); + this.tabControl1.DragLeave += new System.EventHandler(this.ODEditor_MainForm_DragLeave); + this.tabControl1.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.ODEditor_MainForm_QueryContinueDrag); + // + // ODEditor_MainForm + // + this.AllowDrop = true; + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1599, 937); + this.Controls.Add(this.tabControl1); + this.Controls.Add(this.menuStrip1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4); + this.MinimumSize = new System.Drawing.Size(1560, 750); + this.Name = "ODEditor_MainForm"; + this.Text = "Object Dictionary Editor "; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ODEditor_MainForm_FormClosing); + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ODEditor_MainForm_FormClosed); + this.Load += new System.EventHandler(this.ODEditor_MainForm_Load); + this.DragDrop += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragDrop); + this.DragEnter += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragEnter); + this.DragOver += new System.Windows.Forms.DragEventHandler(this.ODEditor_MainForm_DragOver); + this.DragLeave += new System.EventHandler(this.ODEditor_MainForm_DragLeave); + this.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.ODEditor_MainForm_QueryContinueDrag); + this.MouseCaptureChanged += new System.EventHandler(this.ODEditor_MainForm_Leave); + this.MouseLeave += new System.EventHandler(this.ODEditor_MainForm_Leave); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + } #endregion diff --git a/EDSEditorGUI/Form1.cs b/EDSEditorGUI/Form1.cs index c54cf88f..46b40837 100644 --- a/EDSEditorGUI/Form1.cs +++ b/EDSEditorGUI/Form1.cs @@ -26,7 +26,7 @@ You should have received a copy of the GNU General Public License using System.IO; using libEDSsharp; using Xml2CSharp; -using static System.Windows.Forms.VisualStyles.VisualStyleElement; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace ODEditor { @@ -155,37 +155,37 @@ void ProfileAddClick(object sender, EventArgs e) return; } - InsertObjects insObjForm = new InsertObjects(dv.eds, network, eds.ods, "0"); + InsertObjects insObjForm = new InsertObjects(dv.eds, network, eds.ods, "0"); if (insObjForm.ShowDialog() == DialogResult.OK) { - EDSsharp modifiedEds = insObjForm.GetModifiedEDS(); - modifiedEds.Dirty = true; - - if(modifiedEds == dv.eds) - { + EDSsharp modifiedEds = insObjForm.GetModifiedEDS(); + modifiedEds.Dirty = true; + + if(modifiedEds == dv.eds) + { dv.dispatch_updateOD(); dv.dispatch_updatePDOinfo(); dv.eds.UpdatePDOcount(); dv.dispatch_updatedevice(); } - else - { - foreach(TabPage page in tabControl1.TabPages) - { - DeviceView devView = (DeviceView)page.Controls[0]; - if(devView.eds == modifiedEds) - { - devView.dispatch_updateOD(); - devView.dispatch_updatePDOinfo(); - - devView.eds.UpdatePDOcount(); - devView.dispatch_updatedevice(); - } - } - } - } + else + { + foreach(TabPage page in tabControl1.TabPages) + { + DeviceView devView = (DeviceView)page.Controls[0]; + if(devView.eds == modifiedEds) + { + devView.dispatch_updateOD(); + devView.dispatch_updatePDOinfo(); + + devView.eds.UpdatePDOcount(); + devView.dispatch_updatedevice(); + } + } + } + } } } @@ -202,9 +202,9 @@ private void openEDSfile(string path,InfoSection.Filetype ft) Bridge bridge = new Bridge(); //tell me again why bridge is not static? dev = bridge.convert(eds); - DeviceView device = new DeviceView(eds, network); + DeviceView device = new DeviceView(eds, network); - device.UpdateODViewForEDS += Device_UpdateODViewForEDS; + device.UpdateODViewForEDS += Device_UpdateODViewForEDS; eds.OnDataDirty += Eds_onDataDirty; tabControl1.TabPages.Add(eds.di.ProductName); @@ -357,9 +357,9 @@ private void openXDDfile(string path) tabControl1.TabPages.Add(eds.di.ProductName); - DeviceView device = new DeviceView(eds, network); + DeviceView device = new DeviceView(eds, network); - device.UpdateODViewForEDS += Device_UpdateODViewForEDS; + device.UpdateODViewForEDS += Device_UpdateODViewForEDS; eds.OnDataDirty += Eds_onDataDirty; tabControl1.TabPages[tabControl1.TabPages.Count - 1].Controls.Add(device); @@ -404,8 +404,8 @@ private void openXMLfile(string path) tabControl1.TabPages.Add(eds.di.ProductName); - DeviceView device = new DeviceView(eds, network); - device.UpdateODViewForEDS += Device_UpdateODViewForEDS; + DeviceView device = new DeviceView(eds, network); + device.UpdateODViewForEDS += Device_UpdateODViewForEDS; eds.OnDataDirty += Eds_onDataDirty; tabControl1.TabPages[tabControl1.TabPages.Count - 1].Controls.Add(device); @@ -428,26 +428,26 @@ private void openXMLfile(string path) } - private void Device_UpdateODViewForEDS(object sender, UpdateODViewEventArgs e) - { - foreach (TabPage page in tabControl1.TabPages) - { - foreach (Control c in page.Controls) - { - if (c.GetType() == typeof(DeviceView)) - { - DeviceView d = (DeviceView)c; - if (d.eds == e.EDS) - { - d.dispatch_updateOD(); - } - } - - } - } - } - - + private void Device_UpdateODViewForEDS(object sender, UpdateODViewEventArgs e) + { + foreach (TabPage page in tabControl1.TabPages) + { + foreach (Control c in page.Controls) + { + if (c.GetType() == typeof(DeviceView)) + { + DeviceView d = (DeviceView)c; + if (d.eds == e.EDS) + { + d.dispatch_updateOD(); + } + } + + } + } + } + + private void Eds_onDataDirty(bool dirty, EDSsharp sender) { foreach(TabPage page in tabControl1.TabPages) @@ -588,16 +588,16 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) sfd.Filter = "CANopen XDD v1.1 (*.xdd)|*.xdd|" + "CANopen XDC v1.1 (*.xdc)|*.xdc|" - + "CANopen XPD v1.1 (*.xpd)|*.xpd"; - + + "CANopen XPD v1.1 (*.xpd)|*.xpd"; + if (dv.eds.projectFilename == "") { sfd.FileName = Path.GetFileNameWithoutExtension(networkfilename); } else - { - sfd.InitialDirectory = Path.GetDirectoryName(dv.eds.projectFilename); - sfd.RestoreDirectory = true; + { + sfd.InitialDirectory = Path.GetDirectoryName(dv.eds.projectFilename); + sfd.RestoreDirectory = true; sfd.FileName = Path.GetFileNameWithoutExtension(dv.eds.projectFilename); } @@ -691,8 +691,8 @@ private void newToolStripMenuItem_Click(object sender, EventArgs e) tabControl1.TabPages.Add(eds.di.ProductName); - DeviceView device = new DeviceView(eds, network); - device.UpdateODViewForEDS += Device_UpdateODViewForEDS; + DeviceView device = new DeviceView(eds, network); + device.UpdateODViewForEDS += Device_UpdateODViewForEDS; eds.OnDataDirty += Eds_onDataDirty; @@ -703,16 +703,16 @@ private void newToolStripMenuItem_Click(object sender, EventArgs e) network.Add(eds); } - private void TabControl1_Selected(Object sender, TabControlEventArgs e) - { - if(tabControl1.SelectedIndex == 0) - { - DeviceView dv = (DeviceView)tabControl1.SelectedTab.Controls[0]; - dv.dispatch_updateOD(); - dv.dispatch_updatePDOinfo(); - dv.eds.UpdatePDOcount(); - dv.dispatch_updatedevice(); - } + private void TabControl1_Selected(Object sender, TabControlEventArgs e) + { + if(tabControl1.SelectedIndex == 0) + { + DeviceView dv = (DeviceView)tabControl1.SelectedTab.Controls[0]; + dv.dispatch_updateOD(); + dv.dispatch_updatePDOinfo(); + dv.eds.UpdatePDOcount(); + dv.dispatch_updatedevice(); + } } private void tabControl1_ControlsChanged(object sender, ControlEventArgs e) { @@ -936,13 +936,13 @@ private void openXDDNetworkfile(string file) tabControl1.TabPages.Add(eds.di.ProductName); - DeviceView device = new DeviceView(eds, network); + DeviceView device = new DeviceView(eds, network); tabControl1.TabPages[tabControl1.TabPages.Count - 1].Controls.Add(device); device.Dock = DockStyle.Fill; network.Add(eds); - device.UpdateODViewForEDS += Device_UpdateODViewForEDS; + device.UpdateODViewForEDS += Device_UpdateODViewForEDS; eds.OnDataDirty += Eds_onDataDirty; device.dispatch_updateOD(); @@ -968,13 +968,13 @@ private void openNetworkfile(string file) tabControl1.TabPages.Add(eds.di.ProductName); - DeviceView device = new DeviceView(eds, network); + DeviceView device = new DeviceView(eds, network); tabControl1.TabPages[tabControl1.TabPages.Count - 1].Controls.Add(device); device.Dock = DockStyle.Fill; network.Add(eds); - device.UpdateODViewForEDS += Device_UpdateODViewForEDS; + device.UpdateODViewForEDS += Device_UpdateODViewForEDS; eds.OnDataDirty += Eds_onDataDirty; device.dispatch_updateOD(); @@ -1216,7 +1216,7 @@ private bool fileTypeSupported(string fileName) return typeSupported; - } + } private void ODEditor_MainForm_DragEnter(object sender, DragEventArgs e) { diff --git a/EDSEditorGUI/InsertObjects.Designer.cs b/EDSEditorGUI/InsertObjects.Designer.cs index 10194b99..2791c038 100644 --- a/EDSEditorGUI/InsertObjects.Designer.cs +++ b/EDSEditorGUI/InsertObjects.Designer.cs @@ -1,165 +1,165 @@ -namespace ODEditor -{ - partial class InsertObjects - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InsertObjects)); - this.label2 = new System.Windows.Forms.Label(); - this.textBox_offsets = new System.Windows.Forms.TextBox(); - this.button_insert = new System.Windows.Forms.Button(); - this.button_cancel = new System.Windows.Forms.Button(); - this.dataGridView = new System.Windows.Forms.DataGridView(); - this.button_uncheck = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.cbox_Target = new System.Windows.Forms.ComboBox(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); - this.SuspendLayout(); - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 54); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(290, 13); - this.label2.TabIndex = 4; - this.label2.Text = "Index Offset (single or space separated list for multiple insert)"; - // - // textBox_offsets - // - this.textBox_offsets.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox_offsets.Location = new System.Drawing.Point(12, 70); - this.textBox_offsets.Name = "textBox_offsets"; - this.textBox_offsets.Size = new System.Drawing.Size(432, 20); - this.textBox_offsets.TabIndex = 2; - this.textBox_offsets.Text = "1"; - this.textBox_offsets.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBox_offsets_KeyPress); - this.textBox_offsets.Leave += new System.EventHandler(this.TextBox_offsets_Leave); - // - // button_insert - // - this.button_insert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button_insert.Location = new System.Drawing.Point(154, 401); - this.button_insert.Name = "button_insert"; - this.button_insert.Size = new System.Drawing.Size(130, 37); - this.button_insert.TabIndex = 6; - this.button_insert.Text = "Insert"; - this.button_insert.UseVisualStyleBackColor = true; - this.button_insert.Click += new System.EventHandler(this.Button_create_Click); - // - // button_cancel - // - this.button_cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button_cancel.Location = new System.Drawing.Point(314, 401); - this.button_cancel.Name = "button_cancel"; - this.button_cancel.Size = new System.Drawing.Size(130, 37); - this.button_cancel.TabIndex = 7; - this.button_cancel.Text = "Cancel"; - this.button_cancel.UseVisualStyleBackColor = true; - this.button_cancel.Click += new System.EventHandler(this.Button_cancel_Click); - // - // dataGridView - // - this.dataGridView.AllowUserToAddRows = false; - this.dataGridView.AllowUserToDeleteRows = false; - this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; - this.dataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; - this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnKeystroke; - this.dataGridView.Location = new System.Drawing.Point(12, 96); - this.dataGridView.Name = "dataGridView"; - this.dataGridView.Size = new System.Drawing.Size(432, 294); - this.dataGridView.TabIndex = 10; - this.dataGridView.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.DataGridView_ColumnHeaderMouseClick); - this.dataGridView.Leave += new System.EventHandler(this.DataGridView_Leave); - // - // button_uncheck - // - this.button_uncheck.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.button_uncheck.Location = new System.Drawing.Point(12, 401); - this.button_uncheck.Name = "button_uncheck"; - this.button_uncheck.Size = new System.Drawing.Size(130, 37); - this.button_uncheck.TabIndex = 11; - this.button_uncheck.Text = "Uncheck all"; - this.button_uncheck.UseVisualStyleBackColor = true; - this.button_uncheck.Click += new System.EventHandler(this.button_uncheck_Click); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(38, 13); - this.label1.TabIndex = 12; - this.label1.Text = "Target"; - // - // cbox_Target - // - this.cbox_Target.FormattingEnabled = true; - this.cbox_Target.Location = new System.Drawing.Point(12, 25); - this.cbox_Target.Name = "cbox_Target"; - this.cbox_Target.Size = new System.Drawing.Size(432, 21); - this.cbox_Target.TabIndex = 13; - this.cbox_Target.SelectedIndexChanged += new System.EventHandler(this.cbox_Target_SelectedIndexChanged); - // - // InsertObjects - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(456, 450); - this.Controls.Add(this.cbox_Target); - this.Controls.Add(this.label1); - this.Controls.Add(this.button_uncheck); - this.Controls.Add(this.dataGridView); - this.Controls.Add(this.button_cancel); - this.Controls.Add(this.button_insert); - this.Controls.Add(this.textBox_offsets); - this.Controls.Add(this.label2); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "InsertObjects"; - this.Text = "Insert OD Objects"; - ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox textBox_offsets; - private System.Windows.Forms.Button button_insert; - private System.Windows.Forms.Button button_cancel; - private System.Windows.Forms.DataGridView dataGridView; - private System.Windows.Forms.Button button_uncheck; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.ComboBox cbox_Target; - } +namespace ODEditor +{ + partial class InsertObjects + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InsertObjects)); + this.label2 = new System.Windows.Forms.Label(); + this.textBox_offsets = new System.Windows.Forms.TextBox(); + this.button_insert = new System.Windows.Forms.Button(); + this.button_cancel = new System.Windows.Forms.Button(); + this.dataGridView = new System.Windows.Forms.DataGridView(); + this.button_uncheck = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.cbox_Target = new System.Windows.Forms.ComboBox(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.SuspendLayout(); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 54); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(290, 13); + this.label2.TabIndex = 4; + this.label2.Text = "Index Offset (single or space separated list for multiple insert)"; + // + // textBox_offsets + // + this.textBox_offsets.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox_offsets.Location = new System.Drawing.Point(12, 70); + this.textBox_offsets.Name = "textBox_offsets"; + this.textBox_offsets.Size = new System.Drawing.Size(432, 20); + this.textBox_offsets.TabIndex = 2; + this.textBox_offsets.Text = "1"; + this.textBox_offsets.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBox_offsets_KeyPress); + this.textBox_offsets.Leave += new System.EventHandler(this.TextBox_offsets_Leave); + // + // button_insert + // + this.button_insert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button_insert.Location = new System.Drawing.Point(154, 401); + this.button_insert.Name = "button_insert"; + this.button_insert.Size = new System.Drawing.Size(130, 37); + this.button_insert.TabIndex = 6; + this.button_insert.Text = "Insert"; + this.button_insert.UseVisualStyleBackColor = true; + this.button_insert.Click += new System.EventHandler(this.Button_create_Click); + // + // button_cancel + // + this.button_cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button_cancel.Location = new System.Drawing.Point(314, 401); + this.button_cancel.Name = "button_cancel"; + this.button_cancel.Size = new System.Drawing.Size(130, 37); + this.button_cancel.TabIndex = 7; + this.button_cancel.Text = "Cancel"; + this.button_cancel.UseVisualStyleBackColor = true; + this.button_cancel.Click += new System.EventHandler(this.Button_cancel_Click); + // + // dataGridView + // + this.dataGridView.AllowUserToAddRows = false; + this.dataGridView.AllowUserToDeleteRows = false; + this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; + this.dataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; + this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnKeystroke; + this.dataGridView.Location = new System.Drawing.Point(12, 96); + this.dataGridView.Name = "dataGridView"; + this.dataGridView.Size = new System.Drawing.Size(432, 294); + this.dataGridView.TabIndex = 10; + this.dataGridView.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.DataGridView_ColumnHeaderMouseClick); + this.dataGridView.Leave += new System.EventHandler(this.DataGridView_Leave); + // + // button_uncheck + // + this.button_uncheck.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.button_uncheck.Location = new System.Drawing.Point(12, 401); + this.button_uncheck.Name = "button_uncheck"; + this.button_uncheck.Size = new System.Drawing.Size(130, 37); + this.button_uncheck.TabIndex = 11; + this.button_uncheck.Text = "Uncheck all"; + this.button_uncheck.UseVisualStyleBackColor = true; + this.button_uncheck.Click += new System.EventHandler(this.button_uncheck_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(38, 13); + this.label1.TabIndex = 12; + this.label1.Text = "Target"; + // + // cbox_Target + // + this.cbox_Target.FormattingEnabled = true; + this.cbox_Target.Location = new System.Drawing.Point(12, 25); + this.cbox_Target.Name = "cbox_Target"; + this.cbox_Target.Size = new System.Drawing.Size(432, 21); + this.cbox_Target.TabIndex = 13; + this.cbox_Target.SelectedIndexChanged += new System.EventHandler(this.cbox_Target_SelectedIndexChanged); + // + // InsertObjects + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(456, 450); + this.Controls.Add(this.cbox_Target); + this.Controls.Add(this.label1); + this.Controls.Add(this.button_uncheck); + this.Controls.Add(this.dataGridView); + this.Controls.Add(this.button_cancel); + this.Controls.Add(this.button_insert); + this.Controls.Add(this.textBox_offsets); + this.Controls.Add(this.label2); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "InsertObjects"; + this.Text = "Insert OD Objects"; + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox textBox_offsets; + private System.Windows.Forms.Button button_insert; + private System.Windows.Forms.Button button_cancel; + private System.Windows.Forms.DataGridView dataGridView; + private System.Windows.Forms.Button button_uncheck; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox cbox_Target; + } } \ No newline at end of file diff --git a/EDSEditorGUI/InsertObjects.cs b/EDSEditorGUI/InsertObjects.cs index cb03e41a..e91e6219 100644 --- a/EDSEditorGUI/InsertObjects.cs +++ b/EDSEditorGUI/InsertObjects.cs @@ -1,335 +1,335 @@ -/* - This file is part of libEDSsharp. - - libEDSsharp is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - libEDSsharp is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with libEDSsharp. If not, see . - - Copyright(c) 2016 - 2019 Robin Cornelius - Copyright(c) 2020 Janez Paternoster -*/ - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq.Expressions; -using System.Text.RegularExpressions; -using System.Windows.Forms; -using libEDSsharp; - -namespace ODEditor -{ - public partial class InsertObjects : Form - { - private EDSsharp eds; - readonly SortedDictionary srcObjects; - readonly bool[] enabled; - readonly int dataGridView_InitialColumnCount; - List network; - List offsets; - - /// - /// Display form to: specify offset(s), insert clone of selected srcObjects into existing eds - /// - /// - /// - public InsertObjects(EDSsharp eds, List network, SortedDictionary srcObjects, string initialOffset) - { - this.eds = eds; - this.srcObjects = srcObjects; - this.network = network; - - InitializeComponent(); - - cbox_Target.Items.Clear(); - foreach(var item in network) - { - cbox_Target.Items.Add(item.di.ProductName); - } - cbox_Target.SelectedItem = eds.di.ProductName; - - textBox_offsets.Text = initialOffset; - - dataGridView.Columns.Add(new DataGridViewCheckBoxColumn() - { - Name = "Insert", - FalseValue = false, - TrueValue = true, - Visible = true - }); - int idx = dataGridView.Columns.Add("Original Object", "Original Object"); - dataGridView.Columns[idx].ReadOnly = true; - dataGridView_InitialColumnCount = dataGridView.ColumnCount; - - enabled = new bool[srcObjects.Count]; - for(int i = 0; i < enabled.Length; i++) - enabled[i] = true; - - Verify(initialOffset == "0"); - - DialogResult = DialogResult.Cancel; - } - - private void Button_cancel_Click(object sender, EventArgs e) - { - Close(); - } - - private bool Verify(bool InitiallyDisableIfError = false) - { - String pattern = @"(\d+)\s*([-])\s*(\d+)"; - /* get offests */ - offsets = new List(); - - if (textBox_offsets.Text.Contains("-")) - { - MatchCollection matches = System.Text.RegularExpressions.Regex.Matches(textBox_offsets.Text, pattern); - if (matches.Count != 0) - { - foreach (System.Text.RegularExpressions.Match m in matches) - { - int value1 = Int32.Parse(m.Groups[1].Value); - int value2 = Int32.Parse(m.Groups[3].Value); - - if ((value2 > value1) && (m.Groups[2].Value == "-")) - { - for (int i = value1; i <= value2; i++) - { - try - { - offsets.Add(i); - } - catch (Exception) - { - MessageBox.Show("Syntax error in Index Offset!\n\nValid value is single signed number or space separated list of multiple signed numbers or a range seprated by '-'."); - return false; - } - } - } - } - } - } - else - { - string[] str = textBox_offsets.Text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - foreach (string s in str) - { - try - { - int value = (int)new System.ComponentModel.Int32Converter().ConvertFromString(s); - offsets.Add(value); - } - catch (Exception) - { - MessageBox.Show("Syntax error in Index Offset!\n\nValid value is single signed number or space separated list of multiple signed numbers or a range seprated by '-'."); - return false; - } - } - } - // write column headers - int colIdx = dataGridView_InitialColumnCount; - dataGridView.ColumnCount = colIdx + offsets.Count; - foreach (int o in offsets) - { - dataGridView.Columns[colIdx].Name = $"Offset {o}"; - dataGridView.Columns[colIdx++].ReadOnly = true; - } - - // write rows and verify errors - bool newIndexesValid = true; - var newIndexes = new List(); - DataGridViewCellStyle styleErr = new DataGridViewCellStyle - { - Font = new Font(dataGridView.Font, FontStyle.Bold), - ForeColor = Color.Red - }; - - dataGridView.Rows.Clear(); - - int odIdx = 0; - int j = 1; - foreach (ODentry od in srcObjects.Values) - { - String numpattern = @"(\w*\d+\Z)"; - string newname; - - string[] words = Regex.Split(od.parameter_name, numpattern); - // MatchCollection nummatches = System.Text.RegularExpressions.Regex.Matches(od.parameter_name, numpattern); - if (words.Length > 1) - { - - // value1 = Int32.Parse(m.Groups[1].Value); - int nameidx = Int32.Parse(words[1]) + j++; - - newname = words[0] + nameidx;// nameidx.ToString ; - - } - else { - newname = od.parameter_name; - } - int rowIdx = dataGridView.Rows.Add(enabled[odIdx], $"0x{od.Index:X4} - {newname}"); - int cellIdx = dataGridView_InitialColumnCount; - - foreach (int o in offsets) - { - int newIndex = (int)od.Index + o; - bool err = newIndex <= 0 || newIndex > 0xFFFF; - - dataGridView.Rows[rowIdx].Cells[cellIdx].Value = err ? $"{newIndex}" : $"0x{newIndex:X4}"; - - if (!err) - err = newIndexes.Contains(newIndex); - - if (!err) - { - - newIndexes.Add(newIndex); - err = eds.ods.ContainsKey((UInt16)newIndex); - } - - if (err) - { - if (enabled[odIdx] && InitiallyDisableIfError) - { - dataGridView.Rows[rowIdx].Cells[0].Value = false; - enabled[odIdx] = false; - } - else if (enabled[odIdx]) - { - newIndexesValid = false; - } - dataGridView.Rows[rowIdx].Cells[cellIdx].Style = styleErr; - } - cellIdx++; - } - odIdx++; - } - - dataGridView.ClearSelection(); - - return newIndexesValid; - } - - private void Button_create_Click(object sender, EventArgs e) - { - if (Verify()) - { - // clone OD objects - int odIdx = 0; - int i = 1; - foreach (ODentry od in srcObjects.Values) - { - if (enabled[odIdx]) - { - foreach (int o in offsets) - { - UInt16 newIndex = (UInt16)(od.Index + o); - ODentry newObject = od.Clone(); - - String pattern = @"(\w*\d+\Z)"; - - string[] words = Regex.Split(od.parameter_name, pattern); - // MatchCollection nummatches = System.Text.RegularExpressions.Regex.Matches(od.parameter_name, numpattern); - if (words.Length > 1) - { - int nameidx = Int32.Parse(words[1]) + i++; - newObject.parameter_name = words[0] + nameidx;// nameidx.ToString ; - - } - - newObject.Index = newIndex; - - eds.ods.Add(newIndex, newObject); - } - } - odIdx++; - } - - DialogResult = DialogResult.OK; - Close(); - } - } - - private void TextBox_offsets_KeyPress(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == ' ' || e.KeyChar == '\r') - { - Verify(); - } - } - - private void TextBox_offsets_Leave(object sender, EventArgs e) - { - Verify(); - } - - private void DataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) - { - // toggle selection on click on first column - if (e.ColumnIndex == 0) - { - dataGridView.ClearSelection(); - dataGridView.CurrentCell = null; - foreach (DataGridViewRow row in dataGridView.Rows) - { - row.Cells[0].Value = !((bool)row.Cells[0].Value); - } - } - } - - private void DataGridView_Leave(object sender, EventArgs e) - { - // recalculate enabled[] - dataGridView.ClearSelection(); - dataGridView.CurrentCell = null; - int odIdx = 0; - foreach (DataGridViewRow row in dataGridView.Rows) - { - enabled[odIdx++] = (bool)row.Cells[0].Value; - } - } - - private void button_uncheck_Click(object sender, EventArgs e) - { - int odIdx = 0; - foreach (DataGridViewRow item in dataGridView.Rows) - { - DataGridViewCheckBoxCell cell = (DataGridViewCheckBoxCell)item.Cells[0]; - - cell.Value = false; - enabled[odIdx++] = false; - } - } - - private void cbox_Target_SelectedIndexChanged(object sender, EventArgs e) - { - EDSsharp edsBefore = eds; - foreach (var item in network) - { - if((string)cbox_Target.SelectedItem == item.di.ProductName) - { - this.eds = item; - break; - } - } - if(this.eds != null && this.eds != edsBefore) - { - Verify(false); - } - } - - public EDSsharp GetModifiedEDS() - { - return this.eds; - } - } -} +/* + This file is part of libEDSsharp. + + libEDSsharp is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + libEDSsharp is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with libEDSsharp. If not, see . + + Copyright(c) 2016 - 2019 Robin Cornelius + Copyright(c) 2020 Janez Paternoster +*/ + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq.Expressions; +using System.Text.RegularExpressions; +using System.Windows.Forms; +using libEDSsharp; + +namespace ODEditor +{ + public partial class InsertObjects : Form + { + private EDSsharp eds; + readonly SortedDictionary srcObjects; + readonly bool[] enabled; + readonly int dataGridView_InitialColumnCount; + List network; + List offsets; + + /// + /// Display form to: specify offset(s), insert clone of selected srcObjects into existing eds + /// + /// + /// + public InsertObjects(EDSsharp eds, List network, SortedDictionary srcObjects, string initialOffset) + { + this.eds = eds; + this.srcObjects = srcObjects; + this.network = network; + + InitializeComponent(); + + cbox_Target.Items.Clear(); + foreach(var item in network) + { + cbox_Target.Items.Add(item.di.ProductName); + } + cbox_Target.SelectedItem = eds.di.ProductName; + + textBox_offsets.Text = initialOffset; + + dataGridView.Columns.Add(new DataGridViewCheckBoxColumn() + { + Name = "Insert", + FalseValue = false, + TrueValue = true, + Visible = true + }); + int idx = dataGridView.Columns.Add("Original Object", "Original Object"); + dataGridView.Columns[idx].ReadOnly = true; + dataGridView_InitialColumnCount = dataGridView.ColumnCount; + + enabled = new bool[srcObjects.Count]; + for(int i = 0; i < enabled.Length; i++) + enabled[i] = true; + + Verify(initialOffset == "0"); + + DialogResult = DialogResult.Cancel; + } + + private void Button_cancel_Click(object sender, EventArgs e) + { + Close(); + } + + private bool Verify(bool InitiallyDisableIfError = false) + { + String pattern = @"(\d+)\s*([-])\s*(\d+)"; + /* get offests */ + offsets = new List(); + + if (textBox_offsets.Text.Contains("-")) + { + MatchCollection matches = System.Text.RegularExpressions.Regex.Matches(textBox_offsets.Text, pattern); + if (matches.Count != 0) + { + foreach (System.Text.RegularExpressions.Match m in matches) + { + int value1 = Int32.Parse(m.Groups[1].Value); + int value2 = Int32.Parse(m.Groups[3].Value); + + if ((value2 > value1) && (m.Groups[2].Value == "-")) + { + for (int i = value1; i <= value2; i++) + { + try + { + offsets.Add(i); + } + catch (Exception) + { + MessageBox.Show("Syntax error in Index Offset!\n\nValid value is single signed number or space separated list of multiple signed numbers or a range seprated by '-'."); + return false; + } + } + } + } + } + } + else + { + string[] str = textBox_offsets.Text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + foreach (string s in str) + { + try + { + int value = (int)new System.ComponentModel.Int32Converter().ConvertFromString(s); + offsets.Add(value); + } + catch (Exception) + { + MessageBox.Show("Syntax error in Index Offset!\n\nValid value is single signed number or space separated list of multiple signed numbers or a range seprated by '-'."); + return false; + } + } + } + // write column headers + int colIdx = dataGridView_InitialColumnCount; + dataGridView.ColumnCount = colIdx + offsets.Count; + foreach (int o in offsets) + { + dataGridView.Columns[colIdx].Name = $"Offset {o}"; + dataGridView.Columns[colIdx++].ReadOnly = true; + } + + // write rows and verify errors + bool newIndexesValid = true; + var newIndexes = new List(); + DataGridViewCellStyle styleErr = new DataGridViewCellStyle + { + Font = new Font(dataGridView.Font, FontStyle.Bold), + ForeColor = Color.Red + }; + + dataGridView.Rows.Clear(); + + int odIdx = 0; + int j = 1; + foreach (ODentry od in srcObjects.Values) + { + String numpattern = @"(\w*\d+\Z)"; + string newname; + + string[] words = Regex.Split(od.parameter_name, numpattern); + // MatchCollection nummatches = System.Text.RegularExpressions.Regex.Matches(od.parameter_name, numpattern); + if (words.Length > 1) + { + + // value1 = Int32.Parse(m.Groups[1].Value); + int nameidx = Int32.Parse(words[1]) + j++; + + newname = words[0] + nameidx;// nameidx.ToString ; + + } + else { + newname = od.parameter_name; + } + int rowIdx = dataGridView.Rows.Add(enabled[odIdx], $"0x{od.Index:X4} - {newname}"); + int cellIdx = dataGridView_InitialColumnCount; + + foreach (int o in offsets) + { + int newIndex = (int)od.Index + o; + bool err = newIndex <= 0 || newIndex > 0xFFFF; + + dataGridView.Rows[rowIdx].Cells[cellIdx].Value = err ? $"{newIndex}" : $"0x{newIndex:X4}"; + + if (!err) + err = newIndexes.Contains(newIndex); + + if (!err) + { + + newIndexes.Add(newIndex); + err = eds.ods.ContainsKey((UInt16)newIndex); + } + + if (err) + { + if (enabled[odIdx] && InitiallyDisableIfError) + { + dataGridView.Rows[rowIdx].Cells[0].Value = false; + enabled[odIdx] = false; + } + else if (enabled[odIdx]) + { + newIndexesValid = false; + } + dataGridView.Rows[rowIdx].Cells[cellIdx].Style = styleErr; + } + cellIdx++; + } + odIdx++; + } + + dataGridView.ClearSelection(); + + return newIndexesValid; + } + + private void Button_create_Click(object sender, EventArgs e) + { + if (Verify()) + { + // clone OD objects + int odIdx = 0; + int i = 1; + foreach (ODentry od in srcObjects.Values) + { + if (enabled[odIdx]) + { + foreach (int o in offsets) + { + UInt16 newIndex = (UInt16)(od.Index + o); + ODentry newObject = od.Clone(); + + String pattern = @"(\w*\d+\Z)"; + + string[] words = Regex.Split(od.parameter_name, pattern); + // MatchCollection nummatches = System.Text.RegularExpressions.Regex.Matches(od.parameter_name, numpattern); + if (words.Length > 1) + { + int nameidx = Int32.Parse(words[1]) + i++; + newObject.parameter_name = words[0] + nameidx;// nameidx.ToString ; + + } + + newObject.Index = newIndex; + + eds.ods.Add(newIndex, newObject); + } + } + odIdx++; + } + + DialogResult = DialogResult.OK; + Close(); + } + } + + private void TextBox_offsets_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar == ' ' || e.KeyChar == '\r') + { + Verify(); + } + } + + private void TextBox_offsets_Leave(object sender, EventArgs e) + { + Verify(); + } + + private void DataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) + { + // toggle selection on click on first column + if (e.ColumnIndex == 0) + { + dataGridView.ClearSelection(); + dataGridView.CurrentCell = null; + foreach (DataGridViewRow row in dataGridView.Rows) + { + row.Cells[0].Value = !((bool)row.Cells[0].Value); + } + } + } + + private void DataGridView_Leave(object sender, EventArgs e) + { + // recalculate enabled[] + dataGridView.ClearSelection(); + dataGridView.CurrentCell = null; + int odIdx = 0; + foreach (DataGridViewRow row in dataGridView.Rows) + { + enabled[odIdx++] = (bool)row.Cells[0].Value; + } + } + + private void button_uncheck_Click(object sender, EventArgs e) + { + int odIdx = 0; + foreach (DataGridViewRow item in dataGridView.Rows) + { + DataGridViewCheckBoxCell cell = (DataGridViewCheckBoxCell)item.Cells[0]; + + cell.Value = false; + enabled[odIdx++] = false; + } + } + + private void cbox_Target_SelectedIndexChanged(object sender, EventArgs e) + { + EDSsharp edsBefore = eds; + foreach (var item in network) + { + if((string)cbox_Target.SelectedItem == item.di.ProductName) + { + this.eds = item; + break; + } + } + if(this.eds != null && this.eds != edsBefore) + { + Verify(false); + } + } + + public EDSsharp GetModifiedEDS() + { + return this.eds; + } + } +} diff --git a/EDSEditorGUI/NewIndex.Designer.cs b/EDSEditorGUI/NewIndex.Designer.cs index 3ca563bb..e85375df 100644 --- a/EDSEditorGUI/NewIndex.Designer.cs +++ b/EDSEditorGUI/NewIndex.Designer.cs @@ -1,5 +1,5 @@ -using libEDSsharp; - +using libEDSsharp; + namespace ODEditor { partial class NewIndex diff --git a/EDSEditorGUI/Properties/Resources.Designer.cs b/EDSEditorGUI/Properties/Resources.Designer.cs index 734f92bf..2295eb4a 100644 --- a/EDSEditorGUI/Properties/Resources.Designer.cs +++ b/EDSEditorGUI/Properties/Resources.Designer.cs @@ -1,253 +1,253 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace ODEditor.Properties { - using System; - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // 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", "17.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() { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [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("ODEditor.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap _305_Close_16x16_72 { - get { - object obj = ResourceManager.GetObject("_305_Close_16x16_72", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap action_add_16xLG { - get { - object obj = ResourceManager.GetObject("action_add_16xLG", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Close_6519 { - get { - object obj = ResourceManager.GetObject("Close_6519", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Compile_191 { - get { - object obj = ResourceManager.GetObject("Compile_191", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap DriverTemplate_32x { - get { - object obj = ResourceManager.GetObject("DriverTemplate_32x", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap EventLog_5735 { - get { - object obj = ResourceManager.GetObject("EventLog_5735", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ExporttoScript_9881 { - get { - object obj = ResourceManager.GetObject("ExporttoScript_9881", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap GenerateAll { - get { - object obj = ResourceManager.GetObject("GenerateAll", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap GenericVSEditor_9905 { - get { - object obj = ResourceManager.GetObject("GenericVSEditor_9905", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Index_8287_16x { - get { - object obj = ResourceManager.GetObject("Index_8287_16x", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap InsertColumn_5626 { - get { - object obj = ResourceManager.GetObject("InsertColumn_5626", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ListBox_686 { - get { - object obj = ResourceManager.GetObject("ListBox_686", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap NewFile_6276 { - get { - object obj = ResourceManager.GetObject("NewFile_6276", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Open_6529 { - get { - object obj = ResourceManager.GetObject("Open_6529", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Print_11009 { - get { - object obj = ResourceManager.GetObject("Print_11009", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap PrintPreviewControl_698 { - get { - object obj = ResourceManager.GetObject("PrintPreviewControl_698", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap PrintSetup_11011 { - get { - object obj = ResourceManager.GetObject("PrintSetup_11011", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Remove_16xLG { - get { - object obj = ResourceManager.GetObject("Remove_16xLG", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Save_6530 { - get { - object obj = ResourceManager.GetObject("Save_6530", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace ODEditor.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // 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", "17.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() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [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("ODEditor.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap _305_Close_16x16_72 { + get { + object obj = ResourceManager.GetObject("_305_Close_16x16_72", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap action_add_16xLG { + get { + object obj = ResourceManager.GetObject("action_add_16xLG", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Close_6519 { + get { + object obj = ResourceManager.GetObject("Close_6519", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Compile_191 { + get { + object obj = ResourceManager.GetObject("Compile_191", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap DriverTemplate_32x { + get { + object obj = ResourceManager.GetObject("DriverTemplate_32x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap EventLog_5735 { + get { + object obj = ResourceManager.GetObject("EventLog_5735", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ExporttoScript_9881 { + get { + object obj = ResourceManager.GetObject("ExporttoScript_9881", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap GenerateAll { + get { + object obj = ResourceManager.GetObject("GenerateAll", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap GenericVSEditor_9905 { + get { + object obj = ResourceManager.GetObject("GenericVSEditor_9905", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Index_8287_16x { + get { + object obj = ResourceManager.GetObject("Index_8287_16x", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap InsertColumn_5626 { + get { + object obj = ResourceManager.GetObject("InsertColumn_5626", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ListBox_686 { + get { + object obj = ResourceManager.GetObject("ListBox_686", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap NewFile_6276 { + get { + object obj = ResourceManager.GetObject("NewFile_6276", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Open_6529 { + get { + object obj = ResourceManager.GetObject("Open_6529", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Print_11009 { + get { + object obj = ResourceManager.GetObject("Print_11009", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap PrintPreviewControl_698 { + get { + object obj = ResourceManager.GetObject("PrintPreviewControl_698", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap PrintSetup_11011 { + get { + object obj = ResourceManager.GetObject("PrintSetup_11011", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Remove_16xLG { + get { + object obj = ResourceManager.GetObject("Remove_16xLG", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Save_6530 { + get { + object obj = ResourceManager.GetObject("Save_6530", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/EDSEditorGUI/Properties/Settings.Designer.cs b/EDSEditorGUI/Properties/Settings.Designer.cs index 04412fe2..baa3be85 100644 --- a/EDSEditorGUI/Properties/Settings.Designer.cs +++ b/EDSEditorGUI/Properties/Settings.Designer.cs @@ -1,50 +1,50 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace ODEditor.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.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; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int ExporterType { - get { - return ((int)(this["ExporterType"])); - } - set { - this["ExporterType"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("65535")] - public uint WarningMask { - get { - return ((uint)(this["WarningMask"])); - } - set { - this["WarningMask"] = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace ODEditor.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.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; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int ExporterType { + get { + return ((int)(this["ExporterType"])); + } + set { + this["ExporterType"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("65535")] + public uint WarningMask { + get { + return ((uint)(this["WarningMask"])); + } + set { + this["WarningMask"] = value; + } + } + } +} diff --git a/libEDSsharp/CanOpenNodeExporter.cs b/libEDSsharp/CanOpenNodeExporter.cs index f779d4e8..4f13a71f 100644 --- a/libEDSsharp/CanOpenNodeExporter.cs +++ b/libEDSsharp/CanOpenNodeExporter.cs @@ -1,1720 +1,1720 @@ -/* - This file is part of libEDSsharp. - - libEDSsharp is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - libEDSsharp is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with libEDSsharp. If not, see . - - Copyright(c) 2016 - 2019 Robin Cornelius - based heavily on the files CO_OD.h and CO_OD.c from CANopenNode which are - Copyright(c) 2010 - 2016 Janez Paternoster -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.IO; - - - -namespace libEDSsharp -{ - - public class CanOpenNodeExporter : IExporter - { - - private string folderpath; - private string gitVersion; - protected EDSsharp eds; - - private int enabledcount = 0; - - Dictionary acceptable_canopen_names = new Dictionary(); - - //Used for array tracking - Dictionary au = new Dictionary(); - List openings = new List(); - List closings = new List(); - - private byte maxRXmappingsize = 0; - private byte maxTXmappingsize = 0; - ODentry maxRXmappingsOD=null; - ODentry maxTXmappingsOD=null; - - - public void prepareCanOpenNames() - { - acceptable_canopen_names.Add(0x101800, "identity"); - - acceptable_canopen_names.Add(0x140000, "RPDOCommunicationParameter"); - acceptable_canopen_names.Add(0x160000, "RPDOMappingParameter"); - acceptable_canopen_names.Add(0x180000, "TPDOCommunicationParameter"); - acceptable_canopen_names.Add(0x1a0000, "TPDOMappingParameter"); - - acceptable_canopen_names.Add(0x100500, "COB_ID_SYNCMessage"); - - - - acceptable_canopen_names.Add(0x101801, "vendorID"); - acceptable_canopen_names.Add(0x101802, "productCode"); - acceptable_canopen_names.Add(0x101803, "revisionNumber"); - acceptable_canopen_names.Add(0x101804, "serialNumber"); - - acceptable_canopen_names.Add(0x120000, "SDOServerParameter"); - acceptable_canopen_names.Add(0x120001, "COB_IDClientToServer"); - acceptable_canopen_names.Add(0x120002, "COB_IDServerToClient"); - - acceptable_canopen_names.Add(0x128000, "SDOClientParameter"); - acceptable_canopen_names.Add(0x128001, "COB_IDClientToServer"); - acceptable_canopen_names.Add(0x128002, "COB_IDServerToClient"); - - acceptable_canopen_names.Add(0x102900, "errorBehavior"); - - } - - - public void export(string folderpath, string filename, string gitVersion, EDSsharp eds,string odname) - { - this.folderpath = folderpath; - this.gitVersion = gitVersion; - this.eds = eds; - - - enabledcount = eds.GetNoEnabledObjects(); - - prepareCanOpenNames(); - - countPDOS(); - - - fixcompatentry(); - - prewalkArrays(); - - export_h(filename); - export_c(filename); - - } - - private void fixcompatentry() - { - // Handle the TPDO communication parameters in a special way, because of - // sizeof(OD_TPDOCommunicationParameter_t) != sizeof(CO_TPDOCommPar_t) in CANopen.c - // the existing CO_TPDOCommPar_t has a compatibility entry so we must export one regardless - // of if its in the OD or not - - for (UInt16 idx = 0x1800; idx < 0x1900; idx++) - { - if (ObjectActive(idx)) - { - ODentry od = eds.ods[idx]; - - if (!od.Containssubindex(0x04)) - { - ODentry compatibility = new ODentry("compatibility entry", idx, DataType.UNSIGNED8, "0", EDSsharp.AccessType.ro, PDOMappingType.no, od); - od.subobjects.Add(0x04, compatibility); - } - } - } - - } - - private void specialarraysearch(UInt16 start, UInt16 end) - { - UInt16 lowest = 0xffff; - UInt16 highest = 0x0000; - - foreach (KeyValuePair kvp in eds.ods) - { - - if (kvp.Value.prop.CO_disabled == true) - continue; - - if (kvp.Key >= start && kvp.Key <= end) - { - if (kvp.Key > highest) - highest = kvp.Key; - - if (kvp.Key < lowest) - lowest = kvp.Key; - } - } - - if(lowest!=0xffff && highest!=0x0000) - { - openings.Add(lowest); - closings.Add(highest); - - Console.WriteLine(string.Format("New special array detected start 0x{0:X4} end 0x{1:X4}", lowest, highest)); - } - } - - public bool ObjectActive(UInt16 index) - { - if (eds.ods.ContainsKey(index)) - { - return !eds.ods[index].prop.CO_disabled; - } - else return false; - } - - protected void prewalkArrays() - { - - foreach (KeyValuePair kvp in eds.ods) - { - ODentry od = kvp.Value; - if (od.prop.CO_disabled == true) - continue; - - string name = make_cname(od.parameter_name,od); - if (au.ContainsKey(name)) - { - au[name]++; - } - else - { - au[name] = 1; - } - } - - - //Handle special arrays - - specialarraysearch(0x1301, 0x1340); - specialarraysearch(0x1381, 0x13C0); - - - //SDO Client parameters - specialarraysearch(0x1200, 0x127F); - //SDO Server Parameters - specialarraysearch(0x1280, 0x12FF); - - //PDO Mappings and configs - specialarraysearch(0x1400, 0x15FF); - specialarraysearch(0x1600, 0x17FF); - specialarraysearch(0x1800, 0x19FF); - specialarraysearch(0x1A00, 0x1BFF); - - //now find opening and closing points for these arrays - foreach (KeyValuePair kvp in au) - { - if ( kvp.Value > 1) - { - string targetname = kvp.Key; - UInt16 lowest=0xffff; - UInt16 highest=0x0000; - foreach (KeyValuePair kvp2 in eds.ods) - { - - string name = make_cname(kvp2.Value.parameter_name,kvp2.Value); - if(name==targetname) - { - if (kvp2.Key > highest) - highest = kvp2.Key; - - if (kvp2.Key < lowest) - lowest = kvp2.Key; - } - - } - - if (!openings.Contains(lowest)) - { - openings.Add(lowest); - closings.Add(highest); - Console.WriteLine(string.Format("New array detected start 0x{0:X4} end 0x{1:X4}", lowest, highest)); - } - - } - - } - - //Find maximum no entries in a mapping config to define an appropriate array - maxRXmappingsize = 0; - maxTXmappingsize = 0; - - for (ushort x=0x1600;x<0x1800;x++) - { - if(ObjectActive(x)) - { - byte maxcount = EDSsharp.ConvertToByte(eds.ods[x].subobjects[0].defaultvalue); - - if(maxcount > maxRXmappingsize) - { - maxRXmappingsize = maxcount; - maxRXmappingsOD = eds.ods[x]; - } - } - } - - for (ushort x = 0x1a00; x < 0x1c00; x++) - { - if (ObjectActive(x)) - { - byte maxcount = EDSsharp.ConvertToByte(eds.ods[x].subobjects[0].defaultvalue); - - if (maxcount > maxTXmappingsize) - { - maxTXmappingsize = maxcount; - maxTXmappingsOD = eds.ods[x]; - } - } - } - } - - string lastname = ""; - - private string print_h_bylocation(string location) - { - - StringBuilder sb = new StringBuilder(); - - lastname = ""; - - foreach (KeyValuePair kvp in eds.ods) - { - ODentry od = kvp.Value; - - if (od.prop.CO_disabled == true || od.prop.CO_storageGroup != location) - continue; - - sb.Append(print_h_entry(od)); - - } - - return sb.ToString(); - } - - - protected string print_h_entry(ODentry od) - { - StringBuilder sb = new StringBuilder(); - - if (od.Nosubindexes == 0) - { - string specialarraylength = ""; - if (od.datatype == DataType.VISIBLE_STRING || od.datatype == DataType.OCTET_STRING || od.datatype == DataType.UNICODE_STRING) - { - - if (od.Lengthofstring == 0) - { - Warnings.AddWarning(string.Format(" Object 0x{0:X4}/{1:X2} A string must have a default value to set the required datasize for canopen node, i have set this to [1] byte to prevent compile errors", od.Index, od.Subindex),Warnings.warning_class.WARNING_STRING); - specialarraylength = "[1]"; - } - else - { - specialarraylength = string.Format("[{0}]", od.Lengthofstring); - } - } - - sb.AppendLine($"/*{od.Index:X4} */ {od.datatype.ToString(),-14} {make_cname(od.parameter_name,od)}{specialarraylength};"); - } - else - { - //fixme why is this not od.datatype? - DataType t = eds.Getdatatype(od); - - //If it not a defined type, and it probably is not for a REC, we must generate a name, this is - //related to the previous code that generated the actual structures. - - string objecttypewords = ""; - - switch (od.objecttype) - { - - case ObjectType.RECORD: - objecttypewords = String.Format("OD_{0}_t", make_cname(od.parameter_name,od)); - break; - case ObjectType.ARRAY: - objecttypewords = t.ToString(); //this case is handled by the logic in eds.getdatatype(); - break; - default: - objecttypewords = t.ToString(); - break; - } - - string name = make_cname(od.parameter_name,od); - if (au[name] > 1) - { - if (lastname == name) - return ""; - - lastname = name; - sb.AppendLine($"/*{od.Index:X4} */ {objecttypewords,-15} {make_cname(od.parameter_name,od)}[{au[name]}];"); - } - else - { - //Don't put sub indexes on record type in h file unless there are multiples of the same - //in which case its not handled here, we need a special case for the predefined special - //values that arrayspecial() checks for, to generate 1 element arrays if needed - if (od.objecttype == ObjectType.RECORD) - { - if (arrayspecial(od.Index, true)) - { - sb.AppendLine($"/*{od.Index:X4} */ {objecttypewords,-15} {make_cname(od.parameter_name,od)}[1];"); - } - else - { - sb.AppendLine($"/*{od.Index:X4} */ {objecttypewords,-15} {make_cname(od.parameter_name,od)};"); - } - } - else - { - string specialarraylength = ""; - - if (od.datatype == DataType.VISIBLE_STRING || od.datatype == DataType.OCTET_STRING || od.datatype == DataType.UNICODE_STRING) - { - int maxlength = 0; - foreach (ODentry sub in od.subobjects.Values) - { - if (sub.Lengthofstring> maxlength) - maxlength = sub.Lengthofstring; - } - - if (maxlength == 0) - { - Warnings.AddWarning(string.Format(" Object children of 0x{0:X4} A string must have a default value to set the required datasize for canopen node, i have set this to [1] byte to prevent compile errors", od.Index),Warnings.warning_class.WARNING_STRING); - maxlength = 1; - } - - - specialarraylength = string.Format("[{0}]", maxlength); - } - - sb.AppendLine($"/*{od.Index:X4} */ {objecttypewords,-15} {make_cname(od.parameter_name,od)}[{od.Nosubindexes - 1}]{specialarraylength};"); - } - } - } - - return sb.ToString(); - } - - private void addHeader(StreamWriter file) - { - file.WriteLine(string.Format( -@"/******************************************************************************* - CANopen Object Dictionary definition for CANopenNode v1 to v2 - - This file was automatically generated by CANopenEditor {0} - - https://github.com/CANopenNode/CANopenNode - https://github.com/CANopenNode/CANopenEditor - - DON'T EDIT THIS FILE MANUALLY !!!! -*******************************************************************************/", this.gitVersion)); - } - - private void export_h(string filename) - { - if (filename == "") - filename = "CO_OD"; - - StreamWriter file = new StreamWriter(folderpath + Path.DirectorySeparatorChar + filename + ".h"); - - file.WriteLine("// clang-format off"); - addHeader(file); - - file.WriteLine("#ifndef CO_OD_H_"); - file.WriteLine("#define CO_OD_H_"); - file.WriteLine(""); - - file.WriteLine(@"/******************************************************************************* - CANopen DATA TYPES -*******************************************************************************/ - typedef bool_t BOOLEAN; - typedef uint8_t UNSIGNED8; - typedef uint16_t UNSIGNED16; - typedef uint32_t UNSIGNED32; - typedef uint64_t UNSIGNED64; - typedef int8_t INTEGER8; - typedef int16_t INTEGER16; - typedef int32_t INTEGER32; - typedef int64_t INTEGER64; - typedef float32_t REAL32; - typedef float64_t REAL64; - typedef char_t VISIBLE_STRING; - typedef oChar_t OCTET_STRING; - - #ifdef DOMAIN - #undef DOMAIN - #endif - - typedef domain_t DOMAIN; - -"); - - file.WriteLine("/*******************************************************************************"); - file.WriteLine(" FILE INFO:"); - file.WriteLine(string.Format(" FileName: {0}", Path.GetFileName(eds.projectFilename))); - file.WriteLine(string.Format(" FileVersion: {0}", eds.fi.FileVersion)); - file.WriteLine(string.Format(" CreationTime: {0}", eds.fi.CreationTime)); - file.WriteLine(string.Format(" CreationDate: {0}", eds.fi.CreationDate)); - file.WriteLine(string.Format(" CreatedBy: {0}", eds.fi.CreatedBy)); - file.WriteLine("*******************************************************************************/"); - file.WriteLine(""); - file.WriteLine(""); - - file.WriteLine("/*******************************************************************************"); - file.WriteLine(" DEVICE INFO:"); - file.WriteLine(string.Format(" VendorName: {0}", eds.di.VendorName)); - file.WriteLine(string.Format(" VendorNumber: {0}", eds.di.VendorNumber)); - file.WriteLine(string.Format(" ProductName: {0}", eds.di.ProductName)); - file.WriteLine(string.Format(" ProductNumber: {0}", eds.di.ProductNumber)); - file.WriteLine("*******************************************************************************/"); - file.WriteLine(""); - file.WriteLine(""); - - file.WriteLine(@"/******************************************************************************* - FEATURES -*******************************************************************************/"); - - file.WriteLine(string.Format(" #define CO_NO_SYNC {0} //Associated objects: 1005-1007", noSYNC)); - - file.WriteLine(string.Format(" #define CO_NO_EMERGENCY {0} //Associated objects: 1014, 1015", noEMCY)); - - file.WriteLine(string.Format(" #define CO_NO_TIME {0} //Associated objects: 1012, 1013", noTIME)); - - file.WriteLine(string.Format(" #define CO_NO_SDO_SERVER {0} //Associated objects: 1200-127F", noSDOservers)); - file.WriteLine(string.Format(" #define CO_NO_SDO_CLIENT {0} //Associated objects: 1280-12FF", noSDOclients)); - - file.WriteLine(string.Format(" #define CO_NO_GFC {0} //Associated objects: 1300", noGFC)); - file.WriteLine(string.Format(" #define CO_NO_SRDO {0} //Associated objects: 1301-1341, 1381-13C0", noSRDO)); - - int lssServer = 0; - if (eds.di.LSS_Supported == true) - { - lssServer = 1; - } - file.WriteLine(string.Format(" #define CO_NO_LSS_SERVER {0} //LSS Slave", lssServer)); - int lssClient = 0; - if (eds.di.LSS_Master == true) - { - lssClient = 1; - } - file.WriteLine(string.Format(" #define CO_NO_LSS_CLIENT {0} //LSS Master", lssClient)); - - int ngSlave = 0; - if (eds.di.NG_Slave == true) - { - ngSlave = 1; - } - file.WriteLine(string.Format(" #define CO_NODE_GUARDING_SLAVE {0} //NG Slave", ngSlave)); - - file.WriteLine(string.Format(" #define CO_NODE_GUARDING_MASTER {0} //NG Master", eds.di.NrOfNG_MonitoredNodes)); - - file.WriteLine(string.Format(" #define CO_NO_RPDO {0} //Associated objects: 14xx, 16xx", noRXpdos)); - file.WriteLine(string.Format(" #define CO_NO_TPDO {0} //Associated objects: 18xx, 1Axx", noTXpdos)); - - bool ismaster = false; - if(ObjectActive(0x1f80)) - { - ODentry master = eds.ods[0x1f80]; - - // we could do with a cut down function that returns a value rather than a string - string meh = formatvaluewithdatatype(master.defaultvalue, master.datatype); - meh = meh.Replace("L", ""); - - UInt32 NMTStartup = Convert.ToUInt32(meh, 16); - if ((NMTStartup & 0x01) == 0x01) - ismaster = true; - } - - file.WriteLine(string.Format(" #define CO_NO_NMT_MASTER {0}", ismaster==true?1:0)); - file.WriteLine(string.Format(" #define CO_NO_TRACE 0")); - file.WriteLine(""); - file.WriteLine(""); - file.WriteLine(@"/******************************************************************************* - OBJECT DICTIONARY -*******************************************************************************/"); - - file.WriteLine(string.Format(" #define CO_OD_NoOfElements {0}", enabledcount)); - file.WriteLine(""); - file.WriteLine(""); - - file.WriteLine(@"/******************************************************************************* - TYPE DEFINITIONS FOR RECORDS -*******************************************************************************/"); - - //We need to identify all the record types used and generate a struct for each one - //FIXME the original CANopenNode exporter said how many items used this struct in the comments - - List structnamelist = new List(); - - /* make sure, we have all storage groups */ - eds.CO_storageGroups.Add("ROM"); - eds.CO_storageGroups.Add("EEPROM"); - - foreach (KeyValuePair kvp in eds.ods) - { - ODentry od = kvp.Value; - - /* make sure, we have all storage groups */ - eds.CO_storageGroups.Add(od.prop.CO_storageGroup); - - if (od.objecttype != ObjectType.RECORD) - continue; - - string structname = String.Format("OD_{0}_t", make_cname(od.parameter_name,od)); - - if (structnamelist.Contains(structname)) - continue; - - structnamelist.Add(structname); - - // we need to search the mappings to find the largest or this will not generate correctly - // as can opennode only has 1 structure defined for all mappings see #220 - - if (kvp.Key>=0x1600 && kvp.Key<0x1800) - { - //switch the OD entry to the largest - od = maxRXmappingsOD; - } - - if (kvp.Key >= 0x1A00 && kvp.Key < 0x1C00) - { - //switch the OD entry to the largest - od = maxTXmappingsOD; - } - - if (od == null) - continue; - - List structmemberlist = new List(); - - file.WriteLine(string.Format("/*{0:X4} */ typedef struct {{", kvp.Key)); - foreach (KeyValuePair kvp2 in od.subobjects) // kvp.Value.subobjects) - { - string paramaterarrlen = ""; - ODentry subod = kvp2.Value; - - string proposedname = make_cname(subod.parameter_name,subod); - - int suffix=1; - while (structmemberlist.Contains(proposedname)) - { - Warnings.AddWarning(string.Format("STRUCT WARNING; in 0x{0:X4}/{1:X2} Duplicate struct entry name, it has been auto numbered",subod.Index,subod.Subindex),Warnings.warning_class.WARNING_STRUCT); - proposedname = make_cname(subod.parameter_name,subod) + suffix.ToString(); - suffix++; - } - - structmemberlist.Add(proposedname); - - if (subod.datatype==DataType.VISIBLE_STRING || subod.datatype==DataType.OCTET_STRING) - { - paramaterarrlen = String.Format("[{0}]", subod.Lengthofstring); - } - - file.WriteLine(string.Format(" {0,-15}{1}{2};", subod.datatype.ToString(), proposedname,paramaterarrlen)); - - } - - file.WriteLine(string.Format(" }} {0};", structname)); - - } - - - - file.WriteLine(@" -/******************************************************************************* - TYPE DEFINITIONS FOR OBJECT DICTIONARY INDEXES - - some of those are redundant with CO_SDO.h CO_ObjDicId_t -*******************************************************************************/"); - - //FIXME how can we get rid of that redundancy? - - foreach (KeyValuePair kvp in eds.ods) - { - - ODentry od = kvp.Value; - - if (od.prop.CO_disabled == true) - continue; - - DataType t = eds.Getdatatype(od); - - - switch (od.objecttype) - { - default: - { - file.WriteLine(string.Format("/*{0:X4} */", od.Index)); - file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0:X4}_{1}", od.Index, make_cname(od.parameter_name,od)), od.Index, t.ToString())); - - file.WriteLine(""); - } - break; - - case ObjectType.ARRAY: - case ObjectType.RECORD: - { - file.WriteLine(string.Format("/*{0:X4} */", od.Index)); - file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0:X4}_{1}", od.Index, make_cname(od.parameter_name,od)), od.Index, t.ToString())); - - file.WriteLine(""); - - //sub indexes - file.WriteLine(string.Format(" #define {0,-51} 0", string.Format("OD_{0:X4}_0_{1}_maxSubIndex", od.Index, make_cname(od.parameter_name,od)))); - - List ODSIs = new List(); - - string ODSIout = ""; - - foreach (KeyValuePair kvp2 in od.subobjects) - { - ODentry sub = kvp2.Value; - - if (kvp2.Key == 0) - continue; - - string ODSI = string.Format("{0}", string.Format("OD_{0:X4}_{1}_{2}_{3}", od.Index, kvp2.Key, make_cname(od.parameter_name,od), make_cname(sub.parameter_name,sub))); - - if (ODSIs.Contains(ODSI)) - { - continue; - } - - ODSIs.Add(ODSI); - - ODSIout += ($" #define {ODSI,-51} {kvp2.Key}{Environment.NewLine}"); - } - - file.Write(ODSIout); - file.WriteLine(""); - } - break; - } - } - - file.WriteLine(@"/******************************************************************************* - STRUCTURES FOR VARIABLES IN DIFFERENT MEMORY LOCATIONS -*******************************************************************************/ -#define CO_OD_FIRST_LAST_WORD 0x55 //Any value from 0x01 to 0xFE. If changed, EEPROM will be reinitialized. -"); - foreach (string location in eds.CO_storageGroups) - { - if (location == "Unused") - { - continue; - } - - file.Write("/***** Structure for "); - file.Write(location); - file.WriteLine(" variables ********************************************/"); - file.Write("struct sCO_OD_"); - file.Write(location); - file.Write(@"{ - UNSIGNED32 FirstWord; - -"); - - file.Write(print_h_bylocation(location)); - - file.WriteLine(@" - UNSIGNED32 LastWord; -}; -"); - } - - file.WriteLine(@"/***** Declaration of Object Dictionary variables *****************************/"); - - foreach (string location in eds.CO_storageGroups) - { - if (location == "Unused") - { - continue; - } - - file.Write("extern struct sCO_OD_"); - file.Write(location); - file.Write(" CO_OD_"); - file.Write(location); - file.WriteLine(@"; -"); - } - -file.WriteLine(@"/******************************************************************************* - ALIASES FOR OBJECT DICTIONARY VARIABLES -*******************************************************************************/"); - - List constructed_rec_types = new List(); - - foreach (KeyValuePair kvp in eds.ods) - { - - - ODentry od = kvp.Value; - - if (od.prop.CO_disabled == true) - continue; - - string loc = "CO_OD_" + od.prop.CO_storageGroup; - - DataType t = eds.Getdatatype(od); - - - switch (od.objecttype) - { - default: - { - file.WriteLine(string.Format("/*{0:X4}, Data Type: {1} */", od.Index, t.ToString())); - file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0}_idx", make_cname(od.parameter_name, od)), od.Index, t.ToString())); - file.WriteLine(string.Format(" #define {0,-51} {1}.{2}", string.Format("OD_{0}", make_cname(od.parameter_name,od)), loc, make_cname(od.parameter_name,od))); - - DataType dt = od.datatype; - - if (dt == DataType.OCTET_STRING || dt == DataType.VISIBLE_STRING) - { - file.WriteLine(string.Format(" #define {0,-51} {1}", string.Format("ODL_{0}_stringLength", make_cname(od.parameter_name,od)), od.Lengthofstring)); - } - file.WriteLine(""); - } - break; - - case ObjectType.ARRAY: - { - DataType dt = od.datatype; - - file.WriteLine(string.Format("/*{0:X4}, Data Type: {1}, Array[{2}] */", od.Index, t.ToString(), od.Nosubindexes - 1)); - file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0}_idx", make_cname(od.parameter_name, od)), od.Index, t.ToString())); - file.WriteLine(string.Format(" #define OD_{0,-48} {1}.{2}", make_cname(od.parameter_name,od), loc, make_cname(od.parameter_name,od))); - file.WriteLine(string.Format(" #define {0,-51} {1}", string.Format("ODL_{0}_arrayLength", make_cname(od.parameter_name,od)), od.Nosubindexes - 1)); - - - List ODAs = new List(); - - string ODAout = ""; - - foreach (KeyValuePair kvp2 in od.subobjects) - { - ODentry sub = kvp2.Value; - - if (kvp2.Key == 0) - continue; - - string ODA = string.Format("{0}", string.Format("ODA_{0}_{1}", make_cname(od.parameter_name,od), make_cname(sub.parameter_name,sub))); - - if (ODAs.Contains(ODA)) - { - continue; - } - - ODAs.Add(ODA); - - //Arrays do not have a size in the raw CO objects, Records do - //so offset by one - if (od.objecttype == ObjectType.ARRAY) - { - ODAout += ($" #define {string.Format("ODA_{0}_{1}", make_cname(od.parameter_name,od), make_cname(sub.parameter_name,sub)),-51} {kvp2.Key - 1}{Environment.NewLine}"); - } - else - { - ODAout += ($" #define {string.Format("ODA_{0}_{1}", make_cname(od.parameter_name,od), make_cname(sub.parameter_name,sub)),-51} {kvp2.Key}{Environment.NewLine}"); - } - } - - file.Write(ODAout); - file.WriteLine(""); - } - break; - - case ObjectType.RECORD: - { - string rectype = make_cname(od.parameter_name,od); - - if (!constructed_rec_types.Contains(rectype)) - { - file.WriteLine(string.Format("/*{0:X4}, Data Type: {1}_t */", od.Index, rectype)); - file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0}_idx", make_cname(od.parameter_name, od)), od.Index, t.ToString())); - file.WriteLine(string.Format(" #define {0,-51} {1}.{2}", string.Format("OD_{0}", rectype), loc, rectype)); - constructed_rec_types.Add(rectype); - file.WriteLine(""); - } - - } - break; - } - } - file.WriteLine("#endif"); - file.WriteLine("// clang-format on"); - file.Close(); - - } - - private void export_c(string filename) - { - if (filename == "") - filename = "CO_OD"; - StreamWriter file = new StreamWriter(folderpath + Path.DirectorySeparatorChar + filename + ".c"); - - file.WriteLine("// clang-format off"); - addHeader(file); - file.WriteLine(@"// For CANopenNode V2 users, C macro `CO_VERSION_MAJOR=2` has to be added to project options -#ifndef CO_VERSION_MAJOR - #include ""CO_driver.h"" - #include """ + Path.GetFileNameWithoutExtension(filename) + @".h"" - #include ""CO_SDO.h"" -#elif CO_VERSION_MAJOR < 4 - #include ""301/CO_driver.h"" - #include """ + Path.GetFileNameWithoutExtension(filename) + @".h"" - #include ""301/CO_SDOserver.h"" -#else - #error This Object dictionary is not compatible with CANopenNode v4.0 and up! -#endif - -/******************************************************************************* - DEFINITION AND INITIALIZATION OF OBJECT DICTIONARY VARIABLES -*******************************************************************************/ - -"); - foreach (string location in eds.CO_storageGroups) - { - if (location == "Unused") - { - continue; - } - - file.Write("/***** Definition for "); - file.Write(location); - file.WriteLine(" variables *******************************************/"); - file.Write("struct sCO_OD_"); - file.Write(location); - file.Write(" CO_OD_"); - file.Write(location); - file.Write(@" = { - CO_OD_FIRST_LAST_WORD, - -"); - - file.Write(export_OD_def_array(location)); - - file.WriteLine(@" - CO_OD_FIRST_LAST_WORD, -}; - -"); - } - - - file.WriteLine(@" - -/******************************************************************************* - STRUCTURES FOR RECORD TYPE OBJECTS -*******************************************************************************/ - -"); - - file.Write(export_record_types()); - - file.Write(@"/******************************************************************************* - OBJECT DICTIONARY -*******************************************************************************/ -const CO_OD_entry_t CO_OD[CO_OD_NoOfElements] = { -"); - - file.Write(write_od()); - - file.WriteLine("};"); - file.WriteLine("// clang-format on"); - - file.Close(); - } - - bool arrayspecialcase = false; - int arrayspecialcasecount = 0; - - string write_od() - { - - StringBuilder returndata = new StringBuilder(); - - foreach (KeyValuePair kvp in eds.ods) - { - - ODentry od = kvp.Value; - - if (od.prop.CO_disabled == true) - continue; - - returndata.Append(write_od_line(od)); - - - } - - return returndata.ToString(); - } - - protected string write_od_line(ODentry od) - { - StringBuilder sb = new StringBuilder(); - - string loc = "CO_OD_" + od.prop.CO_storageGroup; - - byte flags = getflags(od); - - int datasize = od.objecttype == ObjectType.RECORD ? 0 : (int)Math.Ceiling((double)od.Sizeofdatatype() / (double)8.0); - - string array = ""; - - //only needed for array objects - if (od.objecttype == ObjectType.ARRAY && od.Nosubindexes > 0) - array = string.Format("[0]"); - - - if (arrayspecial(od.Index, true)) - { - arrayspecialcase = true; - arrayspecialcasecount = 0; - } - - if (arrayspecialcase) - { - array = string.Format("[{0}]", arrayspecialcasecount); - arrayspecialcasecount++; - } - - //Arrays and Recs have 1 less subindex than actually present in the od.subobjects - int nosubindexs = od.Nosubindexes; - if (od.objecttype == ObjectType.ARRAY || od.objecttype == ObjectType.RECORD) - { - if (nosubindexs > 0) - nosubindexs--; - } - - //Arrays really should obey the max subindex parameter not the physical number of elements - if (od.objecttype == ObjectType.ARRAY) - { - if ((od.Getmaxsubindex() != nosubindexs)) - { - if (od.Index != 0x1003 && od.Index != 0x1011)//ignore 0x1003, it is a special case as per CANopen specs, and ignore 0x1011 CANopenNode uses special sub indexes for eeprom resets - { - Warnings.AddWarning(String.Format("Subindex discrepancy on object 0x{0:X4} arraysize: {1} vs max sub-index: {2}", od.Index, nosubindexs, od.Getmaxsubindex())); - } - - //0x1003 is a special case for CANopenNode - //SubIndex 0 will probably be 0 for no errors - //so we cannot read that to determine max subindex size, which is required to set up CANopenNode so we leave it alone here - //as its already set to subod.count - if (od.Index != 0x1003) - { - nosubindexs = od.Getmaxsubindex(); - } - } - } - - string pdata; //CO_OD_entry_t pData generator - - if (od.objecttype == ObjectType.RECORD) - { - - pdata = string.Format("&OD_record{0:X4}", od.Index); - } - else - { - pdata = string.Format("&{0}.{1}{2}", loc, make_cname(od.parameter_name,od), array); - } - - if ((od.objecttype == ObjectType.VAR || od.objecttype == ObjectType.ARRAY) && od.datatype == DataType.DOMAIN) - { - //NB domain MUST have a data pointer of 0, can open node requires this and makes checks - //against null to determine this is a DOMAIN type. - pdata = "0"; - } - - sb.AppendLine($"{{0x{od.Index:X4}, 0x{nosubindexs:X2}, 0x{flags:X2}, {datasize,2:#0}, (void*){pdata}}},"); - - if (arrayspecial(od.Index, false)) - { - arrayspecialcase = false; - } - - return sb.ToString(); - } - - /// - /// Get the CANopenNode specific flags, these flags are used internally in CANopenNode to determine details about the object variable - /// - /// An odentry to access - /// byte containing the flag value - public byte getflags(ODentry od) - { - byte flags = 0; - byte mapping = 0; //mapping flags, if pdo is enabled - - //aways return 0 for REC objects as CO_OD_getDataPointer() uses this to pickup the details - if (od.objecttype == ObjectType.RECORD) - return 0; - - switch((od.parent == null ? od : od.parent).prop.CO_storageGroup.ToUpper()) - { - case "ROM": - flags = 0x01; - break; - - case "RAM": - flags = 0x02; - break; - - case "EEPROM": - default: - flags = 0x03; - break; - } - - /* some exceptions for rwr/rww. Those are entries that are always r/w via SDO transfer, - * but can only be read -or- written via PDO */ - if (od.accesstype == EDSsharp.AccessType.ro - || od.accesstype == EDSsharp.AccessType.rw - || od.accesstype == EDSsharp.AccessType.rwr - || od.accesstype == EDSsharp.AccessType.rww - || od.accesstype == EDSsharp.AccessType.@const) - { - /* SDO server may read from the variable */ - flags |= 0x04; - - if (od.accesstype != EDSsharp.AccessType.rww) - { - /* Variable is mappable for TPDO */ - mapping |= 0x20; - } - } - if (od.accesstype == EDSsharp.AccessType.wo - || od.accesstype == EDSsharp.AccessType.rw - || od.accesstype == EDSsharp.AccessType.rwr - || od.accesstype == EDSsharp.AccessType.rww) - { - /* SDO server may write to the variable */ - flags |= 0x08; - - if (od.accesstype != EDSsharp.AccessType.rwr) - { - /* Variable is mappable for RPDO */ - mapping |= 0x10; - } - } - - if (od.Index == 0x1003) - { - /* SDO server may write to the variable */ - flags |= 0x08; - } - - switch (od.PDOtype) - { - case libEDSsharp.PDOMappingType.RPDO: mapping |= 0x10; break; - case libEDSsharp.PDOMappingType.TPDO: mapping |= 0x20; break; - case libEDSsharp.PDOMappingType.optional: mapping |= 0x30; break; - } - - if (od.PDOMapping) - { - flags |= mapping; - } - - if(od.prop.CO_flagsPDO) - { - /* If variable is mapped to any PDO, then is automatically send, if variable its value */ - flags |=0x40; - } - - if(od.parent!=null && od.parent.prop.CO_flagsPDO) - { - //parent types are storing the prop in the ODeditor in the parent object but the child object is tested to set the flag - //this is breaking legacy export - flags |= 0x40; - } - - - int datasize = (int)Math.Ceiling((double)od.Sizeofdatatype() / (double)8.0); - - if (datasize > 1) - { - if (od.datatype == DataType.VISIBLE_STRING || - od.datatype == DataType.OCTET_STRING) - { - //#149 VISIBLE_STRING and OCTET_STRING are an arrays of 8 bit values, either VISIBLE_CHAR or UNSIGNED8 - //and therefor are NOT multi-byte - } - else - { - /* variable is a multi-byte value */ - flags |= 0x80; - } - } - - return flags; - } - - string formatvaluewithdatatype(string defaultvalue, DataType dt, bool fixstring=false) - { - try - { - int nobase = 10; - bool nodeidreplace = false; - - - if (defaultvalue == null || defaultvalue == "") - { - //No default value, we better supply one for sensible data types - if (dt == DataType.VISIBLE_STRING || - dt == DataType.OCTET_STRING || - dt == DataType.UNKNOWN || - dt == DataType.UNICODE_STRING) - { - - if (fixstring == true) - return "'X'"; - - return ""; - } - - Console.WriteLine("Warning assuming a 0 default"); - defaultvalue = "0"; - } - - if (defaultvalue.Contains("$NODEID", StringComparison.OrdinalIgnoreCase)) // fetch different case of "NODeID" (allowed according DS301) - { - defaultvalue = defaultvalue.ToUpper().Replace("$NODEID", ""); - defaultvalue = defaultvalue.Replace("+", ""); - defaultvalue = defaultvalue.Trim(); - nodeidreplace = true; - } - - String pat = @"^0[xX][0-9a-fA-FL]+"; - - Regex r = new Regex(pat, RegexOptions.IgnoreCase); - Match m = r.Match(defaultvalue); - if (m.Success) - { - nobase = 16; - defaultvalue = defaultvalue.Replace("L", ""); - } - - pat = @"^0[0-7]+"; - r = new Regex(pat, RegexOptions.IgnoreCase); - m = r.Match(defaultvalue); - if (m.Success) - { - nobase = 8; - } - - if (nodeidreplace) - { - UInt32 data = Convert.ToUInt32(defaultvalue.Trim(), nobase); - data += eds.NodeID; - defaultvalue = string.Format("0x{0:X}", data); - nobase = 16; - } - - - switch (dt) - { - case DataType.UNSIGNED24: - case DataType.UNSIGNED32: - return String.Format("0x{0:X4}L", Convert.ToUInt32(defaultvalue, nobase)); - - case DataType.INTEGER24: - case DataType.INTEGER32: - return String.Format("0x{0:X4}L", Convert.ToInt32(defaultvalue, nobase)); - - case DataType.REAL32: - case DataType.REAL64: - return (String.Format("{0}", defaultvalue)); - - - //fix me this looks wrong - case DataType.UNICODE_STRING: - return (String.Format("'{0}'", defaultvalue)); - - case DataType.VISIBLE_STRING: - { - - ASCIIEncoding a = new ASCIIEncoding(); - string unescape = StringUnescape.Unescape(defaultvalue); - char[] chars = unescape.ToCharArray(); - - string array = "{"; - - foreach (char c in chars) - { - - array += "'" + StringUnescape.Escape(c) + "', "; - } - - array = array.Substring(0, array.Length - 2); - - array += "}"; - return array; - - } - - - case DataType.OCTET_STRING: - { - string[] bits = defaultvalue.Split(' '); - string octet = "{"; - foreach (string s in bits) - { - octet += formatvaluewithdatatype(s, DataType.UNSIGNED8); - - if (!object.ReferenceEquals(s, bits.Last())) - { - octet += ", "; - } - } - octet += "}"; - return octet; - } - - case DataType.INTEGER8: - return String.Format("0x{0:X1}", Convert.ToSByte(defaultvalue, nobase)); - - case DataType.INTEGER16: - return String.Format("0x{0:X2}", Convert.ToInt16(defaultvalue, nobase)); - - case DataType.UNSIGNED8: - return String.Format("0x{0:X1}L", Convert.ToByte(defaultvalue, nobase)); - - case DataType.UNSIGNED16: - return String.Format("0x{0:X2}", Convert.ToUInt16(defaultvalue, nobase)); - - case DataType.INTEGER64: - return String.Format("0x{0:X8}L", Convert.ToInt64(defaultvalue, nobase)); - - case DataType.UNSIGNED64: - return String.Format("0x{0:X8}L", Convert.ToUInt64(defaultvalue, nobase)); - - case DataType.TIME_DIFFERENCE: - case DataType.TIME_OF_DAY: - return String.Format("{{{0}}}", Convert.ToUInt64(defaultvalue, nobase)); - - default: - return (String.Format("{0:X}", defaultvalue)); - - } - } - catch(Exception) - { - Warnings.AddWarning(String.Format("Error converting value {0} to type {1}", defaultvalue, dt.ToString()),Warnings.warning_class.WARNING_BUILD); - return ""; - } - } - - public static string ParseString(string input) - { - var provider = new Microsoft.CSharp.CSharpCodeProvider(); - var parameters = new System.CodeDom.Compiler.CompilerParameters() - { - GenerateExecutable = false, - GenerateInMemory = true, - }; - - var code = @" - namespace Tmp - { - public class TmpClass - { - public static string GetValue() - { - return """ + input + @"""; - } - } - }"; - - var compileResult = provider.CompileAssemblyFromSource(parameters, code); - - if (compileResult.Errors.HasErrors) - { - throw new ArgumentException(compileResult.Errors.Cast().First(e => !e.IsWarning).ErrorText); - } - - var asmb = compileResult.CompiledAssembly; - var method = asmb.GetType("Tmp.TmpClass").GetMethod("GetValue"); - - return method.Invoke(null, null) as string; - } - - protected string make_cname(string name,ODentry entry) - { - if (name == null) - return null; - - if (name == "") - return ""; - - Regex splitter = new Regex(@"[\W]+"); - - //string[] bits = Regex.Split(name,@"[\W]+"); - var bits = splitter.Split(name).Where(s => s != String.Empty); - - string output = ""; - - char lastchar = ' '; - foreach (string s in bits) - { - if(Char.IsUpper(lastchar) && Char.IsUpper(s.First())) - output+="_"; - - if (s.Length > 1) - { - output += char.ToUpper(s[0]) + s.Substring(1); - } - else - { - output += s; - } - - if(output.Length>0) - lastchar = output.Last(); - - } - - if (output.Length > 1) - { - if (Char.IsLower(output[1])) - output = Char.ToLowerInvariant(output[0]) + output.Substring(1); - } - else - output = output.ToLowerInvariant(); //single character - - - UInt32 key = (UInt32)((entry.Index << 8) + entry.Subindex ); - - if ((entry.Index >= 0x1200) && (entry.Index < 0x1280)) - key = (UInt32)((0x1200 << 8) + entry.Subindex); - - if ((entry.Index >= 0x1280) && (entry.Index < 0x1300)) - key = (UInt32)((0x1280 << 8) + entry.Subindex); - - if ((entry.Index >= 0x1400) && (entry.Index < 0x1600)) - key = (UInt32)((0x1400 <<8) + entry.Subindex); - - if ((entry.Index >= 0x1600) && (entry.Index < 0x1800)) - key = (UInt32)((0x1600 << 8) + entry.Subindex); - - if ((entry.Index >= 0x1800) && (entry.Index < 0x1a00)) - key = (UInt32)((0x1800 << 8) + entry.Subindex); - - if ((entry.Index >= 0x1a00) && (entry.Index < 0x1c00)) - key = (UInt32)((0x1a00 << 8) + entry.Subindex); - - if (acceptable_canopen_names.ContainsKey(key) && !(entry.parent != null && entry.Subindex == 0)) - { - string newname = acceptable_canopen_names[key]; - if (output != newname) - Warnings.AddWarning(string.Format("Warning: index 0x{0:X4}/{1:X2} correcting name for CanOpenNode compatibility from {2} to {3}", entry.Index, entry.Subindex, output, newname),Warnings.warning_class.WARNING_RENAME); - output = newname; - } - - return output; - } - - /// - /// Export the record type objects in the CO_OD.c file - /// - /// string - protected string export_record_types() - { - StringBuilder returndata = new StringBuilder(); - - bool arrayopen = false; - int arrayindex = 0; - - foreach (KeyValuePair kvp in eds.ods) - { - ODentry od = kvp.Value; - - if (od.objecttype != ObjectType.RECORD) - continue; - - if (od.prop.CO_disabled == true) - continue; - - int count = od.subobjects.Count; //don't include index - - if(od.Index>=0x1400 && od.Index<0x1600) - { - //what is this doing for us? - //count = 3; //CANopenNode Fudging. Its only 3 parameters for RX PDOS in the c code despite being a PDO_COMMUNICATION_PARAMETER - } - - returndata.AppendLine($"/*0x{od.Index:X4}*/ const CO_OD_entryRecord_t OD_record{od.Index:X4}[{count}] = {{"); - - string arrayaccess = ""; - - if (arrayspecial(od.Index, true) || arrayopen) - { - arrayaccess = string.Format("[{0}]",arrayindex); - arrayindex++; - arrayopen = true; - } - - foreach (KeyValuePair kvpsub in od.subobjects) - { - returndata.Append(export_one_record_type(kvpsub.Value,arrayaccess)); - } - - if (arrayspecial(od.Index, false)) - { - arrayindex=0; - arrayopen = false; - } - - returndata.AppendLine($"}};{Environment.NewLine}"); - } - - return returndata.ToString(); - } - - /// - /// Exports a sub object line in a record object - /// - /// sub ODentry object to export - /// string forming current array level or empty string for none - /// string forming one line of CO_OD.c record objects - protected string export_one_record_type(ODentry sub,string arrayaccess) - { - - if (sub == null || sub.parent == null) - return ""; - - StringBuilder sb = new StringBuilder(); - - string cname = make_cname(sub.parent.parameter_name,sub.parent); - - string subcname = make_cname(sub.parameter_name,sub); - int datasize = (int)Math.Ceiling((double)sub.Sizeofdatatype() / (double)8.0); - - if (sub.datatype != DataType.DOMAIN) - { - sb.AppendLine($" {{(void*)&{"CO_OD_" + sub.parent.prop.CO_storageGroup}.{cname}{arrayaccess}.{subcname}, 0x{getflags(sub):X2}, 0x{datasize:X} }},"); - } - else - { - //Domain type MUST have its data pointer set to 0 for CANopenNode - sb.AppendLine($" {{(void*)0, 0x{getflags(sub):X2}, 0x{datasize:X} }},"); - } - - return sb.ToString(); - } - - - int noTXpdos = 0; - int noRXpdos = 0; - int noSDOclients = 0; - int noSDOservers = 0; - int distTXpdo = 0; - int distRXpdo = 0; - int noSYNC = 0; - int noEMCY = 0; - int noTIME = 0; - int noGFC = 0; - int noSRDO = 0; - - void countPDOS() - { - noRXpdos = 0; - noTXpdos = 0; - - //feature tests for default CanOpenNode build - //if you have a custom CanOpen.c then you may not require all these features - - //check the SYNC feature - int checkfeature = 0; - if (ObjectActive(0x1005)) - checkfeature++; - if (ObjectActive(0x1006)) - checkfeature++; - if (ObjectActive(0x1007)) - checkfeature++; - if (ObjectActive(0x1019)) - checkfeature++; - if (checkfeature == 4) - { - noSYNC = 1; - } - else - { - Warnings.AddWarning("BUILD WARNING, required objects for SYNC are not present 0x1005,0x1006,0x1007,0x1019",Warnings.warning_class.WARNING_BUILD); - } - - //EMCY - checkfeature = 0; - if (ObjectActive(0x1003)) - checkfeature++; - if (ObjectActive(0x1014)) - checkfeature++; - if (ObjectActive(0x1015)) - checkfeature++; - if (checkfeature == 3) - { - noEMCY = 1; - } - else - { - Warnings.AddWarning("BUILD WARNING, required objects for EMCY are not present 0x1003,0x1014,0x1015",Warnings.warning_class.WARNING_BUILD); - } - - //TIME - if (ObjectActive(0x1012)) - { - noTIME = 1; - } - else - { - //TIME is optional - } - - //NMT CLIENT - checkfeature = 0; - if (ObjectActive(0x1f80)) - checkfeature ++; - if (ObjectActive(0x1029)) - checkfeature ++; - if (ObjectActive(0x1017)) - checkfeature ++; - if (ObjectActive(0x1001)) - checkfeature ++; - if (checkfeature == 4) - { - //NMT Client is not optional - } - else - { - Warnings.AddWarning("BUILD WARNING, required objects for NMT Client are not present 0x1f80,0x1029,0x1017,0x1001",Warnings.warning_class.WARNING_BUILD); - } - - foreach (KeyValuePair kvp in eds.ods) - { - UInt16 index = kvp.Key; - - if (kvp.Value.prop.CO_disabled == true) - continue; - - if (index >= 0x1400 && index < 0x1600) - { - noRXpdos++; - distRXpdo = index - 0x1400; - } - - if (index >= 0x1800 && index < 0x1A00) - { - noTXpdos++; - distTXpdo = index - 0x1800; - } - - if((index & 0xFF80) == 0x1200) - { - noSDOservers++; - } - - if ((index & 0xFF80) == 0x1280) - { - noSDOclients++; - } - - if (index == 0x1300) - noGFC = 1; - - if (index >= 0x1301 && index <= 0x1340) - noSRDO++; - } - } - - bool arrayspecial(UInt16 index, bool open) - { - - if (open) - { - - if (openings.Contains(index)) - return true; - } - else - { - - if (closings.Contains(index)) - return true; - } - - return false; - } - - - string export_OD_def_array(string location) - { - - StringBuilder sb = new StringBuilder(); - - foreach (KeyValuePair kvp in eds.ods) - { - ODentry od = kvp.Value; - - if (od.prop.CO_disabled == true || od.prop.CO_storageGroup != location) - continue; - - if (od.Nosubindexes == 0) - { - sb.AppendLine($"/*{od.Index:X4}*/ {formatvaluewithdatatype(od.defaultvalue, od.datatype,true)},"); - } - else - { - if (arrayspecial(od.Index, true)) - { - sb.AppendFormat("/*{0:X4}*/ {{{{", od.Index); - } - else - { - sb.AppendFormat("/*{0:X4}*/ {{", od.Index); - } - - foreach (KeyValuePair kvp2 in od.subobjects) - { - ODentry sub = kvp2.Value; - - DataType dt = sub.datatype; - - if ((od.objecttype==ObjectType.ARRAY) && kvp2.Key == 0) - continue; - - sb.Append(formatvaluewithdatatype(sub.defaultvalue, dt,true)); - - if (od.subobjects.Keys.Last() != kvp2.Key) - sb.Append(", "); - } - - if (arrayspecial(od.Index, false)) - { - sb.AppendLine("}},"); - } - else - { - sb.AppendLine("},"); - } - } - } - - return sb.ToString(); - } - } - - - - - - -} +/* + This file is part of libEDSsharp. + + libEDSsharp is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + libEDSsharp is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with libEDSsharp. If not, see . + + Copyright(c) 2016 - 2019 Robin Cornelius + based heavily on the files CO_OD.h and CO_OD.c from CANopenNode which are + Copyright(c) 2010 - 2016 Janez Paternoster +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.IO; + + + +namespace libEDSsharp +{ + + public class CanOpenNodeExporter : IExporter + { + + private string folderpath; + private string gitVersion; + protected EDSsharp eds; + + private int enabledcount = 0; + + Dictionary acceptable_canopen_names = new Dictionary(); + + //Used for array tracking + Dictionary au = new Dictionary(); + List openings = new List(); + List closings = new List(); + + private byte maxRXmappingsize = 0; + private byte maxTXmappingsize = 0; + ODentry maxRXmappingsOD=null; + ODentry maxTXmappingsOD=null; + + + public void prepareCanOpenNames() + { + acceptable_canopen_names.Add(0x101800, "identity"); + + acceptable_canopen_names.Add(0x140000, "RPDOCommunicationParameter"); + acceptable_canopen_names.Add(0x160000, "RPDOMappingParameter"); + acceptable_canopen_names.Add(0x180000, "TPDOCommunicationParameter"); + acceptable_canopen_names.Add(0x1a0000, "TPDOMappingParameter"); + + acceptable_canopen_names.Add(0x100500, "COB_ID_SYNCMessage"); + + + + acceptable_canopen_names.Add(0x101801, "vendorID"); + acceptable_canopen_names.Add(0x101802, "productCode"); + acceptable_canopen_names.Add(0x101803, "revisionNumber"); + acceptable_canopen_names.Add(0x101804, "serialNumber"); + + acceptable_canopen_names.Add(0x120000, "SDOServerParameter"); + acceptable_canopen_names.Add(0x120001, "COB_IDClientToServer"); + acceptable_canopen_names.Add(0x120002, "COB_IDServerToClient"); + + acceptable_canopen_names.Add(0x128000, "SDOClientParameter"); + acceptable_canopen_names.Add(0x128001, "COB_IDClientToServer"); + acceptable_canopen_names.Add(0x128002, "COB_IDServerToClient"); + + acceptable_canopen_names.Add(0x102900, "errorBehavior"); + + } + + + public void export(string folderpath, string filename, string gitVersion, EDSsharp eds,string odname) + { + this.folderpath = folderpath; + this.gitVersion = gitVersion; + this.eds = eds; + + + enabledcount = eds.GetNoEnabledObjects(); + + prepareCanOpenNames(); + + countPDOS(); + + + fixcompatentry(); + + prewalkArrays(); + + export_h(filename); + export_c(filename); + + } + + private void fixcompatentry() + { + // Handle the TPDO communication parameters in a special way, because of + // sizeof(OD_TPDOCommunicationParameter_t) != sizeof(CO_TPDOCommPar_t) in CANopen.c + // the existing CO_TPDOCommPar_t has a compatibility entry so we must export one regardless + // of if its in the OD or not + + for (UInt16 idx = 0x1800; idx < 0x1900; idx++) + { + if (ObjectActive(idx)) + { + ODentry od = eds.ods[idx]; + + if (!od.Containssubindex(0x04)) + { + ODentry compatibility = new ODentry("compatibility entry", idx, DataType.UNSIGNED8, "0", EDSsharp.AccessType.ro, PDOMappingType.no, od); + od.subobjects.Add(0x04, compatibility); + } + } + } + + } + + private void specialarraysearch(UInt16 start, UInt16 end) + { + UInt16 lowest = 0xffff; + UInt16 highest = 0x0000; + + foreach (KeyValuePair kvp in eds.ods) + { + + if (kvp.Value.prop.CO_disabled == true) + continue; + + if (kvp.Key >= start && kvp.Key <= end) + { + if (kvp.Key > highest) + highest = kvp.Key; + + if (kvp.Key < lowest) + lowest = kvp.Key; + } + } + + if(lowest!=0xffff && highest!=0x0000) + { + openings.Add(lowest); + closings.Add(highest); + + Console.WriteLine(string.Format("New special array detected start 0x{0:X4} end 0x{1:X4}", lowest, highest)); + } + } + + public bool ObjectActive(UInt16 index) + { + if (eds.ods.ContainsKey(index)) + { + return !eds.ods[index].prop.CO_disabled; + } + else return false; + } + + protected void prewalkArrays() + { + + foreach (KeyValuePair kvp in eds.ods) + { + ODentry od = kvp.Value; + if (od.prop.CO_disabled == true) + continue; + + string name = make_cname(od.parameter_name,od); + if (au.ContainsKey(name)) + { + au[name]++; + } + else + { + au[name] = 1; + } + } + + + //Handle special arrays + + specialarraysearch(0x1301, 0x1340); + specialarraysearch(0x1381, 0x13C0); + + + //SDO Client parameters + specialarraysearch(0x1200, 0x127F); + //SDO Server Parameters + specialarraysearch(0x1280, 0x12FF); + + //PDO Mappings and configs + specialarraysearch(0x1400, 0x15FF); + specialarraysearch(0x1600, 0x17FF); + specialarraysearch(0x1800, 0x19FF); + specialarraysearch(0x1A00, 0x1BFF); + + //now find opening and closing points for these arrays + foreach (KeyValuePair kvp in au) + { + if ( kvp.Value > 1) + { + string targetname = kvp.Key; + UInt16 lowest=0xffff; + UInt16 highest=0x0000; + foreach (KeyValuePair kvp2 in eds.ods) + { + + string name = make_cname(kvp2.Value.parameter_name,kvp2.Value); + if(name==targetname) + { + if (kvp2.Key > highest) + highest = kvp2.Key; + + if (kvp2.Key < lowest) + lowest = kvp2.Key; + } + + } + + if (!openings.Contains(lowest)) + { + openings.Add(lowest); + closings.Add(highest); + Console.WriteLine(string.Format("New array detected start 0x{0:X4} end 0x{1:X4}", lowest, highest)); + } + + } + + } + + //Find maximum no entries in a mapping config to define an appropriate array + maxRXmappingsize = 0; + maxTXmappingsize = 0; + + for (ushort x=0x1600;x<0x1800;x++) + { + if(ObjectActive(x)) + { + byte maxcount = EDSsharp.ConvertToByte(eds.ods[x].subobjects[0].defaultvalue); + + if(maxcount > maxRXmappingsize) + { + maxRXmappingsize = maxcount; + maxRXmappingsOD = eds.ods[x]; + } + } + } + + for (ushort x = 0x1a00; x < 0x1c00; x++) + { + if (ObjectActive(x)) + { + byte maxcount = EDSsharp.ConvertToByte(eds.ods[x].subobjects[0].defaultvalue); + + if (maxcount > maxTXmappingsize) + { + maxTXmappingsize = maxcount; + maxTXmappingsOD = eds.ods[x]; + } + } + } + } + + string lastname = ""; + + private string print_h_bylocation(string location) + { + + StringBuilder sb = new StringBuilder(); + + lastname = ""; + + foreach (KeyValuePair kvp in eds.ods) + { + ODentry od = kvp.Value; + + if (od.prop.CO_disabled == true || od.prop.CO_storageGroup != location) + continue; + + sb.Append(print_h_entry(od)); + + } + + return sb.ToString(); + } + + + protected string print_h_entry(ODentry od) + { + StringBuilder sb = new StringBuilder(); + + if (od.Nosubindexes == 0) + { + string specialarraylength = ""; + if (od.datatype == DataType.VISIBLE_STRING || od.datatype == DataType.OCTET_STRING || od.datatype == DataType.UNICODE_STRING) + { + + if (od.Lengthofstring == 0) + { + Warnings.AddWarning(string.Format(" Object 0x{0:X4}/{1:X2} A string must have a default value to set the required datasize for canopen node, i have set this to [1] byte to prevent compile errors", od.Index, od.Subindex),Warnings.warning_class.WARNING_STRING); + specialarraylength = "[1]"; + } + else + { + specialarraylength = string.Format("[{0}]", od.Lengthofstring); + } + } + + sb.AppendLine($"/*{od.Index:X4} */ {od.datatype.ToString(),-14} {make_cname(od.parameter_name,od)}{specialarraylength};"); + } + else + { + //fixme why is this not od.datatype? + DataType t = eds.Getdatatype(od); + + //If it not a defined type, and it probably is not for a REC, we must generate a name, this is + //related to the previous code that generated the actual structures. + + string objecttypewords = ""; + + switch (od.objecttype) + { + + case ObjectType.RECORD: + objecttypewords = String.Format("OD_{0}_t", make_cname(od.parameter_name,od)); + break; + case ObjectType.ARRAY: + objecttypewords = t.ToString(); //this case is handled by the logic in eds.getdatatype(); + break; + default: + objecttypewords = t.ToString(); + break; + } + + string name = make_cname(od.parameter_name,od); + if (au[name] > 1) + { + if (lastname == name) + return ""; + + lastname = name; + sb.AppendLine($"/*{od.Index:X4} */ {objecttypewords,-15} {make_cname(od.parameter_name,od)}[{au[name]}];"); + } + else + { + //Don't put sub indexes on record type in h file unless there are multiples of the same + //in which case its not handled here, we need a special case for the predefined special + //values that arrayspecial() checks for, to generate 1 element arrays if needed + if (od.objecttype == ObjectType.RECORD) + { + if (arrayspecial(od.Index, true)) + { + sb.AppendLine($"/*{od.Index:X4} */ {objecttypewords,-15} {make_cname(od.parameter_name,od)}[1];"); + } + else + { + sb.AppendLine($"/*{od.Index:X4} */ {objecttypewords,-15} {make_cname(od.parameter_name,od)};"); + } + } + else + { + string specialarraylength = ""; + + if (od.datatype == DataType.VISIBLE_STRING || od.datatype == DataType.OCTET_STRING || od.datatype == DataType.UNICODE_STRING) + { + int maxlength = 0; + foreach (ODentry sub in od.subobjects.Values) + { + if (sub.Lengthofstring> maxlength) + maxlength = sub.Lengthofstring; + } + + if (maxlength == 0) + { + Warnings.AddWarning(string.Format(" Object children of 0x{0:X4} A string must have a default value to set the required datasize for canopen node, i have set this to [1] byte to prevent compile errors", od.Index),Warnings.warning_class.WARNING_STRING); + maxlength = 1; + } + + + specialarraylength = string.Format("[{0}]", maxlength); + } + + sb.AppendLine($"/*{od.Index:X4} */ {objecttypewords,-15} {make_cname(od.parameter_name,od)}[{od.Nosubindexes - 1}]{specialarraylength};"); + } + } + } + + return sb.ToString(); + } + + private void addHeader(StreamWriter file) + { + file.WriteLine(string.Format( +@"/******************************************************************************* + CANopen Object Dictionary definition for CANopenNode v1 to v2 + + This file was automatically generated by CANopenEditor {0} + + https://github.com/CANopenNode/CANopenNode + https://github.com/CANopenNode/CANopenEditor + + DON'T EDIT THIS FILE MANUALLY !!!! +*******************************************************************************/", this.gitVersion)); + } + + private void export_h(string filename) + { + if (filename == "") + filename = "CO_OD"; + + StreamWriter file = new StreamWriter(folderpath + Path.DirectorySeparatorChar + filename + ".h"); + + file.WriteLine("// clang-format off"); + addHeader(file); + + file.WriteLine("#ifndef CO_OD_H_"); + file.WriteLine("#define CO_OD_H_"); + file.WriteLine(""); + + file.WriteLine(@"/******************************************************************************* + CANopen DATA TYPES +*******************************************************************************/ + typedef bool_t BOOLEAN; + typedef uint8_t UNSIGNED8; + typedef uint16_t UNSIGNED16; + typedef uint32_t UNSIGNED32; + typedef uint64_t UNSIGNED64; + typedef int8_t INTEGER8; + typedef int16_t INTEGER16; + typedef int32_t INTEGER32; + typedef int64_t INTEGER64; + typedef float32_t REAL32; + typedef float64_t REAL64; + typedef char_t VISIBLE_STRING; + typedef oChar_t OCTET_STRING; + + #ifdef DOMAIN + #undef DOMAIN + #endif + + typedef domain_t DOMAIN; + +"); + + file.WriteLine("/*******************************************************************************"); + file.WriteLine(" FILE INFO:"); + file.WriteLine(string.Format(" FileName: {0}", Path.GetFileName(eds.projectFilename))); + file.WriteLine(string.Format(" FileVersion: {0}", eds.fi.FileVersion)); + file.WriteLine(string.Format(" CreationTime: {0}", eds.fi.CreationTime)); + file.WriteLine(string.Format(" CreationDate: {0}", eds.fi.CreationDate)); + file.WriteLine(string.Format(" CreatedBy: {0}", eds.fi.CreatedBy)); + file.WriteLine("*******************************************************************************/"); + file.WriteLine(""); + file.WriteLine(""); + + file.WriteLine("/*******************************************************************************"); + file.WriteLine(" DEVICE INFO:"); + file.WriteLine(string.Format(" VendorName: {0}", eds.di.VendorName)); + file.WriteLine(string.Format(" VendorNumber: {0}", eds.di.VendorNumber)); + file.WriteLine(string.Format(" ProductName: {0}", eds.di.ProductName)); + file.WriteLine(string.Format(" ProductNumber: {0}", eds.di.ProductNumber)); + file.WriteLine("*******************************************************************************/"); + file.WriteLine(""); + file.WriteLine(""); + + file.WriteLine(@"/******************************************************************************* + FEATURES +*******************************************************************************/"); + + file.WriteLine(string.Format(" #define CO_NO_SYNC {0} //Associated objects: 1005-1007", noSYNC)); + + file.WriteLine(string.Format(" #define CO_NO_EMERGENCY {0} //Associated objects: 1014, 1015", noEMCY)); + + file.WriteLine(string.Format(" #define CO_NO_TIME {0} //Associated objects: 1012, 1013", noTIME)); + + file.WriteLine(string.Format(" #define CO_NO_SDO_SERVER {0} //Associated objects: 1200-127F", noSDOservers)); + file.WriteLine(string.Format(" #define CO_NO_SDO_CLIENT {0} //Associated objects: 1280-12FF", noSDOclients)); + + file.WriteLine(string.Format(" #define CO_NO_GFC {0} //Associated objects: 1300", noGFC)); + file.WriteLine(string.Format(" #define CO_NO_SRDO {0} //Associated objects: 1301-1341, 1381-13C0", noSRDO)); + + int lssServer = 0; + if (eds.di.LSS_Supported == true) + { + lssServer = 1; + } + file.WriteLine(string.Format(" #define CO_NO_LSS_SERVER {0} //LSS Slave", lssServer)); + int lssClient = 0; + if (eds.di.LSS_Master == true) + { + lssClient = 1; + } + file.WriteLine(string.Format(" #define CO_NO_LSS_CLIENT {0} //LSS Master", lssClient)); + + int ngSlave = 0; + if (eds.di.NG_Slave == true) + { + ngSlave = 1; + } + file.WriteLine(string.Format(" #define CO_NODE_GUARDING_SLAVE {0} //NG Slave", ngSlave)); + + file.WriteLine(string.Format(" #define CO_NODE_GUARDING_MASTER {0} //NG Master", eds.di.NrOfNG_MonitoredNodes)); + + file.WriteLine(string.Format(" #define CO_NO_RPDO {0} //Associated objects: 14xx, 16xx", noRXpdos)); + file.WriteLine(string.Format(" #define CO_NO_TPDO {0} //Associated objects: 18xx, 1Axx", noTXpdos)); + + bool ismaster = false; + if(ObjectActive(0x1f80)) + { + ODentry master = eds.ods[0x1f80]; + + // we could do with a cut down function that returns a value rather than a string + string meh = formatvaluewithdatatype(master.defaultvalue, master.datatype); + meh = meh.Replace("L", ""); + + UInt32 NMTStartup = Convert.ToUInt32(meh, 16); + if ((NMTStartup & 0x01) == 0x01) + ismaster = true; + } + + file.WriteLine(string.Format(" #define CO_NO_NMT_MASTER {0}", ismaster==true?1:0)); + file.WriteLine(string.Format(" #define CO_NO_TRACE 0")); + file.WriteLine(""); + file.WriteLine(""); + file.WriteLine(@"/******************************************************************************* + OBJECT DICTIONARY +*******************************************************************************/"); + + file.WriteLine(string.Format(" #define CO_OD_NoOfElements {0}", enabledcount)); + file.WriteLine(""); + file.WriteLine(""); + + file.WriteLine(@"/******************************************************************************* + TYPE DEFINITIONS FOR RECORDS +*******************************************************************************/"); + + //We need to identify all the record types used and generate a struct for each one + //FIXME the original CANopenNode exporter said how many items used this struct in the comments + + List structnamelist = new List(); + + /* make sure, we have all storage groups */ + eds.CO_storageGroups.Add("ROM"); + eds.CO_storageGroups.Add("EEPROM"); + + foreach (KeyValuePair kvp in eds.ods) + { + ODentry od = kvp.Value; + + /* make sure, we have all storage groups */ + eds.CO_storageGroups.Add(od.prop.CO_storageGroup); + + if (od.objecttype != ObjectType.RECORD) + continue; + + string structname = String.Format("OD_{0}_t", make_cname(od.parameter_name,od)); + + if (structnamelist.Contains(structname)) + continue; + + structnamelist.Add(structname); + + // we need to search the mappings to find the largest or this will not generate correctly + // as can opennode only has 1 structure defined for all mappings see #220 + + if (kvp.Key>=0x1600 && kvp.Key<0x1800) + { + //switch the OD entry to the largest + od = maxRXmappingsOD; + } + + if (kvp.Key >= 0x1A00 && kvp.Key < 0x1C00) + { + //switch the OD entry to the largest + od = maxTXmappingsOD; + } + + if (od == null) + continue; + + List structmemberlist = new List(); + + file.WriteLine(string.Format("/*{0:X4} */ typedef struct {{", kvp.Key)); + foreach (KeyValuePair kvp2 in od.subobjects) // kvp.Value.subobjects) + { + string paramaterarrlen = ""; + ODentry subod = kvp2.Value; + + string proposedname = make_cname(subod.parameter_name,subod); + + int suffix=1; + while (structmemberlist.Contains(proposedname)) + { + Warnings.AddWarning(string.Format("STRUCT WARNING; in 0x{0:X4}/{1:X2} Duplicate struct entry name, it has been auto numbered",subod.Index,subod.Subindex),Warnings.warning_class.WARNING_STRUCT); + proposedname = make_cname(subod.parameter_name,subod) + suffix.ToString(); + suffix++; + } + + structmemberlist.Add(proposedname); + + if (subod.datatype==DataType.VISIBLE_STRING || subod.datatype==DataType.OCTET_STRING) + { + paramaterarrlen = String.Format("[{0}]", subod.Lengthofstring); + } + + file.WriteLine(string.Format(" {0,-15}{1}{2};", subod.datatype.ToString(), proposedname,paramaterarrlen)); + + } + + file.WriteLine(string.Format(" }} {0};", structname)); + + } + + + + file.WriteLine(@" +/******************************************************************************* + TYPE DEFINITIONS FOR OBJECT DICTIONARY INDEXES + + some of those are redundant with CO_SDO.h CO_ObjDicId_t +*******************************************************************************/"); + + //FIXME how can we get rid of that redundancy? + + foreach (KeyValuePair kvp in eds.ods) + { + + ODentry od = kvp.Value; + + if (od.prop.CO_disabled == true) + continue; + + DataType t = eds.Getdatatype(od); + + + switch (od.objecttype) + { + default: + { + file.WriteLine(string.Format("/*{0:X4} */", od.Index)); + file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0:X4}_{1}", od.Index, make_cname(od.parameter_name,od)), od.Index, t.ToString())); + + file.WriteLine(""); + } + break; + + case ObjectType.ARRAY: + case ObjectType.RECORD: + { + file.WriteLine(string.Format("/*{0:X4} */", od.Index)); + file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0:X4}_{1}", od.Index, make_cname(od.parameter_name,od)), od.Index, t.ToString())); + + file.WriteLine(""); + + //sub indexes + file.WriteLine(string.Format(" #define {0,-51} 0", string.Format("OD_{0:X4}_0_{1}_maxSubIndex", od.Index, make_cname(od.parameter_name,od)))); + + List ODSIs = new List(); + + string ODSIout = ""; + + foreach (KeyValuePair kvp2 in od.subobjects) + { + ODentry sub = kvp2.Value; + + if (kvp2.Key == 0) + continue; + + string ODSI = string.Format("{0}", string.Format("OD_{0:X4}_{1}_{2}_{3}", od.Index, kvp2.Key, make_cname(od.parameter_name,od), make_cname(sub.parameter_name,sub))); + + if (ODSIs.Contains(ODSI)) + { + continue; + } + + ODSIs.Add(ODSI); + + ODSIout += ($" #define {ODSI,-51} {kvp2.Key}{Environment.NewLine}"); + } + + file.Write(ODSIout); + file.WriteLine(""); + } + break; + } + } + + file.WriteLine(@"/******************************************************************************* + STRUCTURES FOR VARIABLES IN DIFFERENT MEMORY LOCATIONS +*******************************************************************************/ +#define CO_OD_FIRST_LAST_WORD 0x55 //Any value from 0x01 to 0xFE. If changed, EEPROM will be reinitialized. +"); + foreach (string location in eds.CO_storageGroups) + { + if (location == "Unused") + { + continue; + } + + file.Write("/***** Structure for "); + file.Write(location); + file.WriteLine(" variables ********************************************/"); + file.Write("struct sCO_OD_"); + file.Write(location); + file.Write(@"{ + UNSIGNED32 FirstWord; + +"); + + file.Write(print_h_bylocation(location)); + + file.WriteLine(@" + UNSIGNED32 LastWord; +}; +"); + } + + file.WriteLine(@"/***** Declaration of Object Dictionary variables *****************************/"); + + foreach (string location in eds.CO_storageGroups) + { + if (location == "Unused") + { + continue; + } + + file.Write("extern struct sCO_OD_"); + file.Write(location); + file.Write(" CO_OD_"); + file.Write(location); + file.WriteLine(@"; +"); + } + +file.WriteLine(@"/******************************************************************************* + ALIASES FOR OBJECT DICTIONARY VARIABLES +*******************************************************************************/"); + + List constructed_rec_types = new List(); + + foreach (KeyValuePair kvp in eds.ods) + { + + + ODentry od = kvp.Value; + + if (od.prop.CO_disabled == true) + continue; + + string loc = "CO_OD_" + od.prop.CO_storageGroup; + + DataType t = eds.Getdatatype(od); + + + switch (od.objecttype) + { + default: + { + file.WriteLine(string.Format("/*{0:X4}, Data Type: {1} */", od.Index, t.ToString())); + file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0}_idx", make_cname(od.parameter_name, od)), od.Index, t.ToString())); + file.WriteLine(string.Format(" #define {0,-51} {1}.{2}", string.Format("OD_{0}", make_cname(od.parameter_name,od)), loc, make_cname(od.parameter_name,od))); + + DataType dt = od.datatype; + + if (dt == DataType.OCTET_STRING || dt == DataType.VISIBLE_STRING) + { + file.WriteLine(string.Format(" #define {0,-51} {1}", string.Format("ODL_{0}_stringLength", make_cname(od.parameter_name,od)), od.Lengthofstring)); + } + file.WriteLine(""); + } + break; + + case ObjectType.ARRAY: + { + DataType dt = od.datatype; + + file.WriteLine(string.Format("/*{0:X4}, Data Type: {1}, Array[{2}] */", od.Index, t.ToString(), od.Nosubindexes - 1)); + file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0}_idx", make_cname(od.parameter_name, od)), od.Index, t.ToString())); + file.WriteLine(string.Format(" #define OD_{0,-48} {1}.{2}", make_cname(od.parameter_name,od), loc, make_cname(od.parameter_name,od))); + file.WriteLine(string.Format(" #define {0,-51} {1}", string.Format("ODL_{0}_arrayLength", make_cname(od.parameter_name,od)), od.Nosubindexes - 1)); + + + List ODAs = new List(); + + string ODAout = ""; + + foreach (KeyValuePair kvp2 in od.subobjects) + { + ODentry sub = kvp2.Value; + + if (kvp2.Key == 0) + continue; + + string ODA = string.Format("{0}", string.Format("ODA_{0}_{1}", make_cname(od.parameter_name,od), make_cname(sub.parameter_name,sub))); + + if (ODAs.Contains(ODA)) + { + continue; + } + + ODAs.Add(ODA); + + //Arrays do not have a size in the raw CO objects, Records do + //so offset by one + if (od.objecttype == ObjectType.ARRAY) + { + ODAout += ($" #define {string.Format("ODA_{0}_{1}", make_cname(od.parameter_name,od), make_cname(sub.parameter_name,sub)),-51} {kvp2.Key - 1}{Environment.NewLine}"); + } + else + { + ODAout += ($" #define {string.Format("ODA_{0}_{1}", make_cname(od.parameter_name,od), make_cname(sub.parameter_name,sub)),-51} {kvp2.Key}{Environment.NewLine}"); + } + } + + file.Write(ODAout); + file.WriteLine(""); + } + break; + + case ObjectType.RECORD: + { + string rectype = make_cname(od.parameter_name,od); + + if (!constructed_rec_types.Contains(rectype)) + { + file.WriteLine(string.Format("/*{0:X4}, Data Type: {1}_t */", od.Index, rectype)); + file.WriteLine(string.Format(" #define {0,-51} 0x{1:X4}", string.Format("OD_{0}_idx", make_cname(od.parameter_name, od)), od.Index, t.ToString())); + file.WriteLine(string.Format(" #define {0,-51} {1}.{2}", string.Format("OD_{0}", rectype), loc, rectype)); + constructed_rec_types.Add(rectype); + file.WriteLine(""); + } + + } + break; + } + } + file.WriteLine("#endif"); + file.WriteLine("// clang-format on"); + file.Close(); + + } + + private void export_c(string filename) + { + if (filename == "") + filename = "CO_OD"; + StreamWriter file = new StreamWriter(folderpath + Path.DirectorySeparatorChar + filename + ".c"); + + file.WriteLine("// clang-format off"); + addHeader(file); + file.WriteLine(@"// For CANopenNode V2 users, C macro `CO_VERSION_MAJOR=2` has to be added to project options +#ifndef CO_VERSION_MAJOR + #include ""CO_driver.h"" + #include """ + Path.GetFileNameWithoutExtension(filename) + @".h"" + #include ""CO_SDO.h"" +#elif CO_VERSION_MAJOR < 4 + #include ""301/CO_driver.h"" + #include """ + Path.GetFileNameWithoutExtension(filename) + @".h"" + #include ""301/CO_SDOserver.h"" +#else + #error This Object dictionary is not compatible with CANopenNode v4.0 and up! +#endif + +/******************************************************************************* + DEFINITION AND INITIALIZATION OF OBJECT DICTIONARY VARIABLES +*******************************************************************************/ + +"); + foreach (string location in eds.CO_storageGroups) + { + if (location == "Unused") + { + continue; + } + + file.Write("/***** Definition for "); + file.Write(location); + file.WriteLine(" variables *******************************************/"); + file.Write("struct sCO_OD_"); + file.Write(location); + file.Write(" CO_OD_"); + file.Write(location); + file.Write(@" = { + CO_OD_FIRST_LAST_WORD, + +"); + + file.Write(export_OD_def_array(location)); + + file.WriteLine(@" + CO_OD_FIRST_LAST_WORD, +}; + +"); + } + + + file.WriteLine(@" + +/******************************************************************************* + STRUCTURES FOR RECORD TYPE OBJECTS +*******************************************************************************/ + +"); + + file.Write(export_record_types()); + + file.Write(@"/******************************************************************************* + OBJECT DICTIONARY +*******************************************************************************/ +const CO_OD_entry_t CO_OD[CO_OD_NoOfElements] = { +"); + + file.Write(write_od()); + + file.WriteLine("};"); + file.WriteLine("// clang-format on"); + + file.Close(); + } + + bool arrayspecialcase = false; + int arrayspecialcasecount = 0; + + string write_od() + { + + StringBuilder returndata = new StringBuilder(); + + foreach (KeyValuePair kvp in eds.ods) + { + + ODentry od = kvp.Value; + + if (od.prop.CO_disabled == true) + continue; + + returndata.Append(write_od_line(od)); + + + } + + return returndata.ToString(); + } + + protected string write_od_line(ODentry od) + { + StringBuilder sb = new StringBuilder(); + + string loc = "CO_OD_" + od.prop.CO_storageGroup; + + byte flags = getflags(od); + + int datasize = od.objecttype == ObjectType.RECORD ? 0 : (int)Math.Ceiling((double)od.Sizeofdatatype() / (double)8.0); + + string array = ""; + + //only needed for array objects + if (od.objecttype == ObjectType.ARRAY && od.Nosubindexes > 0) + array = string.Format("[0]"); + + + if (arrayspecial(od.Index, true)) + { + arrayspecialcase = true; + arrayspecialcasecount = 0; + } + + if (arrayspecialcase) + { + array = string.Format("[{0}]", arrayspecialcasecount); + arrayspecialcasecount++; + } + + //Arrays and Recs have 1 less subindex than actually present in the od.subobjects + int nosubindexs = od.Nosubindexes; + if (od.objecttype == ObjectType.ARRAY || od.objecttype == ObjectType.RECORD) + { + if (nosubindexs > 0) + nosubindexs--; + } + + //Arrays really should obey the max subindex parameter not the physical number of elements + if (od.objecttype == ObjectType.ARRAY) + { + if ((od.Getmaxsubindex() != nosubindexs)) + { + if (od.Index != 0x1003 && od.Index != 0x1011)//ignore 0x1003, it is a special case as per CANopen specs, and ignore 0x1011 CANopenNode uses special sub indexes for eeprom resets + { + Warnings.AddWarning(String.Format("Subindex discrepancy on object 0x{0:X4} arraysize: {1} vs max sub-index: {2}", od.Index, nosubindexs, od.Getmaxsubindex())); + } + + //0x1003 is a special case for CANopenNode + //SubIndex 0 will probably be 0 for no errors + //so we cannot read that to determine max subindex size, which is required to set up CANopenNode so we leave it alone here + //as its already set to subod.count + if (od.Index != 0x1003) + { + nosubindexs = od.Getmaxsubindex(); + } + } + } + + string pdata; //CO_OD_entry_t pData generator + + if (od.objecttype == ObjectType.RECORD) + { + + pdata = string.Format("&OD_record{0:X4}", od.Index); + } + else + { + pdata = string.Format("&{0}.{1}{2}", loc, make_cname(od.parameter_name,od), array); + } + + if ((od.objecttype == ObjectType.VAR || od.objecttype == ObjectType.ARRAY) && od.datatype == DataType.DOMAIN) + { + //NB domain MUST have a data pointer of 0, can open node requires this and makes checks + //against null to determine this is a DOMAIN type. + pdata = "0"; + } + + sb.AppendLine($"{{0x{od.Index:X4}, 0x{nosubindexs:X2}, 0x{flags:X2}, {datasize,2:#0}, (void*){pdata}}},"); + + if (arrayspecial(od.Index, false)) + { + arrayspecialcase = false; + } + + return sb.ToString(); + } + + /// + /// Get the CANopenNode specific flags, these flags are used internally in CANopenNode to determine details about the object variable + /// + /// An odentry to access + /// byte containing the flag value + public byte getflags(ODentry od) + { + byte flags = 0; + byte mapping = 0; //mapping flags, if pdo is enabled + + //aways return 0 for REC objects as CO_OD_getDataPointer() uses this to pickup the details + if (od.objecttype == ObjectType.RECORD) + return 0; + + switch((od.parent == null ? od : od.parent).prop.CO_storageGroup.ToUpper()) + { + case "ROM": + flags = 0x01; + break; + + case "RAM": + flags = 0x02; + break; + + case "EEPROM": + default: + flags = 0x03; + break; + } + + /* some exceptions for rwr/rww. Those are entries that are always r/w via SDO transfer, + * but can only be read -or- written via PDO */ + if (od.accesstype == EDSsharp.AccessType.ro + || od.accesstype == EDSsharp.AccessType.rw + || od.accesstype == EDSsharp.AccessType.rwr + || od.accesstype == EDSsharp.AccessType.rww + || od.accesstype == EDSsharp.AccessType.@const) + { + /* SDO server may read from the variable */ + flags |= 0x04; + + if (od.accesstype != EDSsharp.AccessType.rww) + { + /* Variable is mappable for TPDO */ + mapping |= 0x20; + } + } + if (od.accesstype == EDSsharp.AccessType.wo + || od.accesstype == EDSsharp.AccessType.rw + || od.accesstype == EDSsharp.AccessType.rwr + || od.accesstype == EDSsharp.AccessType.rww) + { + /* SDO server may write to the variable */ + flags |= 0x08; + + if (od.accesstype != EDSsharp.AccessType.rwr) + { + /* Variable is mappable for RPDO */ + mapping |= 0x10; + } + } + + if (od.Index == 0x1003) + { + /* SDO server may write to the variable */ + flags |= 0x08; + } + + switch (od.PDOtype) + { + case libEDSsharp.PDOMappingType.RPDO: mapping |= 0x10; break; + case libEDSsharp.PDOMappingType.TPDO: mapping |= 0x20; break; + case libEDSsharp.PDOMappingType.optional: mapping |= 0x30; break; + } + + if (od.PDOMapping) + { + flags |= mapping; + } + + if(od.prop.CO_flagsPDO) + { + /* If variable is mapped to any PDO, then is automatically send, if variable its value */ + flags |=0x40; + } + + if(od.parent!=null && od.parent.prop.CO_flagsPDO) + { + //parent types are storing the prop in the ODeditor in the parent object but the child object is tested to set the flag + //this is breaking legacy export + flags |= 0x40; + } + + + int datasize = (int)Math.Ceiling((double)od.Sizeofdatatype() / (double)8.0); + + if (datasize > 1) + { + if (od.datatype == DataType.VISIBLE_STRING || + od.datatype == DataType.OCTET_STRING) + { + //#149 VISIBLE_STRING and OCTET_STRING are an arrays of 8 bit values, either VISIBLE_CHAR or UNSIGNED8 + //and therefor are NOT multi-byte + } + else + { + /* variable is a multi-byte value */ + flags |= 0x80; + } + } + + return flags; + } + + string formatvaluewithdatatype(string defaultvalue, DataType dt, bool fixstring=false) + { + try + { + int nobase = 10; + bool nodeidreplace = false; + + + if (defaultvalue == null || defaultvalue == "") + { + //No default value, we better supply one for sensible data types + if (dt == DataType.VISIBLE_STRING || + dt == DataType.OCTET_STRING || + dt == DataType.UNKNOWN || + dt == DataType.UNICODE_STRING) + { + + if (fixstring == true) + return "'X'"; + + return ""; + } + + Console.WriteLine("Warning assuming a 0 default"); + defaultvalue = "0"; + } + + if (defaultvalue.Contains("$NODEID", StringComparison.OrdinalIgnoreCase)) // fetch different case of "NODeID" (allowed according DS301) + { + defaultvalue = defaultvalue.ToUpper().Replace("$NODEID", ""); + defaultvalue = defaultvalue.Replace("+", ""); + defaultvalue = defaultvalue.Trim(); + nodeidreplace = true; + } + + String pat = @"^0[xX][0-9a-fA-FL]+"; + + Regex r = new Regex(pat, RegexOptions.IgnoreCase); + Match m = r.Match(defaultvalue); + if (m.Success) + { + nobase = 16; + defaultvalue = defaultvalue.Replace("L", ""); + } + + pat = @"^0[0-7]+"; + r = new Regex(pat, RegexOptions.IgnoreCase); + m = r.Match(defaultvalue); + if (m.Success) + { + nobase = 8; + } + + if (nodeidreplace) + { + UInt32 data = Convert.ToUInt32(defaultvalue.Trim(), nobase); + data += eds.NodeID; + defaultvalue = string.Format("0x{0:X}", data); + nobase = 16; + } + + + switch (dt) + { + case DataType.UNSIGNED24: + case DataType.UNSIGNED32: + return String.Format("0x{0:X4}L", Convert.ToUInt32(defaultvalue, nobase)); + + case DataType.INTEGER24: + case DataType.INTEGER32: + return String.Format("0x{0:X4}L", Convert.ToInt32(defaultvalue, nobase)); + + case DataType.REAL32: + case DataType.REAL64: + return (String.Format("{0}", defaultvalue)); + + + //fix me this looks wrong + case DataType.UNICODE_STRING: + return (String.Format("'{0}'", defaultvalue)); + + case DataType.VISIBLE_STRING: + { + + ASCIIEncoding a = new ASCIIEncoding(); + string unescape = StringUnescape.Unescape(defaultvalue); + char[] chars = unescape.ToCharArray(); + + string array = "{"; + + foreach (char c in chars) + { + + array += "'" + StringUnescape.Escape(c) + "', "; + } + + array = array.Substring(0, array.Length - 2); + + array += "}"; + return array; + + } + + + case DataType.OCTET_STRING: + { + string[] bits = defaultvalue.Split(' '); + string octet = "{"; + foreach (string s in bits) + { + octet += formatvaluewithdatatype(s, DataType.UNSIGNED8); + + if (!object.ReferenceEquals(s, bits.Last())) + { + octet += ", "; + } + } + octet += "}"; + return octet; + } + + case DataType.INTEGER8: + return String.Format("0x{0:X1}", Convert.ToSByte(defaultvalue, nobase)); + + case DataType.INTEGER16: + return String.Format("0x{0:X2}", Convert.ToInt16(defaultvalue, nobase)); + + case DataType.UNSIGNED8: + return String.Format("0x{0:X1}L", Convert.ToByte(defaultvalue, nobase)); + + case DataType.UNSIGNED16: + return String.Format("0x{0:X2}", Convert.ToUInt16(defaultvalue, nobase)); + + case DataType.INTEGER64: + return String.Format("0x{0:X8}L", Convert.ToInt64(defaultvalue, nobase)); + + case DataType.UNSIGNED64: + return String.Format("0x{0:X8}L", Convert.ToUInt64(defaultvalue, nobase)); + + case DataType.TIME_DIFFERENCE: + case DataType.TIME_OF_DAY: + return String.Format("{{{0}}}", Convert.ToUInt64(defaultvalue, nobase)); + + default: + return (String.Format("{0:X}", defaultvalue)); + + } + } + catch(Exception) + { + Warnings.AddWarning(String.Format("Error converting value {0} to type {1}", defaultvalue, dt.ToString()),Warnings.warning_class.WARNING_BUILD); + return ""; + } + } + + public static string ParseString(string input) + { + var provider = new Microsoft.CSharp.CSharpCodeProvider(); + var parameters = new System.CodeDom.Compiler.CompilerParameters() + { + GenerateExecutable = false, + GenerateInMemory = true, + }; + + var code = @" + namespace Tmp + { + public class TmpClass + { + public static string GetValue() + { + return """ + input + @"""; + } + } + }"; + + var compileResult = provider.CompileAssemblyFromSource(parameters, code); + + if (compileResult.Errors.HasErrors) + { + throw new ArgumentException(compileResult.Errors.Cast().First(e => !e.IsWarning).ErrorText); + } + + var asmb = compileResult.CompiledAssembly; + var method = asmb.GetType("Tmp.TmpClass").GetMethod("GetValue"); + + return method.Invoke(null, null) as string; + } + + protected string make_cname(string name,ODentry entry) + { + if (name == null) + return null; + + if (name == "") + return ""; + + Regex splitter = new Regex(@"[\W]+"); + + //string[] bits = Regex.Split(name,@"[\W]+"); + var bits = splitter.Split(name).Where(s => s != String.Empty); + + string output = ""; + + char lastchar = ' '; + foreach (string s in bits) + { + if(Char.IsUpper(lastchar) && Char.IsUpper(s.First())) + output+="_"; + + if (s.Length > 1) + { + output += char.ToUpper(s[0]) + s.Substring(1); + } + else + { + output += s; + } + + if(output.Length>0) + lastchar = output.Last(); + + } + + if (output.Length > 1) + { + if (Char.IsLower(output[1])) + output = Char.ToLowerInvariant(output[0]) + output.Substring(1); + } + else + output = output.ToLowerInvariant(); //single character + + + UInt32 key = (UInt32)((entry.Index << 8) + entry.Subindex ); + + if ((entry.Index >= 0x1200) && (entry.Index < 0x1280)) + key = (UInt32)((0x1200 << 8) + entry.Subindex); + + if ((entry.Index >= 0x1280) && (entry.Index < 0x1300)) + key = (UInt32)((0x1280 << 8) + entry.Subindex); + + if ((entry.Index >= 0x1400) && (entry.Index < 0x1600)) + key = (UInt32)((0x1400 <<8) + entry.Subindex); + + if ((entry.Index >= 0x1600) && (entry.Index < 0x1800)) + key = (UInt32)((0x1600 << 8) + entry.Subindex); + + if ((entry.Index >= 0x1800) && (entry.Index < 0x1a00)) + key = (UInt32)((0x1800 << 8) + entry.Subindex); + + if ((entry.Index >= 0x1a00) && (entry.Index < 0x1c00)) + key = (UInt32)((0x1a00 << 8) + entry.Subindex); + + if (acceptable_canopen_names.ContainsKey(key) && !(entry.parent != null && entry.Subindex == 0)) + { + string newname = acceptable_canopen_names[key]; + if (output != newname) + Warnings.AddWarning(string.Format("Warning: index 0x{0:X4}/{1:X2} correcting name for CanOpenNode compatibility from {2} to {3}", entry.Index, entry.Subindex, output, newname),Warnings.warning_class.WARNING_RENAME); + output = newname; + } + + return output; + } + + /// + /// Export the record type objects in the CO_OD.c file + /// + /// string + protected string export_record_types() + { + StringBuilder returndata = new StringBuilder(); + + bool arrayopen = false; + int arrayindex = 0; + + foreach (KeyValuePair kvp in eds.ods) + { + ODentry od = kvp.Value; + + if (od.objecttype != ObjectType.RECORD) + continue; + + if (od.prop.CO_disabled == true) + continue; + + int count = od.subobjects.Count; //don't include index + + if(od.Index>=0x1400 && od.Index<0x1600) + { + //what is this doing for us? + //count = 3; //CANopenNode Fudging. Its only 3 parameters for RX PDOS in the c code despite being a PDO_COMMUNICATION_PARAMETER + } + + returndata.AppendLine($"/*0x{od.Index:X4}*/ const CO_OD_entryRecord_t OD_record{od.Index:X4}[{count}] = {{"); + + string arrayaccess = ""; + + if (arrayspecial(od.Index, true) || arrayopen) + { + arrayaccess = string.Format("[{0}]",arrayindex); + arrayindex++; + arrayopen = true; + } + + foreach (KeyValuePair kvpsub in od.subobjects) + { + returndata.Append(export_one_record_type(kvpsub.Value,arrayaccess)); + } + + if (arrayspecial(od.Index, false)) + { + arrayindex=0; + arrayopen = false; + } + + returndata.AppendLine($"}};{Environment.NewLine}"); + } + + return returndata.ToString(); + } + + /// + /// Exports a sub object line in a record object + /// + /// sub ODentry object to export + /// string forming current array level or empty string for none + /// string forming one line of CO_OD.c record objects + protected string export_one_record_type(ODentry sub,string arrayaccess) + { + + if (sub == null || sub.parent == null) + return ""; + + StringBuilder sb = new StringBuilder(); + + string cname = make_cname(sub.parent.parameter_name,sub.parent); + + string subcname = make_cname(sub.parameter_name,sub); + int datasize = (int)Math.Ceiling((double)sub.Sizeofdatatype() / (double)8.0); + + if (sub.datatype != DataType.DOMAIN) + { + sb.AppendLine($" {{(void*)&{"CO_OD_" + sub.parent.prop.CO_storageGroup}.{cname}{arrayaccess}.{subcname}, 0x{getflags(sub):X2}, 0x{datasize:X} }},"); + } + else + { + //Domain type MUST have its data pointer set to 0 for CANopenNode + sb.AppendLine($" {{(void*)0, 0x{getflags(sub):X2}, 0x{datasize:X} }},"); + } + + return sb.ToString(); + } + + + int noTXpdos = 0; + int noRXpdos = 0; + int noSDOclients = 0; + int noSDOservers = 0; + int distTXpdo = 0; + int distRXpdo = 0; + int noSYNC = 0; + int noEMCY = 0; + int noTIME = 0; + int noGFC = 0; + int noSRDO = 0; + + void countPDOS() + { + noRXpdos = 0; + noTXpdos = 0; + + //feature tests for default CanOpenNode build + //if you have a custom CanOpen.c then you may not require all these features + + //check the SYNC feature + int checkfeature = 0; + if (ObjectActive(0x1005)) + checkfeature++; + if (ObjectActive(0x1006)) + checkfeature++; + if (ObjectActive(0x1007)) + checkfeature++; + if (ObjectActive(0x1019)) + checkfeature++; + if (checkfeature == 4) + { + noSYNC = 1; + } + else + { + Warnings.AddWarning("BUILD WARNING, required objects for SYNC are not present 0x1005,0x1006,0x1007,0x1019",Warnings.warning_class.WARNING_BUILD); + } + + //EMCY + checkfeature = 0; + if (ObjectActive(0x1003)) + checkfeature++; + if (ObjectActive(0x1014)) + checkfeature++; + if (ObjectActive(0x1015)) + checkfeature++; + if (checkfeature == 3) + { + noEMCY = 1; + } + else + { + Warnings.AddWarning("BUILD WARNING, required objects for EMCY are not present 0x1003,0x1014,0x1015",Warnings.warning_class.WARNING_BUILD); + } + + //TIME + if (ObjectActive(0x1012)) + { + noTIME = 1; + } + else + { + //TIME is optional + } + + //NMT CLIENT + checkfeature = 0; + if (ObjectActive(0x1f80)) + checkfeature ++; + if (ObjectActive(0x1029)) + checkfeature ++; + if (ObjectActive(0x1017)) + checkfeature ++; + if (ObjectActive(0x1001)) + checkfeature ++; + if (checkfeature == 4) + { + //NMT Client is not optional + } + else + { + Warnings.AddWarning("BUILD WARNING, required objects for NMT Client are not present 0x1f80,0x1029,0x1017,0x1001",Warnings.warning_class.WARNING_BUILD); + } + + foreach (KeyValuePair kvp in eds.ods) + { + UInt16 index = kvp.Key; + + if (kvp.Value.prop.CO_disabled == true) + continue; + + if (index >= 0x1400 && index < 0x1600) + { + noRXpdos++; + distRXpdo = index - 0x1400; + } + + if (index >= 0x1800 && index < 0x1A00) + { + noTXpdos++; + distTXpdo = index - 0x1800; + } + + if((index & 0xFF80) == 0x1200) + { + noSDOservers++; + } + + if ((index & 0xFF80) == 0x1280) + { + noSDOclients++; + } + + if (index == 0x1300) + noGFC = 1; + + if (index >= 0x1301 && index <= 0x1340) + noSRDO++; + } + } + + bool arrayspecial(UInt16 index, bool open) + { + + if (open) + { + + if (openings.Contains(index)) + return true; + } + else + { + + if (closings.Contains(index)) + return true; + } + + return false; + } + + + string export_OD_def_array(string location) + { + + StringBuilder sb = new StringBuilder(); + + foreach (KeyValuePair kvp in eds.ods) + { + ODentry od = kvp.Value; + + if (od.prop.CO_disabled == true || od.prop.CO_storageGroup != location) + continue; + + if (od.Nosubindexes == 0) + { + sb.AppendLine($"/*{od.Index:X4}*/ {formatvaluewithdatatype(od.defaultvalue, od.datatype,true)},"); + } + else + { + if (arrayspecial(od.Index, true)) + { + sb.AppendFormat("/*{0:X4}*/ {{{{", od.Index); + } + else + { + sb.AppendFormat("/*{0:X4}*/ {{", od.Index); + } + + foreach (KeyValuePair kvp2 in od.subobjects) + { + ODentry sub = kvp2.Value; + + DataType dt = sub.datatype; + + if ((od.objecttype==ObjectType.ARRAY) && kvp2.Key == 0) + continue; + + sb.Append(formatvaluewithdatatype(sub.defaultvalue, dt,true)); + + if (od.subobjects.Keys.Last() != kvp2.Key) + sb.Append(", "); + } + + if (arrayspecial(od.Index, false)) + { + sb.AppendLine("}},"); + } + else + { + sb.AppendLine("},"); + } + } + } + + return sb.ToString(); + } + } + + + + + + +} diff --git a/libEDSsharp/CanOpenNodeExporter_V4.cs b/libEDSsharp/CanOpenNodeExporter_V4.cs index a10f41e9..57ca7eca 100644 --- a/libEDSsharp/CanOpenNodeExporter_V4.cs +++ b/libEDSsharp/CanOpenNodeExporter_V4.cs @@ -194,14 +194,14 @@ private int Prepare_var(ODentry od, string indexH, string varName, string group) string attr = Get_attributes(od, data.cTypeMultibyte, data.cTypeString); // data storage - string dataPtr = "NULL"; + string dataPtr = "NULL"; if (data.cValue != null) { ODStorage_t[group].Add($"{data.cType} x{varName}{data.cTypeArray};"); ODStorage[group].Add($".x{varName} = {data.cValue}"); dataPtr = $"&{odname}_{group}.x{varName}{data.cTypeArray0}"; - } - + } + // objects ODObjs_t.Add($"OD_obj_var_t o_{varName};"); ODObjs.Add($" .o_{varName} = {{"); @@ -345,7 +345,7 @@ private int Prepare_rec(ODentry od, string indexH, string varName, string group) Warnings.AddWarning($"Error in 0x{indexH}: Data type in RECORD, subIndex 0 must be UNSIGNED8, not {sub.datatype}!", Warnings.warning_class.WARNING_BUILD); string subcName = Make_cname(sub.parameter_name); - string dataPtr = "NULL"; + string dataPtr = "NULL"; if (data.cValue != null) { subODStorage_t.Add($"{data.cType} {subcName}{data.cTypeArray};"); diff --git a/libEDSsharp/CanOpenXDD.cs b/libEDSsharp/CanOpenXDD.cs index 9b8bf1ee..13b40334 100644 --- a/libEDSsharp/CanOpenXDD.cs +++ b/libEDSsharp/CanOpenXDD.cs @@ -639,8 +639,8 @@ public ISO15745ProfileContainer convert(EDSsharp eds) NetworkManagement.CANopenGeneralFeatures.bootUpSlave = eds.di.SimpleBootUpSlave; //NetworkManagment.CANopenGeneralFeatures.dynamicChannels = eds.di.DynamicChannelsSupported; //fix me count of dynamic channels not handled yet eds only has bool NetworkManagement.CANopenGeneralFeatures.granularity = eds.di.Granularity; - NetworkManagement.CANopenGeneralFeatures.groupMessaging = eds.di.GroupMessaging; - + NetworkManagement.CANopenGeneralFeatures.groupMessaging = eds.di.GroupMessaging; + NetworkManagement.CANopenGeneralFeatures.ngMaster = eds.di.NG_Master; NetworkManagement.CANopenGeneralFeatures.ngSlave = eds.di.NG_Slave; NetworkManagement.CANopenGeneralFeatures.NrOfNG_MonitoredNodes = eds.di.NrOfNG_MonitoredNodes; @@ -918,9 +918,9 @@ public EDSsharp convert(ISO15745ProfileContainer container) } eds.di.NG_Master = NetworkManagment.CANopenGeneralFeatures.ngMaster; - eds.di.NG_Slave = NetworkManagment.CANopenGeneralFeatures.ngSlave; - eds.di.NrOfNG_MonitoredNodes = NetworkManagment.CANopenGeneralFeatures.NrOfNG_MonitoredNodes; - + eds.di.NG_Slave = NetworkManagment.CANopenGeneralFeatures.ngSlave; + eds.di.NrOfNG_MonitoredNodes = NetworkManagment.CANopenGeneralFeatures.NrOfNG_MonitoredNodes; + eds.di.NrOfRXPDO = NetworkManagment.CANopenGeneralFeatures.nrOfRxPDO; eds.di.NrOfTXPDO = NetworkManagment.CANopenGeneralFeatures.nrOfTxPDO; @@ -3832,8 +3832,8 @@ public partial class ProfileBody_CommunicationNetwork_CANopenNetworkManagementCA private ushort nrOfTxPDOField; private bool ngMasterField; - private bool ngSlaveField; - private ushort NrOfNG_MonitoredNodesField; + private bool ngSlaveField; + private ushort NrOfNG_MonitoredNodesField; private bool bootUpSlaveField; private bool layerSettingServiceSlaveField; @@ -4001,18 +4001,18 @@ public bool ngMaster { this.ngMasterField = value; } - } - + } + /// [System.Xml.Serialization.XmlAttributeAttribute()] [System.ComponentModel.DefaultValueAttribute(typeof(ushort), "0")] - public ushort NrOfNG_MonitoredNodes + public ushort NrOfNG_MonitoredNodes { - get + get { return this.NrOfNG_MonitoredNodesField; } - set + set { this.NrOfNG_MonitoredNodesField = value; } diff --git a/libEDSsharp/CanOpenXSD_1_1.cs b/libEDSsharp/CanOpenXSD_1_1.cs index 5e6d8264..21730392 100644 --- a/libEDSsharp/CanOpenXSD_1_1.cs +++ b/libEDSsharp/CanOpenXSD_1_1.cs @@ -2461,7 +2461,7 @@ public partial class ProfileBody_CommunicationNetwork_CANopenNetworkManagementCA private bool bootUpSlaveField; - private bool ngSlaveField; + private bool ngSlaveField; private bool ngMasterField; private ushort NrOfNG_MonitoredNodesField; @@ -2597,13 +2597,13 @@ public bool ngMaster /// [System.Xml.Serialization.XmlAttributeAttribute()] [System.ComponentModel.DefaultValueAttribute(typeof(ushort), "0")] - public ushort NrOfNG_MonitoredNodes + public ushort NrOfNG_MonitoredNodes { - get + get { return this.NrOfNG_MonitoredNodesField; } - set + set { this.NrOfNG_MonitoredNodesField = value; } diff --git a/libEDSsharp/NetworkPDOreport.cs b/libEDSsharp/NetworkPDOreport.cs index 484f598a..2f65b26d 100644 --- a/libEDSsharp/NetworkPDOreport.cs +++ b/libEDSsharp/NetworkPDOreport.cs @@ -31,7 +31,7 @@ public class NetworkPDOreport public void gennetpdodoc(string filepath, List network) { - file = new StreamWriter(filepath, false); + file = new StreamWriter(filepath, false); file.NewLine = "\n"; file.Write(" Network PDO report"); diff --git a/libEDSsharp/PDOHelper.cs b/libEDSsharp/PDOHelper.cs index f8fbba08..4e6b640e 100644 --- a/libEDSsharp/PDOHelper.cs +++ b/libEDSsharp/PDOHelper.cs @@ -11,7 +11,7 @@ public class PDOSlot { private UInt16 _MappingIndex; - private UInt16 _ConfigurationIndex; + private UInt16 _ConfigurationIndex; public bool nodeidpresent; public ushort ConfigurationIndex { @@ -82,17 +82,17 @@ public bool invalid public UInt16 eventtimer; public byte syncstart; public byte transmissiontype; - public string DescriptionComm; - public string DescriptionMap; - + public string DescriptionComm; + public string DescriptionMap; + public PDOSlot() { configloc = "PERSIST_COMM"; mappingloc = "PERSIST_COMM"; transmissiontype = 254; Mapping = new List(); - DescriptionComm = ""; - DescriptionMap = ""; + DescriptionComm = ""; + DescriptionMap = ""; } public string getTargetName(ODentry od) @@ -215,8 +215,8 @@ public void build_PDOlist(UInt16 startcob, List slots) //Look at mappings - ODentry mapping = eds.Getobject((ushort)(idx + 0x200)); - + ODentry mapping = eds.Getobject((ushort)(idx + 0x200)); + if (mapping != null) { slot.DescriptionMap = mapping.Description; }else @@ -323,19 +323,19 @@ public void buildmappingsfromlists(bool isCANopenNode_V4) if (slot.isTXPDO()) { config.parameter_name = "TPDO communication parameter"; - config.prop.CO_countLabel = "TPDO"; - - sub = new ODentry("Highest sub-index supported", (ushort)slot.ConfigurationIndex, 0); - sub.defaultvalue = "0x06"; - sub.datatype = DataType.UNSIGNED8; - sub.accesstype = EDSsharp.AccessType.ro; + config.prop.CO_countLabel = "TPDO"; + + sub = new ODentry("Highest sub-index supported", (ushort)slot.ConfigurationIndex, 0); + sub.defaultvalue = "0x06"; + sub.datatype = DataType.UNSIGNED8; + sub.accesstype = EDSsharp.AccessType.ro; config.addsubobject(0x00, sub); sub = new ODentry("COB-ID used by TPDO", (ushort)slot.ConfigurationIndex, 1); - sub.datatype = DataType.UNSIGNED32; - if (slot.nodeidpresent) - sub.defaultvalue = "$NODEID+"; // DSP306: "The $NODEID must appear at the beginning of the expression. Otherwise the line is interpreted as without a formula. - sub.defaultvalue += String.Format("0x{0:X}", slot.COB); + sub.datatype = DataType.UNSIGNED32; + if (slot.nodeidpresent) + sub.defaultvalue = "$NODEID+"; // DSP306: "The $NODEID must appear at the beginning of the expression. Otherwise the line is interpreted as without a formula. + sub.defaultvalue += String.Format("0x{0:X}", slot.COB); sub.accesstype = EDSsharp.AccessType.rw; config.addsubobject(0x01, sub); @@ -351,15 +351,15 @@ public void buildmappingsfromlists(bool isCANopenNode_V4) sub.accesstype = EDSsharp.AccessType.rw; config.addsubobject(0x03, sub); - if (!isCANopenNode_V4) - { - sub = new ODentry("compatibility entry", (ushort)slot.ConfigurationIndex, 4); - sub.datatype = DataType.UNSIGNED8; - sub.defaultvalue = "0"; - sub.accesstype = EDSsharp.AccessType.rw; + if (!isCANopenNode_V4) + { + sub = new ODentry("compatibility entry", (ushort)slot.ConfigurationIndex, 4); + sub.datatype = DataType.UNSIGNED8; + sub.defaultvalue = "0"; + sub.accesstype = EDSsharp.AccessType.rw; config.addsubobject(0x04, sub); - } - + } + sub = new ODentry("Event timer", (ushort)slot.ConfigurationIndex, 5); sub.datatype = DataType.UNSIGNED16; sub.defaultvalue = slot.eventtimer.ToString(); @@ -376,18 +376,18 @@ public void buildmappingsfromlists(bool isCANopenNode_V4) else { config.parameter_name = "RPDO communication parameter"; - config.prop.CO_countLabel = "RPDO"; - - sub = new ODentry("Highest sub-index supported", (ushort)slot.ConfigurationIndex, 0); - sub.defaultvalue = isCANopenNode_V4 ? "0x05" : "0x02"; - sub.datatype = DataType.UNSIGNED8; - sub.accesstype = EDSsharp.AccessType.ro; + config.prop.CO_countLabel = "RPDO"; + + sub = new ODentry("Highest sub-index supported", (ushort)slot.ConfigurationIndex, 0); + sub.defaultvalue = isCANopenNode_V4 ? "0x05" : "0x02"; + sub.datatype = DataType.UNSIGNED8; + sub.accesstype = EDSsharp.AccessType.ro; config.addsubobject(0x00, sub); sub = new ODentry("COB-ID used by RPDO", (ushort)slot.ConfigurationIndex, 1); - sub.datatype = DataType.UNSIGNED32; - if (slot.nodeidpresent) - sub.defaultvalue = "$NODEID+"; // DSP306: "The $NODEID must appear at the beginning of the expression. Otherwise the line is interpreted as without a formula. + sub.datatype = DataType.UNSIGNED32; + if (slot.nodeidpresent) + sub.defaultvalue = "$NODEID+"; // DSP306: "The $NODEID must appear at the beginning of the expression. Otherwise the line is interpreted as without a formula. sub.defaultvalue += String.Format("0x{0:X}", slot.COB); sub.accesstype = EDSsharp.AccessType.rw; config.addsubobject(0x01, sub); @@ -396,15 +396,15 @@ public void buildmappingsfromlists(bool isCANopenNode_V4) sub.datatype = DataType.UNSIGNED8; sub.defaultvalue = slot.transmissiontype.ToString(); sub.accesstype = EDSsharp.AccessType.rw; - config.addsubobject(0x02, sub); - - if (isCANopenNode_V4) - { - sub = new ODentry("Event timer", (ushort)slot.ConfigurationIndex, 5); - sub.datatype = DataType.UNSIGNED16; - sub.defaultvalue = slot.eventtimer.ToString(); - sub.accesstype = EDSsharp.AccessType.rw; - config.addsubobject(0x05, sub); + config.addsubobject(0x02, sub); + + if (isCANopenNode_V4) + { + sub = new ODentry("Event timer", (ushort)slot.ConfigurationIndex, 5); + sub.datatype = DataType.UNSIGNED16; + sub.defaultvalue = slot.eventtimer.ToString(); + sub.accesstype = EDSsharp.AccessType.rw; + config.addsubobject(0x05, sub); } } @@ -479,43 +479,43 @@ public void addPDOslot(UInt16 configindex) PDOSlot newslot = new PDOSlot(); newslot.ConfigurationIndex = configindex; - switch (configindex) - { - case 0x1400: - newslot.COB = 0x80000200; - newslot.nodeidpresent = true; - break; - case 0x1401: - newslot.COB = 0x80000300; - newslot.nodeidpresent = true; - break; - case 0x1402: - newslot.COB = 0x80000400; - newslot.nodeidpresent = true; - break; - case 0x1403: - newslot.COB = 0x80000500; - newslot.nodeidpresent = true; - break; - case 0x1800: - newslot.COB = 0xC0000180; - newslot.nodeidpresent = true; - break; - case 0x1801: - newslot.COB = 0xC0000280; - newslot.nodeidpresent = true; - break; - case 0x1802: - newslot.COB = 0xC0000380; - newslot.nodeidpresent = true; - break; - case 0x1803: - newslot.COB = 0xC0000480; - newslot.nodeidpresent = true; - break; - default: - newslot.COB = 0xC0000000; - break; + switch (configindex) + { + case 0x1400: + newslot.COB = 0x80000200; + newslot.nodeidpresent = true; + break; + case 0x1401: + newslot.COB = 0x80000300; + newslot.nodeidpresent = true; + break; + case 0x1402: + newslot.COB = 0x80000400; + newslot.nodeidpresent = true; + break; + case 0x1403: + newslot.COB = 0x80000500; + newslot.nodeidpresent = true; + break; + case 0x1800: + newslot.COB = 0xC0000180; + newslot.nodeidpresent = true; + break; + case 0x1801: + newslot.COB = 0xC0000280; + newslot.nodeidpresent = true; + break; + case 0x1802: + newslot.COB = 0xC0000380; + newslot.nodeidpresent = true; + break; + case 0x1803: + newslot.COB = 0xC0000480; + newslot.nodeidpresent = true; + break; + default: + newslot.COB = 0xC0000000; + break; } newslot.configloc = "PERSIST_COMM"; @@ -565,14 +565,14 @@ public UInt16 findPDOslotgap(bool isTXPDO) /// public void removePDOslot(UInt16 configindex) { - foreach (PDOSlot slot in pdoslots) - { - if (slot.ConfigurationIndex == configindex) - { - pdoslots.Remove(slot); - break; - } - } + foreach (PDOSlot slot in pdoslots) + { + if (slot.ConfigurationIndex == configindex) + { + pdoslots.Remove(slot); + break; + } + } } } } diff --git a/libEDSsharp/Properties/Resources.Designer.cs b/libEDSsharp/Properties/Resources.Designer.cs index a5a81006..60a83da3 100644 --- a/libEDSsharp/Properties/Resources.Designer.cs +++ b/libEDSsharp/Properties/Resources.Designer.cs @@ -1,63 +1,63 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace libEDSsharp.Properties { - using System; - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // 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", "17.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() { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [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("libEDSsharp.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace libEDSsharp.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // 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", "17.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() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [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("libEDSsharp.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/libEDSsharp/eds.cs b/libEDSsharp/eds.cs index f88ea3a4..e5ef6dd3 100644 --- a/libEDSsharp/eds.cs +++ b/libEDSsharp/eds.cs @@ -25,11 +25,11 @@ You should have received a copy of the GNU General Public License using System.Globalization; using System.Reflection; using CanOpenXSD_1_1; -using System.Runtime.Remoting.Messaging; -using System.Net.NetworkInformation; -using System.Security.Cryptography; -using Xml2CSharp; - +using System.Runtime.Remoting.Messaging; +using System.Net.NetworkInformation; +using System.Security.Cryptography; +using Xml2CSharp; + namespace libEDSsharp { @@ -751,21 +751,21 @@ public class DeviceInfo : InfoSection public UInt32 RevisionNumber; [EdsExport] - public bool BaudRate_10 = false; + public bool BaudRate_10 = false; [EdsExport] - public bool BaudRate_20 = false; + public bool BaudRate_20 = false; [EdsExport] - public bool BaudRate_50 = false; + public bool BaudRate_50 = false; [EdsExport] - public bool BaudRate_125 = false; + public bool BaudRate_125 = false; [EdsExport] - public bool BaudRate_250 = false; + public bool BaudRate_250 = false; [EdsExport] - public bool BaudRate_500 = false; + public bool BaudRate_500 = false; [EdsExport] - public bool BaudRate_800 = false; + public bool BaudRate_800 = false; [EdsExport] - public bool BaudRate_1000 = false; + public bool BaudRate_1000 = false; public bool BaudRate_auto = false; @@ -794,12 +794,12 @@ public class DeviceInfo : InfoSection [EdsExport] public bool LSS_Supported; - public bool LSS_Master; - + public bool LSS_Master; + [EdsExport] public bool NG_Slave; - public bool NG_Master; + public bool NG_Master; public UInt16 NrOfNG_MonitoredNodes; @@ -1269,7 +1269,7 @@ public override string ToString() public string ObjectTypeString() { return Enum.IsDefined(typeof(ObjectType), objecttype) ? objecttype.ToString() : ObjectType.VAR.ToString(); - } + } public void ObjectTypeString(string objectType) { @@ -1369,15 +1369,15 @@ public ODentry AddSubEntry() return null; ODentry newOd; - - if ((baseObject.Nosubindexes == 0) && ((baseObject.objecttype == ObjectType.ARRAY) || (baseObject.objecttype == ObjectType.RECORD))) { + + if ((baseObject.Nosubindexes == 0) && ((baseObject.objecttype == ObjectType.ARRAY) || (baseObject.objecttype == ObjectType.RECORD))) { baseObject.subobjects.Add(0, new ODentry - { - parent = baseObject, - parameter_name = "Highest sub-index supported", - accesstype = EDSsharp.AccessType.ro, - objecttype = ObjectType.VAR, - datatype = DataType.UNSIGNED8, + { + parent = baseObject, + parameter_name = "Highest sub-index supported", + accesstype = EDSsharp.AccessType.ro, + objecttype = ObjectType.VAR, + datatype = DataType.UNSIGNED8, defaultvalue = "0x01" }); } @@ -2146,9 +2146,9 @@ public void ParseEDSentry(KeyValuePair> kvp) Match m2 = r2.Match(m.Groups[0].ToString()); if (m2.Success) - { - UInt16 modindex=0, odindex=0; - + { + UInt16 modindex=0, odindex=0; + try { modindex = Convert.ToUInt16(m2.Groups[1].Value); } catch (Exception) { Console.WriteLine("** ALL GONE WRONG **" + m2.Groups[1].Value); } //Indexes in the EDS are always in hex format without the pre 0x @@ -2225,32 +2225,32 @@ public void ParseEDSentry(KeyValuePair> kvp) } if (kvp.Value.ContainsKey("Count")) - { - /* FIXME: The format of "Count" is Unsigned8[; Unsigned8] according DS306 - * Count: - Number of extended Sub-Indexes with this description that are created per module. The format is Unsigned8 [; Unsigned8]. - If one or more Sub - Indexes are created per attached module to build a new sub- index, then Count is that Number. In example 32 bit module creates 4 Sub - Indexes each having 8 Bit: Count = 4 + { + /* FIXME: The format of "Count" is Unsigned8[; Unsigned8] according DS306 + * Count: + Number of extended Sub-Indexes with this description that are created per module. The format is Unsigned8 [; Unsigned8]. + If one or more Sub - Indexes are created per attached module to build a new sub- index, then Count is that Number. In example 32 bit module creates 4 Sub - Indexes each having 8 Bit: Count = 4 If several modules are gathered to form a new Sub- Index, then the number is 0, followed by semicolon and the number of bits that are created per module to build a new Sub-Index.In example 2 bit modules with 8 bit objects: The first Sub - Index is built upon modules 1 - 4, the next upon modules 5 - 8 etc.: Count = 0; 2.The objects are created, when a new byte begins: Module 1 creates the Sub - Index 1; modules 2 - 4 fill it up; module 5 creates Sub-Index 2 and so forth. - */ - pat2 = @"\s*([0-9a-fA-F]+)\s*;\s*([0-9a-fA-F]+)"; - r2 = new Regex(pat2, RegexOptions.IgnoreCase); - m2 = r2.Match(kvp.Value["Count"]); - - - - if (m2.Success) - { - Console.WriteLine("** FIXME Count format not supported ** Count: " + kvp.Value["Count"]); - int found = kvp.Value["Count"].IndexOf(";"); - string s = kvp.Value["Count"].Substring(found + 1); - try { od.count = Convert.ToByte(s, Getbase(s)); } - catch (Exception) { Console.WriteLine("** ALL GONE WRONG ** Count" + kvp.Value["Count"]); } - } - else - { - - try { od.count = Convert.ToByte(kvp.Value["Count"], Getbase(kvp.Value["Count"])); } - catch (Exception) { Console.WriteLine("** ALL GONE WRONG ** Count" + kvp.Value["Count"]); } + */ + pat2 = @"\s*([0-9a-fA-F]+)\s*;\s*([0-9a-fA-F]+)"; + r2 = new Regex(pat2, RegexOptions.IgnoreCase); + m2 = r2.Match(kvp.Value["Count"]); + + + + if (m2.Success) + { + Console.WriteLine("** FIXME Count format not supported ** Count: " + kvp.Value["Count"]); + int found = kvp.Value["Count"].IndexOf(";"); + string s = kvp.Value["Count"].Substring(found + 1); + try { od.count = Convert.ToByte(s, Getbase(s)); } + catch (Exception) { Console.WriteLine("** ALL GONE WRONG ** Count" + kvp.Value["Count"]); } + } + else + { + + try { od.count = Convert.ToByte(kvp.Value["Count"], Getbase(kvp.Value["Count"])); } + catch (Exception) { Console.WriteLine("** ALL GONE WRONG ** Count" + kvp.Value["Count"]); } } } @@ -2270,29 +2270,29 @@ public void ParseEDSentry(KeyValuePair> kvp) throw new ParameterException("CompactSubObj not valid for a VAR Object, section: " + section); if (kvp.Value.ContainsKey("ParameterValue")) - { - - try { od.actualvalue = kvp.Value["ParameterValue"]; } + { + + try { od.actualvalue = kvp.Value["ParameterValue"]; } catch (Exception) { Console.WriteLine("** ALL GONE WRONG ** ParameterValue:" + kvp.Value["ParameterValue"]); } } if (kvp.Value.ContainsKey("HighLimit")) - { - try { od.HighLimit = kvp.Value["HighLimit"]; } + { + try { od.HighLimit = kvp.Value["HighLimit"]; } catch (Exception) { Console.WriteLine("** ALL GONE WRONG ** HighLimit:" + kvp.Value["HighLimit"]); } } if (kvp.Value.ContainsKey("LowLimit")) - { - try { od.LowLimit = kvp.Value["LowLimit"]; } + { + try { od.LowLimit = kvp.Value["LowLimit"]; } catch (Exception) { Console.WriteLine("** ALL GONE WRONG ** LowLimit:" + kvp.Value["LowLimit"]); } } if (kvp.Value.ContainsKey("Denotation")) - { - try { od.denotation = kvp.Value["Denotation"]; } - catch (Exception) { Console.WriteLine("** ALL GONE WRONG ** Denotation:" + kvp.Value["Denotation"]); } - + { + try { od.denotation = kvp.Value["Denotation"]; } + catch (Exception) { Console.WriteLine("** ALL GONE WRONG ** Denotation:" + kvp.Value["Denotation"]); } + } @@ -2439,8 +2439,8 @@ public void Loadfile(string filename) di = new DeviceInfo(eds["DeviceInfo"]); foreach (KeyValuePair> kvp in eds) - { - + { + try { ParseEDSentry(kvp); } catch (Exception) { Console.WriteLine("** ALL GONE WRONG **" + kvp); } @@ -2466,7 +2466,7 @@ public void Loadfile(string filename) string strSection = ""; if (eds.ContainsKey("DeviceCommissioning")) // wrong section name as defined in the DSP302, but right spelling (for compabiltiy to some tools) strSection = "DeviceCommissioning"; - else if (eds.ContainsKey("DeviceComissioning")) // right section name as defined in the DSP302, (wrong spelling) + else if (eds.ContainsKey("DeviceComissioning")) // right section name as defined in the DSP302, (wrong spelling) strSection = "DeviceComissioning"; if (strSection != ""){ @@ -2492,7 +2492,7 @@ public void Loadfile(string filename) foreach (string s in eds.Keys) { - String pat = @"M([0-9]+)ModuleInfo"; + String pat = @"M([0-9]+)ModuleInfo"; Regex r = new Regex(pat, RegexOptions.IgnoreCase); Match m = r.Match(s); @@ -2710,7 +2710,7 @@ public void Savefile(string filename, InfoSection.Filetype ft) fi.EDSVersionMajor = 4; fi.EDSVersionMinor = 0; - StreamWriter writer = System.IO.File.CreateText(filename); + StreamWriter writer = System.IO.File.CreateText(filename); writer.NewLine = "\n"; fi.Write(writer,ft); di.Write(writer,ft); @@ -2989,7 +2989,7 @@ public UInt32 GetNodeID(string input, out bool nodeidpresent) input = input.Replace(" ", ""); return Convert.ToUInt32(input.Trim(), Getbase(input)); } - + input = input.Replace("$NODEID", dc.NodeID.ToString()); // dc.NodeID is decimal string[] bits = Array.ConvertAll(input.Split('+'), p => p.Trim()); // Split and Trim the value if (bits.Length==1) @@ -3033,7 +3033,7 @@ public bool tryGetODEntry(UInt16 index, out ODentry od) } return false; - } + } //RX COM 0x1400 //RX Map 0x1600 @@ -3044,11 +3044,11 @@ public bool tryGetODEntry(UInt16 index, out ODentry od) public bool CreatePDO(bool rx,UInt16 index) { //check if we are creating an RX PDO it is a valid index - if (rx && (index < 0x1400 || index >= 0x1600)) + if (rx && (index < 0x1400 || index >= 0x1600)) return false; //check if we are creating an PDO TX it is a valid index - if (!rx & (index < 0x1800 || index >= 0x1A00)) + if (!rx & (index < 0x1800 || index >= 0x1A00)) return false; //Check it does not already exist diff --git a/libEDSsharp/extensions.cs b/libEDSsharp/extensions.cs index 6619e303..b76bdbe0 100644 --- a/libEDSsharp/extensions.cs +++ b/libEDSsharp/extensions.cs @@ -25,19 +25,19 @@ public static string ToHexString(this UInt32 val) } - public static class StringExtensions - { - public static bool Contains(this String str, String substring, - StringComparison comp) - { - if (substring == null) - throw new ArgumentNullException("substring", - "substring cannot be null."); - else if (!Enum.IsDefined(typeof(StringComparison), comp)) - throw new ArgumentException("comp is not a member of StringComparison", - "comp"); - - return str.IndexOf(substring, comp) >= 0; - } + public static class StringExtensions + { + public static bool Contains(this String str, String substring, + StringComparison comp) + { + if (substring == null) + throw new ArgumentNullException("substring", + "substring cannot be null."); + else if (!Enum.IsDefined(typeof(StringComparison), comp)) + throw new ArgumentException("comp is not a member of StringComparison", + "comp"); + + return str.IndexOf(substring, comp) >= 0; + } } }