Commit 14ed3bc3 张东亮

暂停改为按钮

1 个父辈 66a61cc9
...@@ -1064,8 +1064,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -1064,8 +1064,6 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
#region 门禁 #region 门禁
//门禁状态:0正常。1=安全门禁打开,已停止运动
private int CurDoorLimitState = 0;
protected void DoorLimitProcess() protected void DoorLimitProcess()
{ {
try try
...@@ -1078,9 +1076,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1078,9 +1076,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
//if (CurDoorLimitState.Equals(0))
{
if (StoreManager.DisBoxDoorLimit) if (StoreManager.DisBoxDoorLimit)
{ {
} }
...@@ -1092,16 +1088,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -1092,16 +1088,15 @@ namespace OnlineStore.DeviceLibrary
{ {
SecurityAccessStop("后门门禁"); SecurityAccessStop("后门门禁");
} }
}
//else
if (CurDoorLimitState.Equals(1))
{
if (IOValue(IO_Type.FrontDoor_Limit).Equals(IO_VALUE.HIGH) && if (IOValue(IO_Type.FrontDoor_Limit).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.BackDoor_Limit).Equals(IO_VALUE.HIGH)) IOValue(IO_Type.BackDoor_Limit).Equals(IO_VALUE.HIGH))
{ {
SecurityAccessReset(); SecurityAccessReset();
} }
}
} }
catch (Exception ex) catch (Exception ex)
...@@ -1121,16 +1116,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -1121,16 +1116,12 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
CurDoorLimitState = 1; if(!MoveStop)
if (alarmType > (AlarmType.IoSingleTimeOut))
{ {
return; MoveStop = true;
SetWarnMsg($"{doorname}被打开,{Name}暂停运动");
} }
//LogUtil.info($"{Name} {doorname}被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},暂停运动");
MoveStop = true;
SetWarnMsg($"{doorname}被打开,{Name}暂停运动");
//Alarm(AlarmType.SuddenStop);
} }
...@@ -1144,17 +1135,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -1144,17 +1135,10 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
CurDoorLimitState = 0;
//MoveStop = false;
if (WarnMsg.Contains("暂停运动")) if (WarnMsg.Contains("暂停运动"))
{ {
SetWarnMsg(""); SetWarnMsg("");
} }
if (alarmType > (AlarmType.IoSingleTimeOut))
{
return;
}
//光栅恢复处理
} }
#endregion #endregion
......
...@@ -18,42 +18,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -18,42 +18,13 @@ namespace OnlineStore.DeviceLibrary
{ {
public const string boxACamName = "box_A"; public const string boxACamName = "box_A";
public const string boxBCamName = "box_B"; public const string boxBCamName = "box_B";
Thread[] camerathread;
bool IsOpen = false;
Asa.Camera.VisionLib camera;
bool loadCameraState = false;
public delegate void CameraAcqEventHandler(CameraArgs cameraArgs); public delegate void CameraAcqEventHandler(CameraArgs cameraArgs);
public event CameraAcqEventHandler camera_event; public event CameraAcqEventHandler camera_event;
public void RegisterCameraGrabImage(CameraAcqEventHandler grabbedEventHandler)
{
//camera_event += grabbedEventHandler;
}
void LoadCameraConfig(object boxA, object boxB) void LoadCameraConfig(object boxA, object boxB)
{ {
//Task.Factory.StartNew(new Action(() =>
//{
// if (loadCameraState)
// return;
// string path = @".\Config\Camera.json";
// if (!File.Exists(path))
// {
// LogUtil.error(Name + "找不到监控相机配置文件" + path);
// }
// camera = new Asa.Camera.VisionLib(path,true);
// camera.PreviewImage(boxACamName, (IntPtr)boxA);
// camera.PreviewImage(boxBCamName, (IntPtr)boxB);
// camera.Open();
// loadCameraState = true;
//}));
} }
public Bitmap AcqImage(string camName)
{
Bitmap bitmap = camera.GetImage(camName);
return bitmap;
}
public void StartRecord(string boxAFileName,string boxBFileName) public void StartRecord(string boxAFileName,string boxBFileName)
{ {
StartBoxARecord(boxAFileName); StartBoxARecord(boxAFileName);
......
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
this.lblMoveInfo = new System.Windows.Forms.Label(); this.lblMoveInfo = new System.Windows.Forms.Label();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.panBase = new System.Windows.Forms.Panel(); this.panBase = new System.Windows.Forms.Panel();
this.btnMoveStop = new System.Windows.Forms.Button();
this.btnHlhasReel = new System.Windows.Forms.Button(); this.btnHlhasReel = new System.Windows.Forms.Button();
this.btnDebugAxis = new System.Windows.Forms.Button(); this.btnDebugAxis = new System.Windows.Forms.Button();
this.chbMoveStop = new System.Windows.Forms.CheckBox();
this.lblName = new System.Windows.Forms.Label(); this.lblName = new System.Windows.Forms.Label();
this.chbDebug = new System.Windows.Forms.CheckBox(); this.chbDebug = new System.Windows.Forms.CheckBox();
this.lblStoreStatus = new System.Windows.Forms.Label(); this.lblStoreStatus = new System.Windows.Forms.Label();
...@@ -437,9 +437,9 @@ ...@@ -437,9 +437,9 @@
this.panBase.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.panBase.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panBase.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panBase.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panBase.Controls.Add(this.btnMoveStop);
this.panBase.Controls.Add(this.btnHlhasReel); this.panBase.Controls.Add(this.btnHlhasReel);
this.panBase.Controls.Add(this.btnDebugAxis); this.panBase.Controls.Add(this.btnDebugAxis);
this.panBase.Controls.Add(this.chbMoveStop);
this.panBase.Controls.Add(this.lblName); this.panBase.Controls.Add(this.lblName);
this.panBase.Controls.Add(this.chbDebug); this.panBase.Controls.Add(this.chbDebug);
this.panBase.Controls.Add(this.lblStoreStatus); this.panBase.Controls.Add(this.lblStoreStatus);
...@@ -450,6 +450,19 @@ ...@@ -450,6 +450,19 @@
this.panBase.Size = new System.Drawing.Size(997, 50); this.panBase.Size = new System.Drawing.Size(997, 50);
this.panBase.TabIndex = 260; this.panBase.TabIndex = 260;
// //
// btnMoveStop
//
this.btnMoveStop.BackColor = System.Drawing.Color.White;
this.btnMoveStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMoveStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnMoveStop.Location = new System.Drawing.Point(572, 3);
this.btnMoveStop.Name = "btnMoveStop";
this.btnMoveStop.Size = new System.Drawing.Size(105, 40);
this.btnMoveStop.TabIndex = 290;
this.btnMoveStop.Text = "暂停运动";
this.btnMoveStop.UseVisualStyleBackColor = false;
this.btnMoveStop.Click += new System.EventHandler(this.btnMoveStop_Click);
//
// btnHlhasReel // btnHlhasReel
// //
this.btnHlhasReel.BackColor = System.Drawing.Color.SkyBlue; this.btnHlhasReel.BackColor = System.Drawing.Color.SkyBlue;
...@@ -476,18 +489,6 @@ ...@@ -476,18 +489,6 @@
this.btnDebugAxis.UseVisualStyleBackColor = false; this.btnDebugAxis.UseVisualStyleBackColor = false;
this.btnDebugAxis.Click += new System.EventHandler(this.btnDebugAxis_Click); this.btnDebugAxis.Click += new System.EventHandler(this.btnDebugAxis_Click);
// //
// chbMoveStop
//
this.chbMoveStop.AutoSize = true;
this.chbMoveStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbMoveStop.Location = new System.Drawing.Point(597, 14);
this.chbMoveStop.Name = "chbMoveStop";
this.chbMoveStop.Size = new System.Drawing.Size(104, 28);
this.chbMoveStop.TabIndex = 262;
this.chbMoveStop.Text = "暂停运动";
this.chbMoveStop.UseVisualStyleBackColor = true;
this.chbMoveStop.Click += new System.EventHandler(this.chbMoveStop_CheckedChanged);
//
// lblName // lblName
// //
this.lblName.BackColor = System.Drawing.Color.DodgerBlue; this.lblName.BackColor = System.Drawing.Color.DodgerBlue;
...@@ -504,7 +505,7 @@ ...@@ -504,7 +505,7 @@
// //
this.chbDebug.AutoSize = true; this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(496, 14); this.chbDebug.Location = new System.Drawing.Point(462, 13);
this.chbDebug.Name = "chbDebug"; this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(104, 28); this.chbDebug.Size = new System.Drawing.Size(104, 28);
this.chbDebug.TabIndex = 247; this.chbDebug.TabIndex = 247;
...@@ -611,7 +612,6 @@ ...@@ -611,7 +612,6 @@
private System.Windows.Forms.Label lblInoutInfo; private System.Windows.Forms.Label lblInoutInfo;
private System.Windows.Forms.TextBox txtSlaveId; private System.Windows.Forms.TextBox txtSlaveId;
protected System.Windows.Forms.Panel panBase; protected System.Windows.Forms.Panel panBase;
protected System.Windows.Forms.CheckBox chbMoveStop;
protected System.Windows.Forms.Label lblName; protected System.Windows.Forms.Label lblName;
protected System.Windows.Forms.CheckBox chbDebug; protected System.Windows.Forms.CheckBox chbDebug;
protected System.Windows.Forms.Label lblStoreStatus; protected System.Windows.Forms.Label lblStoreStatus;
...@@ -624,6 +624,7 @@ ...@@ -624,6 +624,7 @@
private System.Windows.Forms.Button btnHlhasReel; private System.Windows.Forms.Button btnHlhasReel;
private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
protected System.Windows.Forms.Button btnMoveStop;
} }
} }
...@@ -36,7 +36,6 @@ namespace OnlineStore.XLRStore ...@@ -36,7 +36,6 @@ namespace OnlineStore.XLRStore
} }
private void FrmStoreIOStatus_Load(object sender, EventArgs e) private void FrmStoreIOStatus_Load(object sender, EventArgs e)
{ {
chbMoveStop.Checked = boxBean.MoveStop;
lblStoreStatus.Text = DeviceBase.GetRunStr(boxBean.runStatus); lblStoreStatus.Text = DeviceBase.GetRunStr(boxBean.runStatus);
lblThisSta.Text = boxBean.WarnMsg; lblThisSta.Text = boxBean.WarnMsg;
...@@ -191,9 +190,15 @@ namespace OnlineStore.XLRStore ...@@ -191,9 +190,15 @@ namespace OnlineStore.XLRStore
{ {
FormStatus(true); FormStatus(true);
} }
if (boxBean.MoveStop != chbMoveStop.Checked) if (boxBean.MoveStop)
{ {
chbMoveStop.Checked= boxBean.MoveStop; btnMoveStop.Text = "恢复运动";
btnMoveStop.BackColor = Color.Green;
}
else
{
btnMoveStop.Text = "暂停运动";
btnMoveStop.BackColor = Color.Yellow;
} }
} }
else else
...@@ -477,20 +482,6 @@ namespace OnlineStore.XLRStore ...@@ -477,20 +482,6 @@ namespace OnlineStore.XLRStore
tabcon.Controls.Add(lineTabPage); tabcon.Controls.Add(lineTabPage);
} }
private void chbMoveStop_CheckedChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
if(boxBean.MoveStop == chbMoveStop.Checked)
{
return;
}
boxBean.MoveStop = chbMoveStop.Checked;
LogUtil.info(boxBean.Name + "用户切换是否暂停: " + boxBean.MoveStop);
}
private void btnDebugAxis_Click(object sender, EventArgs e) private void btnDebugAxis_Click(object sender, EventArgs e)
{ {
//boxBean.IsDebug //boxBean.IsDebug
...@@ -530,6 +521,17 @@ namespace OnlineStore.XLRStore ...@@ -530,6 +521,17 @@ namespace OnlineStore.XLRStore
{ {
boxBean.StopRecord(); boxBean.StopRecord();
} }
private void btnMoveStop_Click(object sender, EventArgs e)
{
if (boxBean.runStatus <= RunStatus.Wait)
{
MessageBox.Show(boxBean.Name + "请先启动设备", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
boxBean.MoveStop = !boxBean.MoveStop;
LogUtil.info(boxBean.Name + "用户切换是否暂停: " + boxBean.MoveStop);
}
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!