Esempio n. 1
0
 /// <summary>
 /// 消數事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void ClearProductionQtyFrm_ClearProductionQtyEvent(object sender, EventBaseInfo<ProjectCorrectRecord> e)
 {
     if (e != null)
     {
         this._projectProductionRealTimeManager.ClearProductionQty(e.ObjectInformation);
     }
 }
        /// <summary>
        /// 工程生產數據上傳狀態事件
        /// </summary>
        /// <param name="isSccessed">是否成功</param>
        public void OnProjectProductionDataUploadStatus(bool isSccessed)
        {
            if (this.ProjectProductionDataUploadStatusEvent != null)
            {
                EventBaseInfo<bool> info = new EventBaseInfo<bool>();

                info.ObjectInformation = isSccessed;

                this.ProjectProductionDataUploadStatusEvent(this, info);
            }
        }
Esempio n. 3
0
        void DinnerControler_DinnerMessageEvent(object sender, EventBaseInfo<string> e)
        {
            if (e == null)
            {
                return;
            }

            if (this.InvokeRequired)
            {
                SetDinnerTitleDelegate setTitle = new SetDinnerTitleDelegate(SetDinnerTitle);
                this.Invoke(setTitle, new object[] { e.ObjectInformation });
            }
            else
            {
                this.SetDinnerTitle(e.ObjectInformation);
            }
        }
Esempio n. 4
0
        void MachineMessageEvent(object sender, EventBaseInfo<EventMachineMessageInfo> e)
        {
            if (e != null && e.ObjectInformation != null)
            {
                MachineMessageInfo messageInfo = null;

                if (this._machineMessageInfos.ContainsKey(e.ObjectInformation.MachineNo))
                {
                    messageInfo = this._machineMessageInfos[e.ObjectInformation.MachineNo];
                }
                else
                {
                    messageInfo = new MachineMessageInfo();

                    this._machineMessageInfos.Add(e.ObjectInformation.MachineNo, messageInfo);
                }

                messageInfo.MachineNoMessage = e.ObjectInformation.MachineNo;

                switch (e.ObjectInformation.MessageType)
                {
                    case MachineMessageType.ServiceConnectStatus:

                        if (messageInfo.ServiceConnectStatusMessage == null)
                        {
                            messageInfo.ServiceConnectStatusMessage = new MachineMessageCell();
                        }

                        this.SetMachineMessageCell(e.ObjectInformation, messageInfo.ServiceConnectStatusMessage);

                        break;
                    case MachineMessageType.ExceptionMessage:

                        if (messageInfo.MachineMessage == null)
                        {
                            messageInfo.MachineMessage = new MachineMessageCell();
                        }

                        this.SetMachineMessageCell(e.ObjectInformation, messageInfo.MachineMessage);

                        break;
                    case MachineMessageType.PLCConnectStatus:

                        if (messageInfo.PLCConnectMessage == null)
                        {
                            messageInfo.PLCConnectMessage = new MachineMessageCell();
                        }

                        this.SetMachineMessageCell(e.ObjectInformation, messageInfo.PLCConnectMessage);

                        break;
                    default:
                        break;
                }

                this.MachineMessageBox.SetMachineNoMessage(messageInfo);
            }
        }
 void SignalLightControler_ExceptionEvent(object sender, EventBaseInfo<Exception> e)
 {
     if (e != null)
     {
         this.OnException(e.ObjectInformation);
     }
 }
Esempio n. 6
0
        /// <summary>
        /// 設置工程生產數據完整性狀態
        /// </summary>
        /// <param name="projectDataType"></param>
        void SetProjectProductionDataFullStatus(EventBaseInfo<CommonDefine.ProjectDataType> e)
        {
            switch (e.ObjectInformation)
            {
                case CommonDefine.ProjectDataType.ProjectGrade:
                    if (!e.BoolValue)
                    {
                        this._projectStatusBase.ButtonSetPerQty.StartBackColorGlitter(Color.OrangeRed, 1);
                    }
                    else
                    {
                        this._projectStatusBase.ButtonSetPerQty.StopBackColorGlitter();
                    }

                    break;
                case CommonDefine.ProjectDataType.ProjectAdditionalInformation:
                    if (!e.BoolValue)
                    {
                        this._projectStatusBase.ButtonMore.StartBackColorGlitter(Color.OrangeRed, 1);
                    }
                    else
                    {
                        this._projectStatusBase.ButtonMore.StopBackColorGlitter();
                    }

                    break;
                default:
                    break;
            }
        }
 /// <summary>
 /// 備份排期工程列表事件,通知控制中心
 /// </summary>
 /// <param name="scheduleProjectList">排期工程列表</param>
 protected void OnBackupScheduleProject(List<ScheduleProjectData> scheduleProjectList)
 {
     if (this.BackupScheduleProjectEvent != null)
     {
         EventBaseInfo<List<ScheduleProjectData>> eventInfo = new EventBaseInfo<List<ScheduleProjectData>>();
         eventInfo.ObjectInformation = scheduleProjectList;
         this.BackupScheduleProjectEvent(this, eventInfo);
     }
 }
