public frmSelectAndonObjectsToCall(
            AndonEventType andonEventTypeItem,
            string opNode,
            ProductionLineForStationBound pLine) : this()
        {
            andonEventType = andonEventTypeItem;
            this.opNode    = opNode;
            productionLine = pLine;

            if (Thread.CurrentThread.CurrentUICulture.Name.Substring(0, 2) == "en")
            {
                Text = string.Format("Andon call for {0}", andonEventType.EventTypeName);
                gpcAndonEvents.Text = string.Format("Please select {0}", andonEventType.CaptionName);
            }
            else
            {
                Text = string.Format("呼叫{0}", andonEventType.EventTypeName);
                gpcAndonEvents.Text = string.Format("请选择{0}", andonEventType.CaptionName);
            }

            // 如果呼叫事件类型是“安全”,则隐藏多选栏
            if (andonEventType.EventTypeCode == "S")
            {
                grdclmnChoice.Visible = false;
            }
        }
Example #2
0
        private void lstEventType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lstEventType.SelectedItem == null)
            {
                tcEventTypes.SelectedTabPage = tpEmpty;
            }
            else
            {
                EventToConsultation etc = null;
                if (cboAndonEvent.SelectedItem != null)
                {
                    etc = cboAndonEvent.SelectedItem as EventToConsultation;
                }

                AndonEventType eventType = (lstEventType.SelectedItem as ImageListBoxItem).Value as AndonEventType;
                switch (eventType.EventTypeCode)
                {
                case "R":
                    tcEventTypes.SelectedTabPage = tpR;

                    if (etc != null && etc.EventCode == "R")
                    {
                        ucDeviceFailureModes.T133Code = etc.WFInstanceID;
                    }
                    else
                    {
                        ucDeviceFailureModes.T133Code = "";
                    }
                    break;

                case "M":
                    tcEventTypes.SelectedTabPage = tpM;

                    ucFailureModesM.T179LeafID = eventType.EventTypeLeaf;
                    break;

                case "Q":
                    tcEventTypes.SelectedTabPage = tpQ;

                    ucFailureModesQ.T179LeafID = eventType.EventTypeLeaf;
                    break;

                case "T":
                    tcEventTypes.SelectedTabPage = tpT;

                    ucFailureModesT.T179LeafID = eventType.EventTypeLeaf;
                    break;

                case "S":
                    tcEventTypes.SelectedTabPage = tpS;

                    ucFailureModesS.T179LeafID = eventType.EventTypeLeaf;
                    break;

                case "O":
                    tcEventTypes.SelectedTabPage = tpO;
                    break;
                }
            }
        }
Example #3
0
        private void GetNewEventInfo(
            ref int eventLeafID,
            ref int objectTreeID,
            ref string objectCode,
            ref int failureModeLeafID)
        {
            eventLeafID       = 0;
            objectTreeID      = 0;
            objectCode        = "";
            failureModeLeafID = 0;

            if (lstEventType.SelectedItem == null)
            {
                return;
            }

            AndonEventType eventType = (lstEventType.SelectedItem as ImageListBoxItem).Value as AndonEventType;

            eventLeafID = eventType.EventTypeLeaf;

            switch (eventType.EventTypeCode)
            {
            case "R":
                objectTreeID      = 133;
                objectCode        = ucDeviceFailureModes.T133Code;
                failureModeLeafID = ucDeviceFailureModes.FailureModeLeafID;
                break;

            case "M":
                objectTreeID      = 118;
                objectCode        = ucFailureModesM.FailureModeCode;
                failureModeLeafID = ucFailureModesM.FailureModeLeafID;
                break;

            case "Q":
                objectTreeID      = 118;
                objectCode        = ucFailureModesQ.FailureModeCode;
                failureModeLeafID = ucFailureModesQ.FailureModeLeafID;
                break;

            case "T":
                objectTreeID      = 118;
                objectCode        = ucFailureModesT.FailureModeCode;
                failureModeLeafID = ucFailureModesT.FailureModeLeafID;
                break;

            case "S":
                objectTreeID      = 118;
                objectCode        = ucFailureModesS.FailureModeCode;
                failureModeLeafID = ucFailureModesS.FailureModeLeafID;
                break;

            case "O":
                break;
            }
        }
