|
|
@@ -33,9 +33,26 @@ namespace VehicleControlSystem.ControlLayer.Serial.DataModel
|
|
|
|
|
|
public class ReceivedData
|
|
|
{
|
|
|
- public Enum DataKind { get; set; } = eDataKind.BatteryState;
|
|
|
+ public eDataKind DataKind { get; set; } = eDataKind.BatteryState;
|
|
|
public eBatteryState BatteryState { get; set; }
|
|
|
- public double Value { get; set; }
|
|
|
+ public double? Value {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ if ( this.DataKind != eDataKind.BatteryState )
|
|
|
+ {
|
|
|
+ double dOrg = 0d;
|
|
|
+ double.TryParse( this.OrgVule , out dOrg );
|
|
|
+
|
|
|
+ return dOrg;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public string OrgVule { get; set; }
|
|
|
+
|
|
|
public double Scale { get; set; }
|
|
|
public string Unit { get; set; }//단위를 붙이기 위해
|
|
|
public bool IsChanged { get; set; }
|
|
|
@@ -45,9 +62,9 @@ namespace VehicleControlSystem.ControlLayer.Serial.DataModel
|
|
|
this.DataKind = kind;
|
|
|
}
|
|
|
|
|
|
- public override string ToString()
|
|
|
- {
|
|
|
- return this.Value.ToString() + " " + this.Unit;
|
|
|
- }
|
|
|
+ //public override string ToString()
|
|
|
+ //{
|
|
|
+ // return this.Value.ToString() + " " + this.Unit;
|
|
|
+ //}
|
|
|
}
|
|
|
}
|