Commit 438cc5b1 几米阳光

界面增加启用调试的处理

1 个父辈 502503f2
......@@ -234,7 +234,14 @@ namespace OnlineStore.AutoInOutStore
LoadOk = true;
cmbHomeType.SelectedIndex = 1;
timer1.Start();
store.ResetEvent += Store_ResetEvent;
}
private void Store_ResetEvent()
{
DebugStatus(false);
}
private DateTime preReadModblsTime = DateTime.Now;
private void timer1_Tick(object sender, EventArgs e)
{
......@@ -1264,18 +1271,7 @@ namespace OnlineStore.AutoInOutStore
{
int value = ACServerManager.GetHomeEndStatus(GetPortName(), GetSlaveAddr());
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)
{
if (!LoadOk)
......@@ -1303,6 +1299,7 @@ namespace OnlineStore.AutoInOutStore
LogUtil.info("切换界面显示时,没有正确输入密码");
return;
}
DebugStatus(false);
this.Visible = true;
this.WindowState = FormWindowState.Maximized;
this.notifyIcon1.Visible = false;
......@@ -1320,7 +1317,7 @@ namespace OnlineStore.AutoInOutStore
{
stop_button_Click(null, null);
}
store.Exit();
KNDManager.CloseAllDO();
StoreOpenStatus(false);
KNDManager.CloseAllConnection();
......@@ -1351,6 +1348,7 @@ namespace OnlineStore.AutoInOutStore
this.ShowInTaskbar = false;
this.notifyIcon1.Visible = true;
this.Hide();
DebugStatus(false);
}
private void FrmStoreBox_FormClosed(object sender, FormClosedEventArgs e)
{
......@@ -1673,6 +1671,33 @@ namespace OnlineStore.AutoInOutStore
private void toolStripMenuItem5_Click(object sender, EventArgs e)
{
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
/// </summary>
public static void Release()
{
sb.closePort();
if (sb != null)
{
sb.closePort();
}
IsRun = false;
}
public static ASTemperateParam LastData = new ASTemperateParam(0, 0);
......
......@@ -16,6 +16,8 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public partial class AC_SA_BoxBean : AC_Store
{
public delegate void ResetDelegate();
public event ResetDelegate ResetEvent;
private bool IsIntSlvBlock = false;
//public bool UseBatchInout = true;
public string CID = "";
......@@ -268,6 +270,7 @@ namespace OnlineStore.DeviceLibrary
#region 原点返回和复位处理
private void ReturnHome()
{
ResetEvent?.Invoke();
WarnMsg = "";
CurrInOutACount = 0;
CurrInOutCount = 0;
......@@ -305,6 +308,7 @@ namespace OnlineStore.DeviceLibrary
/// <param name="isNeedClearAuto">是否需要清理自动出入库</param>
public void Reset(bool isNeedClearAuto)
{
ResetEvent?.Invoke();
CurrInOutCount = 0;
CurrInOutACount = 0;
......@@ -345,7 +349,7 @@ namespace OnlineStore.DeviceLibrary
LocationDownAndWait();
}
AutomaticBaiting.Reset(false );
isInPro = false;
isInPro = false;
}
private void InoutStartReset()
{
......@@ -753,7 +757,7 @@ namespace OnlineStore.DeviceLibrary
StopMove(true);
storeRunStatus = StoreRunStatus.Wait;
mainTimer.Enabled = false;
//mainTimer.Enabled = false;
AutomaticBaiting.StopRun();
KNDManager.CloseAllDO();
if (IsHasCompress_Axis)
......@@ -764,7 +768,14 @@ namespace OnlineStore.DeviceLibrary
StoreManager.CurrInOutType = 0;
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)
{
SaveAlarmInfo(alarmType, alarmDetial, alarmMsg, storeMoveType);
......@@ -1338,6 +1349,7 @@ namespace OnlineStore.DeviceLibrary
temp = param.Temperate;
currTempStr = ("当前湿度:" + humidity.ToString() + ",当前温度:" + temp);
}
//LogUtil.info(currTempStr);
//double currMaxHumidity = HumitureServer.GetMaxHumidity(Config.GetTempAddrList());
double currMaxHumidity = param.Humidity;
float startBlowHumidity = Max_Humidity - StartBlowValue;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!