Exemplo n.º 1
0
        private void fn_SetState(COMM_STATE nComState, CONTROL_STATE nConState, PORT_STATE nPortState, PROCESS_STATE nProcState, ALARM_STATE nAlarmState)
        {
            stState.CommunicationState = (int)nComState;
            stState.ControlState       = (int)nConState;
            stState.PortState          = (int)nPortState;
            stState.ProcessState       = (int)nProcState;
            stState.AlarmState         = (int)nAlarmState;

            Server.SendPacket.DataClear();
            Server.SendPacket.Reply = (int)REPLY.ack_Success;
            Server.SendPacket.PushData <State>(stState);
            Server.fn_PushSendQueue(Server.SendPacket);
        }
Exemplo n.º 2
0
        //-------------------------------------------------------------------------------------------------
        public void SetPortState(int portNo, PORT_STATE portState)
        {
            if (portNo == (int)EN_PORT_ID.LoadPort)
            {
                m_nLoadPortState = (int)portState;
            }
            else if (portNo == (int)EN_PORT_ID.UnloadPort)
            {
                m_nUnloadPortState = (int)portState;
            }

            var b = ConvertIntToByte((int)portState);

            Array.Copy(b, 0, curState.PortState.portState, portNo * 4, 4);
        }
        public PageSetting_Manual_PMC()
        {
            InitializeComponent();

            //Timer 생성
            m_UpdateTimer.IsEnabled = false;
            m_UpdateTimer.Interval  = TimeSpan.FromMilliseconds(100);
            m_UpdateTimer.Tick     += new EventHandler(fn_tmUpdate);

            //Back Color Set
            this.Background = UserConst.G_COLOR_PAGEBACK;

            ubComm1.Tag  = COMMAND.cmdStop;
            ubComm2.Tag  = COMMAND.cmdCycleStop;
            ubComm3.Tag  = COMMAND.cmdOrigin;
            ubComm4.Tag  = COMMAND.cmdModeChange;
            ubComm5.Tag  = COMMAND.cmdPrepareProc;
            ubComm6.Tag  = COMMAND.cmdLoadStart;
            ubComm7.Tag  = COMMAND.cmdUnloadStart;
            ubComm8.Tag  = COMMAND.cmdAlarm;
            ubComm9.Tag  = COMMAND.cmdAreYouAlive;
            ubComm10.Tag = COMMAND.cmdRunProc;
            ubComm11.Tag = COMMAND.cmdVersion;
            ubComm12.Tag = COMMAND.cmdCurrentState;
            ubComm13.Tag = COMMAND.cmdCurrentData;

            ubComm1.Content  = COMMAND.cmdStop;
            ubComm2.Content  = COMMAND.cmdCycleStop;
            ubComm3.Content  = COMMAND.cmdOrigin;
            ubComm4.Content  = COMMAND.cmdModeChange;
            ubComm5.Content  = COMMAND.cmdPrepareProc;
            ubComm6.Content  = COMMAND.cmdLoadStart;
            ubComm7.Content  = COMMAND.cmdUnloadStart;
            ubComm8.Content  = COMMAND.cmdAlarm;
            ubComm9.Content  = COMMAND.cmdAreYouAlive;
            ubComm10.Content = COMMAND.cmdRunProc;
            ubComm11.Content = COMMAND.cmdVersion;
            ubComm12.Content = COMMAND.cmdCurrentState;
            ubComm13.Content = COMMAND.cmdCurrentData;


            EN_PORT_ID portId = new EN_PORT_ID();

            for (int i = 0; i < Enum.GetNames(typeof(EN_PORT_ID)).Length; i++)
            {
                cbPortNo.Items.Add(portId++);
            }
            EN_PORT_ID procId = new EN_PORT_ID();

            for (int i = 0; i < Enum.GetNames(typeof(EN_PORT_ID)).Length; i++)
            {
                cbProcNo.Items.Add(procId++);
            }
            PORT_STATE temp = new PORT_STATE();

            for (int i = 0; i < Enum.GetNames(typeof(PORT_STATE)).Length; i++)
            {
                cbPortState.Items.Add(temp++);
            }
            PROCESS_STATE tempProc = new PROCESS_STATE();

            for (int i = 0; i < Enum.GetNames(typeof(PROCESS_STATE)).Length; i++)
            {
                cbProcState.Items.Add(tempProc++);
            }
            CONTROL_STATE tempCont = new CONTROL_STATE();

            for (int i = 0; i < Enum.GetNames(typeof(CONTROL_STATE)).Length; i++)
            {
                cbContState.Items.Add(tempCont++);
            }
        }