1 增加图片的保存路径和天数

2 优化具放料报警后先移动到安全后再点击重试流程会继续执行的问题
develop
lhiven 1 year ago
parent 653a6da7f2
commit a3bf5f7a83

@ -1942,5 +1942,31 @@ namespace Rs.Framework
return SysConfigParam.GetValue<double>(nameof(PlaceTrayOffsetY));
}
}
/// <summary>
/// 图片保存路径
/// </summary>
[ParameterInit("string", "d:\\images", "system", "图片保存路径")]
public static string ImageSavePath
{
get
{
return SysConfigParam.GetValue<string>(nameof(ImageSavePath));
}
}
/// <summary>
/// 图片保存天数
/// </summary>
[ParameterInit("int", "15", "system", "图片保存天数")]
public static int ImageSaveDays
{
get
{
return SysConfigParam.GetValue<int>(nameof(ImageSaveDays));
}
}
}
}

@ -1404,7 +1404,7 @@ namespace Rs.MotionPlat.Flow
LogHelper.Debug($"治具穴位{nozzle.NozzleIndex}真空异常");
TransitModuleSafePosFlow.Instance.GoSafePostion(EExceptionSafePos.SocketFrom9ToSixteen);
}
Start();
//Start();
break;
}
}

@ -78,11 +78,11 @@ namespace Rs.MotionPlat.Flow.SafePosFlow
}
while (!finished)
{
//if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop)
//{
// Thread.Sleep(10);
// continue;
//}
if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop)
{
Thread.Sleep(10);
continue;
}
switch (step)
{
case ETransitModuleSafePosFlowStep.Z:

@ -831,49 +831,51 @@ namespace Rs.MotionPlat
{
try
{
string dirpath = "D://images";
string[] dirs = Directory.GetDirectories(dirpath);
if (!Directory.Exists(dirpath))
string dirpath = GlobalVar.ImageSavePath;// "D://images";
if(!string.IsNullOrEmpty(dirpath))
{
Directory.CreateDirectory(dirpath);
}
foreach (var dir in dirs)
{
DirectoryInfo di = new DirectoryInfo(dir);
DateTime dtCreate = di.CreationTime;
if ((DateTime.Now - dtCreate).Days > 15)
string[] dirs = Directory.GetDirectories(dirpath);
if (!Directory.Exists(dirpath))
{
di.Delete(true);
Directory.CreateDirectory(dirpath);
}
}
dirpath = "D://软件备份";
if (!Directory.Exists(dirpath))
{
Directory.CreateDirectory(dirpath);
}
dirs = Directory.GetDirectories(dirpath);
foreach (var dir in dirs)
{
DirectoryInfo di = new DirectoryInfo(dir);
DateTime dtCreate = di.CreationTime;
if ((DateTime.Now - dtCreate).Days > 15)
foreach (var dir in dirs)
{
di.Delete(true);
DirectoryInfo di = new DirectoryInfo(dir);
DateTime dtCreate = di.CreationTime;
if ((DateTime.Now - dtCreate).Days > GlobalVar.ImageSaveDays)
{
di.Delete(true);
}
}
dirpath = "D://软件备份";
if (!Directory.Exists(dirpath))
{
Directory.CreateDirectory(dirpath);
}
dirs = Directory.GetDirectories(dirpath);
foreach (var dir in dirs)
{
DirectoryInfo di = new DirectoryInfo(dir);
DateTime dtCreate = di.CreationTime;
if ((DateTime.Now - dtCreate).Days > GlobalVar.ImageSaveDays)
{
di.Delete(true);
}
}
}
//配置文件备份
string workDir = System.Environment.CurrentDirectory;
string zipFileName = DateTime.Now.ToString("yyyyMMddHH");
string bakDir = $"d://软件备份//{DateTime.Now.ToString("yyyyMMdd")}//{zipFileName}";
if (!Directory.Exists(bakDir))
{
Directory.CreateDirectory(bakDir);
CopyDirectory(workDir, bakDir);
string toDir = Path.Combine(Directory.GetParent(bakDir).FullName, zipFileName + ".zip");
ZipHelper.ZipDirectory(bakDir, toDir);
Directory.Delete(bakDir, true);
//配置文件备份
string workDir = System.Environment.CurrentDirectory;
string zipFileName = DateTime.Now.ToString("yyyyMMddHH");
string bakDir = $"d://软件备份//{DateTime.Now.ToString("yyyyMMdd")}//{zipFileName}";
if (!Directory.Exists(bakDir))
{
Directory.CreateDirectory(bakDir);
CopyDirectory(workDir, bakDir);
string toDir = Path.Combine(Directory.GetParent(bakDir).FullName, zipFileName + ".zip");
ZipHelper.ZipDirectory(bakDir, toDir);
Directory.Delete(bakDir, true);
}
}
}
catch (Exception ex)

@ -95,6 +95,7 @@
<HintPath>bin\Debug\Rs.Motion.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.98.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>

@ -78,6 +78,9 @@
this.label7 = new System.Windows.Forms.Label();
this.cboxUpCameraName = new System.Windows.Forms.ComboBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnImageSavePath = new System.Windows.Forms.Button();
this.txtImageSaveDays = new System.Windows.Forms.TextBox();
this.txtImageSavePath = new System.Windows.Forms.TextBox();
this.panelEx1 = new Rs.Controls.PanelEx();
this.btnSaveSpeedParam = new System.Windows.Forms.Button();
this.cboxCurRecipe = new System.Windows.Forms.ComboBox();
@ -92,6 +95,8 @@
this.lblScanBarcodeSpeed = new System.Windows.Forms.Label();
this.lblFlyCameraSpeed = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.lblTakeTrayFromNg2InputSpeed = new System.Windows.Forms.Label();
this.lblStockBeltSpeed = new System.Windows.Forms.Label();
@ -117,6 +122,7 @@
this.txtControlCenterPort = new System.Windows.Forms.TextBox();
this.cboxEnableExceptionHandlingNozzle = new System.Windows.Forms.CheckBox();
this.cboxEnableScanBarCodeByDownCamera = new System.Windows.Forms.CheckBox();
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.tableLayoutPanel1.SuspendLayout();
this.groupBox8.SuspendLayout();
this.groupBox2.SuspendLayout();
@ -510,6 +516,9 @@
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.btnImageSavePath);
this.groupBox1.Controls.Add(this.txtImageSaveDays);
this.groupBox1.Controls.Add(this.txtImageSavePath);
this.groupBox1.Controls.Add(this.panelEx1);
this.groupBox1.Controls.Add(this.cboxCurRecipe);
this.groupBox1.Controls.Add(this.label4);
@ -523,6 +532,8 @@
this.groupBox1.Controls.Add(this.lblScanBarcodeSpeed);
this.groupBox1.Controls.Add(this.lblFlyCameraSpeed);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.label17);
this.groupBox1.Controls.Add(this.label10);
this.groupBox1.Controls.Add(this.label15);
this.groupBox1.Controls.Add(this.lblTakeTrayFromNg2InputSpeed);
this.groupBox1.Controls.Add(this.lblStockBeltSpeed);
@ -535,6 +546,27 @@
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// btnImageSavePath
//
resources.ApplyResources(this.btnImageSavePath, "btnImageSavePath");
this.btnImageSavePath.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56)))));
this.btnImageSavePath.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btnImageSavePath.ForeColor = System.Drawing.Color.White;
this.btnImageSavePath.Name = "btnImageSavePath";
this.btnImageSavePath.UseVisualStyleBackColor = false;
this.btnImageSavePath.Click += new System.EventHandler(this.btnImageSavePath_Click);
//
// txtImageSaveDays
//
resources.ApplyResources(this.txtImageSaveDays, "txtImageSaveDays");
this.txtImageSaveDays.Name = "txtImageSaveDays";
this.txtImageSaveDays.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSysParam_KeyUp);
//
// txtImageSavePath
//
resources.ApplyResources(this.txtImageSavePath, "txtImageSavePath");
this.txtImageSavePath.Name = "txtImageSavePath";
//
// panelEx1
//
resources.ApplyResources(this.panelEx1, "panelEx1");
@ -650,6 +682,16 @@
resources.ApplyResources(this.label5, "label5");
this.label5.Name = "label5";
//
// label17
//
resources.ApplyResources(this.label17, "label17");
this.label17.Name = "label17";
//
// label10
//
resources.ApplyResources(this.label10, "label10");
this.label10.Name = "label10";
//
// label15
//
resources.ApplyResources(this.label15, "label15");
@ -826,6 +868,10 @@
this.cboxEnableScanBarCodeByDownCamera.Name = "cboxEnableScanBarCodeByDownCamera";
this.cboxEnableScanBarCodeByDownCamera.UseVisualStyleBackColor = true;
//
// folderBrowserDialog1
//
resources.ApplyResources(this.folderBrowserDialog1, "folderBrowserDialog1");
//
// CommonConfig
//
resources.ApplyResources(this, "$this");
@ -951,5 +997,11 @@
private System.Windows.Forms.DataGridViewCheckBoxColumn ;
private System.Windows.Forms.DataGridViewCheckBoxColumn ;
private System.Windows.Forms.CheckBox cboxEnableIndexTimeStatistics;
private System.Windows.Forms.Button btnImageSavePath;
private System.Windows.Forms.TextBox txtImageSaveDays;
private System.Windows.Forms.TextBox txtImageSavePath;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
}
}

