Ejemplo n.º 1
0
        private void ReceiveCompleteRecipe(byte tubeIndex, byte stepIndex, OnSynRecipeComplete rCallback, OnSynStepComplete sCallback)
        {
            mSocketObj.socket            = SocketClient.Instance.GetTcpSocket2(tubeIndex);
            mSocketObj.synStepCallback   = sCallback;
            mSocketObj.synRecipeCallback = rCallback;
            mSocketObj.tubeIndex         = tubeIndex;
            if (stepIndex == 0)
            {
                mSocketObj.receiveRecipe = true;
                mSocketObj.stepIndex     = (byte)1;
            }
            else if (stepIndex > 0 && stepIndex < 65)
            {
                mSocketObj.receiveRecipe = false;
                mSocketObj.stepIndex     = stepIndex;
            }

            if (!mSocketObj.socket.Connected)
            {
                mSocketObj.connectCallback = new OnConnectComplete(ReceiveCompleteRecipeAferConnect);
                mSocketObj.tubeIndex       = tubeIndex;
                if (tubeIndex < 4)
                {
                    connect(1);
                }
                else if (tubeIndex > 3)
                {
                    connect(2);
                }
            }
            else
            {
                ReceiveRecipeStep();
            }
        }
Ejemplo n.º 2
0
        public bool SynStep(byte tubeIndex, byte stepIndex, OnSynRecipeComplete rCallback, OnSynStepComplete sCallback)
        {
            //read recipe from device
            mTubeIndex = tubeIndex;
            if (!ComNodeService.Instance.IsConnected())
            {
                return(false);
            }

            ReciveRecipeData(tubeIndex, stepIndex, rCallback, sCallback);
            return(true);
        }
Ejemplo n.º 3
0
        private void ReciveRecipeData(byte tubeIndex, byte stepIndex, OnSynRecipeComplete rCallback, OnSynStepComplete sCallback)
        {
            Thread processRunThread = new Thread(() =>
            {
                //lock (mLock)
                {
                    mRecipeTmpStore = new Demo.utilities.Properties(string.Format("recipe_tmp{0}.data", mTubeIndex));
                    ReceiveCompleteRecipe(tubeIndex, stepIndex, rCallback, sCallback);
                }
            });

            processRunThread.IsBackground = true;
            processRunThread.Start();
        }