using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BPASmartClient.Model
{
///
/// 店铺设备
///
public class DeviceConfigModelJson : ObservableObject
{
///
/// 店铺名称
///
public string ShopName { get { return _mShopName; } set { _mShopName = value; OnPropertyChanged(); } }
private string _mShopName = string.Empty;
///
/// 店铺ID
///
public string ShopId { get { return _mShopId; } set { _mShopId = value; OnPropertyChanged(); } }
private string _mShopId = string.Empty;
///
/// 设备集合
///
public ObservableCollection deviceModels { get; set; } = new ObservableCollection();
}
///
/// 启动模块
///
public class DeviceModel : ObservableObject
{
///
/// 设备名称
///
public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
private string _mDeviceName = string.Empty;
///
/// 启动设备模块
///
public string DeviceModule { get { return _mDeviceModule; } set { _mDeviceModule = value; OnPropertyChanged(); } }
private string _mDeviceModule = string.Empty;
public string DeviceNamespace { get; set; }
public string Id { get { return _mId; } set { _mId = value; OnPropertyChanged(); } }
private string _mId = string.Empty;
///
/// 设备ID
///
public string DeviceId { get { return _mDeviceId; } set { _mDeviceId = value; OnPropertyChanged(); } }
private string _mDeviceId = string.Empty;
///
/// 通讯模块
///
public ObservableCollection communicationDevcies { get; set; } = new ObservableCollection();
}
///
/// 通讯模块
///
public class CommunicationModel : ObservableObject
{
///
/// 通讯启动模块
///
public string CommunicationModule { get { return _mCommunicationModule; } set { _mCommunicationModule = value; OnPropertyChanged(); } }
private string _mCommunicationModule = string.Empty;
public string CommunicationNamespace { get; set; }
public string CommunicationName { get { return _mCommunicationName; } set { _mCommunicationName = value; OnPropertyChanged(); } }
private string _mCommunicationName = string.Empty;
public string DeviceModelId { get { return _mDeviceModelId; } set { _mDeviceModelId = value; OnPropertyChanged(); } }
private string _mDeviceModelId = string.Empty;
public CommunicationPar communicationPar { get { return _mcommunicationPar; } set { _mcommunicationPar = value; OnPropertyChanged(); } }
private CommunicationPar _mcommunicationPar = new CommunicationPar();
public ObservableCollection variables { get; set; } = new ObservableCollection();
}
///
/// 通讯参数
///
public class CommunicationPar : ObservableObject
{
///
/// 选择网口通讯
///
public bool IsNetworkPort { get { return _mIsNetworkPort; } set { _mIsNetworkPort = value; OnPropertyChanged(); } }
private bool _mIsNetworkPort = false;
///
/// 选择串口通讯
///
public bool IsSerialPort { get { return _mIsSerialPort; } set { _mIsSerialPort = value; OnPropertyChanged(); } }
private bool _mIsSerialPort = true;
///
/// IP地址
///
public string IPAddress { get { return _mIPAddress; } set { _mIPAddress = value; OnPropertyChanged(); } }
private string _mIPAddress;
///
/// IP 端口号
///
public int IPPort { get { return _mIPPort; } set { _mIPPort = value; OnPropertyChanged(); } }
private int _mIPPort;
///
/// ip 串口 站号
///
public int StationNo { get { return _mStationNo; } set { _mStationNo = value; OnPropertyChanged(); } }
private int _mStationNo;
///
/// 串口单口号
///
public string SerialPort { get { return _mSerialPort; } set { _mSerialPort = value; OnPropertyChanged(); } }
private string _mSerialPort;
///
/// 波特率
///
public int BaudRate { get { return _mBaudRate; } set { _mBaudRate = value; OnPropertyChanged(); } }
private int _mBaudRate;
///
/// 数据位
///
public int DataBits { get { return _mDataBits; } set { _mDataBits = value; OnPropertyChanged(); } }
private int _mDataBits = 8;
///
/// 停止位
///
public string StopBits { get { return _mStopBits; } set { _mStopBits = value; OnPropertyChanged(); } }
private string _mStopBits = "1";
///
/// 校验位
///
public string Parity { get { return _mParity; } set { _mParity = value; OnPropertyChanged(); } }
private string _mParity;
//public ObservableCollection variables { get; set; } = new ObservableCollection();
}
public class Variable : ObservableObject
{
public int Id { get { return _mId; } set { _mId = value; OnPropertyChanged(); } }
private int _mId;
public string Address { get { return _mAddress; } set { _mAddress = value; OnPropertyChanged(); } }
private string _mAddress;
public int ReadLeng { get { return _mReadLeng; } set { _mReadLeng = value; OnPropertyChanged(); } }
private int _mReadLeng;
}
}