using SWRIS.Dtos; using SWRIS.Enums; using SWRIS.Extensions; using System; using System.Collections.Generic; using System.ComponentModel; namespace SWRIS.Models.ViewModel { public class SettingViewModel : INotifyPropertyChanged { private string _appName = "在线式钢丝绳电磁检测系统"; private string _version = "250902"; private string _copyright = "河南恒达机电设备有限公司"; private string _ipAddress = "192.168.1.233"; private int _port = 9005; private int _dataSaveDays = 120; private TimeSpan _cleanScheduledTime = TimeSpan.FromHours(2); private int _damageNearPointCount = 20; private bool _showDebugMessage = true; private int _sountRiskLevel = (int)RiskLevel.Moderate; private double _speedVariationThreshold = 0.25; private double _damageExtent = 0.5; private int _alarmValidCount = 3; private string _crane = "炼钢一跨1#"; private CalibrationDataModel _calibration; private bool _isAutoStart = true; /// /// 应用名称 /// public string AppName { get => _appName; set { _appName = value; OnPropertyChanged(nameof(AppName)); } } /// /// 应用版本 /// public string Version { get => _version; set { _version = value; OnPropertyChanged(nameof(Version)); } } /// /// 技术支持 /// public string Copyright { get => _copyright; set { _copyright = value; OnPropertyChanged(nameof(Copyright)); } } /// /// 服务端IP地址 /// public string IpAddress { get => _ipAddress; set { _ipAddress = value; OnPropertyChanged(nameof(IpAddress)); } } /// /// 服务端端口号 /// public int Port { get => _port; set { _port = value; OnPropertyChanged(nameof(Port)); } } /// /// 是否显示调试信息 /// public bool ShowDebugMessage { get => _showDebugMessage; set { _showDebugMessage = value; OnPropertyChanged(nameof(ShowDebugMessage)); } } /// /// 数据存储天数 /// public int DataSaveDays { get => _dataSaveDays; set { _dataSaveDays = value; OnPropertyChanged(nameof(DataSaveDays)); } } /// /// 清理数据计划时间 /// public TimeSpan CleanScheduledTime { get => _cleanScheduledTime; set { _cleanScheduledTime = value; OnPropertyChanged(nameof(CleanScheduledTime)); } } /// /// 损伤邻近点数 /// public int DamageNearPointCount { get => _damageNearPointCount; set { _damageNearPointCount = value; OnPropertyChanged(nameof(DamageNearPointCount)); } } /// /// 语音报警风险等级 /// public int SoundRiskLevel { get => _sountRiskLevel; set { _sountRiskLevel = value; OnPropertyChanged(nameof(SoundRiskLevel)); } } /// /// 速度变化阈值 /// public double SpeedVariationThreshold { get => _speedVariationThreshold; set { _speedVariationThreshold = value; OnPropertyChanged(nameof(SpeedVariationThreshold)); } } /// /// 损伤验证范围 /// public double DamageExtent { get => _damageExtent; set { _damageExtent = value; OnPropertyChanged(nameof(DamageExtent)); } } /// /// 损伤验证次数 /// public int AlarmValidCount { get => _alarmValidCount; set { _alarmValidCount = value; OnPropertyChanged(nameof(AlarmValidCount)); } } /// /// 起重机名称 /// public string Crane { get => _crane; set { _crane = value; OnPropertyChanged(nameof(Crane)); } } /// /// 标定设置 /// public CalibrationDataModel Calibration { get => _calibration; set { _calibration = value; OnPropertyChanged(nameof(Calibration)); } } public bool IsAutoStart { get => _isAutoStart; set { _isAutoStart = value; OnPropertyChanged(nameof(IsAutoStart)); } } public List RiskLevels => TypeExtension.ToKeyAndDescriptionList(typeof(RiskLevel)); public event PropertyChangedEventHandler PropertyChanged; protected internal virtual void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }