private void CheckLaserInfo() { LaserC00Request c00 = new LaserC00Request(); var bytes = serialPortCom.Encode(c00); byte[] recData = serialPortCom.SendData(bytes); if (recData != null) { LaserBaseResponse baseResponse = serialPortCom.LaserBaseResponse(bytes, recData); if (baseResponse != null) { LaserC00Response c00r = baseResponse as LaserC00Response; if (c00r != null) { lblLaserVersion.Text = c00r.VersionNumber.ToString(); lblWorkingHour.Text = string.Format("{0} : {1}", c00r.Hour, c00r.Month); } } } }
private void InitializeDecoders() { Decoders = new Dictionary <byte, LaserBaseResponse>(); Decoders[0x00] = new LaserC00Response(); Decoders[0x01] = new LaserC01Response(); Decoders[0x03] = new LaserC03Response(); Decoders[0x04] = new LaserC04Response(); Decoders[0x05] = new LaserC05Response(); Decoders[0x06] = new LaserC06Response(); Decoders[0x07] = new LaserC07Response(); Decoders[0x08] = new LaserC08Response(); Decoders[0x09] = new LaserC09Response(); Decoders[0x0B] = new LaserC0BResponse(); Decoders[0x0C] = new LaserC0CResponse(); Decoders[0x71] = new LaserC71Response(); Decoders[0x72] = new LaserC72Response(); Decoders[0x73] = new LaserC73Response(); Decoders[0x74] = new LaserC74Response(); Decoders[0x75] = new LaserC75Response(); //initialize default decoder Decoder = Decoders[0x00]; }