|
@@ -82,6 +82,10 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
{
|
|
|
//装载配置文件
|
|
|
CfgFilePath = System.IO.Directory.GetCurrentDirectory() + "\\cfg\\";
|
|
|
+ if (System.IO.Directory.Exists(CfgFilePath) == false)
|
|
|
+ {
|
|
|
+ System.IO.Directory.CreateDirectory(CfgFilePath);
|
|
|
+ }
|
|
|
var files = Directory.GetFiles(CfgFilePath, "*.ttcfg");
|
|
|
comboBox_File.Items.Clear();
|
|
|
foreach (var file in files)
|
|
@@ -1193,13 +1197,17 @@ namespace MOTINOVA_Motor_Factory_Set
|
|
|
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 = System.IO.Directory.GetCurrentDirectory() + "\\log\\";
|
|
|
+ LogSaveFileName = System.IO.Directory.GetCurrentDirectory() + "\\log_" + DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "-") + "\\";
|
|
|
+ if (System.IO.Directory.Exists(LogSaveFileName) == false)
|
|
|
+ System.IO.Directory.CreateDirectory(LogSaveFileName);
|
|
|
LogSaveFileName += textBox_PDinfo.Text + "_" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "-").Replace(":", string.Empty).Replace(" ", "_") + "_测试记录" + ".png";
|
|
|
bit.Save(LogSaveFileName);//默认保存格式为PNG,保存成jpg格式质量不是很好
|
|
|
|
|
|
//一键导出数据
|
|
|
//设置保存路径
|
|
|
- LogSaveFileName = System.IO.Directory.GetCurrentDirectory() + "\\log\\";
|
|
|
+ LogSaveFileName = System.IO.Directory.GetCurrentDirectory() + "\\log_" + DateTime.Now.ToString("yyyy-MM-dd").Replace("/", "-") + "\\";
|
|
|
+ if (System.IO.Directory.Exists(LogSaveFileName) == false)
|
|
|
+ System.IO.Directory.CreateDirectory(LogSaveFileName);
|
|
|
LogSaveFileName += textBox_PDinfo.Text + "_" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("/", "-").Replace(":", string.Empty).Replace(" ", "_") + "_ParamsLog" + ".ttlog";
|
|
|
|
|
|
//开始发送指令
|