|
@@ -5502,7 +5502,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
richTextBox_FacModeLog.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试页面上传服务器成功" + "\r\n";
|
|
|
}
|
|
|
//测试记录
|
|
|
- LogSaveFileName = LocalSavePath + "\\" + ProductInfo + "_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + "_测试记录" + ".log";
|
|
|
+ LogSaveFileName = LogSavePath + "\\" + ProductInfo + "_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + "_测试记录" + ".log";
|
|
|
string file_str = "";
|
|
|
file_str += "测试时间:\r\n" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\r\n\r\n";
|
|
|
file_str += "检验记录:\r\n" + richTextBox_FacModeLog.Text.Replace("\n", "\r\n") + "\r\n\r\n";
|
|
@@ -5552,7 +5552,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
richTextBox_FacModeLog.AppendText("配置文件:" + comboBox_FacModeCfgDate.Text + " / " + comboBox_FacModeCfgFile.Text + "\r\n");
|
|
|
|
|
|
//检查打标信息格式
|
|
|
- label_FacModeSatus.Text = "检查扫码信息";
|
|
|
+ label_FacModeStatus.Text = "检查扫码信息";
|
|
|
Delay_ms(500);
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "检查扫码信息" + "\r\n");
|
|
|
if (textBox_FacModeScan.Text == string.Empty)
|
|
@@ -5564,17 +5564,19 @@ namespace Welling_Motor_Debug_Tool
|
|
|
{
|
|
|
if (!textBox_FacModeScan.Text.Contains(" "))
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "标签格式错误";
|
|
|
+ button__FacMode_Start.Enabled = true;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
catch (System.Exception)
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "标签格式错误";
|
|
|
+ button__FacMode_Start.Enabled = true;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -5601,9 +5603,9 @@ namespace Welling_Motor_Debug_Tool
|
|
|
short DataTemp_Int16;
|
|
|
string ResultPathName = "";
|
|
|
|
|
|
- label_FacModeSatus.Text = "开始测试";
|
|
|
+ label_FacModeStatus.Text = "开始测试";
|
|
|
Delay_ms(500);
|
|
|
- label_FacModeSatus.Text = "系统开机";
|
|
|
+ label_FacModeStatus.Text = "系统开机";
|
|
|
|
|
|
//系统开机,确保测试前先关机,发送关机指令再发送开机指令
|
|
|
BootInfo = "";
|
|
@@ -5625,7 +5627,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "开机失败" + BootInfo + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -5640,7 +5642,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
do
|
|
|
{
|
|
|
//发送系统清除指令
|
|
|
- label_FacModeSatus.Text = "系统清除!";
|
|
|
+ label_FacModeStatus.Text = "系统清除";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "系统清除" + "\r\n");
|
|
|
Code[0] = (byte)'C';
|
|
|
Code[1] = (byte)'L';
|
|
@@ -5663,7 +5665,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "系统清除失败" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -5673,7 +5675,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
}
|
|
|
|
|
|
//系统重新开机
|
|
|
- label_FacModeSatus.Text = "重新开机";
|
|
|
+ label_FacModeStatus.Text = "重新开机";
|
|
|
BootInfo = "";
|
|
|
Code[0] = 0xF1;
|
|
|
mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
|
|
@@ -5688,7 +5690,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "重新开机失败" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -5701,7 +5703,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
label_FacModeSysClear.BackColor = Color.Yellow;
|
|
|
- label_FacModeSatus.Text = "跳过系统清除!";
|
|
|
+ label_FacModeStatus.Text = "跳过系统清除!";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过系统清除" + "\r\n");
|
|
|
Delay_ms(500);
|
|
|
}
|
|
@@ -5710,7 +5712,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (textBox_ErrorCode.Text.Contains("H"))
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "故障码:" + textBox_ErrorCode.Text + "\r\n");
|
|
|
- label_FacModeSatus.Text = "电机存在故障!";
|
|
|
+ label_FacModeStatus.Text = "电机存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -5722,10 +5724,11 @@ namespace Welling_Motor_Debug_Tool
|
|
|
//参数写入
|
|
|
if (checkBox_FacModeCfgWrite.Checked)
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "参数写入";
|
|
|
+ label_FacModeStatus.Text = "参数写入";
|
|
|
//写入产品型号和SN
|
|
|
do
|
|
|
{
|
|
|
+ //根据扫码信息获取型号和SN
|
|
|
string ScanInfo = textBox_FacModeScan.Text;
|
|
|
string regexInfo = "";
|
|
|
string[] InfoList = { "" };
|
|
@@ -5742,14 +5745,14 @@ namespace Welling_Motor_Debug_Tool
|
|
|
string Model = InfoList[0];
|
|
|
string Spec = InfoList[1];
|
|
|
string Sn = InfoList[2];
|
|
|
- //InfoList[0] = Model.Replace("-", "").Substring(2, 12) + Spec.Substring(Spec.Length - 4);
|
|
|
+ InfoList[0] = Model.Replace("-", "").Substring(2, 12) + Spec.Substring(Spec.Length - 4);
|
|
|
InfoList[1] = Sn;
|
|
|
}
|
|
|
}
|
|
|
catch
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "标签格式错误" + BootInfo + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "标签格式错误";
|
|
|
return;
|
|
@@ -5761,7 +5764,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
//...
|
|
|
|
|
|
//写入型号
|
|
|
- label_FacModeSatus.Text = "写入型号";
|
|
|
+ label_FacModeStatus.Text = "写入型号";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入型号" + "\r\n");
|
|
|
textBox_FacModeName.Text = InfoList[0];
|
|
|
string Mode = textBox_FacModeName.Text;
|
|
@@ -5791,7 +5794,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "型号写入失败" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -5801,7 +5804,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
}
|
|
|
|
|
|
//写入SN
|
|
|
- label_FacModeSatus.Text = "写入SN";
|
|
|
+ label_FacModeStatus.Text = "写入SN";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "写入SN" + "\r\n");
|
|
|
textBox_FacModeNum.Text = InfoList[1];
|
|
|
string SN = textBox_FacModeNum.Text;
|
|
@@ -5830,7 +5833,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "SN写入失败" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -5849,7 +5852,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
//写入配置文件
|
|
|
do
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "写入配置文件";
|
|
|
+ label_FacModeStatus.Text = "写入配置文件";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "读取配置文件" + "\r\n");
|
|
|
//配置文件
|
|
|
List<byte[]> CmdList = new List<byte[]>();
|
|
@@ -5895,7 +5898,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "参数写入失败" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -5909,7 +5912,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
label_FacMode_CfgWrite.BackColor = Color.Yellow;
|
|
|
- label_FacModeSatus.Text = "跳过参数写入!";
|
|
|
+ label_FacModeStatus.Text = "跳过参数写入!";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过参数写入" + "\r\n");
|
|
|
Delay_ms(500);
|
|
|
}
|
|
@@ -5919,7 +5922,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
{
|
|
|
if (label_FacModeBMS.BackColor == Color.Red)
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "BMS通讯异常!";
|
|
|
+ label_FacModeStatus.Text = "BMS通讯异常!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -5931,7 +5934,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
label_FacModeBMS.BackColor = Color.Yellow;
|
|
|
- label_FacModeSatus.Text = "跳过BMS通讯检测!";
|
|
|
+ label_FacModeStatus.Text = "跳过BMS通讯检测!";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过BMS通讯检测" + "\r\n");
|
|
|
Delay_ms(500);
|
|
|
}
|
|
@@ -5939,7 +5942,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
//基础功能检测
|
|
|
if (checkBox_FacBaseFucTest.Checked)
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "基础功能检测";
|
|
|
+ label_FacModeStatus.Text = "基础功能检测";
|
|
|
//发送指令进入配置模式
|
|
|
do
|
|
|
{
|
|
@@ -5956,7 +5959,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入配置模式异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -5982,7 +5985,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (richTextBox_DebugParam.Text == string.Empty)
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "获取调试信息异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6007,7 +6010,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
Code[2 * i + 3] = (byte)(uwDataTemp >> 8);
|
|
|
}
|
|
|
mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x463C, Code);
|
|
|
- label_FacModeSatus.Text = "启动电机";
|
|
|
+ label_FacModeStatus.Text = "启动电机";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "启动电机" + "\r\n");
|
|
|
//设置转速100%
|
|
|
var Data = new byte[1];
|
|
@@ -6025,7 +6028,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "车速传感器异常" + " " + textBox_RunInfo_BikeSpeed.Text + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6044,7 +6047,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "电压测量异常" + " " + textBox_RunInfo_Vol.Text + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6062,7 +6065,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "电流测量异常" + " " + textBox_RunInfo_Current.Text + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6082,7 +6085,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "温度传感器异常" + " " + textBox_RunInfo_T_PCB.Text + " " + textBox_RunInfo_T_MCU.Text + " " + textBox_RunInfo_T_Coil.Text + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6100,7 +6103,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "电机转速异常" + " " + textBox_RunInfo_MotorSpeed.Text + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6121,7 +6124,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (richTextBox_DebugParam.Text == string.Empty)
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "获取调试信息异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6145,7 +6148,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
Code[2 * i + 3] = (byte)(uwDataTemp >> 8);
|
|
|
}
|
|
|
mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x463C, Code);
|
|
|
- label_FacModeSatus.Text = "停止电机";
|
|
|
+ label_FacModeStatus.Text = "停止电机";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "停止电机" + "\r\n");
|
|
|
Delay_ms(2000);
|
|
|
} while (false);
|
|
@@ -6157,7 +6160,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
label_FacModeCurrentTest.BackColor = Color.Yellow;
|
|
|
label_FacModeNTC.BackColor = Color.Yellow;
|
|
|
label_FacModeMotorSpeed.BackColor = Color.Yellow;
|
|
|
- label_FacModeSatus.Text = "跳过基础功能检测!";
|
|
|
+ label_FacModeStatus.Text = "跳过基础功能检测!";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过基础功能检测" + "\r\n");
|
|
|
Delay_ms(500);
|
|
|
}
|
|
@@ -6165,7 +6168,37 @@ namespace Welling_Motor_Debug_Tool
|
|
|
//力矩检测
|
|
|
if (checkBox_FacTor.Checked)
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "力矩传感器检测!";
|
|
|
+ label_FacModeStatus.Text = "力矩传感器检测!";
|
|
|
+ //发送指令进入配置模式
|
|
|
+ do
|
|
|
+ {
|
|
|
+ if (textBox_RunInfo_Vol.Text != "---") //已进入配置模式,不重新发送
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ Code[0] = 0x01;
|
|
|
+ mySerialProcess.SendCmdWithoutNotice((ushort)0x751, (byte)0x16, (ushort)0x1901, Code);
|
|
|
+ WriteACK = false;
|
|
|
+ WriteCnt = 0;
|
|
|
+ ACK_WaitCnt = 0;
|
|
|
+ while (ACK_WaitCnt <= 2) ; //1s
|
|
|
+ if (textBox_RunInfo_Vol.Text != "---")
|
|
|
+ {
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入配置模式" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入配置模式异常" + "\r\n");
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
+ label_FacModeResult.BackColor = Color.Red;
|
|
|
+ label_FacModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ FacMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } while (false);
|
|
|
ushort Max = 0, Torque = 0;
|
|
|
//提示输入力矩信号
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "10s内模拟力矩信号输入" + "\r\n");
|
|
@@ -6186,7 +6219,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (ACK_WaitCnt >= 20)
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "力矩传感器异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6199,7 +6232,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
{
|
|
|
label_FacModeTq.BackColor = Color.Yellow;
|
|
|
label_FacModeCad.BackColor = Color.Yellow;
|
|
|
- label_FacModeSatus.Text = "跳过力矩检测!";
|
|
|
+ label_FacModeStatus.Text = "跳过力矩检测!";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过力矩检测" + "\r\n");
|
|
|
Delay_ms(500);
|
|
|
}
|
|
@@ -6207,7 +6240,37 @@ namespace Welling_Motor_Debug_Tool
|
|
|
//踏频检测
|
|
|
if (checkBox_FacCad.Checked)
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "踏频传感器检测!";
|
|
|
+ label_FacModeStatus.Text = "踏频传感器检测!";
|
|
|
+ //发送指令进入配置模式
|
|
|
+ do
|
|
|
+ {
|
|
|
+ if (textBox_RunInfo_Vol.Text != "---") //已进入配置模式,不重新发送
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ Code[0] = 0x01;
|
|
|
+ mySerialProcess.SendCmdWithoutNotice((ushort)0x751, (byte)0x16, (ushort)0x1901, Code);
|
|
|
+ WriteACK = false;
|
|
|
+ WriteCnt = 0;
|
|
|
+ ACK_WaitCnt = 0;
|
|
|
+ while (ACK_WaitCnt <= 2) ; //1s
|
|
|
+ if (textBox_RunInfo_Vol.Text != "---")
|
|
|
+ {
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入配置模式" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入配置模式异常" + "\r\n");
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
+ label_FacModeResult.BackColor = Color.Red;
|
|
|
+ label_FacModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ FacMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } while (false);
|
|
|
ushort Max = 0, Cadence = 0;
|
|
|
//提示输入踏频信号
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "10s内模拟踏频信号输入" + "\r\n");
|
|
@@ -6228,7 +6291,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (ACK_WaitCnt >= 20)
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "踏频传感器异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6241,7 +6304,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
{
|
|
|
label_FacModeTq.BackColor = Color.Yellow;
|
|
|
label_FacModeCad.BackColor = Color.Yellow;
|
|
|
- label_FacModeSatus.Text = "跳过踏频检测!";
|
|
|
+ label_FacModeStatus.Text = "跳过踏频检测!";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过踏频检测" + "\r\n");
|
|
|
Delay_ms(500);
|
|
|
}
|
|
@@ -6249,9 +6312,39 @@ namespace Welling_Motor_Debug_Tool
|
|
|
//转把检测
|
|
|
if (checkBox_FacThrrotleTest.Checked)
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "转把检测";
|
|
|
+ label_FacModeStatus.Text = "转把检测";
|
|
|
+ //发送指令进入配置模式
|
|
|
+ do
|
|
|
+ {
|
|
|
+ if (textBox_RunInfo_Vol.Text != "---") //已进入配置模式,不重新发送
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ Code[0] = 0x01;
|
|
|
+ mySerialProcess.SendCmdWithoutNotice((ushort)0x751, (byte)0x16, (ushort)0x1901, Code);
|
|
|
+ WriteACK = false;
|
|
|
+ WriteCnt = 0;
|
|
|
+ ACK_WaitCnt = 0;
|
|
|
+ while (ACK_WaitCnt <= 2) ; //1s
|
|
|
+ if (textBox_RunInfo_Vol.Text != "---")
|
|
|
+ {
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入配置模式" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入配置模式异常" + "\r\n");
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
+ label_FacModeResult.BackColor = Color.Red;
|
|
|
+ label_FacModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ FacMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } while (false);
|
|
|
//进入TURBO档
|
|
|
- richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "转把检测,进入TURBO" + "\r\n");
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "转把检测,发送指令进入TURBO" + "\r\n");
|
|
|
Code[0] = 0x04;
|
|
|
Code[1] = 0xF0;
|
|
|
mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2802, Code);
|
|
@@ -6262,7 +6355,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (textBox_RunInfo_GearSt.Text != "TURBO")
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入TURBO异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6284,7 +6377,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (ACK_WaitCnt >= 20) //转把超时
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "转把功能异常,松开转把" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6296,7 +6389,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
label_FacModeGas.BackColor = Color.Yellow;
|
|
|
- label_FacModeSatus.Text = "跳过转把检测!";
|
|
|
+ label_FacModeStatus.Text = "跳过转把检测!";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过转把检测" + "\r\n");
|
|
|
Delay_ms(500);
|
|
|
}
|
|
@@ -6304,7 +6397,37 @@ namespace Welling_Motor_Debug_Tool
|
|
|
//刹车检测
|
|
|
if (checkBox_FacBreakTest.Checked)
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "刹把检测";
|
|
|
+ label_FacModeStatus.Text = "刹把检测";
|
|
|
+ //发送指令进入配置模式
|
|
|
+ do
|
|
|
+ {
|
|
|
+ if (textBox_RunInfo_Vol.Text != "---") //已进入配置模式,不重新发送
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ Code[0] = 0x01;
|
|
|
+ mySerialProcess.SendCmdWithoutNotice((ushort)0x751, (byte)0x16, (ushort)0x1901, Code);
|
|
|
+ WriteACK = false;
|
|
|
+ WriteCnt = 0;
|
|
|
+ ACK_WaitCnt = 0;
|
|
|
+ while (ACK_WaitCnt <= 2) ; //1s
|
|
|
+ if (textBox_RunInfo_Vol.Text != "---")
|
|
|
+ {
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入配置模式" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入配置模式异常" + "\r\n");
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
+ label_FacModeResult.BackColor = Color.Red;
|
|
|
+ label_FacModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ FacMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } while (false);
|
|
|
//启动电机进入WALK模式
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "剎把检测,进入WALK" + "\r\n");
|
|
|
Code[0] = 0x22;
|
|
@@ -6317,7 +6440,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (textBox_RunInfo_GearSt.Text != "WALK")
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入WALK异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6339,7 +6462,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (ACK_WaitCnt >= 20) //剎把超时
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "剎把功能异常,松开剎把" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6358,7 +6481,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (textBox_RunInfo_GearSt.Text != "OFF")
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "退出WALK异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6372,7 +6495,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
label_FacModeBreak.BackColor = Color.Yellow;
|
|
|
- label_FacModeSatus.Text = "跳过刹车检测!";
|
|
|
+ label_FacModeStatus.Text = "跳过刹车检测!";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过刹车检测" + "\r\n");
|
|
|
Delay_ms(500);
|
|
|
}
|
|
@@ -6381,7 +6504,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (checkBox_FacLightTest.Checked)
|
|
|
{
|
|
|
//前后灯检测
|
|
|
- label_FacModeSatus.Text = "前后灯检测";
|
|
|
+ label_FacModeStatus.Text = "前后灯检测";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送开灯指令" + "\r\n");
|
|
|
//发送指令打开车灯
|
|
|
Code[0] = 0x00;
|
|
@@ -6394,7 +6517,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (textBox_RunInfo_LightSwitch.Text != "ON")
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "开灯指令发送异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6415,7 +6538,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
else
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "前后灯异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6435,7 +6558,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (textBox_RunInfo_LightSwitch.Text != "OFF")
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "关灯指令发送异常" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6450,7 +6573,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
{
|
|
|
label_FacModeLightF.BackColor = Color.Yellow;
|
|
|
label_FacModeLightB.BackColor = Color.Yellow;
|
|
|
- label_FacModeSatus.Text = "跳过前后灯检测!";
|
|
|
+ label_FacModeStatus.Text = "跳过前后灯检测!";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过前后灯检测" + "\r\n");
|
|
|
Delay_ms(500);
|
|
|
}
|
|
@@ -6458,7 +6581,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
//软件版本检测
|
|
|
do
|
|
|
{
|
|
|
- label_FacModeSatus.Text = "软件版本确认";
|
|
|
+ label_FacModeStatus.Text = "软件版本确认";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令读取版本信息" + "\r\n");
|
|
|
//发送指令读取版本
|
|
|
Class_Motor_Ver.Mode = "---";
|
|
@@ -6472,7 +6595,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (Class_Motor_Ver.Mode == "---")
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "读取版本信息失败" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6496,7 +6619,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
catch (System.Exception)
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "软件版本信息不完整" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6507,7 +6630,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
if (string.Equals(VerCheck, VerRead) == false) //版本错误,直接结束
|
|
|
{
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "软件版本错误" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "存在故障!";
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
label_FacModeResult.BackColor = Color.Red;
|
|
|
label_FacModeResult.Text = "测试异常";
|
|
|
Delay_ms(500);
|
|
@@ -6522,7 +6645,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
|
|
|
//测试合格
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试结束" + "\r\n");
|
|
|
- label_FacModeSatus.Text = "测试结束!";
|
|
|
+ label_FacModeStatus.Text = "测试结束!";
|
|
|
label_FacModeResult.BackColor = Color.Green;
|
|
|
label_FacModeResult.Text = "测试合格";
|
|
|
Delay_ms(500);
|
|
@@ -6537,7 +6660,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
label_FacModeResult.BackColor = Color.Yellow;
|
|
|
label_FacModeResult.Text = "测试中";
|
|
|
//测试过程标签
|
|
|
- label_FacModeSatus.Text = "测试就绪";
|
|
|
+ label_FacModeStatus.Text = "测试就绪";
|
|
|
//测试结果标签
|
|
|
foreach (Control c in groupBox28.Controls)
|
|
|
{
|
|
@@ -6566,5 +6689,460 @@ namespace Welling_Motor_Debug_Tool
|
|
|
richTextBox_FacModeLog.SelectionStart = richTextBox_FacModeLog.Text.Length;
|
|
|
richTextBox_FacModeLog.ScrollToCaret();
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 参数检验测试停止
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="OK_Flag"></param>
|
|
|
+ private void CheckMode_Stop(bool OK_Flag)
|
|
|
+ {
|
|
|
+ //打开开始按钮
|
|
|
+ button_CheckModeStart.Enabled = true;
|
|
|
+
|
|
|
+ //系统关机
|
|
|
+ var Code = new byte[32];//发送的指令数据
|
|
|
+ Code[0] = 0xF0;
|
|
|
+ mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
|
|
|
+
|
|
|
+ //路径设置
|
|
|
+ string LocalSavePath = "";
|
|
|
+ string ServerSavePath = "";
|
|
|
+ if (OK_Flag)
|
|
|
+ {
|
|
|
+ LocalSavePath = localInfo.LocalDataPath + localInfo.CheckPathName + "OK\\";
|
|
|
+ ServerSavePath = toolStripTextBox_ServerPath + "/qcTest/OK/";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ LocalSavePath = localInfo.LocalDataPath + localInfo.CheckPathName + "FAIL\\";
|
|
|
+ ServerSavePath = toolStripTextBox_ServerPath + "/qcTest/FAIL/";
|
|
|
+ }
|
|
|
+ if (Directory.Exists(LocalSavePath) == false)
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(LocalSavePath);
|
|
|
+ }
|
|
|
+
|
|
|
+ //保存和上传
|
|
|
+ string LogSavePath = "";
|
|
|
+ string LogSaveFileName = "";
|
|
|
+ string ProductInfo = textBox_CheckModeScan.Text;
|
|
|
+ LogSavePath = LocalSavePath + DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "-") + "\\" + ProductInfo;
|
|
|
+ if (Directory.Exists(LogSavePath) == false)
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(LogSavePath);
|
|
|
+ }
|
|
|
+ //测试页面
|
|
|
+ Bitmap bit = new Bitmap(this.Width, this.Height);//实例化一个和窗体一样大的bitmap
|
|
|
+ Graphics g = Graphics.FromImage(bit);
|
|
|
+ g.CopyFromScreen(this.Left, this.Top, 0, 0, new Size(this.Width, this.Height));//保存整个窗体为图片
|
|
|
+ LogSaveFileName = LogSavePath + "\\" + ProductInfo + "_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + "_测试页面" + ".png";
|
|
|
+ bit.Save(LogSaveFileName);
|
|
|
+ //上传测试页面到服务器
|
|
|
+ if (myFtp.IsNetConnected == true)
|
|
|
+ {
|
|
|
+ string DateNow = DateTime.Now.ToString("yyyy-MM-dd");
|
|
|
+ if (myFtp.DirectoryExist(ServerSavePath, DateNow) == false)
|
|
|
+ {
|
|
|
+ myFtp.MakeDir(ServerSavePath + DateNow);
|
|
|
+ }
|
|
|
+ if (myFtp.DirectoryExist(ServerSavePath + DateNow, ProductInfo) == false)
|
|
|
+ {
|
|
|
+ myFtp.MakeDir(ServerSavePath + DateNow + "/" + ProductInfo);
|
|
|
+ }
|
|
|
+ bool result = myFtp.UploadFile(LogSaveFileName, ServerSavePath + DateNow + "/" + ProductInfo);
|
|
|
+ if (result == true)
|
|
|
+ richTextBox_CheckModeLog.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试页面上传服务器成功" + "\r\n";
|
|
|
+ }
|
|
|
+ //测试记录
|
|
|
+ LogSaveFileName = LogSavePath + "\\" + ProductInfo + "_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + "_测试记录" + ".log";
|
|
|
+ string file_str = "";
|
|
|
+ file_str += "测试时间:\r\n" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\r\n\r\n";
|
|
|
+ file_str += "检验记录:\r\n" + richTextBox_CheckModeLog.Text.Replace("\n", "\r\n") + "\r\n\r\n";
|
|
|
+ file_str += "检验结果:\r\n" + label_CheckModeResult.Text + "\r\n\r\n";
|
|
|
+ System.IO.File.WriteAllText(LogSaveFileName, file_str);
|
|
|
+ //上传测试记录到服务器
|
|
|
+ if (myFtp.IsNetConnected == true)
|
|
|
+ {
|
|
|
+ string DateNow = DateTime.Now.ToString("yyyy-MM-dd");
|
|
|
+ if (myFtp.DirectoryExist(ServerSavePath, DateNow) == false)
|
|
|
+ {
|
|
|
+ myFtp.MakeDir(ServerSavePath + DateNow);
|
|
|
+ }
|
|
|
+ if (myFtp.DirectoryExist(ServerSavePath + DateNow, ProductInfo) == false)
|
|
|
+ {
|
|
|
+ myFtp.MakeDir(ServerSavePath + DateNow + "/" + ProductInfo);
|
|
|
+ }
|
|
|
+ bool result = myFtp.UploadFile(LogSaveFileName, ServerSavePath + DateNow + "/" + ProductInfo);
|
|
|
+ if (result == true)
|
|
|
+ richTextBox_CheckModeLog.Text += DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试记录上传服务器成功" + "\r\n";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 参数检验开始
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="sender"></param>
|
|
|
+ /// <param name="e"></param>
|
|
|
+ private void button_CheckModeStart_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ CheckTestStart();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 参数检验测试子函数
|
|
|
+ /// </summary>
|
|
|
+ private void CheckTestStart()
|
|
|
+ {
|
|
|
+ //初始化标签
|
|
|
+ CheckModeLabelInit();
|
|
|
+ richTextBox_CheckModeLog.Clear();
|
|
|
+
|
|
|
+ //按钮禁止操作
|
|
|
+ button_CheckModeStart.Enabled = false;
|
|
|
+
|
|
|
+ //记录配置文件
|
|
|
+ richTextBox_CheckModeLog.AppendText("配置文件:" + comboBox_CheckModeCfgDate.Text + " / " + comboBox_CheckModeCfgFile.Text + "\r\n");
|
|
|
+
|
|
|
+ //检查打标信息
|
|
|
+ label_CheckModeStatus.Text = "检查扫码信息";
|
|
|
+ Delay_ms(500);
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "检查扫码信息" + "\r\n");
|
|
|
+ if (textBox_CheckModeScan.Text == string.Empty)
|
|
|
+ {
|
|
|
+ MessageBox.Show("请扫码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (!textBox_CheckModeScan.Text.Contains(" "))
|
|
|
+ {
|
|
|
+ label_CheckModeStatus.Text = "存在故障!";
|
|
|
+ label_CheckModeResult.BackColor = Color.Red;
|
|
|
+ label_CheckModeResult.Text = "标签格式错误";
|
|
|
+ button_CheckModeStart.Enabled = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (System.Exception)
|
|
|
+ {
|
|
|
+ label_CheckModeStatus.Text = "存在故障!";
|
|
|
+ label_CheckModeResult.BackColor = Color.Red;
|
|
|
+ label_CheckModeResult.Text = "标签格式错误";
|
|
|
+ button_CheckModeStart.Enabled = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //流水号计数
|
|
|
+ //...
|
|
|
+
|
|
|
+ //创建线程,执行测试任务
|
|
|
+ Thread th = new Thread(CheckModeTest_Task);
|
|
|
+ th.Start();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 执行一次测试任务
|
|
|
+ /// </summary>
|
|
|
+ private void CheckModeTest_Task()
|
|
|
+ {
|
|
|
+ //开始测试
|
|
|
+ richTextBox_CheckModeLog.AppendText("产品标签:" + textBox_CheckModeScan.Text + "\r\n");
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "开始测试" + "\r\n");
|
|
|
+
|
|
|
+ //变量定义
|
|
|
+ var Code = new byte[255];//发送的指令数据
|
|
|
+ ushort DataTemp;
|
|
|
+ short DataTemp_Int16;
|
|
|
+ string ResultPathName = "";
|
|
|
+
|
|
|
+ label_CheckModeStatus.Text = "开始测试";
|
|
|
+ Delay_ms(500);
|
|
|
+ label_CheckModeStatus.Text = "系统开机";
|
|
|
+
|
|
|
+ //系统开机,确保测试前先关机,发送关机指令再发送开机指令
|
|
|
+ BootInfo = "";
|
|
|
+ Code[0] = 0xF0;
|
|
|
+ mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
|
|
|
+ Delay_ms(1500);
|
|
|
+ Code[0] = 0xF1;
|
|
|
+ mySerialProcess.SendCmd(0x7FF, 0x16, 0x2201, Code);
|
|
|
+ ACK_WaitCnt = 0;
|
|
|
+ while (ACK_WaitCnt <= 2) ; //1s
|
|
|
+
|
|
|
+ //检查BOOT版本
|
|
|
+ if (BootInfo != string.Empty)
|
|
|
+ {
|
|
|
+ label_CheckModeBoot.BackColor = Color.Green;
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "开机成功,Boot版本:" + BootInfo + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "开机失败" + BootInfo + "\r\n");
|
|
|
+ label_CheckModeStatus.Text = "存在故障!";
|
|
|
+ label_CheckModeResult.BackColor = Color.Red;
|
|
|
+ label_CheckModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ CheckMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //发送指令读取版本信息
|
|
|
+ do
|
|
|
+ {
|
|
|
+ label_CheckModeStatus.Text = "读取版本信息";
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令读取版本信息" + "\r\n");
|
|
|
+ //发送指令读取版本
|
|
|
+ Class_Motor_Ver.Mode = "---";
|
|
|
+ Class_Motor_Ver.SN = "---";
|
|
|
+ Class_Motor_Ver.HW = "---";
|
|
|
+ Class_Motor_Ver.FW = "---";
|
|
|
+ Class_Motor_Ver.Special = "---";
|
|
|
+ mySerialProcess.SendCmd((ushort)0x731, (byte)0x11, (ushort)0x3900, null);
|
|
|
+ ACK_WaitCnt = 0;
|
|
|
+ while (ACK_WaitCnt <= 2) ; //1s
|
|
|
+ if (Class_Motor_Ver.Mode == "---")
|
|
|
+ {
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "版本信息读取失败" + "\r\n");
|
|
|
+ label_CheckModeStatus.Text = "存在故障!";
|
|
|
+ label_CheckModeResult.BackColor = Color.Red;
|
|
|
+ label_CheckModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ CheckMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "版本信息读取成功" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ } while (false);
|
|
|
+
|
|
|
+ //软件版本检查
|
|
|
+ if (checkBox_CheckModeFWVer.Checked)
|
|
|
+ {
|
|
|
+ richTextBox_CheckModeLog.AppendText("型号: " + Class_Motor_Ver.Mode + "\r\n");
|
|
|
+ richTextBox_CheckModeLog.AppendText("序列号: " + Class_Motor_Ver.SN + "\r\n");
|
|
|
+ richTextBox_CheckModeLog.AppendText("硬件版本: " + Class_Motor_Ver.HW + "\r\n");
|
|
|
+ richTextBox_CheckModeLog.AppendText("软件版本: " + Class_Motor_Ver.FW + "\r\n");
|
|
|
+ richTextBox_CheckModeLog.AppendText("软件标识: " + Class_Motor_Ver.Special + "\r\n");
|
|
|
+ //判断版本是否正确
|
|
|
+ string VerCheck = comboBox_CheckModeCfgFile.Text.Split('_')[3] + "_" + comboBox_CheckModeCfgFile.Text.Split('_')[4];
|
|
|
+ string VerRead = "";
|
|
|
+ try
|
|
|
+ {
|
|
|
+ VerRead = Class_Motor_Ver.FW.Split('_')[0] + Class_Motor_Ver.Special.Split('-')[2].Substring(0, 4).Replace('V', '.') + "_" + Class_Motor_Ver.FW.Split('_')[1];
|
|
|
+ }
|
|
|
+ catch (System.Exception)
|
|
|
+ {
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "软件版本信息不完整" + "\r\n");
|
|
|
+ label_CheckModeStatus.Text = "存在故障!";
|
|
|
+ label_CheckModeResult.BackColor = Color.Red;
|
|
|
+ label_CheckModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ CheckMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (string.Equals(VerCheck, VerRead) == false) //版本错误,直接结束
|
|
|
+ {
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "软件版本错误" + "\r\n");
|
|
|
+ label_CheckModeStatus.Text = "存在故障!";
|
|
|
+ label_CheckModeResult.BackColor = Color.Red;
|
|
|
+ label_CheckModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ CheckMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ label_CheckModeFWVer.BackColor = Color.Green;
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "软件版本正确" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ label_CheckModeFWVer.BackColor = Color.Yellow;
|
|
|
+ label_CheckModeStatus.Text = "跳过软件版本查询";
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过软件版本查询" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+
|
|
|
+ //打标信息核对
|
|
|
+ if (checkBox_CheckModeSN.Checked)
|
|
|
+ {
|
|
|
+ label_CheckModeStatus.Text = "核对打标信息";
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "核对打标信息" + "\r\n");
|
|
|
+ //根据扫码信息获取型号和SN
|
|
|
+ string ScanInfo = textBox_CheckModeScan.Text;
|
|
|
+ string regexInfo = "";
|
|
|
+ string[] InfoList = { "" };
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if (中置电机ToolStripMenuItem.Checked == true)
|
|
|
+ {
|
|
|
+ regexInfo = @"[0-9][0-9][V][0-9][0-9][0-9][W]";
|
|
|
+ InfoList = Regex.Split(ScanInfo, regexInfo, RegexOptions.IgnoreCase);
|
|
|
+ }
|
|
|
+ else if (轮毂电机ToolStripMenuItem.Checked == true)
|
|
|
+ {
|
|
|
+ InfoList = ScanInfo.Split(new string[] { " " }, StringSplitOptions.None);
|
|
|
+ string Model = InfoList[0];
|
|
|
+ string Spec = InfoList[1];
|
|
|
+ string Sn = InfoList[2];
|
|
|
+ InfoList[0] = Model.Replace("-", "").Substring(2, 12) + Spec.Substring(Spec.Length - 4);
|
|
|
+ InfoList[1] = Sn;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch
|
|
|
+ {
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "标签格式错误" + "\r\n");
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
+ label_FacModeResult.BackColor = Color.Red;
|
|
|
+ label_FacModeResult.Text = "标签格式错误";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ CheckMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //核对型号
|
|
|
+ if (string.Equals(InfoList[0], Class_Motor_Ver.Mode) == false) //型号错误,直接结束
|
|
|
+ {
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "型号不一致" + "\r\n");
|
|
|
+ label_CheckModeStatus.Text = "存在故障!";
|
|
|
+ label_CheckModeResult.BackColor = Color.Red;
|
|
|
+ label_CheckModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ CheckMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "型号一致" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ //核对SN
|
|
|
+ if (string.Equals(InfoList[1], Class_Motor_Ver.SN) == false) //型号错误,直接结束
|
|
|
+ {
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "SN不一致" + "\r\n");
|
|
|
+ label_CheckModeStatus.Text = "存在故障!";
|
|
|
+ label_CheckModeResult.BackColor = Color.Red;
|
|
|
+ label_CheckModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ CheckMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "SN一致" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ label_CheckModeFWVer.BackColor = Color.Yellow;
|
|
|
+ label_CheckModeStatus.Text = "跳过打标信息确认";
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过打标信息确认" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+
|
|
|
+ //参数检验
|
|
|
+ if (checkBox_CheckModeCfg.Checked)
|
|
|
+ {
|
|
|
+ //读取配置文件信息
|
|
|
+ label_CheckModeStatus.Text = "参数检查";
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "读取配置文件" + "\r\n");
|
|
|
+ //配置文件
|
|
|
+ List<byte[]> CmdList = new List<byte[]>();
|
|
|
+ //从服务器下载文件
|
|
|
+ string SelectFile = "";
|
|
|
+ SelectFile = comboBox_CheckModeCfgDate.SelectedItem.ToString() + "/" + comboBox_CheckModeCfgFile.SelectedItem.ToString();
|
|
|
+ if (File.Exists(localInfo.LocalPath + comboBox_CheckModeCfgFile.SelectedItem.ToString()))//本地存在选定文件,先删除本地
|
|
|
+ {
|
|
|
+ File.Delete(localInfo.LocalPath + comboBox_CheckModeCfgFile.SelectedItem.ToString());
|
|
|
+ }
|
|
|
+ myFtp.DownloadFile(toolStripTextBox_ServerPath.Text + "/" + localInfo.CfgPathName + SelectFile, localInfo.LocalPath);
|
|
|
+ //打开文件
|
|
|
+ Dictionary<string, string> ConfigCmd = new Dictionary<string, string>();//配置文件格式
|
|
|
+ StreamReader streamReader = new StreamReader(localInfo.LocalPath + comboBox_CheckModeCfgFile.SelectedItem.ToString());
|
|
|
+ ConfigCmd.Clear();
|
|
|
+ while (streamReader.Peek() != -1)
|
|
|
+ {
|
|
|
+ string fileLineInfo = streamReader.ReadLine();
|
|
|
+ if (fileLineInfo.Contains("["))
|
|
|
+ {
|
|
|
+ if (fileLineInfo.Contains("助力参数"))
|
|
|
+ {
|
|
|
+ fileLineInfo = streamReader.ReadLine();
|
|
|
+ }
|
|
|
+ ConfigCmd.Add(fileLineInfo, streamReader.ReadLine());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ streamReader.Close();
|
|
|
+ int CmdNum = ConfigCmd.Count(); //指令个数
|
|
|
+ Delay_ms(500);
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "读取完成," + "共" + CmdNum.ToString() + "条指令," + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ //逐条读取比较
|
|
|
+ for (int i = 0; i < CmdNum; i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ label_CheckModeFWVer.BackColor = Color.Yellow;
|
|
|
+ label_CheckModeStatus.Text = "跳过参数检验";
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过参数检验" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+
|
|
|
+ //传感器标定检验
|
|
|
+ if (checkBox_CheckModeTorque.Checked)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ label_CheckModeFWVer.BackColor = Color.Yellow;
|
|
|
+ label_CheckModeStatus.Text = "跳过传感器标定检验";
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "跳过传感器标定检验" + "\r\n");
|
|
|
+ Delay_ms(500);
|
|
|
+ }
|
|
|
+
|
|
|
+ //测试合格
|
|
|
+ richTextBox_CheckModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "测试结束" + "\r\n");
|
|
|
+ label_CheckModeStatus.Text = "测试结束!";
|
|
|
+ label_CheckModeResult.BackColor = Color.Green;
|
|
|
+ label_CheckModeResult.Text = "测试合格";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储并上传
|
|
|
+ CheckMode_Stop(true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void CheckModeLabelInit()
|
|
|
+ {
|
|
|
+ //测试状态标签
|
|
|
+ label_CheckModeResult.BackColor = Color.Yellow;
|
|
|
+ label_CheckModeResult.Text = "测试中";
|
|
|
+ //测试过程标签
|
|
|
+ label_CheckModeStatus.Text = "测试就绪";
|
|
|
+ //测试结果标签
|
|
|
+ foreach (Control c in groupBox31.Controls)
|
|
|
+ {
|
|
|
+ if (c is Label)
|
|
|
+ {
|
|
|
+ if (c.Text == string.Empty)
|
|
|
+ c.BackColor = Color.Red;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|