Преглед изворни кода

1,控制参数预留1低8位作为转把定速巡航开关;
2,仪表用户参数增加转把定速巡航开关。

Dail пре 11 месеци
родитељ
комит
a02b78046c

BIN
.vs/Welling_Motor_Debug_Tool/v17/.suo


+ 1 - 1
Welling_Motor_Debug_Tool/Params.cs

@@ -18,7 +18,7 @@ namespace Welling_Motor_Debug_Tool
                                                            "预留11","预留12"};
         public List<string> ControlParam = new List<string> {"位置传感器零点","位置传感器当前零点","峰值电流","电流保护阈值","最高档电压保护阈值","最高档欠压保护阈值",
                                                              "超速保护阈值","过热保护阈值","过热保护恢复阈值","过热降额启动阈值","电机过热保护阈值","电机过热保护恢复阈值", "电机过热降额启动阈值",
-                                                             "预留1","预留2","预留3"};
+                                                             "定制功能使能","预留1","预留2"};
         public List<string> AssistParam = new List<string> { "零速启动增益", "巡航启动增益", "助力转矩曲线编号", "助力踏频曲线编号",
                                                              "转矩曲线.a", "转矩曲线.b","转矩曲线.c","转矩曲线.d",
                                                              "踏频曲线.a", "踏频曲线.b","踏频曲线.c","踏频曲线.d",

+ 70 - 0
Welling_Motor_Debug_Tool/mainForm.Designer.cs

@@ -181,6 +181,8 @@ namespace Welling_Motor_Debug_Tool
             this.button_ReadBikeParam2 = new System.Windows.Forms.Button();
             this.richTextBox_BikeParam2 = new System.Windows.Forms.RichTextBox();
             this.tabPage_ControlParam = new System.Windows.Forms.TabPage();
+            this.comboBox_Bike_CCS = new System.Windows.Forms.ComboBox();
+            this.label133 = new System.Windows.Forms.Label();
             this.button_WriteControlParam = new System.Windows.Forms.Button();
             this.button_ReadControlParam = new System.Windows.Forms.Button();
             this.richTextBox_ControlParam = new System.Windows.Forms.RichTextBox();
@@ -320,6 +322,8 @@ namespace Welling_Motor_Debug_Tool
             this.label50 = new System.Windows.Forms.Label();
             this.label51 = new System.Windows.Forms.Label();
             this.groupBox13 = new System.Windows.Forms.GroupBox();
+            this.comboBox_OBC_BikeCCS = new System.Windows.Forms.ComboBox();
+            this.label137 = new System.Windows.Forms.Label();
             this.numericUpDown_OBC_SpeedLimitAdj = new System.Windows.Forms.NumericUpDown();
             this.label80 = new System.Windows.Forms.Label();
             this.label128 = new System.Windows.Forms.Label();
@@ -1939,6 +1943,9 @@ namespace Welling_Motor_Debug_Tool
             // 
             // comboBox_TailLightVol
             // 
+            this.comboBox_TailLightVol.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
+            this.comboBox_TailLightVol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_TailLightVol.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_TailLightVol.FormattingEnabled = true;
             this.comboBox_TailLightVol.Items.AddRange(new object[] {
             "6V",
@@ -1959,6 +1966,9 @@ namespace Welling_Motor_Debug_Tool
             // 
             // comboBox_FrontLightVol
             // 
+            this.comboBox_FrontLightVol.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
+            this.comboBox_FrontLightVol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_FrontLightVol.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_FrontLightVol.FormattingEnabled = true;
             this.comboBox_FrontLightVol.Items.AddRange(new object[] {
             "6V",
@@ -1979,6 +1989,9 @@ namespace Welling_Motor_Debug_Tool
             // 
             // comboBox_TailLightMode
             // 
+            this.comboBox_TailLightMode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
+            this.comboBox_TailLightMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_TailLightMode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.comboBox_TailLightMode.FormattingEnabled = true;
             this.comboBox_TailLightMode.Items.AddRange(new object[] {
             "1",
@@ -2078,6 +2091,8 @@ namespace Welling_Motor_Debug_Tool
             // tabPage_ControlParam
             // 
             this.tabPage_ControlParam.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+            this.tabPage_ControlParam.Controls.Add(this.comboBox_Bike_CCS);
+            this.tabPage_ControlParam.Controls.Add(this.label133);
             this.tabPage_ControlParam.Controls.Add(this.button_WriteControlParam);
             this.tabPage_ControlParam.Controls.Add(this.button_ReadControlParam);
             this.tabPage_ControlParam.Controls.Add(this.richTextBox_ControlParam);
@@ -2087,6 +2102,30 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_ControlParam.TabIndex = 2;
             this.tabPage_ControlParam.Text = "控制参数";
             // 
+            // comboBox_Bike_CCS
+            // 
+            this.comboBox_Bike_CCS.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
+            this.comboBox_Bike_CCS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_Bike_CCS.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.comboBox_Bike_CCS.FormattingEnabled = true;
+            this.comboBox_Bike_CCS.Items.AddRange(new object[] {
+            "NA",
+            "开",
+            "关"});
+            this.comboBox_Bike_CCS.Location = new System.Drawing.Point(932, 14);
+            this.comboBox_Bike_CCS.Name = "comboBox_Bike_CCS";
+            this.comboBox_Bike_CCS.Size = new System.Drawing.Size(55, 29);
+            this.comboBox_Bike_CCS.TabIndex = 10;
+            // 
+            // label133
+            // 
+            this.label133.AutoSize = true;
+            this.label133.Location = new System.Drawing.Point(855, 18);
+            this.label133.Name = "label133";
+            this.label133.Size = new System.Drawing.Size(74, 21);
+            this.label133.TabIndex = 8;
+            this.label133.Text = "转把巡航";
+            // 
             // button_WriteControlParam
             // 
             this.button_WriteControlParam.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
@@ -3601,6 +3640,8 @@ namespace Welling_Motor_Debug_Tool
             // 
             // groupBox13
             // 
+            this.groupBox13.Controls.Add(this.comboBox_OBC_BikeCCS);
+            this.groupBox13.Controls.Add(this.label137);
             this.groupBox13.Controls.Add(this.numericUpDown_OBC_SpeedLimitAdj);
             this.groupBox13.Controls.Add(this.label80);
             this.groupBox13.Controls.Add(this.label128);
@@ -3622,6 +3663,30 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox13.TabStop = false;
             this.groupBox13.Text = "设置用户参数";
             // 
+            // comboBox_OBC_BikeCCS
+            // 
+            this.comboBox_OBC_BikeCCS.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
+            this.comboBox_OBC_BikeCCS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.comboBox_OBC_BikeCCS.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.comboBox_OBC_BikeCCS.FormattingEnabled = true;
+            this.comboBox_OBC_BikeCCS.Items.AddRange(new object[] {
+            "NA",
+            "开",
+            "关"});
+            this.comboBox_OBC_BikeCCS.Location = new System.Drawing.Point(83, 174);
+            this.comboBox_OBC_BikeCCS.Name = "comboBox_OBC_BikeCCS";
+            this.comboBox_OBC_BikeCCS.Size = new System.Drawing.Size(91, 29);
+            this.comboBox_OBC_BikeCCS.TabIndex = 18;
+            // 
+            // label137
+            // 
+            this.label137.AutoSize = true;
+            this.label137.Location = new System.Drawing.Point(6, 178);
+            this.label137.Name = "label137";
+            this.label137.Size = new System.Drawing.Size(74, 21);
+            this.label137.TabIndex = 19;
+            this.label137.Text = "转把巡航";
+            // 
             // numericUpDown_OBC_SpeedLimitAdj
             // 
             this.numericUpDown_OBC_SpeedLimitAdj.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
@@ -7050,6 +7115,7 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_BikeParam.PerformLayout();
             this.tabPage_BikeParam2.ResumeLayout(false);
             this.tabPage_ControlParam.ResumeLayout(false);
+            this.tabPage_ControlParam.PerformLayout();
             this.tabPage_SensorParam.ResumeLayout(false);
             this.tabPage_SensorParam.PerformLayout();
             this.tabPage_AssistParam.ResumeLayout(false);
@@ -7724,5 +7790,9 @@ namespace Welling_Motor_Debug_Tool
         private ToolStripMenuItem 自动更新ToolStripMenuItem;
         private ToolStripMenuItem 打开ToolStripMenuItem;
         private ToolStripMenuItem 关闭ToolStripMenuItem;
+        private Label label133;
+        private ComboBox comboBox_Bike_CCS;
+        public ComboBox comboBox_OBC_BikeCCS;
+        private Label label137;
     }
 }

+ 21 - 1
Welling_Motor_Debug_Tool/mainForm.cs

@@ -1410,6 +1410,11 @@ namespace Welling_Motor_Debug_Tool
                                     for (int i = 0; i < myParams.ControlParam.Count; i++)
                                     {
                                         richTextBox_ControlParam.AppendText(myParams.ControlParam[i] + "=" + Convert.ToString((ushort)(Data[2 * i + 1] * 256 + Data[2 * i])) + ", ");
+                                        //转把定速巡航
+                                        if (i == 13)
+                                        {
+                                            comboBox_Bike_CCS.SelectedIndex = ((Data[2 * i]) == 0xAA) ? 1 : 2;
+                                        }
                                     }
                                     richTextBox_ControlParam.Text = richTextBox_ControlParam.Text.Substring(0, richTextBox_ControlParam.Text.Length - 2);
                                 }));
@@ -2193,6 +2198,9 @@ namespace Welling_Motor_Debug_Tool
                                     //限速微调
                                     numericUpDown_OBC_SpeedLimitAdj.Value = (int)(Data[6] > 128 ? (Data[6] - 256) : Data[6]);
                                     richTextBox_OBC_ReadUserInfo.AppendText("限速微调:" + Convert.ToString(numericUpDown_OBC_SpeedLimitAdj.Value) + " km/h" + "\r\n");
+                                    //定速巡航
+                                    comboBox_OBC_BikeCCS.SelectedIndex = (Data[7] == 0xAA) ? 1 : 2;
+                                    richTextBox_OBC_ReadUserInfo.AppendText("转把巡航:" + comboBox_OBC_BikeCCS.Text + "\r\n");
                                 }));
                             }
                             break;
