//-------------------------------------------------------------------------------------------------
        public void SetAlarm(int no)
        {
            Alarm pmcAlarm = new Alarm(no);

            pmcPacket packet = new pmcPacket();

            packet.DataClear();
            packet.Signal = (int)COMMAND.cmdAlarm;
            packet.Reply  = (int)REPLY.ack_Success;
            packet.PushData <Alarm>(pmcAlarm);

            fn_EnqueuePacket(packet);
        }
        //---------------------------------------------------------------------------
        private void PollingThread(object obj)
        {
            Queue <pmcPacket> que = obj as Queue <pmcPacket>;

            while (true)
            {
                Thread.Sleep(100);
                if (que.Count < 1)
                {
                    continue;
                }

                pmcPacket stPacket = que.Dequeue();
                if (m_bUsePollLog)
                {
                    printf("[Polling. Packet Recv] " + (COMMAND)stPacket.Signal);
                }

                switch ((COMMAND)stPacket.Signal)
                {
                case COMMAND.cmdCurrentState:
                    stPacket.DataClear();
                    stPacket.Reply = (int)REPLY.ack_Success;
                    stPacket.PushData <State>(curState);
                    SendPacket(stPacket);
                    break;

                case COMMAND.cmdCurrentData:
                    DataList curDataList = new DataList();
                    curDataList.Add(data); curDataList.Add(data2); curDataList.Add(data3); curDataList.Add(data4);
                    stPacket.DataClear();
                    stPacket.Reply = (int)REPLY.ack_Success;
                    stPacket.PushData <DataList>(curDataList);
                    SendPacket(stPacket);
                    break;
                }
            }
        }
Beispiel #3
0
        public void fn_SetSendMsg()
        {
            pmcPacket packet = new pmcPacket();

            packet.DataClear();
            packet.Src    = 6;
            packet.Dest   = 0;
            packet.UnitID = 1;
            packet.Signal = (int)COMMAND.cmdVersion;
            packet.Reply  = (int)REPLY.ack_Success;
            packet.SeqNo  = 0;
            packet.Size   = (int)stVersion.datasize;
            packet.PushData <Samsung.PMC.Packet.Body.Version>(stVersion);
            Server.fn_PushSendQueue(packet);
        }
