This commit is contained in:
gongxh
2022-05-19 13:16:37 +08:00
parent 972124f446
commit f5190d70ce
2 changed files with 17 additions and 9 deletions

View File

@@ -97,10 +97,12 @@ namespace CleanMachineHMI
// GlobalHelper.RoleMenuPermission = LeadDbHelperSQLite.Query(sql).Tables[0]; // GlobalHelper.RoleMenuPermission = LeadDbHelperSQLite.Query(sql).Tables[0];
Global.RoleMenuPermission = new CleanMachine.BLL.SYS.RoleMenuPermissionBLL().GetList(_user.RoleId).ToList(); Global.RoleMenuPermission = new CleanMachine.BLL.SYS.RoleMenuPermissionBLL().GetList(_user.RoleId).ToList();
if (Global.MainFormNew == null)
{
Global.MainFormNew = new frmMainNew(); Global.MainFormNew = new frmMainNew();
}
Global.MainFormNew.Show(); Global.MainFormNew.Show();
} }
else else
{ {

View File

@@ -172,8 +172,11 @@ namespace CleanMachineHMI
private void frmMainNew_Load(object sender, EventArgs e) private void frmMainNew_Load(object sender, EventArgs e)
{ {
#if RELEASE
try try
{ {
#endif
this.SetFormControlText(); this.SetFormControlText();
SwitchFrmMenu = new dlgSwitchFrmMenu(AddFrmMenuPage); SwitchFrmMenu = new dlgSwitchFrmMenu(AddFrmMenuPage);
@@ -309,11 +312,14 @@ namespace CleanMachineHMI
RemoveMaintainingFlag = new dlgShowMessage(ClearMaintainingFlag); RemoveMaintainingFlag = new dlgShowMessage(ClearMaintainingFlag);
timer.Enabled = true; timer.Enabled = true;
InitControl(); InitControl();
#if RELEASE
} }
catch (Exception ex) catch (Exception ex)
{ {
KryptonMessageBox.Show(ex.Message); KryptonMessageBox.Show(ex.Message);
} }
#endif
} }
private void ClearMaintainingFlag() private void ClearMaintainingFlag()
{ {
@@ -518,7 +524,7 @@ namespace CleanMachineHMI
#region 线程执行函数 #region 线程执行函数
private void RefreshPlcItem_M() private void RefreshPlcItem_M()
{ {
while (Global.SysThIsRunFlag) while (Global.SysThIsRunFlag)
@@ -572,7 +578,7 @@ namespace CleanMachineHMI
try try
{ {
#endif #endif
#region 定时器运行函数 #region 定时器运行函数
//当前托报废率超过10%,则提示 //当前托报废率超过10%,则提示
string sql_CurrPalletmsg = $@"SELECT * FROM CM_WORKING_PALLET WHERE WORKING_STATUS = 0"; string sql_CurrPalletmsg = $@"SELECT * FROM CM_WORKING_PALLET WHERE WORKING_STATUS = 0";
DataTable dt_CurrPalletmsg = LeadDbHelperSQLite.Query(sql_CurrPalletmsg).Tables[0]; DataTable dt_CurrPalletmsg = LeadDbHelperSQLite.Query(sql_CurrPalletmsg).Tables[0];
@@ -750,16 +756,16 @@ namespace CleanMachineHMI
//} //}
#region 定期清理历史业务数据 -- 数据保存2个月 #region 定期清理历史业务数据 -- 数据保存2个月
//string sqlZbkWorkingPallet = $@"DELETE FROM ZBK_WORKING_PALLET WHERE julianday('now') - julianday(UPDATE_TIME) > 30"; //string sqlZbkWorkingPallet = $@"DELETE FROM ZBK_WORKING_PALLET WHERE julianday('now') - julianday(UPDATE_TIME) > 30";
//string sqlZbkWorkingPalletDtl = $@"DELETE FROM ZBK_WORKING_PALLET_DTL WHERE julianday('now') - julianday(UPDATE_TIME) > 30"; //string sqlZbkWorkingPalletDtl = $@"DELETE FROM ZBK_WORKING_PALLET_DTL WHERE julianday('now') - julianday(UPDATE_TIME) > 30";
//LeadDbHelperSQLite.Execute(sqlZbkWorkingPallet); //LeadDbHelperSQLite.Execute(sqlZbkWorkingPallet);
//LeadDbHelperSQLite.Execute(sqlZbkWorkingPalletDtl); //LeadDbHelperSQLite.Execute(sqlZbkWorkingPalletDtl);
#endregion #endregion
// PlcOperationHelper.Instance.HeartbeatDetection(); // PlcOperationHelper.Instance.HeartbeatDetection();
ShowWarningMsg(); ShowWarningMsg();
#endregion #endregion
#if RELEASE #if RELEASE
} }
@@ -771,7 +777,7 @@ namespace CleanMachineHMI
Thread.Sleep(500); Thread.Sleep(500);
} }
} }
#endregion #endregion
private void Test() private void Test()
{ {