public PostExecuteResult(LcDataPacket packet) : base(CmdIDType.RUN_POST, packet)
 {
     if (null != packet && packet.Data != null)
     {
         ResultCode = packet.Data[0] | (packet.Data[1] << 8);
     }
 }
 public CommandResultEvent(CmdIDType cmd, LcDataPacket packet) : this(cmd)
 {
     if (null != packet && packet.Data != null)
     {
         Result = (packet.Data[0] == 0x01) ? true : false;
     }
 }
 public ResetOpticalResult(LcDataPacket packet)
     : base(CmdIDType.RESET_OPTICAL_CAL, packet)
 {
     if (null != packet && packet.Data != null)
     {
         ResultCode = packet.Data[0] | (packet.Data[1] << 8);
     }
 }
 public AnalogDataStatusEvent(LcDataPacket packet) : base(packet)
 {
     if (null != packet)
     {
         AnalogData = new ADCData(packet.Data);
         LEDStatus  = new LEDStatusType(packet.Data);
     }
 }
 public SwitchStatusEvent(LcDataPacket packet) : base(packet)
 {
     if (null != packet)
     {
         _sw     = (SwitchID)packet.Data[0];
         _status = SerialMessage.PackWord(packet.Data, 1);
     }
 }
        public SensorStateChangeEvent(LcDataPacket packet) : base(packet)
        {
            byte status = packet.Data[0];

            _state = (status == 1) ? true : false;
            if (_state == true)
            {
                _id = (SensorIDEnum)packet.Data[1];
            }
        }
        public VersionEvent(LcDataPacket packet)
            : base(CmdIDType.GET_VERSION, null)
        {
            UIMajor = SerialMessage.PackWord(packet.Data, 0);
            UIMinor = SerialMessage.PackWord(packet.Data, 2);
            UIBuild = SerialMessage.PackWord(packet.Data, 4);

            CtlMajor = SerialMessage.PackWord(packet.Data, 6);
            CtlMinor = SerialMessage.PackWord(packet.Data, 8);
            CtlBuild = SerialMessage.PackWord(packet.Data, 10);
        }
        public OpticalCalEvent(LcDataPacket packet)
            : base(CmdIDType.GET_OPTICAL_CAL, null)
        {
            target = (UInt16)SerialMessage.PackWord(packet.Data, 0);

            int idx = 2;

            // 8 LED Data Info
            for (int i = 0; i < 8; i++, idx += 18)
            {
                ledData[i]     = new LedDataInfo(packet.Data, idx);
                ledData[i].LED = i;
            }
            //idx += 14;
            CRC = (UInt16)SerialMessage.PackWord(packet.Data, idx);
        }
 public ChannelGainStatusEvent(LcDataPacket packet) : base(packet)
 {
     Channel = packet.Data[0];
     _gain   = packet.Data[1];
 }
 public AnalyzerDataEvent(LcDataPacket packet)
 {
     _data = packet;
 }