@@ -2702,6 +2710,7 @@ namespace Welling_Motor_Debug_Tool
         private void button_ReadControlParam_Click(object sender, EventArgs e)
         {
             richTextBox_ControlParam.Clear();
+            comboBox_Bike_CCS.SelectedIndex = 0;
             mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x3E00, null);
         }
 
@@ -2722,7 +2731,15 @@ namespace Welling_Motor_Debug_Tool
             {
                 for (int i = 0; i < strDataTemp.Length; i++)
                 {
-                    uwDataTemp = Convert.ToUInt16(strDataTemp[i].Split('=')[1]);
+                    if (i == 13)
+                    {
+                        uwDataTemp = (comboBox_Bike_CCS.SelectedIndex == 1) ? (ushort)0x00AA : (ushort)0x0000;
+                    }
+                    else
+                    {
+                        uwDataTemp = Convert.ToUInt16(strDataTemp[i].Split('=')[1]);
+                    }
+                    
                     ConfigParam[2 * i + 2] = (byte)uwDataTemp;
                     ConfigParam[2 * i + 3] = (byte)(uwDataTemp >> 8);
                 }
@@ -3604,6 +3621,7 @@ namespace Welling_Motor_Debug_Tool
         private void button_OBC_ReadUserInfo_Click(object sender, EventArgs e)
         {
             richTextBox_OBC_ReadUserInfo.Clear();
+            comboBox_OBC_BikeCCS.SelectedIndex = 0;
             mySerialProcess.SendCmd((ushort)0x731, (byte)0x11, (ushort)0x3300, null);
         }
 
@@ -3641,6 +3659,8 @@ namespace Welling_Motor_Debug_Tool
             UserInfoCode[3] = (byte)(uint)numericUpDown_OBC_OffTime.Value;
             //限速微调
             UserInfoCode[4] = (byte)(int)numericUpDown_OBC_SpeedLimitAdj.Value;
+            //定速巡航开关
+            UserInfoCode[5] = (byte)((comboBox_OBC_BikeCCS.SelectedIndex == 1) ? 0xAA : 0x00);
             mySerialProcess.SendCmd((ushort)0x731, (byte)0x16, (ushort)0x3408, UserInfoCode);
         }
 

BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.GenerateResource.cache


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.exe


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.pdb