using MV485.helper; using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MV485.model { public class TSlaveDetail : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } public string DetailId { get; set; } public string SlaveId { get; set; } public string DeviceSn { get; set; } public string ReadTime { get; set; } public ulong SampleResult { get; set; } public string SampleResultName { get { if(MeterType > 0 && MeterType <= 3) { return ((double)SampleResult / Constant.CUBE_VALUE).ToString(); } return ""; } } public string SampleTime { get; set; } public int MeterType { get; set; } public string MeterResult { get { //return MeterType.ToString(); if (!string.IsNullOrEmpty(SampleTime)) { return Tools.GetResultTypeName((byte)MeterType); } else { return ""; } } } public string ImageFile { get; set; } private int _index; public int Index { get => _index; set { if(_index != value) { _index = value; OnPropertyChanged(nameof(Index)); } } } public string ImageSource { get { if (File.Exists(ImageFile)) { return ImageFile; } else { return null; } } } private string _readMemo; public string ReadMemo { get => _readMemo; set { if(_readMemo != value) { _readMemo = value; OnPropertyChanged(nameof(ReadMemo)); } } } //-------------------------------------------------------------------- } }