Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow oRow in dgvAlarmView.SelectedRows)
            {
                //oRow.Cells["colTime"].Value;
                string code = oRow.Cells["colAlarmId"].Value.ToString();

                int eqpAlarmCode = 0;
                int.TryParse(code, out eqpAlarmCode);

                eqpAlarmCode = eqpAlarmCode - 30000;
                //oRow.Cells["colType"].Value;
                //oRow.Cells["colPosition"].Value;
                //oRow.Cells["colMessage"].Value;
                string clearable = oRow.Cells["colClearable"].Value.ToString();

                if (clearable == "Y")
                {
                    ACommand command = CUIManager.Inst.GetCommand("REQUEST");
                    command.SubCommandName = "ALARM_RESET";
                    command.AddParameter("ALARM_CODE", eqpAlarmCode.ToString());
                    command.Execute();
                }
            }
        }
Exemple #2
0
        private void AutoRecipeModeChange(bool enable)
        {
            ACommand command = CUIManager.Inst.GetCommand("MENU");

            command.SubCommandName = "AUTO_RECIPE_CHANGE";
            command.AddParameter("AUTO_RECIPE_CHANGE", enable.ToString());
            command.Execute();
        }
Exemple #3
0
        private void ExchangeModeChange(bool exchangeMode)
        {
            ACommand command = CUIManager.Inst.GetCommand("MENU");

            command.SubCommandName = "EXCHANGE_MODE_CHANGE";
            command.AddParameter("EXCHANGE_MODE", exchangeMode.ToString());
            command.Execute();
        }
Exemple #4
0
        private void ExchangePossibleModeChange(bool value)
        {
            ACommand command = CUIManager.Inst.GetCommand("MENU");

            command.SubCommandName = "EXCHANGE_POSSIBLE_CHANGE";
            command.AddParameter("EXCHANGE_POSSIBLE", value.ToString());
            command.Execute();
        }
Exemple #5
0
        private void DownstreamInlineModeChange(bool value)
        {
            ACommand command = CUIManager.Inst.GetCommand("MENU");

            command.SubCommandName = "DOWNSTREAM_INLINE_MODE_CHANGE";
            command.AddParameter("DOWNSTREAM_INLINE_MODE", value.ToString());
            command.Execute();
        }
Exemple #6
0
        private void EqpModeChange(int mode)
        {
            ACommand command = CUIManager.Inst.GetCommand("MENU");

            command.SubCommandName = "EQP_MODE_CHANGE";
            command.AddParameter("EQP_MODE", mode.ToString());
            command.Execute();
        }
Exemple #7
0
        private void CIMModeChange(short cimMode)
        {
            ACommand command = CUIManager.Inst.GetCommand("MENU");

            command.SubCommandName = "CIM_MODE_CHANGE";
            command.AddParameter("CIM_MODE", cimMode.ToString());
            command.Execute();
        }
Exemple #8
0
        private void frmLinkSignal_VisibleChanged(object sender, EventArgs e)
        {
            _timer.Enabled = this.Visible;

            ACommand command = CUIManager.Inst.GetCommand("REQUEST");

            command.SubCommandName = "LINK_SIGNAL_UPDATE";
            command.AddParameter("UPDATE", this.Visible.ToString());
            command.Execute();
        }
