Commit dce86849 刘韬

1

1 个父辈 88ad6acf
...@@ -34,6 +34,9 @@ namespace OnlineStore.Common ...@@ -34,6 +34,9 @@ namespace OnlineStore.Common
[MyConfigComment("是否必须包含PN")] [MyConfigComment("是否必须包含PN")]
public static MyConfig<bool> Device_MustHavePN = false; public static MyConfig<bool> Device_MustHavePN = false;
[MyConfigComment("跳过贴标流程")]
public static MyConfig<bool> Device_Disable_labelling = false;
[MyConfigComment("X高压端口")] [MyConfigComment("X高压端口")]
public static MyConfig<string> XRay_Port = "http://192.168.1.4:50001"; public static MyConfig<string> XRay_Port = "http://192.168.1.4:50001";
......
...@@ -78,6 +78,11 @@ CREATE TABLE ""ReelInfo"" ( ...@@ -78,6 +78,11 @@ CREATE TABLE ""ReelInfo"" (
sql = "alter table ReelInfo add column resultimage TEXT;"; sql = "alter table ReelInfo add column resultimage TEXT;";
sh.ExecuteNonQuery(sql); sh.ExecuteNonQuery(sql);
} }
if (!sc.Contains("algo TEXT"))
{
sql = "alter table ReelInfo add column algo TEXT;";
sh.ExecuteNonQuery(sql);
}
} }
} }
...@@ -126,7 +131,12 @@ id =@id"; ...@@ -126,7 +131,12 @@ id =@id";
sh.ExecuteNonQuery(sql, para); sh.ExecuteNonQuery(sql, para);
} }
} }
public void DeleteDataByDate(int day)
{
string sql = "DELETE FROM ReelInfo WHERE DateTime < date('now', '-" + day + " days');";
SQLiteParameter[] para = new SQLiteParameter[] { };
sh.ExecuteNonQuery (sql, para);
}
public void InsertLog(string device, string action, object state, string log = "") public void InsertLog(string device, string action, object state, string log = "")
{ {
string sql = "INSERT INTO ReelInfo VALUES(NULL, @device,@action, @state, @log,@datetime,NULL)"; string sql = "INSERT INTO ReelInfo VALUES(NULL, @device,@action, @state, @log,@datetime,NULL)";
......
...@@ -338,7 +338,7 @@ namespace DeviceLibrary ...@@ -338,7 +338,7 @@ namespace DeviceLibrary
case MoveStep.H01_HomeReset: case MoveStep.H01_HomeReset:
ServerCM.storeStatus = StoreStatus.ResetMove; ServerCM.storeStatus = StoreStatus.ResetMove;
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear); Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
lastReeID = "";
if (IOValue(IO_Type.Loading_Car_Check2).Equals(IO_VALUE.LOW) if (IOValue(IO_Type.Loading_Car_Check2).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.Loading_Car_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.Loading_Car1315_Check).Equals(IO_VALUE.LOW)) && IOValue(IO_Type.Loading_Car_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.Loading_Car1315_Check).Equals(IO_VALUE.LOW))
{ {
......
...@@ -23,6 +23,7 @@ namespace DeviceLibrary ...@@ -23,6 +23,7 @@ namespace DeviceLibrary
Task GetResultTask = null; Task GetResultTask = null;
Dictionary<string, int> CountList = new Dictionary<string, int>(); Dictionary<string, int> CountList = new Dictionary<string, int>();
int xrayimageretry = 0; int xrayimageretry = 0;
string lastReeID = "";
void CountingMoveProcess() void CountingMoveProcess()
{ {
if (CheckWait(CountMoveInfo)) if (CheckWait(CountMoveInfo))
...@@ -155,6 +156,13 @@ namespace DeviceLibrary ...@@ -155,6 +156,13 @@ namespace DeviceLibrary
if (string.IsNullOrWhiteSpace(CountMoveInfo.MoveParam.WareCode)) if (string.IsNullOrWhiteSpace(CountMoveInfo.MoveParam.WareCode))
CountMoveInfo.MoveParam.WareCode = CountMoveInfo.MoveParam.codeInfos.Where(c=> Regex.IsMatch(c.CodeStr, @"^S[2-3]0")).FirstOrDefault().CodeStr; CountMoveInfo.MoveParam.WareCode = CountMoveInfo.MoveParam.codeInfos.Where(c=> Regex.IsMatch(c.CodeStr, @"^S[2-3]0")).FirstOrDefault().CodeStr;
CountMoveInfo.MoveParam.ReeID = CountMoveInfo.MoveParam.WareCode; CountMoveInfo.MoveParam.ReeID = CountMoveInfo.MoveParam.WareCode;
if (lastReeID == CountMoveInfo.MoveParam.ReeID)
{
CountMoveInfo.log("唯一码与上一盘料出现重复,请检查");
Msg.add("唯一码与上一盘料出现重复,请检查", MsgLevel.alarm);
RobotManage.UserPause("唯一码与上一盘料出现重复");
}
lastReeID = CountMoveInfo.MoveParam.ReeID;
CountMoveInfo.MoveParam.PN = CountMoveInfo.MoveParam.codeInfos.Where(c=>c.CodeStr.StartsWith("AT")).FirstOrDefault()?.CodeStr; CountMoveInfo.MoveParam.PN = CountMoveInfo.MoveParam.codeInfos.Where(c=>c.CodeStr.StartsWith("AT")).FirstOrDefault()?.CodeStr;
if (string.IsNullOrWhiteSpace(CountMoveInfo.MoveParam.PN)) { if (string.IsNullOrWhiteSpace(CountMoveInfo.MoveParam.PN)) {
var hc =CountMoveInfo.MoveParam.codeInfos.Where(c => Regex.IsMatch(c.CodeStr, @"(?:@@|-)(AT\w*)(?:@@|-)")).FirstOrDefault()?.CodeStr; var hc =CountMoveInfo.MoveParam.codeInfos.Where(c => Regex.IsMatch(c.CodeStr, @"(?:@@|-)(AT\w*)(?:@@|-)")).FirstOrDefault()?.CodeStr;
......
...@@ -5,6 +5,7 @@ using OnlineStore.Common; ...@@ -5,6 +5,7 @@ using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
...@@ -157,8 +158,14 @@ namespace DeviceLibrary ...@@ -157,8 +158,14 @@ namespace DeviceLibrary
CountList.Remove(OutMoveInfo.MoveParam.ReeID); CountList.Remove(OutMoveInfo.MoveParam.ReeID);
} }
if (OutMoveInfo.MoveParam.QTY > 0) if (OutMoveInfo.MoveParam.QTY > 0)
SetPrintJob(OutMoveInfo); {
else { if (Setting_Init.Device_Disable_labelling)
OutMoveInfo.log($"已禁用贴标,不打印标签");
else
SetPrintJob(OutMoveInfo);
}
else
{
OutMoveInfo.MoveParam.IsNg = true; OutMoveInfo.MoveParam.IsNg = true;
OutMoveInfo.MoveParam.NgMsg = "点料结果为0"; OutMoveInfo.MoveParam.NgMsg = "点料结果为0";
OutMoveInfo.NextMoveStep(MoveStep.Out_20); OutMoveInfo.NextMoveStep(MoveStep.Out_20);
...@@ -180,10 +187,8 @@ namespace DeviceLibrary ...@@ -180,10 +187,8 @@ namespace DeviceLibrary
else else
{ {
OutMoveInfo.NextMoveStep(MoveStep.Out_20); OutMoveInfo.NextMoveStep(MoveStep.Out_20);
} }
break; break;
case MoveStep.Out_20: case MoveStep.Out_20:
if (OutMoveInfo.MoveParam.IsNg) if (OutMoveInfo.MoveParam.IsNg)
{ {
...@@ -199,7 +204,6 @@ namespace DeviceLibrary ...@@ -199,7 +204,6 @@ namespace DeviceLibrary
Unloading_Middle_Axis.AbsMove(OutMoveInfo, OutToPos.Middle_P2, Config.Unloading_Middle_Axis_P1_speed); Unloading_Middle_Axis.AbsMove(OutMoveInfo, OutToPos.Middle_P2, Config.Unloading_Middle_Axis_P1_speed);
Unloading_UpDown_Axis.AbsMove(OutMoveInfo, OutToPos.UpDown_P2, Config.Unloading_UpDown_Axis_P1_speed); Unloading_UpDown_Axis.AbsMove(OutMoveInfo, OutToPos.UpDown_P2, Config.Unloading_UpDown_Axis_P1_speed);
OutMoveInfo.log($"旋转轴,升降轴到达p2点NG"); OutMoveInfo.log($"旋转轴,升降轴到达p2点NG");
} }
} }
else if (OutCarMoveInfo.MoveStep == MoveStep.OutCarReadyPut && (InCarType == OutCarType || InCarType== CarTypeE.None)) else if (OutCarMoveInfo.MoveStep == MoveStep.OutCarReadyPut && (InCarType == OutCarType || InCarType== CarTypeE.None))
...@@ -234,8 +238,6 @@ namespace DeviceLibrary ...@@ -234,8 +238,6 @@ namespace DeviceLibrary
pos1 = 0; pos1 = 0;
Unloading_UpDown_Axis.AbsMove(OutMoveInfo, pos1, Config.Unloading_UpDown_Axis_P1_speed); Unloading_UpDown_Axis.AbsMove(OutMoveInfo, pos1, Config.Unloading_UpDown_Axis_P1_speed);
OutMoveInfo.log($"升降轴到达放料p3点,pos:{pos1},PlateH:{OutMoveInfo.MoveParam.PlateH}"); OutMoveInfo.log($"升降轴到达放料p3点,pos:{pos1},PlateH:{OutMoveInfo.MoveParam.PlateH}");
//Unloading_UpDown_Axis.AbsMove(OutMoveInfo, OutToPos.UpDown_P3, Config.Unloading_UpDown_Axis_P1_speed);
//OutMoveInfo.log($"升降轴到达p3点");
break; break;
case MoveStep.Out_23: case MoveStep.Out_23:
OutMoveInfo.NextMoveStep(MoveStep.Out_24); OutMoveInfo.NextMoveStep(MoveStep.Out_24);
...@@ -293,7 +295,13 @@ namespace DeviceLibrary ...@@ -293,7 +295,13 @@ namespace DeviceLibrary
OutMoveInfo.log($"批量轴慢速上升到检测点亮,当前位置:{Unloading_Batch_Axis.GetAclPosition()},控制上升:{OutMoveInfo.MoveParam.PlateH},{target}"); OutMoveInfo.log($"批量轴慢速上升到检测点亮,当前位置:{Unloading_Batch_Axis.GetAclPosition()},控制上升:{OutMoveInfo.MoveParam.PlateH},{target}");
break; break;
case MoveStep.Out_31: case MoveStep.Out_31:
OutMoveInfo.NextMoveStep(MoveStep.Out_WaitForLabel); if (Setting_Init.Device_Disable_labelling)
{
OutMoveInfo.NextMoveStep(MoveStep.Out_LabelFinished);
OutMoveInfo.log("已跳过贴标");
}
else
OutMoveInfo.NextMoveStep(MoveStep.Out_WaitForLabel);
break; break;
case MoveStep.Out_WaitForLabel: case MoveStep.Out_WaitForLabel:
Msg.add("等待贴标", MsgLevel.info); Msg.add("等待贴标", MsgLevel.info);
......
...@@ -7,6 +7,7 @@ using System.Collections.Generic; ...@@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
...@@ -84,10 +85,11 @@ namespace TheMachine ...@@ -84,10 +85,11 @@ namespace TheMachine
Environment.CurrentDirectory = Application.StartupPath; Environment.CurrentDirectory = Application.StartupPath;
XmlConfigurator.Configure(); XmlConfigurator.Configure();
var pn = ServerCommunication.GetPnByReelid("123"); //var pn = ServerCommunication.GetPnByReelid("123");
//var pn= ServerCommunication.GetPnByReelid("S202306181351530002"); //var pn= ServerCommunication.GetPnByReelid("S202306181351530002");
//LogUtil.info(pn); //LogUtil.info(pn);
//return; //return;
CommonLib.DeleteOverDayFile(Path.Combine(CommonLib.AppPathRoot, "image"), "*.*", 30);
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); Application.Run(new Form1());
......
...@@ -44,6 +44,7 @@ namespace TheMachine ...@@ -44,6 +44,7 @@ namespace TheMachine
this.btn_openxray = new System.Windows.Forms.Button(); this.btn_openxray = new System.Windows.Forms.Button();
this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword(); this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword();
this.cb_musthavepn = new System.Windows.Forms.CheckBox(); this.cb_musthavepn = new System.Windows.Forms.CheckBox();
this.cb_disablelabelling = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.X光调试.SuspendLayout(); this.X光调试.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
...@@ -203,6 +204,17 @@ namespace TheMachine ...@@ -203,6 +204,17 @@ namespace TheMachine
this.cb_musthavepn.UseVisualStyleBackColor = true; this.cb_musthavepn.UseVisualStyleBackColor = true;
this.cb_musthavepn.CheckedChanged += new System.EventHandler(this.cb_EnableBuzzer_CheckedChanged); this.cb_musthavepn.CheckedChanged += new System.EventHandler(this.cb_EnableBuzzer_CheckedChanged);
// //
// cb_disablelabelling
//
this.cb_disablelabelling.AutoSize = true;
this.cb_disablelabelling.Location = new System.Drawing.Point(14, 100);
this.cb_disablelabelling.Name = "cb_disablelabelling";
this.cb_disablelabelling.Size = new System.Drawing.Size(96, 16);
this.cb_disablelabelling.TabIndex = 9;
this.cb_disablelabelling.Text = "跳过贴标流程";
this.cb_disablelabelling.UseVisualStyleBackColor = true;
this.cb_disablelabelling.CheckedChanged += new System.EventHandler(this.cb_EnableBuzzer_CheckedChanged);
//
// SettingControl // SettingControl
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -210,6 +222,7 @@ namespace TheMachine ...@@ -210,6 +222,7 @@ namespace TheMachine
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.uC_SetUserPassword1); this.Controls.Add(this.uC_SetUserPassword1);
this.Controls.Add(this.cb_autorun); this.Controls.Add(this.cb_autorun);
this.Controls.Add(this.cb_disablelabelling);
this.Controls.Add(this.cb_musthavepn); this.Controls.Add(this.cb_musthavepn);
this.Controls.Add(this.cb_EnableBuzzer); this.Controls.Add(this.cb_EnableBuzzer);
this.Name = "SettingControl"; this.Name = "SettingControl";
...@@ -238,5 +251,6 @@ namespace TheMachine ...@@ -238,5 +251,6 @@ namespace TheMachine
private System.Windows.Forms.Button btn_printertest; private System.Windows.Forms.Button btn_printertest;
private System.Windows.Forms.Button buttonmunial; private System.Windows.Forms.Button buttonmunial;
private System.Windows.Forms.CheckBox cb_musthavepn; private System.Windows.Forms.CheckBox cb_musthavepn;
private System.Windows.Forms.CheckBox cb_disablelabelling;
} }
} }
...@@ -71,6 +71,7 @@ namespace TheMachine ...@@ -71,6 +71,7 @@ namespace TheMachine
Config.PropertyBind(Setting_Init.Printer_Labelname.Key, cb_labelselect, "SelectedItem", "SelectedValueChanged"); Config.PropertyBind(Setting_Init.Printer_Labelname.Key, cb_labelselect, "SelectedItem", "SelectedValueChanged");
Config.PropertyBind(Setting_Init.App_AutoRun.Key, cb_autorun, "Checked", "CheckedChanged", false); Config.PropertyBind(Setting_Init.App_AutoRun.Key, cb_autorun, "Checked", "CheckedChanged", false);
Config.PropertyBind(Setting_Init.Device_MustHavePN.Key, cb_musthavepn, "Checked", "CheckedChanged", false); Config.PropertyBind(Setting_Init.Device_MustHavePN.Key, cb_musthavepn, "Checked", "CheckedChanged", false);
Config.PropertyBind(Setting_Init.Device_Disable_labelling.Key, cb_disablelabelling, "Checked", "CheckedChanged", false);
this.cb_autorun.CheckedChanged += new System.EventHandler(this.cb_autorun_CheckedChanged); this.cb_autorun.CheckedChanged += new System.EventHandler(this.cb_autorun_CheckedChanged);
loadlabellist(); loadlabellist();
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!