Esempio n. 8
0
        /// <summary>
        /// 工程生產數據完整通知事件,由模塊通知界面,界面進行相應處理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ProjectProductionRealTimeManager_ProjectProductionDataFullEvent(object sender, EventBaseInfo<CommonDefine.ProjectDataType> e)
        {
            if (e == null)
            {
                return;
            }

            this.SetDataFullStatus(e);
        }
Esempio n. 9
0
 /// <summary>
 /// 班次工程實時數據事件,用於模塊通知界面顯示
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void ProjectProductionRealTimeManager_ShiftProjectRealTimeDataEvent(object sender, EventBaseInfo<ShiftProjectProductionDataInformation> e)
 {
     if (e != null && e.ObjectInformation != null)
     {
         this.ShowShiftProjectProductionDataInformation(e.ObjectInformation);
     }
 }
Esempio n. 10
0
        void ControlCenter_FunctionFormShowEvent(object sender, EventBaseInfo<string> e)
        {
            if (this._isExitSystem)
            {
                return;
            }

            try
            {
                if (e != null)
                {
                    if (this.InvokeRequired)
                    {
                        OpenFormDelegate openForm = new OpenFormDelegate(OpenMenuItem);
                        this.Invoke(openForm, new object[] { e.ObjectInformation });
                    }
                    else
                    {
                        OpenMenuItem(e.ObjectInformation);
                    }
                }
            }
            catch { }
        }
Esempio n. 11
0
 /// <summary>
 /// 異常事件方法
 /// </summary>
 /// <param name="ex"></param>
 protected void OnException(Exception ex)
 {
     if (this.ExceptionEvent != null)
     {
         EventBaseInfo<Exception> eventInfo = new EventBaseInfo<Exception>();
         eventInfo.ObjectInformation = ex;
         this.ExceptionEvent(this, eventInfo);
     }
 }
Esempio n. 12
0
        void ControlCenter_DinnerEvent(object sender, EventBaseInfo<bool> e)
        {
            if (this._isExitSystem)
            {
                return;
            }

            try
            {
                if (e != null)
                {
                    if (this.InvokeRequired)
                    {
                        DinnerStatusSettingDelegate dinnerForm = new DinnerStatusSettingDelegate(SetDinnerControlStatus);
                        this.Invoke(dinnerForm, new object[] { e.ObjectInformation });
                    }
                    else
                    {
                        this.SetDinnerControlStatus(e.ObjectInformation);
                    }
                }
            }
            catch { }
        }
Esempio n. 13
0
 void ControlCenter_ExceptionEventInformation(object sender, EventBaseInfo<ExceptionInformation> e)
 {
     if (e != null && e.ObjectInformation != null)
     {
         if (e.ObjectInformation.Type == CommonDefine.ExceptionType.ProjectProductionDataUploadFail)
         {
             if (this.InvokeRequired)
             {
                 SetExceptionMessageDelegate setExceptionMessage = new SetExceptionMessageDelegate(SetExceptionMessage);
                 this.Invoke(setExceptionMessage, new object[] { e.ObjectInformation });
             }
             else
             {
                 this.SetExceptionMessage(e.ObjectInformation);
             }
         }
     }
 }
Esempio n. 14
0
 void OnCorrectProductionQty(ProjectCorrectRecord correctRecord)
 {
     if (this.CorrectProductionQtyEvent != null)
     {
         EventBaseInfo<ProjectCorrectRecord> info = new EventBaseInfo<ProjectCorrectRecord>();
         info.ObjectInformation = correctRecord;
         this.CorrectProductionQtyEvent(this, info);
     }
 }
