|
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.Toolkit.Mvvm.ComponentModel;
- using System.Collections.ObjectModel;
-
- namespace BPASmartClient.ViewModel.Model
- {
- /// <summary>
- /// 店铺设备
- /// </summary>
- public class DeviceConfigModel : ObservableObject
- {
- /// <summary>
- /// 店铺名称
- /// </summary>
- public string ShopName { get { return _mShopName; } set { _mShopName = value; OnPropertyChanged(); } }
- private string _mShopName = string.Empty;
-
- /// <summary>
- /// 店铺ID
- /// </summary>
- public string ShopId { get { return _mShopId; } set { _mShopId = value; OnPropertyChanged(); } }
- private string _mShopId = string.Empty;
-
- /// <summary>
- /// 设备集合
- /// </summary>
- public ObservableCollection<DeviceModel> deviceModels = new ObservableCollection<DeviceModel>();
- }
-
- /// <summary>
- /// 启动模块
- /// </summary>
- public class DeviceModel : ObservableObject
- {
- /// <summary>
- /// 设备名称
- /// </summary>
- public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
- private string _mDeviceName = string.Empty;
-
- /// <summary>
- /// 启动设备模块
- /// </summary>
- public string DeviceModule { get { return _mDeviceModule; } set { _mDeviceModule = value; OnPropertyChanged(); } }
- private string _mDeviceModule = string.Empty;
-
- /// <summary>
- /// 设备ID
- /// </summary>
- public string DeviceId { get { return _mDeviceId; } set { _mDeviceId = value; OnPropertyChanged(); } }
- private string _mDeviceId = string.Empty;
-
- /// <summary>
- /// 通讯模块
- /// </summary>
- public ObservableCollection<CommunicationModel> communicationDevcies = new ObservableCollection<CommunicationModel>();
-
- }
-
- /// <summary>
- /// 通讯模块
- /// </summary>
- public class CommunicationModel : ObservableObject
- {
- /// <summary>
- /// 通讯启动模块
- /// </summary>
- public string CommunicationModule { get { return _mCommunicationModule; } set { _mCommunicationModule = value; OnPropertyChanged(); } }
- private string _mCommunicationModule = string.Empty;
-
-
-
- }
-
- /// <summary>
- /// 通讯参数
- /// </summary>
- public class CommunicationPar : ObservableObject
- {
- public CommunicationParType communicationType { get { return _mcommunicationType; } set { _mcommunicationType = value; OnPropertyChanged(); } }
- private CommunicationParType _mcommunicationType;
-
-
- public string CommunicationValue { get { return _mCommunicationValue; } set { _mCommunicationValue = value; OnPropertyChanged(); } }
- private string _mCommunicationValue = string.Empty;
-
- }
-
- public enum CommunicationParType
- {
- /// <summary>
- /// IP地址
- /// </summary>
- IPAddress,
- /// <summary>
- /// 端口号
- /// </summary>
- Port,
- /// <summary>
- /// 串口端口号
- /// </summary>
- SerialPort,
- /// <summary>
- /// 波特率
- /// </summary>
- BaudRate,
- /// <summary>
- /// 数据位
- /// </summary>
- DataBits,
- /// <summary>
- /// 停止位
- /// </summary>
- StopBits,
- /// <summary>
- /// 校验位
- /// </summary>
- Parity,
- }
- }
|