From 330bdf41884bc7590709468aadd78cdb34dc7304 Mon Sep 17 00:00:00 2001 From: Esmaeill Date: Fri, 23 Aug 2024 12:13:08 +0330 Subject: [PATCH] compatible to hcs300 #2 --- Form1.Designer.cs | 62 +++++++++++++++++++++++++++++++++++------------ Form1.cs | 18 ++++++++++++++ Programmer.csproj | 6 ++--- 3 files changed, 68 insertions(+), 18 deletions(-) diff --git a/Form1.Designer.cs b/Form1.Designer.cs index c0e3bd7..289ceae 100644 --- a/Form1.Designer.cs +++ b/Form1.Designer.cs @@ -31,6 +31,7 @@ private void InitializeComponent() this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.btn_mc_gen = new System.Windows.Forms.Button(); this.btn_gen_seed = new System.Windows.Forms.Button(); this.btn_pp = new System.Windows.Forms.Button(); this.btn_mc_clc = new System.Windows.Forms.Button(); @@ -87,7 +88,9 @@ private void InitializeComponent() this.groupBox3 = new System.Windows.Forms.GroupBox(); this.rtb = new System.Windows.Forms.RichTextBox(); this.timer1 = new System.Windows.Forms.Timer(this.components); - this.btn_mc_gen = new System.Windows.Forms.Button(); + this.deviceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.hCS301ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.hCS300ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -135,6 +138,18 @@ private void InitializeComponent() this.groupBox1.TabStop = false; this.groupBox1.Text = "Main"; // + // btn_mc_gen + // + this.btn_mc_gen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btn_mc_gen.Enabled = false; + this.btn_mc_gen.Location = new System.Drawing.Point(390, 30); + this.btn_mc_gen.Name = "btn_mc_gen"; + this.btn_mc_gen.Size = new System.Drawing.Size(75, 23); + this.btn_mc_gen.TabIndex = 24; + this.btn_mc_gen.Text = "Generate"; + this.btn_mc_gen.UseVisualStyleBackColor = true; + this.btn_mc_gen.Click += new System.EventHandler(this.btn_mc_gen_Click); + // // btn_gen_seed // this.btn_gen_seed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -461,7 +476,8 @@ private void InitializeComponent() this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.sERToolStripMenuItem, this.discriminationToolStripMenuItem, - this.learnModeToolStripMenuItem}); + this.learnModeToolStripMenuItem, + this.deviceToolStripMenuItem}); this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); this.optionsToolStripMenuItem.Text = "Options"; @@ -485,7 +501,7 @@ private void InitializeComponent() // bitToolStripMenuItem // this.bitToolStripMenuItem.Name = "bitToolStripMenuItem"; - this.bitToolStripMenuItem.Size = new System.Drawing.Size(103, 22); + this.bitToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.bitToolStripMenuItem.Text = "8 Bit"; this.bitToolStripMenuItem.Click += new System.EventHandler(this.bitToolStripMenuItem_Click); // @@ -494,7 +510,7 @@ private void InitializeComponent() this.bitToolStripMenuItem1.Checked = true; this.bitToolStripMenuItem1.CheckState = System.Windows.Forms.CheckState.Checked; this.bitToolStripMenuItem1.Name = "bitToolStripMenuItem1"; - this.bitToolStripMenuItem1.Size = new System.Drawing.Size(103, 22); + this.bitToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); this.bitToolStripMenuItem1.Text = "10 Bit"; this.bitToolStripMenuItem1.Click += new System.EventHandler(this.bitToolStripMenuItem1_Click); // @@ -714,17 +730,30 @@ private void InitializeComponent() this.timer1.Interval = 200; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // - // btn_mc_gen + // deviceToolStripMenuItem // - this.btn_mc_gen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btn_mc_gen.Enabled = false; - this.btn_mc_gen.Location = new System.Drawing.Point(390, 30); - this.btn_mc_gen.Name = "btn_mc_gen"; - this.btn_mc_gen.Size = new System.Drawing.Size(75, 23); - this.btn_mc_gen.TabIndex = 24; - this.btn_mc_gen.Text = "Generate"; - this.btn_mc_gen.UseVisualStyleBackColor = true; - this.btn_mc_gen.Click += new System.EventHandler(this.btn_mc_gen_Click); + this.deviceToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.hCS301ToolStripMenuItem, + this.hCS300ToolStripMenuItem}); + this.deviceToolStripMenuItem.Name = "deviceToolStripMenuItem"; + this.deviceToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.deviceToolStripMenuItem.Text = "Device"; + // + // hCS301ToolStripMenuItem + // + this.hCS301ToolStripMenuItem.Checked = true; + this.hCS301ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.hCS301ToolStripMenuItem.Name = "hCS301ToolStripMenuItem"; + this.hCS301ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.hCS301ToolStripMenuItem.Text = "HCS301"; + this.hCS301ToolStripMenuItem.Click += new System.EventHandler(this.hCS301ToolStripMenuItem_Click); + // + // hCS300ToolStripMenuItem + // + this.hCS300ToolStripMenuItem.Name = "hCS300ToolStripMenuItem"; + this.hCS300ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.hCS300ToolStripMenuItem.Text = "HCS300"; + this.hCS300ToolStripMenuItem.Click += new System.EventHandler(this.hCS300ToolStripMenuItem_Click); // // Form1 // @@ -738,7 +767,7 @@ private void InitializeComponent() this.MainMenuStrip = this.menuStrip1; this.MinimumSize = new System.Drawing.Size(665, 445); this.Name = "Form1"; - this.Text = "HCS301 Programmer V0.2.6"; + this.Text = "HCS Programmer V0.2.7"; this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -819,6 +848,9 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem; private System.Windows.Forms.Button btn_gen_seed; private System.Windows.Forms.Button btn_mc_gen; + private System.Windows.Forms.ToolStripMenuItem deviceToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem hCS301ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem hCS300ToolStripMenuItem; } } diff --git a/Form1.cs b/Form1.cs index 914c74d..4e605b9 100644 --- a/Form1.cs +++ b/Form1.cs @@ -929,6 +929,24 @@ private void btn_mc_gen_Click(object sender, EventArgs e) print_log("Manufacturer Code Generated " + tb_mf.Text); } + private void hCS301ToolStripMenuItem_Click(object sender, EventArgs e) + { + hCS301ToolStripMenuItem.Checked = true; + hCS300ToolStripMenuItem.Checked = false; + + rb_9or12v.Text= "9 or 12 V"; + rb_6v.Text= "6 V"; + } + + private void hCS300ToolStripMenuItem_Click(object sender, EventArgs e) + { + hCS300ToolStripMenuItem.Checked = true; + hCS301ToolStripMenuItem.Checked = false; + + rb_9or12v.Text = "5 or 6 V"; + rb_6v.Text = "3.0 V"; + } + private void cb_br_SelectedIndexChanged(object sender, EventArgs e) { switch(cb_br.SelectedIndex) diff --git a/Programmer.csproj b/Programmer.csproj index 9da72fc..e3bad79 100644 --- a/Programmer.csproj +++ b/Programmer.csproj @@ -7,7 +7,7 @@ {917791B5-231E-4832-9E8C-FE4E65DAC6FB} WinExe Programmer - HCS301-Programmer-v0.2.5 + HCS-Programmer-v0.2.7 v4.7.2 512 true @@ -23,8 +23,8 @@ false false true - 6 - 1.0.2.%2a + 7 + 1.0.2.7 false true