Пример #1
0
        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;
            }
        }
Пример #2
0
        private void btnSwitch_Click(object sender, EventArgs e)
        {
            ProductionLineForStationBound prdtLine = null;

            if (cboProductionLines.SelectedItem == null)
            {
                return;
            }
            else
            {
                prdtLine = cboProductionLines.SelectedItem as ProductionLineForStationBound;
            }

            string strProcedureName =
                string.Format(
                    "{0}.{1}",
                    className,
                    MethodBase.GetCurrentMethod().Name);

            WriteLog.Instance.WriteBeginSplitter(strProcedureName);
            try
            {
                WriteLog.Instance.Write("切换选定的生产线", strProcedureName);

                int    errCode = 0;
                string errText = "";

                IRAPMDMClient.Instance.usp_SwitchToProductionLine(
                    IRAPUser.Instance.CommunityID,
                    prdtLine.HostName,
                    prdtLine.T134LeafID,
                    IRAPUser.Instance.SysLogID,
                    out errCode,
                    out errText);
                WriteLog.Instance.Write(string.Format("({0}){1}", errCode, errText), strProcedureName);
                if (errCode == 0)
                {
                    lblCurrentPLineName.Text = prdtLine.ToString();
                    btnSwitch.Enabled        = false;
                    ShowMessageBox.Show(errText, Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    ShowMessageBox.Show(errText, Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception error)
            {
                WriteLog.Instance.Write(error.Message, strProcedureName);
                ShowMessageBox.Show(error.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                WriteLog.Instance.WriteEndSplitter(strProcedureName);
            }
        }
Пример #3
0
        protected void RefreshCurrentProductionLine()
        {
            currentProductionLine = GetBoundAndonHost();
            if (currentProductionLine != null)
            {
                if (Thread.CurrentThread.CurrentUICulture.Name.Substring(0, 2) == "en")
                {
                    lblProductionLine.Text =
                        string.Format(
                            "Current production line: {0}",
                            currentProductionLine.T134NodeName);

                    if (currentProductionLine.IsStoped)
                    {
                        lblProductionLine.ForeColor = Color.Red;
                        lblProductionLine.Text     += "  (Stopped)";
                    }
                    else
                    {
                        lblProductionLine.ForeColor = Color.Green;
                    }
                }
                else
                {
                    lblProductionLine.Text =
                        string.Format(
                            "当前产线:{0}",
                            currentProductionLine.T134NodeName);

                    if (currentProductionLine.IsStoped)
                    {
                        lblProductionLine.ForeColor = Color.Red;
                        lblProductionLine.Text     += "  (已停线)";
                    }
                    else
                    {
                        lblProductionLine.ForeColor = Color.Green;
                    }
                }
            }
            else
            {
                lblProductionLine.ForeColor = Color.Green;

                if (Thread.CurrentThread.CurrentUICulture.Name.Substring(0, 2) == "en")
                {
                    lblProductionLine.Text = "Current production line: None";
                }
                else
                {
                    lblProductionLine.Text = "当前产线:无";
                }
            }
        }
Пример #4
0
        private void cboProductionLines_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboProductionLines.SelectedItem == null)
            {
                btnSwitch.Enabled = false;
                return;
            }

            ProductionLineForStationBound prdtLine = cboProductionLines.SelectedItem as ProductionLineForStationBound;

            btnSwitch.Enabled = prdtLine.ToString() != lblCurrentPLineName.Text;
        }
Пример #5
0
        private void frmSwitchToPLine_30_Activated(object sender, EventArgs e)
        {
            string strProcedureName =
                string.Format(
                    "{0}.{1}",
                    className,
                    MethodBase.GetCurrentMethod().Name);

            WriteLog.Instance.WriteBeginSplitter(strProcedureName);
            try
            {
                cboProductionLines.Properties.Items.Clear();
                btnSwitch.Enabled = false;
                WriteLog.Instance.Write("获取当前站点绑定的生产线清单", strProcedureName);

                int    errCode = 0;
                string errText = "";

                IRAPMDMClient.Instance.ufn_GetList_StationBoundProductionLines(
                    IRAPUser.Instance.CommunityID,
                    IRAPUser.Instance.SysLogID,
                    ref lines,
                    out errCode,
                    out errText);
                WriteLog.Instance.Write(string.Format("({0}){1}", errCode, errText), strProcedureName);
                if (errCode == 0)
                {
                    foreach (ProductionLineForStationBound line in lines)
                    {
                        cboProductionLines.Properties.Items.Add(line);
                    }

                    ProductionLineForStationBound currentPrdtLine = GetBoundedProductionLine(lines);
                    if (currentPrdtLine != null)
                    {
                        cboProductionLines.SelectedItem = currentPrdtLine;
                        lblCurrentPLineName.Text        = currentPrdtLine.ToString();
                    }
                    else
                    {
                        lblCurrentPLineName.Text = "";
                    }
                }
            }
            catch (Exception error)
            {
                WriteLog.Instance.Write(error.Message, strProcedureName);
            }
            finally
            {
                WriteLog.Instance.WriteEndSplitter(strProcedureName);
            }
        }
Пример #6
0
        private ProductionLineForStationBound GetBoundedProductionLine(List <ProductionLineForStationBound> prdtLines)
        {
            ProductionLineForStationBound prdtLine = null;

            foreach (ProductionLineForStationBound productionLine in lines)
            {
                if (productionLine.BoundToAndonHost)
                {
                    prdtLine = productionLine;
                    break;
                }
            }
            return(prdtLine);
        }
Пример #7
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);
            }
        }
Пример #8
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);
            }
        }