Commit 502c2435 张东亮

调试逻辑修改

1 个父辈 367d54f3
......@@ -48,6 +48,7 @@ namespace OnlineStore.XLRStore
FrmPosDebug frmPosDebug = new FrmPosDebug();
AddForm(tabControl1, " 库位调试 ", frmPosDebug);
boxBean.camera_event += BoxBean_camera_event;
btnDebugAxis.Enabled = !boxBean.IsDebug;
IsLoad = true;
}
/// <summary>
......@@ -398,6 +399,11 @@ namespace OnlineStore.XLRStore
}
private void btnStart_Click(object sender, EventArgs e)
{
if (boxBean.IsDebug)
{
MessageBox.Show("调试模式不允许启动!");
return;
}
if (boxBean.runStatus.Equals(RunStatus.Wait))
{
LogUtil.info(boxBean.Name + "点击:启用调试");
......@@ -448,8 +454,12 @@ namespace OnlineStore.XLRStore
{
if (!boxBean.IsDebug)
{
DialogResult result = MessageBox.Show("是否切换到调试状态?", "是否确认切换", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result.Equals(DialogResult.Yes))
if (!boxBean.runStatus.Equals(RunStatus.Wait))
{
MessageBox.Show("请先停止设备再切换为调试模式!");
chbDebug.Checked = false;
}
else
{
boxBean.IsDebug = true;
boxBean.Config.IsDebug = 1;
......@@ -457,10 +467,19 @@ namespace OnlineStore.XLRStore
boxBean.ChangeDebug(true);
LogUtil.info(boxBean.Name + "用户切换到调试状态 ");
}
else
{
chbDebug.Checked=false;
}
//DialogResult result = MessageBox.Show("是否切换到调试状态?", "是否确认切换", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
//if (result.Equals(DialogResult.Yes))
//{
// boxBean.IsDebug = true;
// boxBean.Config.IsDebug = 1;
// StoreManager.SaveBoxConfig(boxBean.Config);
// boxBean.ChangeDebug(true);
// LogUtil.info(boxBean.Name + "用户切换到调试状态 ");
//}
//else
//{
// chbDebug.Checked=false;
//}
}
}
else
......@@ -482,6 +501,7 @@ namespace OnlineStore.XLRStore
}
}
}
btnDebugAxis.Enabled = !boxBean.IsDebug;
}
protected void AddForm(TabControl tabcon, string text, Form form)
......@@ -518,7 +538,8 @@ namespace OnlineStore.XLRStore
private void btnDebugAxis_Click(object sender, EventArgs e)
{
//boxBean.IsDebug
if (boxBean.IsDebug)
return;
FrmPwd fw = new FrmPwd(10);
DialogResult result = fw.ShowDialog();
if (!result.Equals(DialogResult.OK))
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!