|
@@ -25,6 +25,8 @@ namespace Welling_Motor_Debug_Tool
|
|
|
string IP, Port, User, PassWD, ModelPath, CfgPath;
|
|
|
//FTP
|
|
|
ftp myFtp = new ftp();
|
|
|
+ //高级参数修改标志
|
|
|
+ bool WriteLockStatus = true;
|
|
|
|
|
|
public GenerateParams()
|
|
|
{
|
|
@@ -107,6 +109,10 @@ namespace Welling_Motor_Debug_Tool
|
|
|
}
|
|
|
richTextBox_Note.Text = richTextBox_Note.Text.Remove(richTextBox_Note.Text.Length - 1);
|
|
|
}
|
|
|
+ //高级参数只读
|
|
|
+ richTextBox_AdvanceParams.ReadOnly = true;
|
|
|
+ pictureBox1.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Lock;
|
|
|
+ WriteLockStatus = true;
|
|
|
}
|
|
|
|
|
|
private void radioButton_MIGIC_Click(object sender, EventArgs e)
|
|
@@ -366,6 +372,313 @@ namespace Welling_Motor_Debug_Tool
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 导入样机生产记录文件,可用于生成模板
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="sender"></param>
|
|
|
+ /// <param name="e"></param>
|
|
|
+ private void button_LoadFile_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ comboBox_ModelFile.SelectedIndex = -1;
|
|
|
+ button_ExportParams.Enabled = true;
|
|
|
+ //高级参数只读
|
|
|
+ richTextBox_AdvanceParams.ReadOnly = true;
|
|
|
+ pictureBox1.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Lock;
|
|
|
+ WriteLockStatus = true;
|
|
|
+ //打开对话框选择文件
|
|
|
+ OpenFileDialog ofd = new OpenFileDialog();
|
|
|
+ ofd.Title = "请选择样机测试记录文件";
|
|
|
+ ofd.InitialDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
|
|
|
+ ofd.Filter = "文本文件(*.txt)|*.txt";
|
|
|
+ ofd.Multiselect = false;
|
|
|
+ if (ofd.ShowDialog() == DialogResult.OK)
|
|
|
+ {
|
|
|
+ //打开文件
|
|
|
+ StreamReader objReader = new StreamReader(ofd.FileName);
|
|
|
+ string sLine = "";
|
|
|
+ ArrayList array_CfgInfo = new ArrayList();
|
|
|
+ array_CfgInfo.Clear();
|
|
|
+ while (sLine != null)
|
|
|
+ {
|
|
|
+ sLine = objReader.ReadLine();
|
|
|
+ array_CfgInfo.Add(sLine);
|
|
|
+ }
|
|
|
+ objReader.Close();
|
|
|
+ //转换为模板显示
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string fileInfo = "";
|
|
|
+ fileInfo += "#说明\r\n";
|
|
|
+ fileInfo += "#0表示命令无效,1开启该命令的参数写入\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ fileInfo += "[型号],1\r\n";
|
|
|
+ fileInfo += "电机型号," + array_CfgInfo[5].ToString().Split(new string[] { ": " }, StringSplitOptions.None)[1] + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ fileInfo += "[SN号],0\r\n";
|
|
|
+ fileInfo += "电机SN," + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ fileInfo += "[校验码],0\r\n";
|
|
|
+ fileInfo += "校验码," + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ if (array_CfgInfo[71].ToString().Length <= 6)
|
|
|
+ {
|
|
|
+ fileInfo += "[自定义1],0\r\n";
|
|
|
+ fileInfo += "自定义字符串1," + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ fileInfo += "[自定义1],1\r\n";
|
|
|
+ fileInfo += "自定义字符串1," + array_CfgInfo[71].ToString().Split(new string[] { ": " }, StringSplitOptions.None)[1] + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (array_CfgInfo[72].ToString().Length <= 6)
|
|
|
+ {
|
|
|
+ fileInfo += "[自定义2],0\r\n";
|
|
|
+ fileInfo += "自定义字符串2," + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ fileInfo += "[自定义2],1\r\n";
|
|
|
+ fileInfo += "自定义字符串2," + array_CfgInfo[72].ToString().Split(new string[] { ": " }, StringSplitOptions.None)[1] + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (array_CfgInfo[73].ToString().Length <= 6)
|
|
|
+ {
|
|
|
+ fileInfo += "[自定义3],0\r\n";
|
|
|
+ fileInfo += "自定义字符串3," + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ fileInfo += "[自定义3],1\r\n";
|
|
|
+ fileInfo += "自定义字符串3," + array_CfgInfo[73].ToString().Split(new string[] { ": " }, StringSplitOptions.None)[1] + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+ }
|
|
|
+
|
|
|
+ fileInfo += "[生产信息],1\r\n";
|
|
|
+ fileInfo += "生产商," + "\r\n";
|
|
|
+ fileInfo += "生产地," + "\r\n";
|
|
|
+ fileInfo += "生产日期," + "\r\n";
|
|
|
+ fileInfo += "产品标识," + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ fileInfo += "[马达信息],1\r\n";
|
|
|
+ fileInfo += "存储标志,1\r\n";
|
|
|
+ fileInfo += array_CfgInfo[13].ToString().Replace('=',',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ fileInfo += "[整车参数],1\r\n";
|
|
|
+ fileInfo += "存储标志,1\r\n";
|
|
|
+ fileInfo += array_CfgInfo[16].ToString().Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ fileInfo += "[控制参数],1\r\n";
|
|
|
+ fileInfo += "存储标志,1\r\n";
|
|
|
+ fileInfo += array_CfgInfo[19].ToString().Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ fileInfo += "[力矩传感器参数],1\r\n";
|
|
|
+ fileInfo += "存储标志,1\r\n";
|
|
|
+ fileInfo += array_CfgInfo[22].ToString().Split(new string[] { ", 力矩传感器踏频脉冲数" }, StringSplitOptions.None)[0].Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ fileInfo += "[其它传感器参数],1\r\n";
|
|
|
+ fileInfo += "存储标志,1\r\n";
|
|
|
+ fileInfo += ("力矩传感器踏频脉冲数" + array_CfgInfo[22].ToString().Split(new string[] { ", 力矩传感器踏频脉冲数" }, StringSplitOptions.None)[1]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ fileInfo += "[助力参数],1\r\n";
|
|
|
+ fileInfo += "存储标志,1\r\n";
|
|
|
+ fileInfo += "空,0\r\n";
|
|
|
+ fileInfo += array_CfgInfo[25].ToString().Split(new string[] { ", 助力转矩曲线编号" }, StringSplitOptions.None)[0].Replace('=', ',').Replace(" ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[25].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[27].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[29].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[31].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[33].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[35].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[37].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[39].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[41].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[43].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[45].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[47].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[49].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[51].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("转矩曲线.a" + array_CfgInfo[53].ToString().Split(new string[] { "转矩曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 踏频曲线.a" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("踏频曲线.a" + array_CfgInfo[25].ToString().Split(new string[] { "踏频曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 助力启动阈值" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("踏频曲线.a" + array_CfgInfo[27].ToString().Split(new string[] { "踏频曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 助力启动阈值" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("踏频曲线.a" + array_CfgInfo[29].ToString().Split(new string[] { "踏频曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 助力启动阈值" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("踏频曲线.a" + array_CfgInfo[31].ToString().Split(new string[] { "踏频曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 助力启动阈值" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("踏频曲线.a" + array_CfgInfo[33].ToString().Split(new string[] { "踏频曲线.a" }, StringSplitOptions.None)[1].Split(new string[] { ", 助力启动阈值" }, StringSplitOptions.None)[0]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += ("助力启动阈值" + array_CfgInfo[25].ToString().Split(new string[] { "助力启动阈值" }, StringSplitOptions.None)[1]).Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+ fileInfo += "\r\n";
|
|
|
+
|
|
|
+ fileInfo += "[调试参数],1\r\n";
|
|
|
+ fileInfo += "存储标志,1\r\n";
|
|
|
+ fileInfo += array_CfgInfo[56].ToString().Replace('=', ',').Replace(", ", "\r\n") + "\r\n";
|
|
|
+
|
|
|
+
|
|
|
+ //加载高级界面
|
|
|
+ richTextBox_AdvanceParams.Clear();
|
|
|
+ richTextBox_AdvanceParams.AppendText(fileInfo);
|
|
|
+
|
|
|
+ //加载简易界面
|
|
|
+ do //基础参数界面
|
|
|
+ {
|
|
|
+ //内容转换行
|
|
|
+ ArrayList arrText = new ArrayList(fileInfo.Split(new string[] { "\r\n" }, StringSplitOptions.None));//创建一个动态数组
|
|
|
+ //建立字典,存放并获取每个命令的行号
|
|
|
+ Dictionary<string, int> DicRowNum = new Dictionary<string, int>();
|
|
|
+ DicRowNum.Add("[整车参数]", 0);
|
|
|
+ DicRowNum.Add("[控制参数]", 0);
|
|
|
+ DicRowNum.Add("[助力参数]", 0);
|
|
|
+ DicRowNum.Add("[调试参数]", 0);
|
|
|
+ DicRowNum.Add("[生产信息]", 0);
|
|
|
+ Dictionary<string, int> __dict = new Dictionary<string, int>(DicRowNum);
|
|
|
+ foreach (KeyValuePair<string, int> item in __dict)
|
|
|
+ {
|
|
|
+ foreach (string cmd in arrText)
|
|
|
+ {
|
|
|
+ if (cmd.Contains(item.Key))
|
|
|
+ {
|
|
|
+ DicRowNum[item.Key] = arrText.IndexOf(cmd);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //遍历加载
|
|
|
+ foreach (string index in DicRowNum.Keys)
|
|
|
+ {
|
|
|
+ int rowNum = DicRowNum[index]; //行号
|
|
|
+ switch (index)
|
|
|
+ {
|
|
|
+ case "[整车参数]":
|
|
|
+ {
|
|
|
+ //轮胎周长
|
|
|
+ textBox_BikeWheel.Text = arrText[rowNum + 2].ToString().Split(',')[1];
|
|
|
+ //转把限速
|
|
|
+ textBox_BikeThroSpeed.Text = arrText[rowNum + 4].ToString().Split(',')[1];
|
|
|
+ //推行限速
|
|
|
+ textBox_BikeWalkSpeed.Text = arrText[rowNum + 5].ToString().Split(',')[1];
|
|
|
+ //前牙盘
|
|
|
+ textBox_BikeFrontT.Text = arrText[rowNum + 6].ToString().Split(',')[1];
|
|
|
+ //后牙盘
|
|
|
+ textBox_BikeRealB.Text = arrText[rowNum + 7].ToString().Split(',')[1];
|
|
|
+ //前灯电压
|
|
|
+ ushort LightParams = Convert.ToUInt16(arrText[rowNum + 10].ToString().Split(',')[1]);
|
|
|
+ if ((LightParams & 0x00FF) == 6)
|
|
|
+ comboBox_BikeVolF.SelectedIndex = 0;
|
|
|
+ else if ((LightParams & 0x00FF) == 12)
|
|
|
+ comboBox_BikeVolF.SelectedIndex = 1;
|
|
|
+ else
|
|
|
+ comboBox_BikeVolF.SelectedIndex = -1;
|
|
|
+ //后灯电压
|
|
|
+ if (((LightParams >> 8) & 0x0F) == 6)
|
|
|
+ comboBox_BikeVolB.SelectedIndex = 0;
|
|
|
+ else if (((LightParams >> 8) & 0x0F) == 12)
|
|
|
+ comboBox_BikeVolB.SelectedIndex = 1;
|
|
|
+ else
|
|
|
+ comboBox_BikeVolB.SelectedIndex = -1;
|
|
|
+ //后灯模式c
|
|
|
+ comboBox_BikeModeB.SelectedIndex = (LightParams >> 12) - 1;
|
|
|
+ //启动模式
|
|
|
+ comboBox_BikeStartMode.SelectedIndex = Convert.ToUInt16(arrText[rowNum + 12].ToString().Split(',')[1]) - 1;
|
|
|
+ //开机延迟
|
|
|
+ ushort PowerOnOffParams = Convert.ToUInt16(arrText[rowNum + 13].ToString().Split(',')[1]);
|
|
|
+ textBox_BikePowerOnTime.Text = (PowerOnOffParams >> 12).ToString();
|
|
|
+ //关机延迟
|
|
|
+ textBox_BikePowerOffTime.Text = ((PowerOnOffParams >> 8) & 0x0F).ToString();
|
|
|
+ //自动关机
|
|
|
+ textBox_BikeAutoOffTime.Text = (PowerOnOffParams & 0x00FF).ToString();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "[控制参数]":
|
|
|
+ {
|
|
|
+ //峰值电流
|
|
|
+ textBox_MotorMaxCurr.Text = arrText[rowNum + 4].ToString().Split(',')[1];
|
|
|
+ //过压保护
|
|
|
+ textBox_MotorOV.Text = arrText[rowNum + 6].ToString().Split(',')[1];
|
|
|
+ //欠压保护
|
|
|
+ textBox_MotorUV.Text = arrText[rowNum + 7].ToString().Split(',')[1];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "[助力参数]":
|
|
|
+ {
|
|
|
+ //限速起始
|
|
|
+ textBox_AssistSpeedBegin.Text = arrText[rowNum + 92].ToString().Split(',')[1];
|
|
|
+ //限速结束
|
|
|
+ textBox_AssistSpeedEnd.Text = arrText[rowNum + 93].ToString().Split(',')[1];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "[调试参数]":
|
|
|
+ {
|
|
|
+ //运行模式
|
|
|
+ if ((Convert.ToUInt16(arrText[rowNum + 2].ToString().Split(',')[1]) >= 4) && (Convert.ToUInt16(arrText[rowNum + 2].ToString().Split(',')[1]) <= 6))
|
|
|
+ {
|
|
|
+ comboBox_SysRunMode.SelectedIndex = Convert.ToUInt16(arrText[rowNum + 2].ToString().Split(',')[1]) - 4;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ comboBox_SysRunMode.SelectedIndex = -1;
|
|
|
+ //旋转方向
|
|
|
+ comboBox_SysDir.SelectedIndex = Convert.ToUInt16(arrText[rowNum + 5].ToString().Split(',')[1]);
|
|
|
+ //功率限幅
|
|
|
+ textBox_SysPowerLimit.Text = arrText[rowNum + 23].ToString().Split(',')[1];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "[生产信息]":
|
|
|
+ {
|
|
|
+ //生产商
|
|
|
+ textBox_ProductMac.Text = arrText[rowNum + 1].ToString().Split(',')[1];
|
|
|
+ //生产地
|
|
|
+ textBox_ProductAddr.Text = arrText[rowNum + 2].ToString().Split(',')[1];
|
|
|
+ //生产日期
|
|
|
+ textBox_ProductDate.Text = DateTime.Now.ToString("yyyy-MM-dd").Replace("-", "");
|
|
|
+ //生产标识
|
|
|
+ textBox_ProductTag.Text = arrText[rowNum + 4].ToString().Split(',')[1];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default: break;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } while (false);
|
|
|
+
|
|
|
+ MessageBox.Show("导入完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ MessageBox.Show("导入错误,请检查导入文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void pictureBox1_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if (WriteLockStatus == true)
|
|
|
+ {
|
|
|
+ richTextBox_AdvanceParams.ReadOnly = false;
|
|
|
+ pictureBox1.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Unlock;
|
|
|
+ WriteLockStatus = !WriteLockStatus;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ richTextBox_AdvanceParams.ReadOnly = true;
|
|
|
+ pictureBox1.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Lock;
|
|
|
+ WriteLockStatus = !WriteLockStatus;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void GenerateParams_Load(object sender, EventArgs e)
|
|
|
{
|
|
|
//更新版本信息
|
|
@@ -418,7 +731,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- label_Server_ComStatus.Text = "网络已连接";
|
|
|
+ label_Server_ComStatus.Text = "网络已连接:" + IP;
|
|
|
label_ServerStatus.BackColor = Color.Green;
|
|
|
}
|
|
|
|
|
@@ -457,6 +770,10 @@ namespace Welling_Motor_Debug_Tool
|
|
|
private void comboBox_ModelFile_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
{
|
|
|
button_ExportParams.Enabled = true;
|
|
|
+ //高级参数只读
|
|
|
+ richTextBox_AdvanceParams.ReadOnly = true;
|
|
|
+ pictureBox1.Image = global::Welling_Motor_Debug_Tool.Properties.Resources.Lock;
|
|
|
+ WriteLockStatus = true;
|
|
|
|
|
|
//下载文件
|
|
|
if (System.IO.File.Exists(localInfo.LocalPath + "\\" + comboBox_ModelFile.Text))//本地存在选定文件,先删除本地
|