Exemple #9
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text == "")
            {
                MessageBox.Show("PPID Select Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            foreach (DataGridViewRow item in dgvPPIDRecipeMapView.Rows)
            {
                if (item.Cells["colPPID"].Value.ToString() == comboBox1.Text)
                {
                    MessageBox.Show("PPID Duplication Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }

            ACommand command = CUIManager.Inst.GetCommand("REQUEST");

            command.AddParameter("PPID", comboBox1.Text);
            command.AddParameter("RECIPEID", comboBox2.Text);
            command.AddParameter("PPCINFO", "1");
            command.AddParameter("TIME", DateTime.Now.ToString());
            command.AddParameter("USER", textBox2.Text);
            command.AddParameter("DESC", textBox1.Text);
            command.SubCommandName = "PPID_MAP_REPORT";
            command.Execute();
        }
Exemple #10
0
        private void StageLinkSignaOnOff_Click(object sender, EventArgs e)
        {
            Control control = sender as Control;

            if (control.Tag == null)
            {
                return;
            }
            ACommand command = CUIManager.Inst.GetCommand("REQUEST");

            command.SubCommandName = "STAGE_LINK_SIGNAL_ON/OFF";
            command.AddParameter("SIGNAL_NAME", control.Tag.ToString());
            command.Execute();
        }
Exemple #11
0
        private void Button2_Click(object sender, EventArgs e)
        {
            try
            {
                ACommand command = CUIManager.Inst.GetCommand("REQUEST");
                command.SubCommandName = "SCRAP_REPORT";
                command.AddParameter("GLASSID", TextBox3.Text);

                if (comboBox1.Text == "Whole" || comboBox1.Text == "A")
                {
                    command.AddParameter("SCRAPINDEX", "0");
                }
                else
                {
                    command.AddParameter("SCRAPINDEX", "1");
                }

                command.Execute();
            }
            catch
            {
            }
        }
Exemple #12
0
        private void UpstreamInlineModeChange(bool value)
        {
            //if (value)
            //{
            //    lblUpstreamInlineMode.Text = "ON";
            //    lblUpstreamInlineMode.BackColor = Color.Lime;
            //}
            //else
            //{
            //    lblUpstreamInlineMode.Text = "OFF";
            //    lblUpstreamInlineMode.BackColor = Color.Red;
            //}

            ACommand command = CUIManager.Inst.GetCommand("MENU");

            command.SubCommandName = "UPSTREAM_INLINE_MODE_CHANGE";
            command.AddParameter("UPSTREAM_INLINE_MODE", value.ToString());
            command.Execute();
        }
Exemple #13
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text == "")
            {
                MessageBox.Show("PPID Select Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            ACommand command = CUIManager.Inst.GetCommand("REQUEST");

            command.AddParameter("PPID", comboBox1.Text);
            command.AddParameter("RECIPEID", comboBox2.Text);
            command.AddParameter("PPCINFO", "3");
            command.AddParameter("TIME", DateTime.Now.ToString());
            command.AddParameter("USER", textBox2.Text);
            command.AddParameter("DESC", textBox1.Text);
            command.SubCommandName = "PPID_MAP_REPORT";
            command.Execute();
        }
Exemple #14
0
        private void btnChange_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text == "")
            {
                MessageBox.Show("PPID Select Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            bool mExistFlag = false;

            foreach (DataGridViewRow item in dgvPPIDRecipeMapView.Rows)
            {
                if (item.Cells["colPPID"].Value.ToString() == comboBox1.Text)
                {
                    ACommand command = CUIManager.Inst.GetCommand("REQUEST");
                    command.AddParameter("PPID", comboBox1.Text);
                    command.AddParameter("RECIPEID", comboBox2.Text);
                    command.AddParameter("PPCINFO", "4");
                    command.AddParameter("TIME", DateTime.Now.ToString());
                    command.AddParameter("USER", textBox2.Text);
                    command.AddParameter("DESC", textBox1.Text);
                    command.SubCommandName = "PPID_MAP_REPORT";
                    command.Execute();

                    mExistFlag = true;
                    break;
                }
            }

            if (!mExistFlag)
            {
                MessageBox.Show("PPID Exist Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }



            //bool mExistFlag = false;

            //foreach (DataGridViewRow item in dgvPPIDRecipeMapView.Rows)
            //{
            //    if (item.Cells["colPPID"].Value.ToString() == comboBox1.Text)
            //    {

            //        mExistFlag = true;
            //        break;
            //    }
            //}

            //if (mExistFlag)
            //{
            //    MessageBox.Show("PPID Exist Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    return;
            //}

            //ACommand command = CUIManager.Inst.GetCommand("REQUEST");
            //command.AddParameter("PPID", comboBox1.Text);
            //command.AddParameter("RECIPEID", comboBox2.Text);
            //command.AddParameter("PPCINFO", "4");
            //command.AddParameter("TIME", DateTime.Now.ToString());
            //command.AddParameter("USER", textBox2.Text);
            //command.AddParameter("DESC", textBox1.Text);
            //command.SubCommandName = "PPID_MAP_REPORT";
            //command.Execute();
        }
Exemple #15
0
        protected override int InnerExecute()
        {
            Thread.Sleep(500);
            string   errorType = "";
            ACommand command   = null;

            bool   noResponse = false;
            bool   isTimeout  = false;
            bool   isOffline  = false;
            string id         = "";
            string rcvYNFlag  = "0";

            string strJigId      = "";
            string strResultCode = "";
            string strBoltCnt    = "";
            string strBMSID_A    = "";
            string strBMSID_B    = "";
            string strBMSID_Sum  = "";
            int    count         = 0;

            this.StatusChange(enumProgramStatus.PROCESSING);

            this.Log("STEP00");
            List <string> apdData = new List <string>();

            apdData = new List <string>(_BMS_Assy_WZControl.IW_APD.Split(' '));

            strJigId      = apdData[0].Trim('\0');
            strResultCode = apdData[1].Trim('\0');
            strBoltCnt    = apdData[2].Trim('\0'); // 영역 확인 필요함

            string tempA = "";

            for (int i = 16; i < 32; i++)
            {
                tempA += SmartDevice.UTILS.PLCUtils.HexToAscii(SmartDevice.UTILS.PLCUtils.DecToHex(apdData[i])).Trim();
            }
            strBMSID_A = tempA.Trim('\0');

            string tempB = "";

            for (int i = 32; i < 48; i++)
            {
                tempB += SmartDevice.UTILS.PLCUtils.HexToAscii(SmartDevice.UTILS.PLCUtils.DecToHex(apdData[i])).Trim();
            }
            strBMSID_B = tempB.Trim('\0');

            if (strBMSID_A != "")
            {
                if (strBMSID_B != "")
                {
                    strBMSID_Sum = strBMSID_A + "@" + strBMSID_B;
                }
                else
                {
                    strBMSID_Sum = strBMSID_A;
                }
            }
            else
            {
                if (strBMSID_B != "")
                {
                    strBMSID_Sum = strBMSID_B;
                }
            }

            //CTimeout timeout = CTimeoutManager.GetTimeout(this.ControlName, T1);
            //timeout.TargetOffValueCheck = true;
            //timeout.Begin(_BMS_Assy_WZControl._OB_WORK_COMPLETE_APD_CONFIRM, _BMS_Assy_WZControl.__IB_WORK_COMPLETE_APD as ITimeoutResource);

            //_BMS_Assy_WZControl.OB_WORK_COMPLETE_APD_CONFIRM = true;

            //if (!CTimeout.WaitSync(timeout, 10))
            //{

            //}

            //_BMS_Assy_WZControl.OB_WORK_COMPLETE_APD_CONFIRM = false;
            this.Log("STEP01 JIGID:" + strJigId + " JUDGE:" + strResultCode + " BoltCnt:" + strBoltCnt + " BMSID_A:" + strBMSID_A + " BMSID_B:" + strBMSID_B);
            if (_main.Hsms1.CommunicationsState == Library.Manager.enumCommunicationsState.ENABLED_COMMUNICATING && _main.Hsms1.ControlState == Library.Manager.enumControlState.ONLINE_REMOTE)
            {
                //_main.Hsms1.BMSAssyAPDReport.RcvFlag = false;
                _main.Hsms1.BMSAssyAPDReportRCMD.RcvFlag = false;
                this.Log("STEP02");

                //_main.Hsms1.GetVIDItem("103").Value = DateTime.Now.ToString("yyyyMMddHHmmss");//103	Clock
                //_main.Hsms1.GetVIDItem("110").Value = _BMS_Assy_WZControl.UnitNo;//110 Unit ID
                //_main.Hsms1.GetVIDItem("315").Value = strJigId;//315 JIGID
                //_main.Hsms1.GetVIDItem("350").Value = strBMSID_Sum;//350 BMSID
                //_main.Hsms1.GetVIDItem("375").Value = strResultCode;//375 Judge
                //_main.Hsms1.GetVIDItem("388").Value = strBoltCnt;//388 Bolt Count

                //_main.Hsms1.S6F11_SendMessage(Library.Manager.CHSMSEQPManager.enumCEID.ID1100_BMS_Ass_y_APD_Report);

                string clock  = DateTime.Now.ToString("yyyyMMddHHmmss");
                string unitID = _BMS_Assy_WZControl.UnitNo.ToString();

                _main.Hsms1.S6F11_SendID1100(Library.Manager.CHSMSEQPManager.enumCEID.ID1100_BMS_Ass_y_APD_Report, clock, unitID, strJigId, strBMSID_Sum, strResultCode, strBoltCnt);

                bool waitCmd = CSystemConfig.GetOption("WAIT_HOST_CMD", bool.TrueString, new List <string>()
                {
                    "True", "False"
                }).GetBoolValue1();
                while (!_main.Hsms1.BMSAssyAPDReportRCMD.RcvFlag && (count++ < 4000 || waitCmd))
                {
                    Thread.Sleep(10);
                }

                noResponse = !_main.Hsms1.BMSAssyAPDReportRCMD.RcvFlag;
                isTimeout  = noResponse;

                if (_main.Hsms1.BMSAssyAPDReportRCMD.RcvFlag)
                {
                    _main.Hsms1.BMSAssyAPDReportRCMD.RcvFlag = false;
                    rcvYNFlag = _main.Hsms1.BMSAssyAPDReportRCMD.GetPLCYNFlag();
                }

                //bool waitCmd = CSystemConfig.GetOption("WAIT_HOST_CMD", bool.TrueString, new List<string>() { "True", "False" }).GetBoolValue1();
                //while (!_main.Hsms1.BMSAssyAPDReport.RcvFlag && (count++ < 4000 || waitCmd))
                //{
                //    Thread.Sleep(10);
                //}
                //noResponse = !_main.Hsms1.BMSAssyAPDReport.RcvFlag;
                //isTimeout = noResponse;
            }
            else
            {
                this.Log("STEP03");
                isOffline  = true;
                noResponse = true;
            }

            if (noResponse)
            {
                string reason = "";
                if (isOffline)
                {
                    id     = "E0";//OFFLINE
                    reason = "MES OFFLINE";
                }
                else if (isTimeout)
                {
                    id     = "E1";//TIMEOUT
                    reason = "MES TIMEOUT";
                }
                else
                {
                    id     = "E9";//UNKNOWN
                    reason = "MES UNKNOWN";
                }

                this.Log("STEP04 NO RESPONSE PGM106_01 SET ID=" + id);

                //CUIManager.ShowMsgForm(msgId, "", message, enumButtonType.RETRY | enumButtonType.OK, new List<string>() { "REQUEST:LM_DATA_REQ", "" });

                command = CUIManager.Inst.GetCommand("Form");
                command.SetSubCommand("ShowMessageForm");
                command.AddParameter("MSG_NO", "PGM00002");
                command.AddParameter("ERR_MSG", "UNIT NO : " + _BMS_Assy_WZControl.UnitNo + " BMS_ASSY_APD_REPORT " + reason + " ERR <" + id + ">");
                command.AddParameter("MSG", "UNIT NO : " + _BMS_Assy_WZControl.UnitNo + " BMS_ASSY_APD_REPORT " + reason + " ERR <" + id + ">");
                command.AddParameter("TAG", string.Format("{0},{1},{2}", this.Name, T2, id));
                command.AddParameter("BUTTON_TYPE", "OK");
                command.AddParameter("RETURN_CMD", "");
                command.Execute();

                CBasicControl component = null;
                Dictionary <string, string> messageValues = new Dictionary <string, string>();

                component = _main.GetComponent("WORK_CV04");
                messageValues.Add("MESSAGE", reason);
                component.GetProgram("EQP_MESSAGE_DISPLAY").Execute(messageValues);
            }

            CTimeout timeout = CTimeoutManager.GetTimeout(this.ControlName, T1);

            timeout.TargetOffValueCheck = true;
            timeout.Begin(_BMS_Assy_WZControl._OB_WORK_COMPLETE_APD_CONFIRM, _BMS_Assy_WZControl.__IB_WORK_COMPLETE_APD as ITimeoutResource);

            bool plcTest = CSystemConfig.GetOption("PLC_TEST_FLAG", bool.FalseString, new List <string>()
            {
                "True", "False"
            }).GetBoolValue1();

            if ((!isOffline && !isTimeout) || (plcTest && isOffline))
            {
                _BMS_Assy_WZControl.OB_WORK_COMPLETE_APD_CONFIRM = true;

                if (!CTimeout.WaitSync(timeout, 10))
                {
                }
                _BMS_Assy_WZControl.OB_WORK_COMPLETE_APD_CONFIRM = false;

                if (errorType == "")
                {
                    return(0);
                }
                this.Log("STEP07");
                #region 메시지 창 표시

                //CUIManager.ShowMsgForm(msgId, "", message, enumButtonType.RETRY | enumButtonType.OK, new List<string>() { "REQUEST:LM_DATA_REQ", "" });

                //command = CUIManager.Inst.GetCommand("Form");
                //command.SetSubCommand("ShowMessageForm");
                //command.AddParameter("MSG_NO", "PGM00001");
                //command.AddParameter("TAG", string.Format("{0},{1},{2}", this.Name, T1, id));
                //command.AddParameter("BUTTON_TYPE", "OK");
                //command.AddParameter("RETURN_CMD", ",REQUEST:BMS_ASSY_APD_REPORT");
                //command.Execute();

                #endregion
            }
            else
            {
            }

            return(-1);
        }