Beispiel #4
0
        //---------------------------------------------------------------------------
        public void fn_SendCommand(COMMAND cmd)
        {
            //Local Var.
            pmcPacket stPacket = new pmcPacket();

            stPacket.DataClear();
            stPacket.Signal = (int)cmd;

            switch (cmd)
            {
            case COMMAND.cmdStop:

                stPacket.Reply = (int)REPLY.req_AckUse;
                break;

            case COMMAND.cmdCycleStop:

                stPacket.Reply = (int)REPLY.req_AckUse;
                break;

            case COMMAND.cmdOrigin:

                stPacket.Reply = (int)REPLY.req_AckUse;
                break;

            case COMMAND.cmdModeChange:
                //if (m_nModeTest++ == 0) pmcMode = new Mode(MODE.Manual);
                //else
                //{
                //    pmcMode = new Mode(MODE.Offline);
                //    m_nModeTest = 0;
                //}
                //stPacket.Reply  = (int)REPLY.req_AckUse;
                //stPacket.PushData<Mode>(pmcMode);
                break;

            case COMMAND.cmdPrepareProc:
                stPacket.Reply = (int)REPLY.ack_Success;
                break;

            case COMMAND.cmdLoadStart:
                stPacket.Reply = (int)REPLY.ack_Success;
                break;

            case COMMAND.cmdUnloadStart:
                stPacket.Reply = (int)REPLY.ack_Success;
                break;

            case COMMAND.cmdAlarm:
                break;

            case COMMAND.cmdAreYouAlive:
                break;

            case COMMAND.cmdRunProc:
                break;

            case COMMAND.cmdVersion:
                break;

            case COMMAND.cmdCurrentState:
                break;

            case COMMAND.cmdCurrentData:
                break;

            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            case COMMAND.cmdTimeSync:
                break;

            case COMMAND.cmdWaferIn:
                break;

            case COMMAND.cmdJobStart:
                break;

            case COMMAND.cmdWaferOut:
                break;

            case COMMAND.cmdAutoOp:
                break;

            case COMMAND.cmdAutoOpEnd:
                break;

            case COMMAND.cmdRunRecipe:
                break;

            case COMMAND.cmdLotInfo:
                break;

            case COMMAND.cmdDieIn:
                break;

            case COMMAND.cmdWaferInfo:
                break;

            case COMMAND.cmdMountInfo:
                break;

            case COMMAND.cmdSpecimenInfo:
                break;

            case COMMAND.cmdState:
                break;

            case COMMAND.cmdPMCRequest:
                break;

            case COMMAND.cmdRunRecipeList:
                break;

            case COMMAND.cmdDicingInfoList:
                break;

            default:
                return;
            }

            fn_EnqueuePacket(stPacket);

            printf("[MANUAL]" + (COMMAND)stPacket.Signal, true);
        }
        //---------------------------------------------------------------------------
        private void ProcThread(object obj)
        {
            Queue <pmcPacket> que = obj as Queue <pmcPacket>;
            SJob       job;
            SJobStruct struct_data;

            while (true)
            {
                Thread.Sleep(100);
                if (que.Count < 1)
                {
                    continue;
                }

                pmcPacket stPacket = que.Dequeue();
                printf("[Proc. Packet Recv] " + (COMMAND)stPacket.Signal);

                switch ((COMMAND)stPacket.Signal)
                {
                case COMMAND.cmdTimeSync:
                    TimeSync pmcTime = new TimeSync();
                    pmcTime = stPacket.GetData <TimeSync>();
                    //
                    SetTime(pmcTime);
                    break;

                case COMMAND.cmdVersion:
                    break;

                case COMMAND.cmdAreYouAlive:
                    stPacket.DataClear();
                    stPacket.Reply = (int)REPLY.ack_Success;
                    SendPacket(stPacket);

                    m_bAlive = !m_bAlive;     //Connection Check

                    break;

                case COMMAND.cmdPrepareProc:
                    job         = stPacket.GetData <SJob>();
                    struct_data = job.getStructData();

                    //WriteOperationLog("Prepare", true);

                    m_bPrepare = true;

                    //SetProcState(0, PROCESS_STATE.IDLE);

                    //printf("[Prepare Proc] count : " + job.Count + " job id : " + job[0].sjob_id);
                    //stPacket.Reply = (int)REPLY.ack_Success;
                    //SendPacket(stPacket);
                    break;

                case COMMAND.cmdLoadStart:
                    //List<SpecimenInfo> specimen_info = stPacket.GetDataList<SpecimenInfo>(); //List로 올수도 있음. 설비별로 다름.
                    job         = stPacket.GetData <SJob>();
                    struct_data = job.getStructData();
                    //SetPortState(0, PORT_STATE.LOADING);
                    //SetPortState(1, PORT_STATE.IDLE);

                    //curState.ProcessState.count = 0; //clear
                    //curState.ProcessState.Add(PROCESS_STATE.READY);
                    //printf("[Loading Proc] count : " + specimen_info.Count + " specimen id : " + specimen_info[0].specimen_id);
                    //WriteOperationLog("Load", true);

                    m_bLoadStart = true;

                    Thread.Sleep(1500);     // 3초간 Loaded상태 유지(Odin - Dashboard)
                    //SetPortState(0, PORT_STATE.LOADED);
                    //SetPortState(1, PORT_STATE.IDLE);
                    //stPacket.Reply = (int)REPLY.ack_Success;
                    //SendPacket(stPacket);
                    Thread.Sleep(3000);     // 3초간 Loaded상태 유지(Odin - Dashboard)
                    break;

                case COMMAND.cmdRunProc:
                    //Body Data 없음.
                    job         = stPacket.GetData <SJob>();
                    struct_data = job.getStructData();
                    //SetProcState(0, PROCESS_STATE.PROCESSING);
                    //printf("[Processing Proc]");
                    //WriteOperationLog("Process");

                    m_bProcessStart = true;
                    //SetProcState(0, PROCESS_STATE.PROCESSING_DONE);
                    //stPacket.Reply = (int)REPLY.ack_Success;

                    //Unload Ready
                    //printf("[Unload Ready Proc]");
                    //WriteOperationLog("Unload Ready");
                    //data.setValue((int)0);

                    //SendPacket(stPacket);

                    //SetPortState(0, PORT_STATE.LOADED);
                    //SetPortState(1, PORT_STATE.UNLOAD_READY);
                    Thread.Sleep(3000);     // 3초간 UNLOAD_READY 상태 유지(Odin - Dashboard)
                    break;

                case COMMAND.cmdUnloadStart:
                    //SpecimenInfo specimen_info_unload = stPacket.GetData<SpecimenInfo>(); //List로 올수도 있음. 설비별로 다름.
                    job         = stPacket.GetData <SJob>();
                    struct_data = job.getStructData();
                    //SetPortState(0, PORT_STATE.LOADED);
                    //SetPortState(1, PORT_STATE.UNLOADING);
                    //printf("[UnLoading Proc] specimen id : " + specimen_info_unload.specimen_id);
                    //WriteOperationLog("Unload", true);

                    m_bUnloadStart = true;

                    //stPacket.Reply = (int)REPLY.ack_Success;
                    //SendPacket(stPacket);

                    ////TheEnd
                    //SetPortState(0, PORT_STATE.IDLE);
                    //SetPortState(1, PORT_STATE.IDLE);
                    //SetProcState(0, PROCESS_STATE.IDLE);
                    break;

                default:
                    COMMAND command = (COMMAND)stPacket.Signal;
                    string  str     = command.ToString() + ":";
                    if (command == COMMAND.cmdTimeSync)
                    {
                        TimeSync timesync = stPacket.GetData <TimeSync>();
                        str += timesync.Year + "_" + timesync.Month + "_" + timesync.Day + "_" + timesync.Hour + "_" + timesync.Minute + "_" + timesync.Second;
                    }
                    else if (command == (COMMAND.cmdModeChange))
                    {
                        int Mode = stPacket.Data[0];
                        str += Mode;
                    }

                    //WriteOperationLog(str);

                    stPacket.Reply = (int)REPLY.ack_Success;
                    SendPacket(stPacket);
                    break;
                }
            }
        }