|
@@ -1,19 +1,14 @@
|
|
using DevComponents.DotNetBar;
|
|
using DevComponents.DotNetBar;
|
|
|
|
+using FreeRedis;
|
|
|
|
+using MessagePack;
|
|
|
|
+using MessagePack.Resolvers;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
-using System.ComponentModel;
|
|
|
|
-using System.Data;
|
|
|
|
-using System.Drawing;
|
|
|
|
-using System.Linq;
|
|
|
|
-using FreeRedis;
|
|
|
|
using System.Runtime.InteropServices;
|
|
using System.Runtime.InteropServices;
|
|
-using System.Text;
|
|
|
|
using System.Windows.Forms;
|
|
using System.Windows.Forms;
|
|
using WCS_Client.Frm;
|
|
using WCS_Client.Frm;
|
|
using WCS_Client.UC;
|
|
using WCS_Client.UC;
|
|
using WCS_Client.Utility;
|
|
using WCS_Client.Utility;
|
|
-using MessagePack;
|
|
|
|
-using MessagePack.Resolvers;
|
|
|
|
|
|
|
|
namespace WCS_Client
|
|
namespace WCS_Client
|
|
{
|
|
{
|
|
@@ -24,8 +19,8 @@ namespace WCS_Client
|
|
InitializeComponent();
|
|
InitializeComponent();
|
|
InitFrm();
|
|
InitFrm();
|
|
WCS_Client.Frm.Current.InitData("wcs_pvc");
|
|
WCS_Client.Frm.Current.InitData("wcs_pvc");
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
private void InitFrm()
|
|
private void InitFrm()
|
|
{
|
|
{
|
|
#region 初始化任务栏
|
|
#region 初始化任务栏
|
|
@@ -39,21 +34,27 @@ namespace WCS_Client
|
|
case DayOfWeek.Sunday:
|
|
case DayOfWeek.Sunday:
|
|
sX = "日";
|
|
sX = "日";
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case DayOfWeek.Monday:
|
|
case DayOfWeek.Monday:
|
|
sX = "一";
|
|
sX = "一";
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case DayOfWeek.Tuesday:
|
|
case DayOfWeek.Tuesday:
|
|
sX = "二";
|
|
sX = "二";
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case DayOfWeek.Wednesday:
|
|
case DayOfWeek.Wednesday:
|
|
sX = "三";
|
|
sX = "三";
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case DayOfWeek.Thursday:
|
|
case DayOfWeek.Thursday:
|
|
sX = "四";
|
|
sX = "四";
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case DayOfWeek.Friday:
|
|
case DayOfWeek.Friday:
|
|
sX = "五";
|
|
sX = "五";
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case DayOfWeek.Saturday:
|
|
case DayOfWeek.Saturday:
|
|
sX = "六";
|
|
sX = "六";
|
|
break;
|
|
break;
|
|
@@ -61,12 +62,12 @@ namespace WCS_Client
|
|
}
|
|
}
|
|
catch
|
|
catch
|
|
{
|
|
{
|
|
-
|
|
|
|
}
|
|
}
|
|
Btn_LoginUserTime.Text = string.Format("【{0}】【{1}】【{2}】【星期{3}】", CurrentHelper.User.Use_Name, CurrentHelper.User.Use_RoleName, CurrentHelper.User.Use_LoginTime, sX);
|
|
Btn_LoginUserTime.Text = string.Format("【{0}】【{1}】【{2}】【星期{3}】", CurrentHelper.User.Use_Name, CurrentHelper.User.Use_RoleName, CurrentHelper.User.Use_LoginTime, sX);
|
|
Btn_Copyrignt.Text = "苏州博众精工科技有限公司版权所有";
|
|
Btn_Copyrignt.Text = "苏州博众精工科技有限公司版权所有";
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion 初始化任务栏
|
|
|
|
+
|
|
RefreshMenu();
|
|
RefreshMenu();
|
|
SetMdiForm("系统主页", "系统主页", typeof(FrmHome), false);
|
|
SetMdiForm("系统主页", "系统主页", typeof(FrmHome), false);
|
|
|
|
|
|
@@ -86,8 +87,8 @@ namespace WCS_Client
|
|
};
|
|
};
|
|
eqpData.init(Redis);
|
|
eqpData.init(Redis);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
private void RefreshMenu()
|
|
private void RefreshMenu()
|
|
{
|
|
{
|
|
try
|
|
try
|
|
@@ -100,7 +101,7 @@ namespace WCS_Client
|
|
}
|
|
}
|
|
AddMenu("", "MBtn_Task", "任务管理", null, null);
|
|
AddMenu("", "MBtn_Task", "任务管理", null, null);
|
|
AddMenu("", "MBtn_Monitor", "设备监控", null, null);
|
|
AddMenu("", "MBtn_Monitor", "设备监控", null, null);
|
|
- // AddMenu("", "MBtn_Sys", "系统管理", null, null);
|
|
|
|
|
|
+ AddMenu("", "MBtn_Sys", "系统管理", null, null);
|
|
AddMenu("", "MBtn_Help", "系统帮助", null, null);
|
|
AddMenu("", "MBtn_Help", "系统帮助", null, null);
|
|
|
|
|
|
//MBtn_File
|
|
//MBtn_File
|
|
@@ -113,7 +114,6 @@ namespace WCS_Client
|
|
if (CurrentHelper.User.Use_RoleId == 1)
|
|
if (CurrentHelper.User.Use_RoleId == 1)
|
|
{
|
|
{
|
|
AddMenu("MBtn_User", "MBtn_User_User", "用户管理", typeof(Frm.FrmUser), Btn_Click);
|
|
AddMenu("MBtn_User", "MBtn_User_User", "用户管理", typeof(Frm.FrmUser), Btn_Click);
|
|
- //AddMenu("MBtn_User", "MBtn_User_RoleUser", "用户权限", null, null);
|
|
|
|
}
|
|
}
|
|
//MBtn_Task
|
|
//MBtn_Task
|
|
AddMenu("MBtn_Task", "MBtn_CurrentTask", "当前任务管理", typeof(Frm.FrmWCS_Task), Btn_Click);
|
|
AddMenu("MBtn_Task", "MBtn_CurrentTask", "当前任务管理", typeof(Frm.FrmWCS_Task), Btn_Click);
|
|
@@ -121,17 +121,13 @@ namespace WCS_Client
|
|
AddMenu("MBtn_Task", "MBtn_AgvTask", "Agv任务查询", typeof(Frm.MBtn_AgvTask), Btn_Click);
|
|
AddMenu("MBtn_Task", "MBtn_AgvTask", "Agv任务查询", typeof(Frm.MBtn_AgvTask), Btn_Click);
|
|
AddMenu("MBtn_Task", "MBtn_AgvTask_Dis", "Agv历史任务查询", typeof(Frm.MBtn_AgvTaskDis.MBtn_AgvTask_Dis), Btn_Click);
|
|
AddMenu("MBtn_Task", "MBtn_AgvTask_Dis", "Agv历史任务查询", typeof(Frm.MBtn_AgvTaskDis.MBtn_AgvTask_Dis), Btn_Click);
|
|
////MBtn_Monitor
|
|
////MBtn_Monitor
|
|
- //AddMenu("MBtn_Monitor", "MBtn_SCANN", "扫码信息查询", typeof(Frm.MBtn_SCANN), Btn_Click);
|
|
|
|
- //AddMenu("MBtn_Monitor", "MBtn_EQUMsg", "设备信号查询", typeof(Frm.FrmEquMsg), Btn_Click);
|
|
|
|
- //AddMenu("MBtn_Monitor", "MBtn_ALARAMRE", "历史报警记录", typeof(Frm.Frm_ALARAMRE), Btn_Click);
|
|
|
|
- //AddMenu("MBtn_Monitor", "MBtn_ALARAMERStatistics", "历史报警记录统计", typeof(Frm.Frm_ALARAMERStatistics), Btn_Click);
|
|
|
|
|
|
+ AddMenu("MBtn_Monitor", "MBtn_SCANN", "扫码信息查询", typeof(Frm.MBtn_SCANN), Btn_Click);
|
|
|
|
+
|
|
AddMenu("MBtn_Monitor", "MBtn_Mont", "设备监控查看", typeof(Frm.Frm_YongGuanMontior), Btn_Click);
|
|
AddMenu("MBtn_Monitor", "MBtn_Mont", "设备监控查看", typeof(Frm.Frm_YongGuanMontior), Btn_Click);
|
|
|
|
|
|
//MBtn_Sys
|
|
//MBtn_Sys
|
|
- //AddMenu("MBtn_Sys", "MBtn_Interface_OPOrder", "日志管理", typeof(Frm.FrmLog), Btn_Click);
|
|
|
|
- //AddMenu("MBtn_Sys", "MBtn_Interface_OPUP", "系统设置", typeof(Frm.MBtn_Sys.FormSet), Btn_Click);
|
|
|
|
- //AddMenu("MBtn_Sys", "MBtn_Interface_SrmInfoSet", "堆垛机出入口配置", typeof(Frm.FrmSrmInfoSet), Btn_Click);
|
|
|
|
- //AddMenu("MBtn_Sys", "FrmPalletizingCode", "机械人码垛配置", typeof(Frm.FrmPalletizingCode), Btn_Click);
|
|
|
|
|
|
+ AddMenu("MBtn_Sys", "MBtn_Interface_OPOrder", "日志管理", typeof(Frm.FrmLog), Btn_Click);
|
|
|
|
+ AddMenu("MBtn_Sys", "MBtn_Interface_OPUP", "系统设置", typeof(Frm.MBtn_Sys.FormSet), Btn_Click);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
@@ -140,7 +136,8 @@ namespace WCS_Client
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- List<ButtonItem> mbtn = new List<ButtonItem>();
|
|
|
|
|
|
+ private List<ButtonItem> mbtn = new List<ButtonItem>();
|
|
|
|
+
|
|
private void AddMenu(string PBtnName, string BtnName, string DisplayText, Type t, System.EventHandler BtnItem_Click)
|
|
private void AddMenu(string PBtnName, string BtnName, string DisplayText, Type t, System.EventHandler BtnItem_Click)
|
|
{
|
|
{
|
|
ButtonItem BtnItem = mbtn.Find(a => a.Name == BtnName);
|
|
ButtonItem BtnItem = mbtn.Find(a => a.Name == BtnName);
|
|
@@ -191,8 +188,9 @@ namespace WCS_Client
|
|
Proc = null;
|
|
Proc = null;
|
|
}
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion [ 启动计算器 ]
|
|
}
|
|
}
|
|
|
|
+
|
|
#region [ API: 记事本 ]
|
|
#region [ API: 记事本 ]
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -222,7 +220,8 @@ namespace WCS_Client
|
|
/// </summary>
|
|
/// </summary>
|
|
public const uint WM_SETTEXT = 0x000C;
|
|
public const uint WM_SETTEXT = 0x000C;
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion [ API: 记事本 ]
|
|
|
|
+
|
|
private void Btn_Book_Click(object sender, EventArgs e)
|
|
private void Btn_Book_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
#region [ 启动记事本 ]
|
|
#region [ 启动记事本 ]
|
|
@@ -245,7 +244,7 @@ namespace WCS_Client
|
|
Proc = null;
|
|
Proc = null;
|
|
}
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion [ 启动记事本 ]
|
|
|
|
|
|
#region [ 传递数据给记事本 ]
|
|
#region [ 传递数据给记事本 ]
|
|
|
|
|
|
@@ -263,7 +262,7 @@ namespace WCS_Client
|
|
SendMessage(vHandle, WM_SETTEXT, 0, "");
|
|
SendMessage(vHandle, WM_SETTEXT, 0, "");
|
|
}
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion [ 传递数据给记事本 ]
|
|
}
|
|
}
|
|
|
|
|
|
private void Btn_SysReset_Click(object sender, EventArgs e)
|
|
private void Btn_SysReset_Click(object sender, EventArgs e)
|
|
@@ -276,6 +275,7 @@ namespace WCS_Client
|
|
{
|
|
{
|
|
Application.Exit();
|
|
Application.Exit();
|
|
}
|
|
}
|
|
|
|
+
|
|
private void Btn_Click(object sender, EventArgs e)
|
|
private void Btn_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
ButtonItem BtnItem = sender as ButtonItem;
|
|
ButtonItem BtnItem = sender as ButtonItem;
|
|
@@ -289,8 +289,8 @@ namespace WCS_Client
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
SetMdiForm(BtnItem.Name, BtnItem.Text, t, true);
|
|
SetMdiForm(BtnItem.Name, BtnItem.Text, t, true);
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
public void SetMdiForm(string TabName, string TabText, Type formType, bool CloseButtonVisible)
|
|
public void SetMdiForm(string TabName, string TabText, Type formType, bool CloseButtonVisible)
|
|
{
|
|
{
|
|
bool IsOpened = false;
|
|
bool IsOpened = false;
|
|
@@ -322,9 +322,7 @@ namespace WCS_Client
|
|
STab_Main.SelectedTab = tabItem;
|
|
STab_Main.SelectedTab = tabItem;
|
|
tabItem.CloseButtonVisible = CloseButtonVisible;
|
|
tabItem.CloseButtonVisible = CloseButtonVisible;
|
|
form.Dock = DockStyle.Fill;
|
|
form.Dock = DockStyle.Fill;
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|