Commit 0a13027d 刘韬

1

1 个父辈 8fbd789e
......@@ -24,7 +24,7 @@ namespace OnlineStore
/// <summary>
/// 标签已获取
/// </summary>
LabelGot,
//LabelGot,
/// <summary>
/// 标签中
/// </summary>
......
......@@ -49,7 +49,7 @@ namespace DeviceLibrary
}
}
Task<bool> work;
public Task<bool> TurnToEnd(bool isHorizontal,bool needclamp=false)
public Task<bool> TurnToEnd(bool isHorizontal,bool needclamp=false, double speedratio = 1)
{
return work = Task.Run(() =>
{
......@@ -79,6 +79,7 @@ namespace DeviceLibrary
}
}
else {
speedratio = 1;
RobotManage.mainMachine.CylinderMove(null, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.LOW);
while (!IOManager.IOValue(IO_Type.Tin_Dock_Rotate_Clamp).Equals(IO_VALUE.LOW))
{
......@@ -90,7 +91,7 @@ namespace DeviceLibrary
len = len * -1;
if (!axisBean.IsServeoOn)
axisBean.Open(true, out string msg);
axisBean.RelMove(len, (double)upspeed);
axisBean.RelMove(len, (double)upspeed* speedratio);
//moveInfo.log($"{checkio}");
while (!IOManager.IOValue(checkio).Equals(IO_VALUE.HIGH))
{
......@@ -127,7 +128,7 @@ namespace DeviceLibrary
});
}
public Task TurnWork;
public Task TurnDegree(int degree) {
public Task TurnDegree(int degree, double speedratio = 1) {
return TurnWork=Task.Run(()=>
{
......@@ -149,7 +150,7 @@ namespace DeviceLibrary
TurnToEnd(true).Wait();
}
//moveInfo.log($"len:{len}");
axisBean.RelMove(len*-1, (double)upspeed);
axisBean.RelMove(len*-1, (double)upspeed* speedratio);
Task.Delay(50).Wait();
while (axisBean.IsBusy) {
Task.Delay(50).Wait();
......@@ -202,7 +203,7 @@ namespace DeviceLibrary
TurnToEnd(false).Wait();
});
}
public void TurnDouble()
public void TurnDouble(double speedratio = 1)
{
TurnWork = Task.Run(() =>
{
......@@ -226,9 +227,9 @@ namespace DeviceLibrary
{
Task.Delay(100).Wait();
}
TurnToEnd(true, true).Wait();
TurnToEnd(true, true, speedratio).Wait();
TurnToEnd(false, false).Wait();
TurnToEnd(true, true).Wait();
TurnToEnd(true, true, speedratio).Wait();
//TurnToEnd(false, false).Wait();
//TurnDegree(-20).Wait();
RobotManage.mainMachine.CylinderMove(null, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.LOW);
......
......@@ -471,6 +471,9 @@ namespace DeviceLibrary
//postId格式BoxId#位置
string posId = data[ParamDefine.posId].ToString();
string usedCountstr= data["usedCount"].ToString();
string expireDate= data["expiredDate"].ToString();
string exposureStartDate = data["exposureStartDate"].ToString();
string stabilizationEndDate = data["stabilizationEndDate"].ToString();
//int storeId = int.Parse(posArray[0]);
//根据发送的posId获取位置列表
ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(posId);
......@@ -488,8 +491,11 @@ namespace DeviceLibrary
JobInfo inStoreJob = new JobInfo(message, posId);
RobotManage.mainMachine.LabelingMoveInfo.MoveParam.PosID = inStoreJob.PosId;
RobotManage.mainMachine.LabelingMoveInfo.MoveParam.usedCount = usedCount;
RobotManage.mainMachine.LabelingMoveInfo.MoveParam.Time1 = exposureStartDate;
RobotManage.mainMachine.LabelingMoveInfo.MoveParam.Time2 = stabilizationEndDate;
RobotManage.mainMachine.LabelingMoveInfo.MoveParam.Time3 = expireDate;
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(StoreName + " 收到服务器入库命令:库位号【" + posId + ",usedCount" + usedCount + "】二维码【" + message + "】 开始入库!");
LogUtil.info(StoreName + " 收到服务器入库命令:库位号【" + posId + ",usedCount" + usedCount + ",exposureStartDate="+ exposureStartDate + ",stabilizationEndDate="+ stabilizationEndDate + ",expireDate"+ expireDate + "】二维码【" + message + "】 开始入库!");
}
else
......
......@@ -263,7 +263,7 @@ namespace DeviceLibrary
{
Msg.add(crc.GetString("Res0064", "放料时发现库位已经有料,请检查."), MsgLevel.alarm);
MoveInfo.log($"放料时发现库位已经有料,请检查.");
//RobotManage.UserPause(crc.GetString("Res0065", "放料时发现库位已经有料,请检查"));
//RobotManage.UserPause(crc.GetString("Res0064", "放料时发现库位已经有料,请检查"));
}
else
{
......
......@@ -49,6 +49,12 @@ namespace DeviceLibrary
public void ClearLastPosid() {
lastoutpos = "";
}
public void ClearAll()
{
LogUtil.info($"清除所有缓存出库任务");
lastoutpos = "";
jobInfos = new ConcurrentQueue<JobInfo>();
}
}
public class JobInfo
......
......@@ -174,6 +174,9 @@ namespace DeviceLibrary
private (bool, string) Y_Axis_interference(int from, int to)
{
if (!IsAllDoorClosed())
return (true, "Safe door was not closed, and this axis cannot be moved");
if (Z_Axis.IsInPosition(Config.Z_Axis_P1)) {
return (false, "");
}
......@@ -183,6 +186,9 @@ namespace DeviceLibrary
private (bool, string) X_Axis_interference(int from, int to)
{
if (!IsAllDoorClosed())
return (true, "Safe door was not closed, and this axis cannot be moved");
if (Z_Axis.IsInPosition(Config.Z_Axis_P1))
{
return (false, "");
......@@ -193,6 +199,10 @@ namespace DeviceLibrary
private (bool, string) Z_Axis_interference(int arg1, int arg2)
{
if(!IsAllDoorClosed())
return (true, "Safe door was not closed, and this axis cannot be moved");
if (X_Axis.IsBusy)
return (true, "The other axes are moving, and this axis cannot be moved");
if (Y_Axis.IsBusy)
......@@ -200,6 +210,22 @@ namespace DeviceLibrary
return (false, "");
}
public bool IsAllDoorClosed() {
if (IOValue(IO_Type.PrinterDoor_Check).Equals(IO_VALUE.LOW))
{
return false;
}
if (IOValue(IO_Type.LeftDoor_Check).Equals(IO_VALUE.HIGH))
{
return false;
}
if (IOValue(IO_Type.RightDoor_Check).Equals(IO_VALUE.HIGH))
{
return false;
}
return true;
}
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
StoreMoveInfo.Name = crc.GetString("Res0088","进出库调度");
......@@ -234,12 +260,15 @@ namespace DeviceLibrary
if (runStatus == RunStatus.Running)
{
boxTransport.Process();
if (!LabelingTestMode)
{
if (RobotManage.InoutDebugMode)
AutoInOutTestProcess();
else if (selfAuditMode)
TFIDSelfTestProcess();
else
StoreDemoProcess();
}
LabelingProcess();
}
......@@ -316,6 +345,7 @@ namespace DeviceLibrary
Alarm(AlarmType.None);
StopMove(true);
LedProcess(null);
OutStoreJobList.ClearAll();
Msg.add("","", MsgLevel.info, ErrInfo.X09_Clear);
}
......@@ -359,7 +389,7 @@ namespace DeviceLibrary
ResetMoveInfo.log("锁定抽屉");
IOMove(IO_Type.Entry_Drawer_Lock, IO_VALUE.HIGH);
IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.HIGH);
IOMove(IO_Type.Label_PasteBlow, IO_VALUE.LOW);
//IOMove(IO_Type.Label_PasteBlow, IO_VALUE.LOW);
CylinderMove(ResetMoveInfo, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.LOW);
Msg.add("","", MsgLevel.info, ErrInfo.X09_Clear);
break;
......@@ -489,7 +519,10 @@ namespace DeviceLibrary
{
Msg.add(crc.GetString("Res0172.8f1fa034","自检测到有错误物料,请处理"), MsgLevel.alarm);
}
if (LabelingTestMode) {
Msg.add("Labelling test mode", MsgLevel.warning);
}
if (!lastSafeCheckStatus && ok)
{
......
......@@ -87,11 +87,6 @@ namespace DeviceLibrary
RobotManage.mainMachine.TPMove.ToHigh(StoreMoveInfo);
StoreMoveInfo.log($"{job.WareNum},上层库位移至右侧");
}
}
break;
case MoveStep.StoreIn03:
......@@ -142,9 +137,10 @@ namespace DeviceLibrary
ds = Encoding.ASCII.GetString(data).Trim();
if (!string.IsNullOrEmpty(ds))
{
StoreMoveInfo.MoveParam.RFID = ds;
StoreMoveInfo.log("读取到 RFID:" + ds + " , " + RobotManage.RFID.HexBuff(data));
if (StoreMoveInfo.MoveParam.WareCode.IndexOf(ds) > -1)
StoreMoveInfo.MoveParam.RFID = ds.TrimStart('S');
if (StoreMoveInfo.MoveParam.WareCode.IndexOf(StoreMoveInfo.MoveParam.RFID) > -1)
{
issame = true;
break;
......@@ -160,9 +156,9 @@ namespace DeviceLibrary
ds = Encoding.ASCII.GetString(data).Trim();
if (!string.IsNullOrEmpty(ds))
{
StoreMoveInfo.MoveParam.RFID = ds;
StoreMoveInfo.MoveParam.RFID = ds.TrimStart('S');
StoreMoveInfo.log("读取到 RFID2:" + ds + " , " + RobotManage.RFID.HexBuff(data));
if (StoreMoveInfo.MoveParam.WareCode.IndexOf(ds) > -1)
if (StoreMoveInfo.MoveParam.WareCode.IndexOf(StoreMoveInfo.MoveParam.RFID) > -1)
{
issame = true;
break;
......@@ -184,6 +180,7 @@ namespace DeviceLibrary
case MoveStep.StoreOut13:
if (boxTransport.IsComplateOrFree)
{
Setting_Init.Runtime_Step = Runtime_StepE.None;
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn01);
if (!issame)
{
......
......@@ -48,23 +48,34 @@ namespace DeviceLibrary
case MoveStep.Wait:
StoreMoveInfo.MoveParam.ReelOnFixture = false;
if (IOValue(IO_Type.Taking_Clamp).Equals(IO_VALUE.LOW)) {
if (false && Setting_Init.Runtime_Step == Runtime_StepE.LabelProcess)
if (Setting_Init.Runtime_Step >= Runtime_StepE.LabelProcess && Setting_Init.Runtime_Step <= Runtime_StepE.LabelPasteFinish)
{
StoreMoveInfo.log("检测到上次正在贴标:" + Setting_Init.Runtime_Step + "," + Setting_Init.Runtime_Posid + "," + Setting_Init.Runtime_FromPosid);
if (!string.IsNullOrEmpty(Setting_Init.Runtime_FromPosid))
{
LabelingMoveInfo.NewMove(MoveStep.Labeling01);
//if (Setting_Init.Runtime_Step >= Runtime_StepE.Printed && Setting_Init.Runtime_Step < Runtime_StepE.LabelPasteFinish)
//{
// StoreMoveInfo.log("检测到上次正在贴标:" + Setting_Init.Runtime_Step + "," + Setting_Init.Runtime_Posid + "," + Setting_Init.Runtime_FromPosid);
// Msg.add(crc.GetString("Res0133", "重置前物料正在贴标,无法继续,请手动处理"), MsgLevel.warning, ErrInfo.LabelInPaste);
// RobotManage.UserPause(crc.GetString("Res0133", "重置前物料正在贴标,无法继续,请手动处理"));
// return;
//}
LabelingMoveInfo.MoveParam.IsNg = true;
LabelingMoveInfo.MoveParam.NgMsg = "重置前物料正在贴标,NG处理";
StoreMoveInfo.NextMoveStep(MoveStep.StoreIn03);
}
else
{
Msg.add(crc.GetString("Res0133", "重置前物料正在贴标,无法继续,请手动处理"), MsgLevel.warning, ErrInfo.LabelInPaste);
RobotManage.UserPause(crc.GetString("Res0133", "重置前物料正在贴标,无法继续,请手动处理"));
}
//if (!string.IsNullOrEmpty(Setting_Init.Runtime_FromPosid))
//{
// LabelingMoveInfo.NewMove(MoveStep.Labeling01);
// StoreMoveInfo.NextMoveStep(MoveStep.StoreIn03);
//}
//else
//{
// Msg.add(crc.GetString("Res0133", "重置前物料正在贴标,无法继续,请手动处理"), MsgLevel.warning, ErrInfo.LabelInPaste);
// RobotManage.UserPause(crc.GetString("Res0133", "重置前物料正在贴标,无法继续,请手动处理"));
//}
return;
}
else if (Setting_Init.Runtime_Step >= Runtime_StepE.LabelProcess && Setting_Init.Runtime_Step <= Runtime_StepE.LabelPasteFinish)
else if (Setting_Init.Runtime_Step >= Runtime_StepE.LabelPasteFinish)
{
StoreMoveInfo.log("检测到上次已完成贴标:" + Setting_Init.Runtime_Step + "," + Setting_Init.Runtime_Posid + "," + Setting_Init.Runtime_RFID);
StoreMoveInfo.NewMove(MoveStep.StoreIn03);
......@@ -76,13 +87,6 @@ namespace DeviceLibrary
StoreMoveInfo.MoveParam.RFID = Setting_Init.Runtime_RFID;
return;
}
else if (Setting_Init.Runtime_Step >= Runtime_StepE.Printed && Setting_Init.Runtime_Step < Runtime_StepE.LabelPasteFinish)
{
StoreMoveInfo.log("检测到上次正在贴标:" + Setting_Init.Runtime_Step + "," + Setting_Init.Runtime_Posid+","+ Setting_Init.Runtime_FromPosid);
Msg.add(crc.GetString("Res0133","重置前物料正在贴标,无法继续,请手动处理"), MsgLevel.warning, ErrInfo.LabelInPaste);
RobotManage.UserPause(crc.GetString("Res0133","重置前物料正在贴标,无法继续,请手动处理"));
return;
}
else if (OutStoreJobList.Dequeue(out JobInfo jobInfo))
{
......@@ -134,8 +138,6 @@ namespace DeviceLibrary
StoreMoveInfo.MoveParam.PosID = Setting_Init.Runtime_Posid;
StoreMoveInfo.MoveParam.WareCode= Setting_Init.Runtime_WareCode;
}
break;
case MoveStep.StoreIn01:
string inposid;
......@@ -237,6 +239,7 @@ namespace DeviceLibrary
case MoveStep.StoreIn05:
if (!boxTransport.IsComplateOrFree)
break;
Setting_Init.Runtime_Step = Runtime_StepE.None;
if (StoreMoveInfo.MoveParam.usedCount == 0)
{
if (StoreMoveInfo.MoveParam.RFID.Length > 16)
......@@ -372,6 +375,7 @@ namespace DeviceLibrary
case MoveStep.StoreIn09:
if (boxTransport.IsComplateOrFree)
{
Setting_Init.Runtime_Step = Runtime_StepE.None;
if (!StoreMoveInfo.MoveParam.IsNg)
{
if (!ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.InStoreEnd))
......@@ -475,7 +479,7 @@ namespace DeviceLibrary
case MoveStep.StoreOut11:
if (boxTransport.IsComplateOrFree)
{
ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreBoxEnd);
//ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreBoxEnd);
bool issame = false;
string ds = "";
for (int i = 0; i < 15; i++)
......@@ -542,6 +546,7 @@ namespace DeviceLibrary
case MoveStep.StoreOut12:
if (boxTransport.IsComplateOrFree)
{
Setting_Init.Runtime_Step = Runtime_StepE.None;
if (StoreMoveInfo.MoveParam.OutPosID != StoreMoveInfo.MoveParam.PosID)
{
ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreBoxEnd);
......@@ -575,6 +580,7 @@ namespace DeviceLibrary
{
StoreMoveInfo.NextMoveStep(MoveStep.Wait);
StoreMoveInfo.log($"NG出库库位已完成");
return;
}
}
......
......@@ -121,6 +121,7 @@ namespace DeviceLibrary
Labeling08,
Labeling09,
WaitInStore,
Labeling10_Reset,
Labeling10,
Labeling11,
Labeling12,
......
......@@ -82,7 +82,11 @@ namespace DeviceLibrary
MessageBox.Show(crc.GetString("Res0122","请先选择运动轴"), crc.GetString("Res0123","警告 "), MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
if (!currentAxis.IsSafe(0, out string msg))
{
MessageBox.Show(msg);
return false;
}
return true;
}
private void btnOpenAxis_Click(object sender, EventArgs e)
......
......@@ -166,6 +166,16 @@ namespace TheMachine
var loadtask = Task.Run(() =>
{
RobotManage.Init();
}).ContinueWith(delegate {
CylinderButton.IsSafe += () =>
{
if(RobotManage.isRunning)
return (false, "Device is in automatic");
if (!RobotManage.mainMachine.IsAllDoorClosed())
return (false, "Safe door was not closed");
return (true, "");
};
});
ListViewItem lvi = new ListViewItem(new string[] { "", DateTime.Now.ToString(), crc.GetString("Res0006","设备加载中,请稍后...") });
......@@ -431,7 +441,7 @@ namespace TheMachine
else if (msg.errInfo == ErrInfo.LabelInPaste)
{
RobotManage.mainMachine.IOMove(IO_Type.PrinterDoor_Lock, IO_VALUE.LOW);
if (FrmAlarm.ShowAlarmDialog(crc.GetString("Res0143","贴标区内可能有物料未完成贴标,请手动取出")) == DialogResult.OK)
if (FrmAlarm.ShowAlarmDialog("Labeling Exceptions:" + "\r\n"+ msg.msgtxt) == DialogResult.OK)
{
LogUtil.info("用户确认已处理");
//Setting_Init.Runtime_Step = Runtime_StepE.None;
......@@ -710,28 +720,39 @@ namespace TheMachine
private void button4_Click_1(object sender, EventArgs e)
{
if (!SafeTest())
return;
IOManager.IOMove(IO_Type.Entry_Drawer_Lock,IO_VALUE.LOW);
}
private void button3_Click_1(object sender, EventArgs e)
{
if (!SafeTest())
return;
IOManager.IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.LOW);
}
private void button5_Click_1(object sender, EventArgs e)
{
if (!SafeTest())
return;
IOManager.IOMove(IO_Type.LeftDoor_Lock, IO_VALUE.LOW);
RobotManage.mainMachine.LeftDoorOpen = true;
}
private void button2_Click_1(object sender, EventArgs e)
{
if (!SafeTest())
return;
IOManager.IOMove(IO_Type.RightDoor_Lock, IO_VALUE.LOW);
RobotManage.mainMachine.RightDoorOpen = true;
}
private void button2_Click_2(object sender, EventArgs e)
{
if (!SafeTest())
return;
IOManager.IOMove(IO_Type.PrinterDoor_Lock, IO_VALUE.LOW);
RobotManage.mainMachine.PrintDoorOpen = true;
}
......@@ -743,7 +764,13 @@ namespace TheMachine
RobotManage.mainMachine.StoreMoveInfo.NextMoveStep(MoveStep.StoreIn01);
else if (!cb_cycledemo.Checked)
RobotManage.mainMachine.StoreMoveInfo.NextMoveStep(MoveStep.Wait);
}
bool SafeTest() {
if (RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait)
return true;
MessageBox.Show("The device is moving and cannot be unlocked");
return false;
}
}
}
\ No newline at end of file
......@@ -57,6 +57,7 @@ namespace TheMachine
this.cylinderButton13 = new TheMachine.CylinderButton();
this.cylinderButton11 = new TheMachine.CylinderButton();
this.ioControl1 = new TheMachine.IOControl();
this.cylinderButton9 = new TheMachine.CylinderButton();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
......@@ -64,7 +65,7 @@ namespace TheMachine
//
this.btn_FlipEquip.BackColor = System.Drawing.Color.White;
this.btn_FlipEquip.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_FlipEquip.Location = new System.Drawing.Point(542, 474);
this.btn_FlipEquip.Location = new System.Drawing.Point(542, 515);
this.btn_FlipEquip.Name = "btn_FlipEquip";
this.btn_FlipEquip.Size = new System.Drawing.Size(191, 35);
this.btn_FlipEquip.TabIndex = 2;
......@@ -96,6 +97,7 @@ namespace TheMachine
this.panel1.Controls.Add(this.cylinderButton3);
this.panel1.Controls.Add(this.cylinderButton14);
this.panel1.Controls.Add(this.cylinderButton4);
this.panel1.Controls.Add(this.cylinderButton9);
this.panel1.Controls.Add(this.cylinderButton16);
this.panel1.Controls.Add(this.cylinderButton7);
this.panel1.Controls.Add(this.cylinderButton15);
......@@ -112,7 +114,7 @@ namespace TheMachine
//
this.button10.BackColor = System.Drawing.Color.White;
this.button10.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button10.Location = new System.Drawing.Point(739, 679);
this.button10.Location = new System.Drawing.Point(739, 720);
this.button10.Name = "button10";
this.button10.Size = new System.Drawing.Size(191, 35);
this.button10.TabIndex = 6;
......@@ -124,7 +126,7 @@ namespace TheMachine
//
this.button9.BackColor = System.Drawing.Color.White;
this.button9.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button9.Location = new System.Drawing.Point(542, 679);
this.button9.Location = new System.Drawing.Point(542, 720);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(191, 35);
this.button9.TabIndex = 6;
......@@ -136,7 +138,7 @@ namespace TheMachine
//
this.button8.BackColor = System.Drawing.Color.White;
this.button8.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button8.Location = new System.Drawing.Point(542, 638);
this.button8.Location = new System.Drawing.Point(542, 679);
this.button8.Name = "button8";
this.button8.Size = new System.Drawing.Size(191, 35);
this.button8.TabIndex = 5;
......@@ -148,7 +150,7 @@ namespace TheMachine
//
this.button4.BackColor = System.Drawing.Color.White;
this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button4.Location = new System.Drawing.Point(739, 556);
this.button4.Location = new System.Drawing.Point(739, 597);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(191, 35);
this.button4.TabIndex = 3;
......@@ -160,7 +162,7 @@ namespace TheMachine
//
this.button7.BackColor = System.Drawing.Color.White;
this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button7.Location = new System.Drawing.Point(739, 597);
this.button7.Location = new System.Drawing.Point(739, 638);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(191, 35);
this.button7.TabIndex = 4;
......@@ -172,7 +174,7 @@ namespace TheMachine
//
this.button6.BackColor = System.Drawing.Color.White;
this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button6.Location = new System.Drawing.Point(542, 597);
this.button6.Location = new System.Drawing.Point(542, 638);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(191, 35);
this.button6.TabIndex = 4;
......@@ -184,7 +186,7 @@ namespace TheMachine
//
this.button5.BackColor = System.Drawing.Color.White;
this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button5.Location = new System.Drawing.Point(542, 556);
this.button5.Location = new System.Drawing.Point(542, 597);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(191, 35);
this.button5.TabIndex = 4;
......@@ -196,7 +198,7 @@ namespace TheMachine
//
this.button1.BackColor = System.Drawing.Color.White;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(739, 474);
this.button1.Location = new System.Drawing.Point(739, 515);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(191, 35);
this.button1.TabIndex = 2;
......@@ -208,7 +210,7 @@ namespace TheMachine
//
this.button3.BackColor = System.Drawing.Color.White;
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Location = new System.Drawing.Point(739, 515);
this.button3.Location = new System.Drawing.Point(739, 556);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(191, 35);
this.button3.TabIndex = 2;
......@@ -220,7 +222,7 @@ namespace TheMachine
//
this.button2.BackColor = System.Drawing.Color.White;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Location = new System.Drawing.Point(542, 515);
this.button2.Location = new System.Drawing.Point(542, 556);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(191, 35);
this.button2.TabIndex = 2;
......@@ -374,7 +376,7 @@ namespace TheMachine
this.cylinderButton16.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cylinderButton16.IO_HIGH = "Label_Vacuum";
this.cylinderButton16.IO_LOW = "";
this.cylinderButton16.Location = new System.Drawing.Point(739, 433);
this.cylinderButton16.Location = new System.Drawing.Point(542, 474);
this.cylinderButton16.Name = "cylinderButton16";
this.cylinderButton16.Size = new System.Drawing.Size(191, 35);
this.cylinderButton16.TabIndex = 1;
......@@ -449,6 +451,20 @@ namespace TheMachine
this.ioControl1.Tag = "not";
this.ioControl1.Load += new System.EventHandler(this.ioControl1_Load);
//
// cylinderButton9
//
this.cylinderButton9.BackColor = System.Drawing.Color.White;
this.cylinderButton9.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cylinderButton9.IO_HIGH = "Label_PasteBlow";
this.cylinderButton9.IO_LOW = "";
this.cylinderButton9.Location = new System.Drawing.Point(739, 474);
this.cylinderButton9.Name = "cylinderButton9";
this.cylinderButton9.Size = new System.Drawing.Size(191, 35);
this.cylinderButton9.TabIndex = 1;
this.cylinderButton9.Tag = "not";
this.cylinderButton9.Text = "Label_PasteBlow";
this.cylinderButton9.UseVisualStyleBackColor = false;
//
// IOControls
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......@@ -491,5 +507,6 @@ namespace TheMachine
private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.Button button10;
private CylinderButton cylinderButton9;
}
}
......@@ -39,53 +39,118 @@ namespace TheMachine
private void btn_FlipEquip_Click(object sender, EventArgs e)
{
var result = IsSafe();
if (!result.Item1)
{
MessageBox.Show(result.Item2);
return;
}
RobotManage.mainMachine.FlipEquip.LiftUp(null);
LogUtil.info("手动点击:FlipEquip.LiftUp");
}
private void button1_Click(object sender, EventArgs e)
{
var result = IsSafe();
if (!result.Item1)
{
MessageBox.Show(result.Item2);
return;
}
RobotManage.mainMachine.FlipEquip.LiftDown(null);
LogUtil.info("手动点击:FlipEquip.LiftDown");
}
private void button2_Click(object sender, EventArgs e)
{
var result = IsSafe();
if (!result.Item1)
{
MessageBox.Show(result.Item2);
return;
}
RobotManage.mainMachine.RotateEquip.TurnToEnd(true);
LogUtil.info("手动点击:RotateEquip.TurnToEnd 水平");
}
private void button3_Click(object sender, EventArgs e)
{
var result = IsSafe();
if (!result.Item1)
{
MessageBox.Show(result.Item2);
return;
}
RobotManage.mainMachine.RotateEquip.TurnToEnd(false);
LogUtil.info("手动点击:RotateEquip.TurnToEnd 垂直");
}
private void button5_Click(object sender, EventArgs e)
{
var result = IsSafe();
if (!result.Item1)
{
MessageBox.Show(result.Item2);
return;
}
RobotManage.mainMachine.TPMove.ToLow(null);
}
private void button4_Click(object sender, EventArgs e)
{
var result = IsSafe();
if (!result.Item1)
{
MessageBox.Show(result.Item2);
return;
}
RobotManage.mainMachine.TPMove.ToHigh(null);
}
private void button6_Click(object sender, EventArgs e)
{
var result = IsSafe();
if (!result.Item1)
{
MessageBox.Show(result.Item2);
return;
}
RobotManage.mainMachine.RotateEquip.TurnDegree(45);
}
private void button7_Click(object sender, EventArgs e)
{
var result = IsSafe();
if (!result.Item1)
{
MessageBox.Show(result.Item2);
return;
}
RobotManage.mainMachine.RotateEquip.TurnDegree(-45);
}
private void button8_Click(object sender, EventArgs e)
{
var result = IsSafe();
if (!result.Item1)
{
MessageBox.Show(result.Item2);
return;
}
RobotManage.mainMachine.RotateEquip.TurnRound();
}
public (bool,string) IsSafe() {
if (RobotManage.isRunning)
return (false, "Device is in automatic");
if (!RobotManage.mainMachine.IsAllDoorClosed())
return (false, "Safe door was not closed");
return (true, "");
}
private void button9_Click(object sender, EventArgs e)
{
var r= RobotManage.RFID.ReOpen();
......
......@@ -25,6 +25,8 @@ namespace TheMachine
[STAThread]
static void Main()
{
CameraPointTest.Init();
CameraPointTest.TestHasLabelOnDock(true);
//CameraPointTest.ScanRectangle();
......
......@@ -38,17 +38,19 @@ namespace TheMachine
this.btn_printertest = new System.Windows.Forms.Button();
this.btn_labeledit = new System.Windows.Forms.Button();
this.cb_labelselect = new System.Windows.Forms.ComboBox();
this.tabPage_ledtower = new System.Windows.Forms.TabPage();
this.tp = new System.Windows.Forms.TableLayoutPanel();
this.lbl_Liquidstatus = new System.Windows.Forms.Label();
this.chbAutoRun = new System.Windows.Forms.CheckBox();
this.tp = new System.Windows.Forms.TableLayoutPanel();
this.tabPage_ledtower = new System.Windows.Forms.TabPage();
this.btn_testlabeling = new System.Windows.Forms.Button();
this.cb_labelingtestmoce = new System.Windows.Forms.CheckBox();
this.uC_SetUserPassword1 = new TheMachine.UC_SetUserPassword();
this.uC_LedConfig1 = new TheMachine.UC.UC_LedConfig();
this.tabControl1.SuspendLayout();
this.tabPage_set.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPage_ledtower.SuspendLayout();
this.tp.SuspendLayout();
this.tabPage_ledtower.SuspendLayout();
this.SuspendLayout();
//
// timer1
......@@ -69,6 +71,8 @@ namespace TheMachine
//
// tabPage_set
//
this.tabPage_set.Controls.Add(this.cb_labelingtestmoce);
this.tabPage_set.Controls.Add(this.btn_testlabeling);
this.tabPage_set.Controls.Add(this.groupBox1);
this.tabPage_set.Controls.Add(this.uC_SetUserPassword1);
this.tabPage_set.Controls.Add(this.tp);
......@@ -131,16 +135,29 @@ namespace TheMachine
this.cb_labelselect.Size = new System.Drawing.Size(198, 20);
this.cb_labelselect.TabIndex = 0;
//
// tabPage_ledtower
// tp
//
this.tabPage_ledtower.Controls.Add(this.uC_LedConfig1);
this.tabPage_ledtower.Location = new System.Drawing.Point(4, 22);
this.tabPage_ledtower.Name = "tabPage_ledtower";
this.tabPage_ledtower.Padding = new System.Windows.Forms.Padding(3);
this.tabPage_ledtower.Size = new System.Drawing.Size(1016, 714);
this.tabPage_ledtower.TabIndex = 1;
this.tabPage_ledtower.Text = "灯塔设置";
this.tabPage_ledtower.UseVisualStyleBackColor = true;
this.tp.AutoSize = true;
this.tp.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tp.ColumnCount = 2;
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.Controls.Add(this.chbAutoRun, 0, 7);
this.tp.Controls.Add(this.lbl_Liquidstatus, 0, 4);
this.tp.Location = new System.Drawing.Point(18, 18);
this.tp.Name = "tp";
this.tp.RowCount = 9;
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.Size = new System.Drawing.Size(136, 68);
this.tp.TabIndex = 6;
//
// lbl_Liquidstatus
//
......@@ -166,29 +183,38 @@ namespace TheMachine
this.chbAutoRun.Text = "开机自启动";
this.chbAutoRun.UseVisualStyleBackColor = true;
//
// tp
// tabPage_ledtower
//
this.tp.AutoSize = true;
this.tp.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tp.ColumnCount = 2;
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.Controls.Add(this.chbAutoRun, 0, 7);
this.tp.Controls.Add(this.lbl_Liquidstatus, 0, 4);
this.tp.Location = new System.Drawing.Point(18, 18);
this.tp.Name = "tp";
this.tp.RowCount = 9;
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.Size = new System.Drawing.Size(136, 68);
this.tp.TabIndex = 6;
this.tabPage_ledtower.Controls.Add(this.uC_LedConfig1);
this.tabPage_ledtower.Location = new System.Drawing.Point(4, 22);
this.tabPage_ledtower.Name = "tabPage_ledtower";
this.tabPage_ledtower.Padding = new System.Windows.Forms.Padding(3);
this.tabPage_ledtower.Size = new System.Drawing.Size(1016, 714);
this.tabPage_ledtower.TabIndex = 1;
this.tabPage_ledtower.Text = "灯塔设置";
this.tabPage_ledtower.UseVisualStyleBackColor = true;
//
// btn_testlabeling
//
this.btn_testlabeling.Enabled = false;
this.btn_testlabeling.Location = new System.Drawing.Point(18, 377);
this.btn_testlabeling.Name = "btn_testlabeling";
this.btn_testlabeling.Size = new System.Drawing.Size(201, 38);
this.btn_testlabeling.TabIndex = 13;
this.btn_testlabeling.Text = "Test the labeling once";
this.btn_testlabeling.UseVisualStyleBackColor = true;
this.btn_testlabeling.Click += new System.EventHandler(this.btn_testlabeling_Click);
//
// cb_labelingtestmoce
//
this.cb_labelingtestmoce.AutoSize = true;
this.cb_labelingtestmoce.Location = new System.Drawing.Point(18, 346);
this.cb_labelingtestmoce.Name = "cb_labelingtestmoce";
this.cb_labelingtestmoce.Size = new System.Drawing.Size(138, 16);
this.cb_labelingtestmoce.TabIndex = 14;
this.cb_labelingtestmoce.Text = "Labelling test mode";
this.cb_labelingtestmoce.UseVisualStyleBackColor = true;
this.cb_labelingtestmoce.CheckedChanged += new System.EventHandler(this.cb_labelingtestmoce_CheckedChanged);
//
// uC_SetUserPassword1
//
......@@ -220,9 +246,9 @@ namespace TheMachine
this.tabPage_set.ResumeLayout(false);
this.tabPage_set.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.tabPage_ledtower.ResumeLayout(false);
this.tp.ResumeLayout(false);
this.tp.PerformLayout();
this.tabPage_ledtower.ResumeLayout(false);
this.ResumeLayout(false);
}
......@@ -242,5 +268,7 @@ namespace TheMachine
private System.Windows.Forms.TableLayoutPanel tp;
private System.Windows.Forms.CheckBox chbAutoRun;
private System.Windows.Forms.Label lbl_Liquidstatus;
private System.Windows.Forms.Button btn_testlabeling;
private System.Windows.Forms.CheckBox cb_labelingtestmoce;
}
}
......@@ -166,5 +166,26 @@ namespace TheMachine
{
}
private void btn_testlabeling_Click(object sender, EventArgs e)
{
if (!RobotManage.isRunning || RobotManage.mainMachine.runStatus != RunStatus.Running) {
MessageBox.Show("Please start the device first and complete the home reset");
return;
}
if (RobotManage.mainMachine.LabelingMoveInfo.MoveStep!= MoveStep.Wait)
{
MessageBox.Show("Please wait for the labeling action to end");
return;
}
RobotManage.mainMachine.LabelingMoveInfo.NewMove(MoveStep.Labeling01);
RobotManage.mainMachine.LabelingMoveInfo.log("开始一次贴标测试");
}
private void cb_labelingtestmoce_CheckedChanged(object sender, EventArgs e)
{
RobotManage.mainMachine.LabelingTestMode=cb_labelingtestmoce.Checked;
btn_testlabeling.Enabled = cb_labelingtestmoce.Checked;
}
}
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ namespace TheMachine
using crc = OnlineStore.CodeResourceControl;
public class CylinderButton : Button
{
public static event Func<(bool,string)> IsSafe;
Timer timer;
public CylinderButton()
{
......@@ -142,6 +143,13 @@ namespace TheMachine
}
private void CylinderButton_Click(object sender, EventArgs e)
{
if (IsSafe != null) {
var result = IsSafe.Invoke();
if (!result.Item1) {
MessageBox.Show(result.Item2);
return;
}
}
if (io_state.Equals(IO_VALUE.LOW))
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!