123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace PressureGage_3051.MessageEntity.Incoming
- {
- public class ReadUnit_Response : MessageBase
- {
- private Dictionary<byte, string> unitMapper = new Dictionary<byte, string>();
- private Dictionary<byte, string> rangeMapper = new Dictionary<byte, string>();
- public ReadUnit_Response()
- {
- unitMapper[11] = "Pa";
- unitMapper[12] = "KPa";
- unitMapper[237] = "MPa";
- rangeMapper[0] = "1KPa";
- rangeMapper[1] = "6KPa";
- rangeMapper[2] = "40KPa";
- }
- public int DataNumber
- {
- get
- {
- return RawDataField.First();
- }
- }
- public string PressureUnit
- {
- get
- {
- return unitMapper[RawDataField[2]];
- }
- }
- public string StaticPressureUnit
- {
- get
- {
- return unitMapper[RawDataField[4]];
- }
- }
- public DeviceTypeEnum DeviceType
- {
- get
- {
- return (DeviceTypeEnum)RawDataField[6];
- }
- }
- public SensorTypeEnum SensorType
- {
- get
- {
- return (SensorTypeEnum)RawDataField[8];
- }
- }
- public string MeasuringRange
- {
- get
- {
- return rangeMapper[RawDataField[10]];
- }
- }
- public override string ToLogString()
- {
- return base.ToLogString();
- }
- }
- public enum DeviceTypeEnum : byte
- {
- Pressure = 0,
- Temperature = 1,
- Flow = 2
- }
- public enum SensorTypeEnum : byte
- {
- DifferentialPressure = 0,
- GaugePressure = 3,
- AbsolutPressure = 6
- }
- }
|