/// <summary>
        /// 服務器連線狀態變化方法
        /// </summary>
        /// <param name="connectionStatus"></param>
        private void OnServiceConnectionStatusChange(CommonDefine.ConnectionStatus connectionStatus)
        {
            if (this._currentServiceConnectionStatus != connectionStatus)
            {
                this._currentServiceConnectionStatus = connectionStatus;

                if (this.ServiceConnectionStatusChangeEvent != null)
                {
                    EventBaseInfo<CommonDefine.ConnectionStatus> info = new EventBaseInfo<CommonDefine.ConnectionStatus>();
                    info.ObjectInformation = connectionStatus;

                    this.ServiceConnectionStatusChangeEvent(this,info);
                }
            }
        }
示例#2
0
        /// <summary>
        /// 工程結束請求
        /// </summary>
        /// <param name="finishType">結束類型</param>
        void ProjectFinishQuestion(CommonDefine.ProjectFinishType finishType)
        {
            if (this._projectProductionRealTimeManager.ProductionData != null)
            {
                ReturnValueInfo returnValue = this._projectProductionRealTimeManager.ProjectFinishRequest(finishType);

                if (returnValue != null)
                {
                    if (!returnValue.boolValue)
                    {
                        this.ShowInformationMessage(returnValue.messageText);
                    }
                }
            }
        }
示例#3
0
 /// <summary>
 /// 設置功能控件權限
 /// </summary>
 /// <param name="functionEnable"></param>
 private void SetFunctionControl(CommonDefine.ProjectStatusFunctionEnable functionEnable)
 {
     this._projectStatusBase.ButtonClearQty.Enabled = functionEnable.ClearQty;
     this._projectStatusBase.ButtonCorrectQty.Enabled = functionEnable.CorrectQty;
     this._projectStatusBase.ButtonStop.Enabled = functionEnable.Stop;
     this._projectStatusBase.ButtonProjectEnd.Enabled = functionEnable.ProjectEnd;
     this._projectStatusBase.ButtonMore.Enabled = functionEnable.More;
     this._projectStatusBase.ButtonSet.Enabled = functionEnable.Setting;
     this._projectStatusBase.ButtonReset.Enabled = functionEnable.Reset;
     this._projectStatusBase.ButtonSetPerQty.Enabled = functionEnable.SetPerQty;
 }
示例#4
0
 /// <summary>
 /// 設置功能控件權限
 /// </summary>
 /// <param name="functionEnable"></param>
 private void FunctionControl(CommonDefine.ProjectStatusFunctionEnable functionEnable)
 {
     if (this.InvokeRequired)
     {
         FunctionEnable function = new FunctionEnable(SetFunctionControl);
         this.Invoke(function, new object[] { functionEnable });
     }
     else
     {
         this.SetFunctionControl(functionEnable);
     }
 }
示例#5
0
 /// <summary>
 /// 根據工程結束類型設置界面顯示
 /// </summary>
 /// <param name="finishType"></param>
 void SetFormByProjectFinishType(CommonDefine.ProjectFinishType finishType)
 {
     if (this.InvokeRequired)
     {
         ProjectFinishTypeDelegate type = new ProjectFinishTypeDelegate(SetFormByFinishType);
         this.Invoke(type, new object[] { finishType });
     }
     else
     {
         this.SetFormByFinishType(finishType);
     }
 }
示例#6
0
        /// <summary>
        /// 根據工程結束類型設置界面顯示
        /// </summary>
        /// <param name="finishType"></param>
        void SetFormByFinishType(CommonDefine.ProjectFinishType finishType)
        {
            if (finishType == CommonDefine.ProjectFinishType.Complete)
            {
                base.Text = "結束工程";
                this.m_frmProjectStopBase.PanelExtractionReason.Visible = false;

                this.m_frmProjectStopBase.PanelRemark.Height = 116;
                this.m_frmProjectStopBase.PanelRemark.Location = new Point(98, 21);

                switch (ScreenSizeFactory.ScreenSize)
                {
                    case ScreenSizeType.Size800X600:
                        this.m_frmProjectStopBase.PanelRemark.Width = 400;
                        break;
                    case ScreenSizeType.Size1024X768:
                        this.m_frmProjectStopBase.PanelRemark.Width = 490;
                        break;

                    default:

                        break;
                }
            }

            if (finishType == CommonDefine.ProjectFinishType.Extraction)
            {
                base.Text = "抽起工程";

                this.m_frmProjectStopBase.PanelExtractionReason.Visible = true;

                this.m_frmProjectStopBase.PanelRemark.Height = 69;
                this.m_frmProjectStopBase.PanelRemark.Location = new Point(395, 21);

                switch (ScreenSizeFactory.ScreenSize)
                {
                    case ScreenSizeType.Size800X600:
                        this.m_frmProjectStopBase.PanelRemark.Width = 300;
                        break;
                    case ScreenSizeType.Size1024X768:
                        this.m_frmProjectStopBase.PanelRemark.Width = 395;
                        break;

                    default:

                        break;
                }
            }
        }
示例#7
0
        private void SetServiceConnectionStatus(CommonDefine.ConnectionStatus connectionStatus)
        {
            if (connectionStatus == CommonDefine.ConnectionStatus.Connecting)
            {
                this._mainFrameBase.ServiceConnectStatusLabel.Text = "服務器已連接";
                this._mainFrameBase.ServiceConnectStatusLabel.ForeColor = Color.Green;

                GlobalVar.IsOnline = true;

                this.OnMachineMessage(MachineMessageType.ServiceConnectStatus, MessageStatusType.Normal, this._mainFrameBase.ServiceConnectStatusLabel.Text);
            }
            else if (connectionStatus == CommonDefine.ConnectionStatus.Disconnect)
            {
                this._mainFrameBase.ServiceConnectStatusLabel.Text = "服務器已斷開";
                this._mainFrameBase.ServiceConnectStatusLabel.ForeColor = Color.Red;

                GlobalVar.IsOnline = false;

                this.OnMachineMessage(MachineMessageType.ServiceConnectStatus, MessageStatusType.Exception, this._mainFrameBase.ServiceConnectStatusLabel.Text);
            }
        }
示例#8
0
        private void SetMachineConnectionStatus(CommonDefine.ConnectionStatus connectionStatus)
        {
            if (connectionStatus == CommonDefine.ConnectionStatus.Connecting)
            {
                this._mainFrameBase.PLCStatusLabel.Text = "PLC已連接";
                this._mainFrameBase.PLCStatusLabel.ForeColor = Color.Green;

                this.OnMachineMessage(MachineMessageType.PLCConnectStatus, MessageStatusType.Normal, this._mainFrameBase.PLCStatusLabel.Text);
            }
            else if (connectionStatus == CommonDefine.ConnectionStatus.Disconnect)
            {
                this._mainFrameBase.PLCStatusLabel.Text = "PLC已斷開";
                this._mainFrameBase.PLCStatusLabel.ForeColor = Color.Red;

                this.OnMachineMessage(MachineMessageType.PLCConnectStatus, MessageStatusType.Exception, this._mainFrameBase.PLCStatusLabel.Text);
            }
        }