Commit 438cc5b1 几米阳光

界面增加启用调试的处理

1 个父辈 502503f2
...@@ -234,7 +234,14 @@ namespace OnlineStore.AutoInOutStore ...@@ -234,7 +234,14 @@ namespace OnlineStore.AutoInOutStore
LoadOk = true; LoadOk = true;
cmbHomeType.SelectedIndex = 1; cmbHomeType.SelectedIndex = 1;
timer1.Start(); timer1.Start();
store.ResetEvent += Store_ResetEvent;
} }
private void Store_ResetEvent()
{
DebugStatus(false);
}
private DateTime preReadModblsTime = DateTime.Now; private DateTime preReadModblsTime = DateTime.Now;
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
...@@ -1265,17 +1272,6 @@ namespace OnlineStore.AutoInOutStore ...@@ -1265,17 +1272,6 @@ namespace OnlineStore.AutoInOutStore
int value = ACServerManager.GetHomeEndStatus(GetPortName(), GetSlaveAddr()); int value = ACServerManager.GetHomeEndStatus(GetPortName(), GetSlaveAddr());
this.txtHomeStatus.Text = value.ToString(); this.txtHomeStatus.Text = value.ToString();
} }
private void btnOpenWCF_Click(object sender, EventArgs e)
{
//WCFControl.OpenWCF();
}
private void btnCloseWCF_Click(object sender, EventArgs e)
{
//WCFControl.CloseWCF();
}
private void chbAuto_CheckedChanged(object sender, EventArgs e) private void chbAuto_CheckedChanged(object sender, EventArgs e)
{ {
if (!LoadOk) if (!LoadOk)
...@@ -1303,6 +1299,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1303,6 +1299,7 @@ namespace OnlineStore.AutoInOutStore
LogUtil.info("切换界面显示时,没有正确输入密码"); LogUtil.info("切换界面显示时,没有正确输入密码");
return; return;
} }
DebugStatus(false);
this.Visible = true; this.Visible = true;
this.WindowState = FormWindowState.Maximized; this.WindowState = FormWindowState.Maximized;
this.notifyIcon1.Visible = false; this.notifyIcon1.Visible = false;
...@@ -1320,7 +1317,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1320,7 +1317,7 @@ namespace OnlineStore.AutoInOutStore
{ {
stop_button_Click(null, null); stop_button_Click(null, null);
} }
store.Exit();
KNDManager.CloseAllDO(); KNDManager.CloseAllDO();
StoreOpenStatus(false); StoreOpenStatus(false);
KNDManager.CloseAllConnection(); KNDManager.CloseAllConnection();
...@@ -1351,6 +1348,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1351,6 +1348,7 @@ namespace OnlineStore.AutoInOutStore
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.notifyIcon1.Visible = true; this.notifyIcon1.Visible = true;
this.Hide(); this.Hide();
DebugStatus(false);
} }
private void FrmStoreBox_FormClosed(object sender, FormClosedEventArgs e) private void FrmStoreBox_FormClosed(object sender, FormClosedEventArgs e)
{ {
...@@ -1674,5 +1672,32 @@ namespace OnlineStore.AutoInOutStore ...@@ -1674,5 +1672,32 @@ namespace OnlineStore.AutoInOutStore
{ {
KND.IOMove(IO_Type.DisableDoorControl, IO_VALUE.LOW); KND.IOMove(IO_Type.DisableDoorControl, IO_VALUE.LOW);
} }
private void 出入库调试ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (出入库调试ToolStripMenuItem.Text.Equals("启用调试"))
{
DebugStatus(true);
}
else
{
DebugStatus(false);
}
}
private void DebugStatus(bool status)
{
if (status)
{
出入库调试ToolStripMenuItem.Text = "禁用调试";
}
else
{
出入库调试ToolStripMenuItem.Text = "启用调试";
}
groupAxis.Enabled = status;
groupComAxis.Enabled = status;
groupInout.Enabled = status;
}
} }
} }
...@@ -64,7 +64,10 @@ namespace OnlineStore.Common ...@@ -64,7 +64,10 @@ namespace OnlineStore.Common
/// </summary> /// </summary>
public static void Release() public static void Release()
{ {
if (sb != null)
{
sb.closePort(); sb.closePort();
}
IsRun = false; IsRun = false;
} }
public static ASTemperateParam LastData = new ASTemperateParam(0, 0); public static ASTemperateParam LastData = new ASTemperateParam(0, 0);
......
...@@ -16,6 +16,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,6 +16,8 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public partial class AC_SA_BoxBean : AC_Store public partial class AC_SA_BoxBean : AC_Store
{ {
public delegate void ResetDelegate();
public event ResetDelegate ResetEvent;
private bool IsIntSlvBlock = false; private bool IsIntSlvBlock = false;
//public bool UseBatchInout = true; //public bool UseBatchInout = true;
public string CID = ""; public string CID = "";
...@@ -268,6 +270,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -268,6 +270,7 @@ namespace OnlineStore.DeviceLibrary
#region 原点返回和复位处理 #region 原点返回和复位处理
private void ReturnHome() private void ReturnHome()
{ {
ResetEvent?.Invoke();
WarnMsg = ""; WarnMsg = "";
CurrInOutACount = 0; CurrInOutACount = 0;
CurrInOutCount = 0; CurrInOutCount = 0;
...@@ -305,6 +308,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -305,6 +308,7 @@ namespace OnlineStore.DeviceLibrary
/// <param name="isNeedClearAuto">是否需要清理自动出入库</param> /// <param name="isNeedClearAuto">是否需要清理自动出入库</param>
public void Reset(bool isNeedClearAuto) public void Reset(bool isNeedClearAuto)
{ {
ResetEvent?.Invoke();
CurrInOutCount = 0; CurrInOutCount = 0;
CurrInOutACount = 0; CurrInOutACount = 0;
...@@ -753,7 +757,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -753,7 +757,7 @@ namespace OnlineStore.DeviceLibrary
StopMove(true); StopMove(true);
storeRunStatus = StoreRunStatus.Wait; storeRunStatus = StoreRunStatus.Wait;
mainTimer.Enabled = false; //mainTimer.Enabled = false;
AutomaticBaiting.StopRun(); AutomaticBaiting.StopRun();
KNDManager.CloseAllDO(); KNDManager.CloseAllDO();
if (IsHasCompress_Axis) if (IsHasCompress_Axis)
...@@ -764,7 +768,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -764,7 +768,14 @@ namespace OnlineStore.DeviceLibrary
StoreManager.CurrInOutType = 0; StoreManager.CurrInOutType = 0;
LogUtil.info(LOGGER, StoreName + ",停止运行,总运行时间:" + runTimeWatch.Elapsed.ToString()); LogUtil.info(LOGGER, StoreName + ",停止运行,总运行时间:" + runTimeWatch.Elapsed.ToString());
} }
public void Exit()
{
if (!storeRunStatus.Equals(StoreRunStatus.Wait))
{
StopRun();
}
mainTimer.Enabled = false;
}
public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType) public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
{ {
SaveAlarmInfo(alarmType, alarmDetial, alarmMsg, storeMoveType); SaveAlarmInfo(alarmType, alarmDetial, alarmMsg, storeMoveType);
...@@ -1338,6 +1349,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1338,6 +1349,7 @@ namespace OnlineStore.DeviceLibrary
temp = param.Temperate; temp = param.Temperate;
currTempStr = ("当前湿度:" + humidity.ToString() + ",当前温度:" + temp); currTempStr = ("当前湿度:" + humidity.ToString() + ",当前温度:" + temp);
} }
//LogUtil.info(currTempStr);
//double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList()); //double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
double currMaxHumidity = param.Humidity; double currMaxHumidity = param.Humidity;
float startBlowHumidity = Max_Humidity - StartBlowValue; float startBlowHumidity = Max_Humidity - StartBlowValue;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!