@ -205,7 +205,10 @@ namespace Rs.MotionPlat.SysConfig
public void txtSysParam_KeyUp(object sender, KeyEventArgs e)
{
UpdateSysParam((TextBox)sender);
if(e.KeyCode== Keys.Enter)
{
UpdateSysParam((TextBox)sender);
}
}
private void txtQifuValue_KeyUp(object sender, KeyEventArgs e)
{
@ -305,5 +308,15 @@ namespace Rs.MotionPlat.SysConfig
//((DataGridViewCheckBoxCell)dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex]).Value = true;
}
}
private void btnImageSavePath_Click(object sender, EventArgs e)
{
DialogResult dr = folderBrowserDialog1.ShowDialog();
if(dr== DialogResult.OK)
{
this.txtImageSavePath.Text = folderBrowserDialog1.SelectedPath;
SysConfigParam.Update("ImageSavePath", txtImageSavePath.Text);
}
}
}
}

@ -379,6 +379,18 @@
<data name="groupBox3.Text" xml:space="preserve">
<value>Camera parameter setting</value>
</data>
<data name="btnImageSavePath.Location" type="System.Drawing.Point, System.Drawing">
<value>470, 243</value>
</data>
<data name="btnImageSavePath.Text" xml:space="preserve">
<value>select</value>
</data>
<data name="txtImageSaveDays.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 280</value>
</data>
<data name="txtImageSavePath.Location" type="System.Drawing.Point, System.Drawing">
<value>139, 246</value>
</data>
<data name="btnSaveSpeedParam.Location" type="System.Drawing.Point, System.Drawing">
<value>638, 6</value>
</data>
@ -424,6 +436,18 @@
<data name="label5.Text" xml:space="preserve">
<value>Handling Empty Tray speed:</value>
</data>
<data name="label17.Size" type="System.Drawing.Size, System.Drawing">
<value>101, 12</value>
</data>
<data name="label17.Text" xml:space="preserve">
<value>Image save days:</value>
</data>
<data name="label10.Size" type="System.Drawing.Size, System.Drawing">
<value>101, 12</value>
</data>
<data name="label10.Text" xml:space="preserve">
<value>Image save path:</value>
</data>
<data name="label15.Location" type="System.Drawing.Point, System.Drawing">
<value>94, 166</value>
</data>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save