Example #4
0
        private void cboAndonEvent_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboAndonEvent.SelectedItem == null)
            {
                grdStaffs.DataSource = null;

                splitContainerControl3.Enabled = false;
                lstEventType.SelectedItem      = null;

                Clear();
            }
            else
            {
                grdStaffs.DataSource = (cboAndonEvent.SelectedItem as EventToConsultation).Stakeholders;

                splitContainerControl3.Enabled = true;

                EventToConsultation etc = cboAndonEvent.SelectedItem as EventToConsultation;

                AndonEventType eventType = null;
                if (lstEventType.SelectedItem != null)
                {
                    eventType = (lstEventType.SelectedItem as ImageListBoxItem).Value as AndonEventType;
                }
                else
                {
                    eventType = new AndonEventType();
                }

                if (etc.EventCode == eventType.EventTypeCode)
                {
                    lstEventType_SelectedIndexChanged(lstEventType, null);
                }
                else
                {
                    foreach (ImageListBoxItem item in lstEventType.Items)
                    {
                        if (item == null)
                        {
                            continue;
                        }

                        if (item.Value is AndonEventType)
                        {
                            if (((AndonEventType)item.Value).EventTypeCode == etc.EventCode)
                            {
                                lstEventType.SelectedItem = item;
                                break;
                            }
                        }
                    }
                }
            }
        }
Example #5
0
        public frmSelectFailureModesByDeviceToCall(
            AndonEventType andonEventTypeItem,
            string opNode,
            ProductionLineForStationBound pLine) : this()
        {
            andonEventType = andonEventTypeItem;
            this.opNode    = opNode;
            productionLine = pLine;

            if (Thread.CurrentThread.CurrentUICulture.Name.Substring(0, 2) == "en")
            {
                Text = string.Format("Andon call for {0}", andonEventType.EventTypeName);
            }
            else
            {
                Text = string.Format("呼叫{0}", andonEventType.EventTypeName);
            }
        }
Example #6
0
        public frmSelectPersonsToCall(
            AndonEventType andonEventTypeItem,
            string opNode,
            ProductionLineForStationBound pLine) : this()
        {
            andonEventType = andonEventTypeItem;
            this.opNode    = opNode;
            productionLine = pLine;

            if (Thread.CurrentThread.CurrentUICulture.Name.Substring(0, 2) == "en")
            {
                Text = string.Format("Andon call for {0}", andonEventType.EventTypeName);
                gpcAndonEvents.Text = string.Format("Please select {0}", andonEventType.CaptionName);
            }
            else
            {
                Text = string.Format("呼叫{0}", andonEventType.EventTypeName);
                gpcAndonEvents.Text = string.Format("请选择{0}", andonEventType.CaptionName);
            }
        }
Example #7
0
        private void AndonEventCall(object sender, EventArgs e)
        {
            if (sender is UserControls.ucAndonEventButton)
            {
                string strProcedureName =
                    string.Format(
                        "{0}.{1}",
                        className,
                        MethodBase.GetCurrentMethod().Name);

                WriteLog.Instance.WriteBeginSplitter(strProcedureName);
                try
                {
                    tmrGetAndonEventStatus.Enabled = false;

                    AndonEventType andonEventTypeItem = ((UserControls.ucAndonEventButton)sender).EventTypeItem;

                    switch (andonEventTypeItem.EventTypeCode)
                    {
                    case "R":
                        using (frmSelectFailureModesByDeviceToCall formAndonCall =
                                   new frmSelectFailureModesByDeviceToCall(
                                       andonEventTypeItem,
                                       menuInfo.OpNode,
                                       currentProductionLine))
                        {
                            formAndonCall.ShowDialog();
                        }
                        break;

                    case "O":
                        if (IRAPUser.Instance.CommunityID == 60006)
                        {
                            // 伟世通在进行其他支持呼叫时,使用定制界面
                            using (frmSelectPersonsToCall formAndonCall =
                                       new frmSelectPersonsToCall(
                                           andonEventTypeItem,
                                           menuInfo.OpNode,
                                           currentProductionLine))
                            {
                                formAndonCall.ShowDialog();
                            }
                        }
                        else
                        {
                            // 其他支持呼叫,使用一般通用界面
                            using (frmSelectAndonObjectsToCall formAndonCall =
                                       new frmSelectAndonObjectsToCall(
                                           andonEventTypeItem,
                                           menuInfo.OpNode,
                                           currentProductionLine))
                            {
                                formAndonCall.ShowDialog();
                            }
                        }
                        break;

                    default:
                        using (frmSelectAndonObjectsToCall formAndonCall =
                                   new frmSelectAndonObjectsToCall(
                                       andonEventTypeItem,
                                       menuInfo.OpNode,
                                       currentProductionLine))
                        {
                            formAndonCall.ShowDialog();
                        }
                        break;
                    }

                    GetAndonLightsStatus();
                    GetAndonEventTypeButtonsStatus(ref andonEventTypes, false);
                    RefreshAndonEventTypeButtonsStatus(andonEventTypes, buttons);
                }
                finally
                {
                    tmrGetAndonEventStatus.Enabled = true;
                    WriteLog.Instance.WriteEndSplitter(strProcedureName);
                }
            }
        }