public MainFrame(LocalInformationConfigData localInfo, MachineLocalInformationConfig machineLocalInfo) { InitializeComponent(); this.InitializeMainFrameControl(); this._ControlCenter = new ControlCenter(localInfo, machineLocalInfo); this._ControlCenter.MessageEvent += new EventHandler<EventBaseInfo<string>>(ControlCenter_MessageEvent); this._ControlCenter.FunctionFormShowEvent += new EventHandler<EventBaseInfo<string>>(ControlCenter_FunctionFormShowEvent); this._ControlCenter.ServiceConnectionStatusChangeEvent += new EventHandler<EventBaseInfo<CommonDefine.ConnectionStatus>>(ControlCenter_ServiceConnectionStatusChangeEvent); this._ControlCenter.DinnerEvent += new EventHandler<EventBaseInfo<bool>>(ControlCenter_DinnerEvent); this._ControlCenter.MachineConnectionStatusChangeEvent += new EventHandler<EventBaseInfo<CommonDefine.ConnectionStatus>>(ControlCenter_MachineConnectionStatusChangeEvent); this._ControlCenter.GotoHomePageEvent += new EventHandler(ControlCenter_GotoHomePageEvent); this._ControlCenter.ExceptionEventInformation += new EventHandler<EventBaseInfo<ExceptionInformation>>(ControlCenter_ExceptionEventInformation); this._datatimeShowTimer = new System.Timers.Timer(); this._datatimeShowTimer.Interval = 1000; this._datatimeShowTimer.Enabled = true; this._datatimeShowTimer.Elapsed += new System.Timers.ElapsedEventHandler(DatatimeShowTimer_Elapsed); this._isOpenKeyBoard = false; this._isExitSystem = false; this._mainFrameBase.ExceptionMessageLabel.Text = ""; }
void ShowMachineData(MachineLocalInformationConfig machineData) { txtMachineID.Text = machineData.MachineID; cboComName.Text = machineData.PLCPortName; txtBR.Text = machineData.PLCBaudRate.ToString(); txtRemark.Text = machineData.Remark; this.currentMachineID = machineData.MachineID; }
/// <summary> /// 取得機台信息 /// </summary> /// <returns></returns> private MachineLocalInformationConfig GetUIData() { MachineLocalInformationConfig machineData = new MachineLocalInformationConfig(); machineData.MachineID = txtMachineID.Text.Trim(); machineData.PLCPortName = cboComName.Text.Trim(); machineData.PLCBaudRate = Convert.ToInt32(txtBR.Text.Trim()); machineData.Remark = txtRemark.Text.Trim(); return machineData; }