INT_PT002/INT_PT002/Forms/FormMenu.cs

871 lines
35 KiB
C#
Raw Normal View History

2023-02-09 08:20:49 +00:00
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections.ObjectModel;
2023-02-09 08:20:49 +00:00
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
2023-03-23 05:12:16 +00:00
using System.IO;
2023-02-09 08:20:49 +00:00
2023-03-23 05:12:16 +00:00
using SmartX;
2023-02-13 00:43:01 +00:00
using INT_PT002.Controls;
using INT_PT002.DataStore;
2023-03-23 05:12:16 +00:00
using INT_PT002.DialogForms;
2023-03-30 02:02:19 +00:00
using INT_PT002.Part11_UserManager;
2023-02-13 00:43:01 +00:00
2023-02-09 08:20:49 +00:00
namespace INT_PT002.Forms
{
public partial class FormMenu : Form
{
2023-02-13 00:43:01 +00:00
#region Field
private FormMain m_ParentForm;
2023-03-06 04:52:55 +00:00
// Recipe
2023-03-30 02:02:19 +00:00
private ControlMenuRecipeSetting Child_Recipe_Setting;
// User
2023-03-30 02:02:19 +00:00
private ControlMenuUserUserEditor Child_User_UserEditor;
private ControlMenuUserGroupEditor Child_User_GroupEditor;
2023-03-06 04:52:55 +00:00
// Manual
2023-03-30 02:02:19 +00:00
private ControlMenuManualIoTest Child_Manual_IoTest;
2023-03-06 04:52:55 +00:00
// Log
2023-03-30 02:02:19 +00:00
private ControlMenuLogHistory Child_Log_History;
private ControlMenuLogInspection Child_Log_Inspection;
private ControlMenuLogAlarm Child_Log_Alarm;
2023-03-06 04:52:55 +00:00
// System
2023-03-30 02:02:19 +00:00
private ControlMenuSystemInformation Child_System_Information;
private ControlMenuSystemStatus Child_System_Status;
public Define.E_TopMenuStore SelectedTopMenu;
public Define.E_MenuRecipeStore SelectedMenuRecipe;
public Define.E_MenuUserStore SelectedMenuUser;
public Define.E_MenuManualStore SelectedMenuManual;
public Define.E_MenuLogStore SelectedMenuLog;
public Define.E_MenuSystemStore SelectedMenuSystem;
2023-03-23 05:12:16 +00:00
private Queue<string> Q_FileList = new Queue<string>();
2023-02-13 00:43:01 +00:00
#endregion
#region Constructor
public FormMenu(FormMain parent)
2023-02-09 08:20:49 +00:00
{
InitializeComponent();
2023-02-13 00:43:01 +00:00
this.ParentForm = parent;
this.Initialize();
this.CreateChildControls();
}
#endregion
#region Property
public FormMain ParentForm
{
get { return this.m_ParentForm; }
private set { this.m_ParentForm = value; }
}
#endregion
#region Method
private void Initialize()
{
this.SelectedTopMenu = Define.E_TopMenuStore.Recipe;
2023-03-06 04:52:55 +00:00
this.SelectedMenuRecipe = Define.E_MenuRecipeStore._0_None;
this.SelectedMenuUser = Define.E_MenuUserStore._0_None;
2023-03-06 04:52:55 +00:00
this.SelectedMenuManual = Define.E_MenuManualStore._0_None;
this.SelectedMenuLog = Define.E_MenuLogStore._0_None;
this.SelectedMenuSystem = Define.E_MenuSystemStore._0_None;
2023-02-13 00:43:01 +00:00
}
private void CreateChildControls()
{
2023-03-06 04:52:55 +00:00
this.Child_Recipe_Setting = new ControlMenuRecipeSetting(this);
this.Child_User_UserEditor = new ControlMenuUserUserEditor(this);
this.Child_User_GroupEditor = new ControlMenuUserGroupEditor(this);
2023-03-06 04:52:55 +00:00
this.Child_Manual_IoTest = new ControlMenuManualIoTest(this);
this.Child_Log_History = new ControlMenuLogHistory(this);
this.Child_Log_Inspection = new ControlMenuLogInspection(this);
this.Child_Log_Alarm = new ControlMenuLogAlarm(this);
this.Child_System_Information = new ControlMenuSystemInformation(this);
2023-03-20 00:40:59 +00:00
this.Child_System_Status = new ControlMenuSystemStatus(this);
2023-03-06 04:52:55 +00:00
this.Controls.Add(this.Child_Recipe_Setting);
this.Controls.Add(this.Child_User_UserEditor);
this.Controls.Add(this.Child_User_GroupEditor);
2023-03-06 04:52:55 +00:00
this.Controls.Add(this.Child_Manual_IoTest);
this.Controls.Add(this.Child_Log_Alarm);
this.Controls.Add(this.Child_Log_History);
this.Controls.Add(this.Child_Log_Inspection);
this.Controls.Add(this.Child_System_Information);
2023-03-20 00:40:59 +00:00
this.Controls.Add(this.Child_System_Status);
2023-03-06 04:52:55 +00:00
this.Child_Recipe_Setting.Location = new Point(0, 39);
this.Child_User_UserEditor.Location = new Point(0, 39);
this.Child_User_GroupEditor.Location = new Point(0, 39);
2023-03-06 04:52:55 +00:00
this.Child_Manual_IoTest.Location = new Point(0, 39);
this.Child_Log_Alarm.Location = new Point(0, 39);
this.Child_Log_History.Location = new Point(0, 39);
this.Child_Log_Inspection.Location = new Point(0, 39);
this.Child_System_Information.Location = new Point(0, 39);
2023-03-20 00:40:59 +00:00
this.Child_System_Status.Location = new Point(0, 39);
2023-02-13 00:43:01 +00:00
}
private void UpdateDisplayUser(UserItem user)
{
string id = "", group = "";
2023-03-31 06:50:09 +00:00
switch (user.Status)
{
2023-03-31 06:50:09 +00:00
case Define.E_UserStatus.Level1:
id = user.ID;
group = "Level1";
this.buttonRecipe.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsRecipeEnable;
this.buttonUser.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsUserEnable;
this.buttonManual.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsManualEnable;
this.buttonLog.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsLogEnable;
this.buttonSystem.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsSystemEnable;
break;
2023-03-31 06:50:09 +00:00
case Define.E_UserStatus.Level2:
id = user.ID;
group = "Level2";
this.buttonRecipe.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsRecipeEnable;
this.buttonUser.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsUserEnable;
this.buttonManual.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsManualEnable;
this.buttonLog.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsLogEnable;
this.buttonSystem.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsSystemEnable;
break;
2023-03-31 06:50:09 +00:00
case Define.E_UserStatus.Level3:
id = user.ID;
group = "Level3";
this.buttonRecipe.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsRecipeEnable;
this.buttonUser.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsUserEnable;
this.buttonManual.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsManualEnable;
this.buttonLog.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsLogEnable;
this.buttonSystem.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsSystemEnable;
break;
2023-03-31 06:50:09 +00:00
case Define.E_UserStatus.Developer:
id = user.ID;
group = "Level4";
this.buttonRecipe.Enabled = true;
this.buttonUser.Enabled = true;
this.buttonManual.Enabled = true;
this.buttonLog.Enabled = true;
this.buttonSystem.Enabled = true;
//this.buttonHiddenMenu.Enabled = true;
break;
default:
id = "";
group = "Off";
this.buttonRecipe.Enabled = false;
this.buttonUser.Enabled = false;
this.buttonManual.Enabled = false;
this.buttonLog.Enabled = false;
2023-03-31 06:50:09 +00:00
this.buttonSystem.Enabled = false;
break;
}
if (this.labelUserLevel.Text != group)
this.labelUserLevel.Text = group;
if (this.labelUserID.Text != id)
this.labelUserID.Text = id;
}
2023-03-23 05:12:16 +00:00
#region Log
// FileCopy
private void FileCopy(Define.E_DataType type)
{
int count = 0;
string targetPath = "", destTargetPath = "", sourceFolderPath = "", sourceFilePath = "", destFilePath = "";
string[] result, dirFiles, folders;
2023-03-23 05:12:16 +00:00
DirectoryInfo dir;
FileInfo[] files;
try
{
#region USB 복사
targetPath = "하드 디스크\\";
// USB\SerialNumber\Inspection or Alarm or History
destTargetPath = string.Format("{0}{1}\\{2}\\", targetPath, this.ParentForm.SystemConfig.SERIAL_NUMBER, type);
2023-03-23 05:12:16 +00:00
// USB 폴더 체크 및 생성
dir = new DirectoryInfo(destTargetPath);
if (dir.Exists == false)
dir.Create();
switch(type)
{
case Define.E_DataType.Inspection:
sourceFolderPath = this.ParentForm.PathDataInspectionFolder;
break;
case Define.E_DataType.History:
sourceFolderPath = this.ParentForm.PathDataHistoryFolder;
break;
case Define.E_DataType.Alarm:
sourceFolderPath = this.ParentForm.PathDataAlarmFolder;
break;
default:
sourceFolderPath = this.ParentForm.PathDataInspectionFolder;
break;
}
//
dir = new DirectoryInfo(sourceFolderPath);
2023-03-23 05:12:16 +00:00
if (dir.Exists == false)
dir.Create();
2023-03-23 05:12:16 +00:00
files = dir.GetFiles();
count = files.Length;
foreach (FileInfo file in files)
{
result = file.FullName.Split('\\');
sourceFilePath = file.FullName;
destFilePath = string.Format("{0}{1}", destTargetPath, result[result.Length - 1]);
// 파일 중복 검사
if (File.Exists(destFilePath) == true)
{
DialogFormYesNo df = new DialogFormYesNo(this.ParentForm.SystemConfig.LANGUAGE, 31, Path.GetFileName(result[result.Length - 1]));
df.BringToFront();
if (df.ShowDialog() == DialogResult.Yes)
{
this.Refresh();
File.Delete(destFilePath); // 존재하는 파일 삭제
File.Copy(sourceFilePath, destFilePath);
}
else
{
count--;
this.Refresh();
}
}
else
{
File.Copy(sourceFilePath, destFilePath);
}
}
// 복사 완료 메시지
DialogFormMessage msg = new DialogFormMessage(count.ToString(), this.ParentForm.SystemConfig.LANGUAGE);
//this.SplashFinish();
2023-03-23 05:12:16 +00:00
msg.ShowDialog();
#endregion
}
catch
{
// 제조사에 문의하세요
DialogFormMessage msg = new DialogFormMessage(6, this.ParentForm.SystemConfig.LANGUAGE);
//this.SplashFinish();
2023-03-23 05:12:16 +00:00
msg.ShowDialog();
return;
}
}
public List<string> DirectorySort(DirectoryInfo[] directorys)
{
List<string> listDirectory = new List<string>();
Dictionary<string, int> dirNames = new Dictionary<string, int>();
foreach (DirectoryInfo dir in directorys)
dirNames.Add(dir.Name, int.Parse(dir.Name));
// 순서데로 오름차순 정렬
var vrList = dirNames.OrderBy(x => x.Value);
foreach (var v in vrList)
listDirectory.Add(v.Key);
return listDirectory;
}
private List<string> GetSeletedNodeList(TreeView tree)
{
int yearCNT, monthCNT, dayCNT;
List<string> listSelectedFile = new List<string>();
yearCNT = tree.Nodes.Count;
if (yearCNT != 0)
{
for (int i = 0; i < yearCNT; i++)
{
monthCNT = tree.Nodes[i].Nodes.Count;
if (monthCNT != 0)
{
for (int j = 0; j < monthCNT; j++)
{
dayCNT = tree.Nodes[i].Nodes[j].Nodes.Count;
if (dayCNT != 0)
{
for (int k = 0; k < dayCNT; k++)
{
if (tree.Nodes[i].Nodes[j].Nodes[k].Checked == true)
{
//listSelectedFile.Add(tree.Nodes[i].Nodes[j].Nodes[k].Text);
listSelectedFile.Add(string.Format("{0}\\{1}\\{2}", tree.Nodes[i].Text, tree.Nodes[i].Nodes[j].Text, tree.Nodes[i].Nodes[j].Nodes[k].Text));
}
}
}
}
}
}
}
return listSelectedFile;
}
#endregion
2023-02-13 00:43:01 +00:00
private void SetTopMenu(Define.E_TopMenuStore bottom)
{
switch (bottom)
{
case Define.E_TopMenuStore.Recipe:
this.buttonRecipe.ButtonDown();
this.buttonUser.ButtonUp();
2023-02-13 00:43:01 +00:00
this.buttonManual.ButtonUp();
this.buttonLog.ButtonUp();
this.buttonSystem.ButtonUp();
2023-03-06 04:52:55 +00:00
this.buttonBottom1.ButtonText = "Setting";
this.buttonBottom1.Visible = true;
2023-02-13 00:43:01 +00:00
this.buttonBottom2.Visible = false;
this.buttonBottom3.Visible = false;
this.buttonBottom4.Visible = false;
2023-03-06 04:52:55 +00:00
this.SelectedMenuRecipe = Define.E_MenuRecipeStore._1_Setting;
this.SetBottomMenuRecipe(this.SelectedMenuRecipe);
2023-02-13 00:43:01 +00:00
break;
case Define.E_TopMenuStore.User:
this.buttonRecipe.ButtonUp();
this.buttonUser.ButtonDown();
this.buttonManual.ButtonUp();
this.buttonLog.ButtonUp();
this.buttonSystem.ButtonUp();
this.buttonBottom1.ButtonText = "User Edit";
this.buttonBottom2.ButtonText = "Group Edit";
this.buttonBottom1.Visible = true;
2023-03-20 00:40:59 +00:00
this.buttonBottom2.Visible = true;
this.buttonBottom3.Visible = false;
this.buttonBottom4.Visible = false;
this.SelectedMenuUser = Define.E_MenuUserStore._1_UserEditor;
this.SetBottomMenuUser(this.SelectedMenuUser);
break;
2023-02-13 00:43:01 +00:00
case Define.E_TopMenuStore.Manual:
this.buttonRecipe.ButtonUp();
this.buttonUser.ButtonUp();
2023-02-13 00:43:01 +00:00
this.buttonManual.ButtonDown();
this.buttonLog.ButtonUp();
this.buttonSystem.ButtonUp();
this.buttonBottom1.ButtonText = "IO Test";
this.buttonBottom1.Visible = true;
2023-03-20 00:40:59 +00:00
this.buttonBottom2.Visible = false;
2023-02-13 00:43:01 +00:00
this.buttonBottom3.Visible = false;
this.buttonBottom4.Visible = false;
2023-03-06 04:52:55 +00:00
this.SelectedMenuManual = Define.E_MenuManualStore._1_IoTest;
this.SetBottomMenuManual(this.SelectedMenuManual);
2023-02-13 00:43:01 +00:00
break;
case Define.E_TopMenuStore.Log:
this.buttonRecipe.ButtonUp();
this.buttonUser.ButtonUp();
2023-02-13 00:43:01 +00:00
this.buttonManual.ButtonUp();
this.buttonLog.ButtonDown();
this.buttonSystem.ButtonUp();
2023-03-20 00:40:59 +00:00
this.buttonBottom1.ButtonText = "Inspection";
this.buttonBottom2.ButtonText = "History";
2023-02-13 00:43:01 +00:00
this.buttonBottom3.ButtonText = "Alarm";
this.buttonBottom1.Visible = true;
this.buttonBottom2.Visible = true;
this.buttonBottom3.Visible = true;
this.buttonBottom4.Visible = false;
2023-03-06 04:52:55 +00:00
2023-03-20 00:40:59 +00:00
this.SelectedMenuLog = Define.E_MenuLogStore._1_Inspection;
2023-03-06 04:52:55 +00:00
this.SetBottomMenuLog(this.SelectedMenuLog);
2023-02-13 00:43:01 +00:00
break;
case Define.E_TopMenuStore.System:
this.buttonRecipe.ButtonUp();
this.buttonUser.ButtonUp();
2023-02-13 00:43:01 +00:00
this.buttonManual.ButtonUp();
this.buttonLog.ButtonUp();
this.buttonSystem.ButtonDown();
this.buttonBottom1.ButtonText = "Information";
2023-03-31 01:47:21 +00:00
this.buttonBottom2.ButtonText = "Equipment";
2023-02-13 00:43:01 +00:00
this.buttonBottom1.Visible = true;
this.buttonBottom2.Visible = true;
2023-03-20 00:40:59 +00:00
this.buttonBottom3.Visible = false;
this.buttonBottom4.Visible = false;
2023-03-06 04:52:55 +00:00
this.SelectedMenuSystem = Define.E_MenuSystemStore._1_Information;
this.SetBottomMenuSystem(this.SelectedMenuSystem);
2023-02-13 00:43:01 +00:00
break;
default:
this.buttonBottom1.Visible = false;
this.buttonBottom2.Visible = false;
this.buttonBottom3.Visible = false;
this.buttonBottom4.Visible = false;
break;
}
}
private void SetBottomMenuRecipe(Define.E_MenuRecipeStore menu)
2023-03-06 04:52:55 +00:00
{
switch (menu)
{
case Define.E_MenuRecipeStore._0_None:
break;
case Define.E_MenuRecipeStore._1_Setting:
this.Child_Recipe_Setting.DisplayRefresh();
this.Child_Recipe_Setting.BringToFront();
this.buttonBottom1.ButtonDown();
this.buttonBottom2.ButtonUp();
this.buttonBottom3.ButtonUp();
this.buttonBottom4.ButtonUp();
break;
default:
break;
}
2023-02-13 00:43:01 +00:00
}
private void SetBottomMenuUser(Define.E_MenuUserStore menu)
{
switch (menu)
{
case Define.E_MenuUserStore._1_UserEditor:
this.Child_User_UserEditor.DisplayRefresh();
this.Child_User_UserEditor.BringToFront();
2023-03-06 04:52:55 +00:00
this.buttonBottom1.ButtonDown();
2023-03-06 04:52:55 +00:00
this.buttonBottom2.ButtonUp();
this.buttonBottom3.ButtonUp();
2023-03-06 04:52:55 +00:00
this.buttonBottom4.ButtonUp();
2023-02-13 00:43:01 +00:00
break;
case Define.E_MenuUserStore._2_GroupEditor:
this.Child_User_GroupEditor.DisplayRefresh();
this.Child_User_GroupEditor.BringToFront();
this.buttonBottom1.ButtonUp();
this.buttonBottom2.ButtonDown();
this.buttonBottom3.ButtonUp();
this.buttonBottom4.ButtonUp();
break;
2023-02-13 00:43:01 +00:00
default:
break;
}
}
private void SetBottomMenuManual(Define.E_MenuManualStore menu)
{
switch (menu)
{
2023-03-06 04:52:55 +00:00
case Define.E_MenuManualStore._1_IoTest:
this.Child_Manual_IoTest.DisplayRefresh();
this.Child_Manual_IoTest.BringToFront();
this.buttonBottom1.ButtonDown();
this.buttonBottom2.ButtonUp();
this.buttonBottom3.ButtonUp();
this.buttonBottom4.ButtonUp();
2023-02-13 00:43:01 +00:00
break;
default:
break;
}
}
private void SetBottomMenuLog(Define.E_MenuLogStore menu)
{
switch (menu)
{
2023-03-20 00:40:59 +00:00
case Define.E_MenuLogStore._1_Inspection:
this.Child_Log_Inspection.BringToFront();
this.Child_Log_Inspection.DisplayRefresh();
2023-03-06 04:52:55 +00:00
this.buttonBottom1.ButtonDown();
this.buttonBottom2.ButtonUp();
this.buttonBottom3.ButtonUp();
this.buttonBottom4.ButtonUp();
2023-02-13 00:43:01 +00:00
break;
2023-03-20 00:40:59 +00:00
case Define.E_MenuLogStore._2_History:
this.Child_Log_History.BringToFront();
this.Child_Log_History.DisplayRefresh();
2023-03-06 04:52:55 +00:00
this.buttonBottom1.ButtonUp();
this.buttonBottom2.ButtonDown();
this.buttonBottom3.ButtonUp();
this.buttonBottom4.ButtonUp();
2023-02-13 00:43:01 +00:00
break;
2023-03-06 04:52:55 +00:00
case Define.E_MenuLogStore._3_Alarm:
this.Child_Log_Alarm.BringToFront();
this.Child_Log_Alarm.DisplayRefresh();
2023-03-06 04:52:55 +00:00
this.buttonBottom1.ButtonUp();
this.buttonBottom2.ButtonUp();
this.buttonBottom3.ButtonDown();
this.buttonBottom4.ButtonUp();
2023-02-13 00:43:01 +00:00
break;
default:
break;
}
}
private void SetBottomMenuSystem(Define.E_MenuSystemStore menu)
{
switch (menu)
{
2023-03-06 04:52:55 +00:00
case Define.E_MenuSystemStore._1_Information:
this.Child_System_Information.DisplayRefresh();
this.Child_System_Information.BringToFront();
this.buttonBottom1.ButtonDown();
this.buttonBottom2.ButtonUp();
this.buttonBottom3.ButtonUp();
this.buttonBottom4.ButtonUp();
2023-02-13 00:43:01 +00:00
break;
2023-03-20 00:40:59 +00:00
case Define.E_MenuSystemStore._2_Status:
this.Child_System_Status.DisplayRefresh();
this.Child_System_Status.BringToFront();
2023-03-06 04:52:55 +00:00
this.buttonBottom1.ButtonUp();
this.buttonBottom2.ButtonDown();
this.buttonBottom3.ButtonUp();
this.buttonBottom4.ButtonUp();
2023-02-13 00:43:01 +00:00
break;
default:
break;
}
}
2023-03-31 01:47:21 +00:00
// Menu
public void UpdateEquipmentStatusDisplay(Define.E_EquipmentStatus status)
{
if (status == Define.E_EquipmentStatus.Start)
{
#region Start
this.labelStart.Visible = true;
this.labelStop.Visible = false;
#endregion
}
else
{
#region Stop
this.labelStart.Visible = false;
this.labelStop.Visible = true;
#endregion
}
}
public void Set_Equipment_ButtonEnable(bool data)
{
if (data == true)
{
this.buttonRecipe.Enabled = true;
this.buttonUser.Enabled = true;
this.buttonManual.Enabled = true;
this.buttonLog.Enabled = true;
this.buttonSystem.Enabled = true;
this.buttonBottom1.Enabled = true;
this.buttonBottom2.Enabled = true;
this.buttonBottom3.Enabled = true;
this.buttonBottom4.Enabled = true;
this.buttonHome.Enabled = true;
}
else
{
this.buttonRecipe.Enabled = false;
this.buttonUser.Enabled = false;
this.buttonManual.Enabled = false;
this.buttonLog.Enabled = false;
this.buttonSystem.Enabled = false;
this.buttonBottom1.Enabled = false;
this.buttonBottom2.Enabled = false;
this.buttonBottom3.Enabled = false;
this.buttonBottom4.Enabled = false;
this.buttonHome.Enabled = false;
}
}
// Menu Recipe
2023-03-30 02:02:19 +00:00
public void UpdateDisplayRecipeData(Recipe item)
{
2023-03-30 02:02:19 +00:00
this.Child_Recipe_Setting.UpdateDisplayControlData(item);
}
2023-03-31 01:47:21 +00:00
// Menu Manual
public void UpdateDisplayIOTestInputData(Collection<string> datas)
{
this.Child_Manual_IoTest.UpdateDisplayInputData(datas);
}
2023-03-31 01:47:21 +00:00
public void UpdateDisplayIOTestDispData(Collection<DispData> datas)
{
this.Child_Manual_IoTest.UpdateDisplayDispData(datas);
}
2023-03-31 01:47:21 +00:00
public void UpdateDisplayIOTestDiffData(Collection<DiffData> datas)
{
this.Child_Manual_IoTest.UpdateDisplayDiffData(datas);
}
2023-03-31 01:47:21 +00:00
public void UpdateDisplayIOTestPresData(Collection<PressureData> datas)
{
this.Child_Manual_IoTest.UpdateDisplayPresData(datas);
}
2023-03-31 01:47:21 +00:00
public void UpdateDisplayIOTestAlarmView(AlarmList data)
{
this.Child_Manual_IoTest.UpdateDisplayAlarmView(data);
}
2023-03-30 02:02:19 +00:00
// Menu System
public void UpdateMainBoardVersionDisplay(string data)
{
this.Child_System_Information.UpdateMainBoardVersionDisplay(data);
}
// Menu User
public void UpdateLevelNameDisplay(SystemConfiguration data)
{
this.Child_User_UserEditor.UpdateLevelNameDisplay(data);
}
public void CallBackGetUserData(UserManager.UserMgr_user_list_t userList)
{
this.Child_User_UserEditor.CallBackGetUserData(userList);
}
public void CallBackUserListLockDataEvent(UserManager.UserMgr_user_lock_t user)
{
this.Child_User_UserEditor.CallBackUserListLockDataEvent(user);
}
public void CallBackUserListDeleteDataEvent(UserManager.UserMgr_user_del_t user)
{
this.Child_User_UserEditor.CallBackUserListDeleteDataEvent(user);
}
public void CallBackUserModifyUserData(UserManager.UserMgr_user_modify_t user)
{
this.Child_User_UserEditor.CallBackUserModifyUserData(user);
}
public void CallBackUserListNewData(UserManager.UserMgr_user_info_t user)
{
this.Child_User_UserEditor.CallBackUserListNewData(user);
}
2023-03-31 01:47:21 +00:00
// Menu System
public void UpdateDisplayEquipmentDispData(Collection<DispData> datas)
2023-03-30 02:02:19 +00:00
{
2023-03-31 01:47:21 +00:00
this.Child_System_Status.UpdateDisplayDispData(datas);
}
public void UpdateDisplayEquipmentDiffData(Collection<DiffData> datas)
{
this.Child_System_Status.UpdateDisplayDiffData(datas);
}
public void UpdateDisplayEquipmentPresData(Collection<PressureData> datas)
{
this.Child_System_Status.UpdateDisplayPresData(datas);
}
public void UpdateDisplayEquipmentAlarmView(AlarmList data)
{
this.Child_System_Status.UpdateDisplayAlarmView(data);
}
public void UpdateDisplayEquipmentJudgmentData(LeakData datas)
{
this.Child_System_Status.UpdateDisplayJudgmentData(datas);
}
public void UpdateDisplayEquipmentProcessStatusDisplay(Define.E_ProcessStatus status)
{
this.Child_System_Status.UpdateProcessStatusDisplay(status);
2023-03-30 02:02:19 +00:00
}
public void DisplayRefresh(SystemStatus status)
2023-02-13 00:43:01 +00:00
{
this.SelectedTopMenu = Define.E_TopMenuStore.Recipe;
2023-03-31 06:50:09 +00:00
this.SetTopMenu(this.SelectedTopMenu);
this.UpdateDisplayUser(status.CurrentUser);
2023-02-13 00:43:01 +00:00
}
#endregion
#region Event Handler
private void buttonHome_Click(object sender, EventArgs e)
{
2023-03-31 06:50:09 +00:00
this.buttonRecipe.ButtonDown();
this.buttonUser.ButtonUp();
this.buttonManual.ButtonUp();
this.buttonLog.ButtonUp();
this.buttonSystem.ButtonUp();
2023-02-13 00:43:01 +00:00
this.ParentForm.ChildFormMainDisplay.DisplayRefresh();
this.ParentForm.FormChange((int)Define.E_FormStore.FormMainDisplay);
}
2023-03-06 04:52:55 +00:00
2023-02-13 00:43:01 +00:00
private void buttonRecipe_Click(object sender, EventArgs e)
{
if (this.SelectedTopMenu != Define.E_TopMenuStore.Recipe)
{
this.SelectedTopMenu = Define.E_TopMenuStore.Recipe;
this.SetTopMenu(this.SelectedTopMenu);
}
}
private void buttonUser_Click(object sender, EventArgs e)
{
if (this.SelectedTopMenu != Define.E_TopMenuStore.User)
{
this.SelectedTopMenu = Define.E_TopMenuStore.User;
this.SetTopMenu(this.SelectedTopMenu);
}
}
2023-02-13 00:43:01 +00:00
private void buttonManual_Click(object sender, EventArgs e)
{
if (this.SelectedTopMenu != Define.E_TopMenuStore.Manual)
{
this.SelectedTopMenu = Define.E_TopMenuStore.Manual;
this.SetTopMenu(this.SelectedTopMenu);
}
}
private void buttonLog_Click(object sender, EventArgs e)
{
if (this.SelectedTopMenu != Define.E_TopMenuStore.Log)
{
this.SelectedTopMenu = Define.E_TopMenuStore.Log;
this.SetTopMenu(this.SelectedTopMenu);
}
}
private void buttonSystem_Click(object sender, EventArgs e)
{
if (this.SelectedTopMenu != Define.E_TopMenuStore.System)
{
this.SelectedTopMenu = Define.E_TopMenuStore.System;
this.SetTopMenu(this.SelectedTopMenu);
}
}
private void buttonBottom1_Click(object sender, EventArgs e)
{
2023-03-06 04:52:55 +00:00
switch (this.SelectedTopMenu)
{
case Define.E_TopMenuStore.Recipe:
this.SelectedMenuRecipe = Define.E_MenuRecipeStore._1_Setting;
this.SetBottomMenuRecipe(this.SelectedMenuRecipe);
break;
2023-03-20 00:40:59 +00:00
case Define.E_TopMenuStore.User:
this.SelectedMenuUser = Define.E_MenuUserStore._1_UserEditor;
this.SetBottomMenuUser(this.SelectedMenuUser);
2023-03-06 04:52:55 +00:00
break;
case Define.E_TopMenuStore.Manual:
this.SelectedMenuManual = Define.E_MenuManualStore._1_IoTest;
this.SetBottomMenuManual(this.SelectedMenuManual);
break;
case Define.E_TopMenuStore.Log:
2023-03-20 00:40:59 +00:00
this.SelectedMenuLog = Define.E_MenuLogStore._1_Inspection;
2023-03-06 04:52:55 +00:00
this.SetBottomMenuLog(this.SelectedMenuLog);
break;
case Define.E_TopMenuStore.System:
this.SelectedMenuSystem = Define.E_MenuSystemStore._1_Information;
this.SetBottomMenuSystem(this.SelectedMenuSystem);
break;
default:
break;
}
2023-02-13 00:43:01 +00:00
}
private void buttonBottom2_Click(object sender, EventArgs e)
{
2023-03-06 04:52:55 +00:00
switch (this.SelectedTopMenu)
{
case Define.E_TopMenuStore.Recipe:
this.SelectedMenuRecipe = Define.E_MenuRecipeStore._0_None;
this.SetBottomMenuRecipe(this.SelectedMenuRecipe);
break;
2023-03-20 00:40:59 +00:00
case Define.E_TopMenuStore.User:
this.SelectedMenuUser = Define.E_MenuUserStore._2_GroupEditor;
this.SetBottomMenuUser(this.SelectedMenuUser);
2023-03-06 04:52:55 +00:00
break;
case Define.E_TopMenuStore.Manual:
2023-03-20 00:40:59 +00:00
this.SelectedMenuManual = Define.E_MenuManualStore._0_None;
2023-03-06 04:52:55 +00:00
this.SetBottomMenuManual(this.SelectedMenuManual);
break;
case Define.E_TopMenuStore.Log:
2023-03-20 00:40:59 +00:00
this.SelectedMenuLog = Define.E_MenuLogStore._2_History;
2023-03-06 04:52:55 +00:00
this.SetBottomMenuLog(this.SelectedMenuLog);
break;
case Define.E_TopMenuStore.System:
2023-03-20 00:40:59 +00:00
this.SelectedMenuSystem = Define.E_MenuSystemStore._2_Status;
2023-03-06 04:52:55 +00:00
this.SetBottomMenuSystem(this.SelectedMenuSystem);
break;
default:
break;
}
2023-02-13 00:43:01 +00:00
}
private void buttonBottom3_Click(object sender, EventArgs e)
{
2023-03-06 04:52:55 +00:00
switch (this.SelectedTopMenu)
{
case Define.E_TopMenuStore.Recipe:
this.SelectedMenuRecipe = Define.E_MenuRecipeStore._0_None;
this.SetBottomMenuRecipe(this.SelectedMenuRecipe);
break;
case Define.E_TopMenuStore.User:
this.SelectedMenuUser = Define.E_MenuUserStore._0_None;
this.SetBottomMenuUser(this.SelectedMenuUser);
break;
2023-03-06 04:52:55 +00:00
case Define.E_TopMenuStore.Manual:
this.SelectedMenuManual = Define.E_MenuManualStore._0_None;
this.SetBottomMenuManual(this.SelectedMenuManual);
break;
case Define.E_TopMenuStore.Log:
this.SelectedMenuLog = Define.E_MenuLogStore._3_Alarm;
this.SetBottomMenuLog(this.SelectedMenuLog);
break;
case Define.E_TopMenuStore.System:
2023-03-20 00:40:59 +00:00
this.SelectedMenuSystem = Define.E_MenuSystemStore._0_None;
2023-03-06 04:52:55 +00:00
this.SetBottomMenuSystem(this.SelectedMenuSystem);
break;
default:
break;
}
2023-02-13 00:43:01 +00:00
}
private void buttonBottom4_Click(object sender, EventArgs e)
{
2023-03-06 04:52:55 +00:00
switch (this.SelectedTopMenu)
{
case Define.E_TopMenuStore.Recipe:
this.SelectedMenuRecipe = Define.E_MenuRecipeStore._0_None;
this.SetBottomMenuRecipe(this.SelectedMenuRecipe);
break;
2023-03-20 00:40:59 +00:00
case Define.E_TopMenuStore.User:
this.SelectedMenuUser = Define.E_MenuUserStore._0_None;
this.SetBottomMenuUser(this.SelectedMenuUser);
2023-03-06 04:52:55 +00:00
break;
case Define.E_TopMenuStore.Manual:
this.SelectedMenuManual = Define.E_MenuManualStore._0_None;
this.SetBottomMenuManual(this.SelectedMenuManual);
break;
case Define.E_TopMenuStore.Log:
this.SelectedMenuLog = Define.E_MenuLogStore._0_None;
this.SetBottomMenuLog(this.SelectedMenuLog);
break;
case Define.E_TopMenuStore.System:
2023-03-20 00:40:59 +00:00
this.SelectedMenuSystem = Define.E_MenuSystemStore._0_None;
2023-03-06 04:52:55 +00:00
this.SetBottomMenuSystem(this.SelectedMenuSystem);
break;
default:
break;
}
2023-02-09 08:20:49 +00:00
}
2023-03-31 01:47:21 +00:00
private void labelStart_Click(object sender, EventArgs e)
{
if (this.ParentForm.CurrentSystemStatus.CurrentDisplayMode == Define.E_DisplayModeStore.Equipment)
this.ParentForm.TransferData(CommunicationCommand.Stop, CommunicationID.MainBoard);
}
private void labelStop_Click(object sender, EventArgs e)
{
if (this.ParentForm.CurrentSystemStatus.CurrentDisplayMode == Define.E_DisplayModeStore.Equipment)
this.ParentForm.TransferData(CommunicationCommand.Start, CommunicationID.MainBoard);
}
2023-03-06 04:52:55 +00:00
#endregion
2023-02-09 08:20:49 +00:00
}
}