Ejemplo n.º 1
0
        private void OnRemoteCommandCancel(ProcessCancelEventWithArgs e)
        {
            EventHandler <ProcessCancelEventWithArgs> handler = FireRemoteCommandCancel;

            if (handler != null)
            {
                handler(this, e);
            }
            //TODO - if no listeners are attached we need to respond with an error code
        }
Ejemplo n.º 2
0
        //-[General message from GEM Box]-
        void gemClient_ReceivedCmd(object sender, EventArgs e)
        {
            string strRtn = (string)gemClient.GetNextCommand();

            //-[string return will be comma deliminated]-
            string[] strArray = strRtn.Split(',');

            string sentCmd = strArray[0];
            EventHandler <MessageEventArgs> msgSent = MessageSent;

            if (msgSent != null)
            {
                msgSent(this, new MessageEventArgs(sentCmd));
            }

            string response = strArray.Length > 1 ? strArray[1] : "(empty)";
            EventHandler <MessageEventArgs> msgReceived = MessageReceived;

            if (msgReceived != null)
            {
                msgReceived(this, new MessageEventArgs(response));
            }

            switch (strArray[0])
            {
            case "GetRCSMessage":
                nHeartbeatIndexLast = nHeartbeatIndex;
                nHeartbeatIndex     = Convert.ToInt32(strArray[1]);
                break;

            case "RCMD":
                if (strArray.Length == 1)
                {
                    break;
                }
                switch (strArray[1])
                {
                case "RUN":
                    ProcessRunEventArgs ex = new ProcessRunEventArgs();
                    //-[get CPNAME CPVAL match]-
                    for (int i = 0; i < strArray.Length;)
                    {
                        switch (strArray[i])
                        {
                        case "LotID":
                            ex.sLotID = strArray[++i];
                            break;

                        case "LotRecipe":
                            ex.sLotRecipe = strArray[++i];
                            break;

                        case "CarrierType":
                            ex.sCarrierType = strArray[++i];
                            break;

                        case "SliderType":
                            ex.sSliderType = strArray[++i];
                            break;

                        case "OutputDirectory":
                            ex.sOutputDirectory = strArray[++i];
                            break;

                        case "FailIf":
                            ex.sFailIf = strArray[++i];
                            break;

                        case "SelectedSliders":
                            ex.sSelectedSliders = strArray[++i];
                            break;

                        case "Rows":
                            ex.sRows = strArray[++i];
                            break;

                        case "Columns":
                            ex.sColumns = strArray[++i];
                            break;

                        case "FlowSequenceFile":
                            ex.sFlowSequenceFile = strArray[++i];
                            break;

                        default:
                            i++;
                            break;
                        }
                    }
                    OnRemoteCommandRun(ex);
                    break;

                case "PAUSE":
                    ProcessPauseEventWithArgs ep = new ProcessPauseEventWithArgs();
                    if (strArray.Length < 4)
                    {
                        break;
                    }
                    ep.sLotID = strArray[3];
                    OnRemoteCommandPause(ep);
                    break;

                case "CANCEL":
                    ProcessCancelEventWithArgs ec = new ProcessCancelEventWithArgs();
                    if (strArray.Length < 4)
                    {
                        break;
                    }
                    ec.sLotID = strArray[3];
                    OnRemoteCommandCancel(ec);
                    break;

                default:
                    break;
                }
                break;

            case "PPUL":
                PPUploadEventWithArgs eul = new PPUploadEventWithArgs();
                if (strArray.Length < 6)
                {
                    break;
                }
                eul.sPpid   = strArray[3];
                eul.yPpBody = strArray[5];
                OnPPUpload(eul);
                break;

            case "PPDL":
                PPRequestEventWithArgs erq = new PPRequestEventWithArgs();
                if (strArray.Length < 3)
                {
                    break;
                }
                erq.sPpid = strArray[3];
                OnPPRequest(erq);
                break;

            default:
                break;
            }
        }