Esempio n. 15
0
        private void m_ProjectQCManager_RecordEditEvent(object sender, EventBaseInfo<AbstractProjectQCManager.QCPloblemViewInfo> e)
        {
            Guid pRecordID = Guid.Empty;//品檢記錄ID
            Guid subRecordID = Guid.Empty;//品檢問題記錄ID

            if (!this.m_IsInputingQCQty)
            {
                //當前沒有保持在編輯狀態時,直接選擇通知編輯的記錄進行選中操作
                if (e != null)
                {
                    AbstractProjectQCManager.QCPloblemViewInfo qcReocrd = e.ObjectInformation as AbstractProjectQCManager.QCPloblemViewInfo;
                    if (qcReocrd != null)
                    {
                        pRecordID = qcReocrd.RecordID;
                        subRecordID = qcReocrd.SubRecordID;
                    }
                }
            }
            else
            {
                //處于編輯狀態時,保持對原記錄的選中狀態
                if (this.m_CurrentQCViewInfo != null)
                {
                    pRecordID = this.m_CurrentQCViewInfo.RecordID;
                    subRecordID = this.m_CurrentQCViewInfo.SubRecordID;
                }
            }

            if (this.InvokeRequired)
            {
                this.Invoke(new RecordEditDelegate(RecordEdit), pRecordID, subRecordID);
            }
            else
            {
                RecordEdit(pRecordID, subRecordID);
            }
        }
 /// <summary>
 /// 工程開始生產事件,供控制中心調用通知界面,界面進行控件狀態設置
 /// </summary>
 /// <param name="scheduleProject">已開始生產的排期工程對象</param>
 protected void OnProjectStartProduction(ScheduleProjectData scheduleProject)
 {
     if (this.ProjectStartProductionEvent != null)
     {
         EventBaseInfo<ScheduleProjectData> eventInfo = new EventBaseInfo<ScheduleProjectData>();
         eventInfo.ObjectInformation = scheduleProject;
         this.ProjectStartProductionEvent(this, eventInfo);
     }
 }
 /// <summary>
 /// 基本資料更新事件通知控制中心,由模塊調用通知控制中心
 /// </summary>
 /// <param name="baseData"></param>
 public void OnDataBaseUpdate(BaseData baseData)
 {
     if (this.DataBaseUpdateEvent != null)
     {
         EventBaseInfo<BaseData> eventInfo = new EventBaseInfo<BaseData>();
         eventInfo.ObjectInformation = baseData;
         this.DataBaseUpdateEvent(this, eventInfo);
     }
 }
Esempio n. 18
0
        void ControlCenter_MessageEvent(object sender, EventBaseInfo<string> e)
        {
            if (this._isExitSystem)
            {
                return;
            }

            if (e != null)
            {
                Alter(e.ObjectInformation);
            }
        }
Esempio n. 19
0
        /// <summary>
        /// 異常事件方法
        /// </summary>
        /// <param name="ex"></param>
        protected void OnException(string className,string methodName,string exceptionMessage)
        {
            string message= General.ExceptionMessageFormat(className, methodName, exceptionMessage)+"("+DateTime.Now.ToString()+")";

            if (this.ExceptionEvent != null)
            {
                Exception ex = new Exception(message);
                EventBaseInfo<Exception> eventInfo = new EventBaseInfo<Exception>();
                eventInfo.ObjectInformation = ex;
                this.ExceptionEvent(this, eventInfo);
            }
        }
Esempio n. 20
0
        void ControlCenter_ServiceConnectionStatusChangeEvent(object sender, EventBaseInfo<CommonDefine.ConnectionStatus> e)
        {
            if (this._isExitSystem)
            {
                return;
            }

            try
            {
                if (e != null)
                {
                    SetServiceConnectStatus setConnectStatus = new SetServiceConnectStatus(SetServiceConnectionStatus);
                    this.Invoke(setConnectStatus, new object[] { e.ObjectInformation });
                }
            }
            catch { }
        }
Esempio n. 21
0
 /// <summary>
 /// 工程結束類型事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void ProjectProductionRealTimeManager_ProjectFinishTypeEvent(object sender, EventBaseInfo<CommonDefine.ProjectFinishType> e)
 {
     if (e != null)
     {
         this._projectFinishType = e.ObjectInformation;
         this.SetFormByProjectFinishType(e.ObjectInformation);
     }
 }
