|
@@ -251,6 +251,9 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
timer1.Enabled = true;
|
|
|
timer2.Enabled = true;
|
|
|
|
|
|
+ //显示测试员信息
|
|
|
+ label_TestUser.Text = "测试员:" + StartForm.EnterForm1.comboBox_User.Text;
|
|
|
+
|
|
|
//装载配置文件
|
|
|
GetDateList(false);
|
|
|
|
|
@@ -552,6 +555,9 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
//MCU温度
|
|
|
DataTemp = (ushort)(binary_data_1[25]);
|
|
|
textBox_MCU.Text = Convert.ToString((int)(DataTemp - 40));
|
|
|
+
|
|
|
+ Ack_Flag = true;
|
|
|
+ StepTestFlag = StepTestResult_Enum.StepTestResult_OK;
|
|
|
}));
|
|
|
}
|
|
|
break;
|
|
@@ -1038,6 +1044,41 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ //初始化助力档位为OFF,避免配置无仪表时默认为SMART,导致参数不保存
|
|
|
+ do
|
|
|
+ {
|
|
|
+ Code[0] = 0x00;
|
|
|
+ Code[1] = 0xF0;
|
|
|
+ SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2802, Code);
|
|
|
+ Ack_Flag = false;
|
|
|
+ Ack_Cnt = 0;
|
|
|
+ StepTestFlag = StepTestResult_Enum.StepTestResult_Testing;
|
|
|
+ while (StepTestFlag == StepTestResult_Enum.StepTestResult_Testing) ;//等待测试结束
|
|
|
+ if (StepTestFlag == StepTestResult_Enum.StepTestResult_OK)//成功
|
|
|
+ {
|
|
|
+ richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "助力档位设置为OFF成功" + "\r\n";
|
|
|
+ }
|
|
|
+ else//失败
|
|
|
+ {
|
|
|
+ label_Step.Text = "通信失败!";
|
|
|
+ richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "助力档位设置OFF失败,测试结束" + "\r\n";
|
|
|
+ //关机
|
|
|
+ Code[0] = 0xF0;
|
|
|
+ SendCmd(0x7FF, 0x16, 0x2201, Code);
|
|
|
+ 开ToolStripMenuItem.Checked = false;
|
|
|
+ 关ToolStripMenuItem.Checked = true;
|
|
|
+ button_Start.Enabled = true;
|
|
|
+ Delay_ms(500);
|
|
|
+ //关闭串口
|
|
|
+ portsettings_form.closePort();
|
|
|
+ //存储测试数据
|
|
|
+ ErrorSaveLog();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } while (false);
|
|
|
+
|
|
|
#region Step2:发送指令,依次写入参数
|
|
|
TestStep = TestStep_Enum.Step_Write;
|
|
|
label_Step.Text = "参数写入中,请等待!";
|
|
@@ -1754,7 +1795,7 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
OK_cnt++;
|
|
|
}
|
|
|
}
|
|
|
- ////母线电压
|
|
|
+ ////母线电压,推行时母线电压会被抬高,放到静止是检测
|
|
|
//try
|
|
|
//{
|
|
|
// DataTemp = Convert.ToUInt16(textBox_Vol.Text);
|
|
@@ -2228,9 +2269,9 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
label_Step.Text = "版本查询和确认";
|
|
|
richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令查询版本信息" + "\r\n";
|
|
|
richTextBox_Ver.Text = "";
|
|
|
- SendCmd((ushort)0x751, (byte)0x11, (ushort)0x1200, null);
|
|
|
+ SendCmd((ushort)0x751, (byte)0x11, (ushort)0x1200, null);//查询主控版本
|
|
|
Delay_ms(200);
|
|
|
- SendCmd((ushort)0x651, (byte)0x11, (ushort)0x1200, null);
|
|
|
+ SendCmd((ushort)0x651, (byte)0x11, (ushort)0x1200, null);//查询TE版本
|
|
|
Delay_ms(200);
|
|
|
string FW_Version_Check = comboBox_File.Text.Split('_')[2] + "_" + comboBox_File.Text.Split('_')[3];
|
|
|
string FW_Version_Result = "";
|
|
@@ -2265,24 +2306,27 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (string.Equals(TE_FW_Ver_Check, TE_FW_Ver_Result) == false) //TE版本错误,给出提示
|
|
|
+ if (TE_FW_Ver_Check != "N_A") //单MCU主控板不检测TE版本
|
|
|
{
|
|
|
- if (MessageBox.Show("TE版本错误,请确认主控板是否为HK?", "TE版本错误", MessageBoxButtons.YesNo) == DialogResult.No)
|
|
|
+ if (string.Equals(TE_FW_Ver_Check, TE_FW_Ver_Result) == false) //TE版本错误,给出提示
|
|
|
{
|
|
|
- richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "TE软件版本错误" + "\r\n";
|
|
|
- label_Step.Text = "TE软件版本错误,测试结束!";
|
|
|
- //关机
|
|
|
- Code[0] = 0xF0;
|
|
|
- SendCmd(0x7FF, 0x16, 0x2201, Code);
|
|
|
- 开ToolStripMenuItem.Checked = false;
|
|
|
- 关ToolStripMenuItem.Checked = true;
|
|
|
- button_Start.Enabled = true;
|
|
|
- Delay_ms(500);
|
|
|
- //关闭串口
|
|
|
- portsettings_form.closePort();
|
|
|
- //存储测试数据
|
|
|
- ErrorSaveLog();
|
|
|
- return;
|
|
|
+ if (MessageBox.Show("TE版本错误,请确认主控板是否为HK?", "TE版本错误", MessageBoxButtons.YesNo) == DialogResult.No)
|
|
|
+ {
|
|
|
+ richTextBox_TestRecord.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "TE软件版本错误" + "\r\n";
|
|
|
+ label_Step.Text = "TE软件版本错误,测试结束!";
|
|
|
+ //关机
|
|
|
+ Code[0] = 0xF0;
|
|
|
+ SendCmd(0x7FF, 0x16, 0x2201, Code);
|
|
|
+ 开ToolStripMenuItem.Checked = false;
|
|
|
+ 关ToolStripMenuItem.Checked = true;
|
|
|
+ button_Start.Enabled = true;
|
|
|
+ Delay_ms(500);
|
|
|
+ //关闭串口
|
|
|
+ portsettings_form.closePort();
|
|
|
+ //存储测试数据
|
|
|
+ ErrorSaveLog();
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
label_FW_Version.BackColor = Color.Green;
|
|
@@ -2851,11 +2895,18 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
private void BMS检测不执行ToolStripMenuItem1_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
StartForm.EnterForm1.ShowDialog();
|
|
|
- if ((StartForm.EnterForm1.textBox_User.Text == "PT") && (StartForm.EnterForm1.textBox_Passwd.Text == "123456"))
|
|
|
+ if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
|
|
|
{
|
|
|
- BMS检测不执行ToolStripMenuItem1.Checked = true;
|
|
|
- BMS检测执行ToolStripMenuItem1.Checked = false;
|
|
|
- label_TestFunsUpdate();
|
|
|
+ if (StartForm.EnterForm1.comboBox_User.Text == "工程")
|
|
|
+ {
|
|
|
+ BMS检测不执行ToolStripMenuItem1.Checked = true;
|
|
|
+ BMS检测执行ToolStripMenuItem1.Checked = false;
|
|
|
+ label_TestFunsUpdate();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2873,11 +2924,18 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
private void 推行测试不执行ToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
StartForm.EnterForm1.ShowDialog();
|
|
|
- if ((StartForm.EnterForm1.textBox_User.Text == "PT") && (StartForm.EnterForm1.textBox_Passwd.Text == "123456"))
|
|
|
+ if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
|
|
|
{
|
|
|
- 推行测试不执行ToolStripMenuItem.Checked = true;
|
|
|
- 推行测试执行ToolStripMenuItem.Checked = false;
|
|
|
- label_TestFunsUpdate();
|
|
|
+ if (StartForm.EnterForm1.comboBox_User.Text == "工程")
|
|
|
+ {
|
|
|
+ 推行测试不执行ToolStripMenuItem.Checked = true;
|
|
|
+ 推行测试执行ToolStripMenuItem.Checked = false;
|
|
|
+ label_TestFunsUpdate();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2895,11 +2953,18 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
private void 系统清除不执行ToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
StartForm.EnterForm1.ShowDialog();
|
|
|
- if ((StartForm.EnterForm1.textBox_User.Text == "PT") && (StartForm.EnterForm1.textBox_Passwd.Text == "123456"))
|
|
|
+ if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
|
|
|
{
|
|
|
- 系统清除执行ToolStripMenuItem.Checked = false;
|
|
|
- 系统清除不执行ToolStripMenuItem.Checked = true;
|
|
|
- label_TestFunsUpdate();
|
|
|
+ if (StartForm.EnterForm1.comboBox_User.Text == "工程")
|
|
|
+ {
|
|
|
+ 系统清除执行ToolStripMenuItem.Checked = false;
|
|
|
+ 系统清除不执行ToolStripMenuItem.Checked = true;
|
|
|
+ label_TestFunsUpdate();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2939,20 +3004,27 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
else
|
|
|
{
|
|
|
StartForm.EnterForm1.ShowDialog();
|
|
|
- if ((StartForm.EnterForm1.textBox_User.Text == "PT") && (StartForm.EnterForm1.textBox_Passwd.Text == "123456"))
|
|
|
+ if (StartForm.EnterForm1.textBox_Passwd.Text == StartForm.EnterForm1.UserAccount[StartForm.EnterForm1.comboBox_User.Text])
|
|
|
{
|
|
|
- 系统清除执行ToolStripMenuItem.Checked = false;
|
|
|
- 系统清除不执行ToolStripMenuItem.Checked = true;
|
|
|
- 推行测试执行ToolStripMenuItem.Checked = false;
|
|
|
- 推行测试不执行ToolStripMenuItem.Checked = true;
|
|
|
- BMS检测执行ToolStripMenuItem1.Checked = false;
|
|
|
- BMS检测不执行ToolStripMenuItem1.Checked = true;
|
|
|
-
|
|
|
- 只写入参数ToolStripMenuItem.Checked = true;
|
|
|
- 推行测试ToolStripMenuItem.Enabled = false;
|
|
|
- bMS通信检测ToolStripMenuItem.Enabled = false;
|
|
|
- 系统清除ToolStripMenuItem.Enabled = false;
|
|
|
- label_TestFunsUpdate();
|
|
|
+ if (StartForm.EnterForm1.comboBox_User.Text == "工程")
|
|
|
+ {
|
|
|
+ 系统清除执行ToolStripMenuItem.Checked = false;
|
|
|
+ 系统清除不执行ToolStripMenuItem.Checked = true;
|
|
|
+ 推行测试执行ToolStripMenuItem.Checked = false;
|
|
|
+ 推行测试不执行ToolStripMenuItem.Checked = true;
|
|
|
+ BMS检测执行ToolStripMenuItem1.Checked = false;
|
|
|
+ BMS检测不执行ToolStripMenuItem1.Checked = true;
|
|
|
+
|
|
|
+ 只写入参数ToolStripMenuItem.Checked = true;
|
|
|
+ 推行测试ToolStripMenuItem.Enabled = false;
|
|
|
+ bMS通信检测ToolStripMenuItem.Enabled = false;
|
|
|
+ 系统清除ToolStripMenuItem.Enabled = false;
|
|
|
+ label_TestFunsUpdate();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MessageBox.Show("权限不支持", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|