Esempio n. 22
0
        /// <summary>
        /// 機台消息事件
        /// </summary>
        /// <param name="messageType">消息類型</param>
        /// <param name="statusType">狀態類型</param>
        /// <param name="content">消息內容</param>
        private void OnMachineMessage(MachineMessageType messageType, MessageStatusType statusType, string content)
        {
            if (this.MachineMessageEvent != null)
            {
                EventMachineMessageInfo messageInfo = new EventMachineMessageInfo();

                messageInfo.MessageType = messageType;
                messageInfo.MachineNo = this._ControlCenter.MachineNo;
                messageInfo.StatusType = statusType;
                messageInfo.MessageContent = content;

                EventBaseInfo<EventMachineMessageInfo> baseInfo = new EventBaseInfo<EventMachineMessageInfo>();
                baseInfo.ObjectInformation = messageInfo;

                this.MachineMessageEvent(this, baseInfo);
            }
        }
Esempio n. 23
0
 /// <summary>
 /// 工程狀態中的功能權限設置事件,由模塊發出事件通知“工程狀態”界面,“工程狀態”界面進行設置各個功能的權限
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void ProjectProductionRealTimeManager_ProjectStatusFunctionEnableEvent(object sender, EventBaseInfo<CommonDefine.ProjectStatusFunctionEnable> e)
 {
     if (e != null)
     {
         this.FunctionControl(e.ObjectInformation);
     }
 }
        /// <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);
                }
            }
        }
Esempio n. 25
0
 /// <summary>
 /// 設置工程生產數據完整性狀態
 /// </summary>
 /// <param name="e"></param>
 void SetDataFullStatus(EventBaseInfo<CommonDefine.ProjectDataType> e)
 {
     if (this.InvokeRequired)
     {
         EventBaseInfoDelegate dataFull = new EventBaseInfoDelegate(SetProjectProductionDataFullStatus);
         this.Invoke(dataFull, new object[] { e });
     }
     else
     {
         this.SetProjectProductionDataFullStatus(e);
     }
 }
Esempio n. 26
0
        /// <summary>
        /// 工程準備工作狀態變化事件
        /// </summary>
        void m_Controller_ProjectPerpareStatusChangeEvent(object sender, EventBaseInfo<Common.CustEnum.ProjectStatus> e)
        {
            if (this.InvokeRequired)
            {
                ProjectPerpareStatusChangeDelegate prepareStatus = new ProjectPerpareStatusChangeDelegate(ProjectPerpareStatusChange);

                this.Invoke(prepareStatus, new object[] { e.ObjectInformation });
            }
            else
            {
                ProjectPerpareStatusChange(e.ObjectInformation);
            }
        }
Esempio n. 27
0
 void m_Controller_RecordEditEvent(object sender, EventBaseInfo<ProjectMachineHaltRecord> e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new RecordEditDelegate(RecordEdit), e);
     }
     else
     {
         RecordEdit(e);
     }
 }
        /// <summary>
        /// 用戶選擇一個工程準備進行生產時的事件,通知控制中心
        /// </summary>
        /// <param name="scheduleProject"></param>
        public virtual ReturnValueInfo OnUserSelectedProject(ScheduleProjectData scheduleProject)
        {
            ReturnValueInfo result= new ReturnValueInfo();

            result.boolValue = true;

            if (this.UserSelectedProjectEvent != null)
            {
                EventBaseInfo<ScheduleProjectData> eventInfo = new EventBaseInfo<ScheduleProjectData>();
                eventInfo.ObjectInformation = scheduleProject;
                this.UserSelectedProjectEvent(this, eventInfo);
            }

            return result;
        }
Esempio n. 29
0
 void BaseDataSynchronismManager_ProjectStartProductionEvent(object sender, EventBaseInfo<ScheduleProjectData> e)
 {
     if (this.InvokeRequired)
     {
         SetControlStatusDelegate setStatus = new SetControlStatusDelegate(SetControlStatus);
         this.Invoke(setStatus, new object[] { false });
     }
     else
     {
         this.SetControlStatus(false);
     }
 }
Esempio n. 30
0
        void RecordEdit(EventBaseInfo<ProjectMachineHaltRecord> e)
        {
            if (e != null)
            {
                this.m_CurrentRecord = e.ObjectInformation as ProjectMachineHaltRecord;

                InitForm();
            }
        }