| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553 |
- using OpenTK.Graphics.ES20;
- using SWRIS.Dtos;
- using SWRIS.Enums;
- using SWRIS.Extensions;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- namespace SWRIS.Models.ViewModel
- {
- public class EquipmentSettingViewModel : INotifyPropertyChanged
- {
- private int ropeNumber;
- private string ropeName;
- private string ipAddress;
- private string serialNo;
- private string supplier;
- private int ropeCoreType;
- private int wireMaterialType;
- private int wireSurfaceType;
- private int layType;
- private bool disableAlarm;
- private int[] inUseSensor = new int[] { 1, 2, 3, 4 };
- private double liftHightRatio = 1;
- private RiskLevel soundRiskLevel = RiskLevel.Moderate;
- private ParameterData parameter;
- private bool isConnected;
- private RunningStatus runningStatus;
- /// <summary>
- /// 绳号
- /// </summary>
- public int RopeNumber
- {
- get { return ropeNumber; }
- set
- {
- ropeNumber = value;
- OnPropertyChanged(nameof(RopeNumber));
- }
- }
- /// <summary>
- /// 钢丝绳名称
- /// </summary>
- public string RopeName
- {
- get { return ropeName; }
- set
- {
- ropeName = value;
- OnPropertyChanged(nameof(RopeName));
- }
- }
- /// <summary>
- /// Ip地址
- /// </summary>
- public string IpAddress
- {
- get { return ipAddress; }
- set
- {
- ipAddress = value;
- OnPropertyChanged(nameof(IpAddress));
- }
- }
- /// <summary>
- /// 序列号
- /// </summary>
- public string SerialNo
- {
- get { return serialNo; }
- set
- {
- serialNo = value;
- OnPropertyChanged(nameof(SerialNo));
- }
- }
- /// <summary>
- /// 供应商
- /// </summary>
- public string Supplier
- {
- get { return supplier; }
- set
- {
- supplier = value;
- OnPropertyChanged(nameof(Supplier));
- }
- }
- /// <summary>
- /// 绳芯类型 1 钢芯 2 纤维芯
- /// </summary>
- public int RopeCoreType
- {
- get { return ropeCoreType; }
- set
- {
- ropeCoreType = value;
- OnPropertyChanged(nameof(RopeCoreType));
- }
- }
- /// <summary>
- /// 钢丝材质 1 碳钢 2 不锈钢
- /// </summary>
- public int WireMaterialType
- {
- get { return wireMaterialType; }
- set
- {
- wireMaterialType = value;
- OnPropertyChanged(nameof(WireMaterialType));
- }
- }
- /// <summary>
- /// 表面状态 1 光面 2 A级镀锌 3 B级镀锌
- /// </summary>
- public int WireSurfaceType
- {
- get { return wireSurfaceType; }
- set
- {
- wireSurfaceType = value;
- OnPropertyChanged(nameof(WireSurfaceType));
- }
- }
- /// <summary>
- /// 捻向 1 右交互捻 2 左交互捻 3 右同向捻 4 左同向捻
- /// </summary>
- public int LayType
- {
- get { return layType; }
- set
- {
- layType = value;
- OnPropertyChanged(nameof(LayType));
- }
- }
- /// <summary>
- /// 绳长/高度倍率
- /// </summary>
- public double LiftHightRatio
- {
- get { return liftHightRatio; }
- set
- {
- liftHightRatio = value;
- OnPropertyChanged(nameof(LiftHightRatio));
- }
- }
- public RiskLevel SoundRiskLevel
- {
- get { return soundRiskLevel; }
- set
- {
- soundRiskLevel = value;
- OnPropertyChanged(nameof(SoundRiskLevel));
- }
- }
- public ParameterData Parameter
- {
- get { return parameter; }
- set
- {
- parameter = value;
- OnPropertyChanged(nameof(Parameter));
- }
- }
- public bool IsConnected
- {
- get { return isConnected; }
- set
- {
- isConnected = value;
- OnPropertyChanged(nameof(IsConnected));
- }
- }
- public bool DisableAlarm
- {
- get { return disableAlarm; }
- set
- {
- disableAlarm = value;
- OnPropertyChanged(nameof(DisableAlarm));
- }
- }
- public int[] InUseSensor
- {
- get { return inUseSensor; }
- set
- {
- inUseSensor = value;
- OnPropertyChanged(nameof(InUseSensor));
- }
- }
- public RunningStatus RunningStatus
- {
- get { return runningStatus; }
- set
- {
- runningStatus = value;
- OnPropertyChanged(nameof(RunningStatus));
- }
- }
- public List<KeyAndValueDto> RopeCoreTypes => TypeExtension.ToKeyAndDescriptionList(typeof(RopeCoreType));
- public List<KeyAndValueDto> WireMaterialTypes => TypeExtension.ToKeyAndDescriptionList(typeof(WireMaterialType));
- public List<KeyAndValueDto> LayTypes => TypeExtension.ToKeyAndDescriptionList(typeof(LayType));
- public List<KeyAndValueDto> WireSurfaceTypes => TypeExtension.ToKeyAndDescriptionList(typeof(WireSurfaceType));
- public List<KeyAndValueDto> RiskLevels => TypeExtension.ToKeyAndDescriptionList(typeof(RiskLevel));
- public event PropertyChangedEventHandler PropertyChanged;
- protected internal virtual void OnPropertyChanged(string propertyName)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- public class ParameterData : INotifyPropertyChanged
- {
- private string mainBoardSoftwareVersion;
- private short sensorCount;
- private float samplingStep;
- private short frequencyDivisionFactor;
- private short timeDomainFrequency;
- private short damageThreshold;
- private short scrapUpperLimit;
- private short frontMagnetLength;
- private short backMagnetLength;
- private float valueCoefficient;
- private float effectiveStrokeLength;
- private short zeroPositionCorrectionDuration;
- private short zeroPositionCorrectionOffset;
- private float warningValue;
- private float alarmValue;
- private short soundLightAlarmAutoResetMode;
- private short wireRopeType;
- private short wireRopeCount;
- private float wireRopeLength;
- private float wireRopeDiameter;
- private short wireRopeStrandCount;
- private short wireRopeStrandWireCount;
- private EncoderDirection encoderDirection;
- private DateTime? systemTime;
- private float twistFactor;
- /// <summary>
- /// 主板软件版本号
- /// </summary>
- public string MainBoardSoftwareVersion
- {
- get => mainBoardSoftwareVersion;
- set
- {
- mainBoardSoftwareVersion = value;
- OnPropertyChanged(nameof(MainBoardSoftwareVersion));
- }
- }
- /// <summary>
- /// 传感器数量
- /// </summary>
- public short SensorCount
- {
- get => sensorCount;
- set
- {
- sensorCount = value;
- OnPropertyChanged(nameof(SensorCount));
- }
- }
- /// <summary>
- /// 采样步长 单位:mm/点 4字节浮点数
- /// </summary>
- public float SamplingStep
- {
- get => samplingStep;
- set
- {
- samplingStep = value;
- OnPropertyChanged(nameof(SamplingStep));
- }
- }
- /// <summary>
- /// 分频系数
- /// </summary>
- public short FrequencyDivisionFactor
- {
- get => frequencyDivisionFactor;
- set
- {
- frequencyDivisionFactor = value;
- OnPropertyChanged(nameof(FrequencyDivisionFactor));
- }
- }
- /// <summary>
- /// 时域频率 2字节整型
- /// </summary>
- public short TimeDomainFrequency
- {
- get => timeDomainFrequency;
- set
- {
- timeDomainFrequency = value;
- OnPropertyChanged(nameof(TimeDomainFrequency));
- }
- }
- /// <summary>
- /// 损伤门限 2字节整型
- /// </summary>
- public short DamageThreshold
- {
- get => damageThreshold;
- set
- {
- damageThreshold = value;
- OnPropertyChanged(nameof(DamageThreshold));
- }
- }
- /// <summary>
- /// 报废上限
- /// </summary>
- public short ScrapUpperLimit
- {
- get => scrapUpperLimit;
- set
- {
- scrapUpperLimit = value;
- OnPropertyChanged(nameof(ScrapUpperLimit));
- }
- }
- /// <summary>
- /// 前磁极长度 单位:mm 2字节整型
- /// </summary>
- public short FrontMagnetLength
- {
- get => frontMagnetLength;
- set
- {
- frontMagnetLength = value;
- OnPropertyChanged(nameof(FrontMagnetLength));
- }
- }
- /// <summary>
- /// 后磁极长度 单位:mm 2字节整型
- /// </summary>
- public short BackMagnetLength
- {
- get => backMagnetLength;
- set
- {
- backMagnetLength = value;
- OnPropertyChanged(nameof(BackMagnetLength));
- }
- }
- /// <summary>
- /// 量值系数 4字节浮点数
- /// </summary>
- public float ValueCoefficient
- {
- get => valueCoefficient;
- set
- {
- valueCoefficient = value;
- OnPropertyChanged(nameof(ValueCoefficient));
- }
- }
- /// <summary>
- /// 零位有效行程长度,单位:m 4字节浮点数
- /// </summary>
- public float EffectiveStrokeLength
- {
- get => effectiveStrokeLength;
- set
- {
- effectiveStrokeLength = value;
- OnPropertyChanged(nameof(EffectiveStrokeLength));
- }
- }
- /// <summary>
- /// 零位矫正静止时长,单位:秒 2字节整型
- /// </summary>
- public short ZeroPositionCorrectionDuration
- {
- get => zeroPositionCorrectionDuration;
- set
- {
- zeroPositionCorrectionDuration = value;
- OnPropertyChanged(nameof(ZeroPositionCorrectionDuration));
- }
- }
- /// <summary>
- /// 零位矫正允许偏移量,单位:mm 2字节整型
- /// </summary>
- public short ZeroPositionCorrectionOffset
- {
- get => zeroPositionCorrectionOffset;
- set
- {
- zeroPositionCorrectionOffset = value;
- OnPropertyChanged(nameof(ZeroPositionCorrectionOffset));
- }
- }
- /// <summary>
- /// 预警(黄色报警)量值 4字节浮点数
- /// </summary>
- public float WarningValue
- {
- get => warningValue;
- set
- {
- warningValue = value;
- OnPropertyChanged(nameof(WarningValue));
- }
- }
- /// <summary>
- /// 报警(红色报警)量值 4字节浮点数
- /// </summary>
- public float AlarmValue
- {
- get => alarmValue;
- set
- {
- alarmValue = value;
- OnPropertyChanged(nameof(AlarmValue));
- }
- }
- /// <summary>
- /// 声光报警自动重置方式,0=不自动重置,>0=延时自动重置,-1=开始新一次检测时重置
- /// </summary>
- public short SoundLightAlarmAutoResetMode
- {
- get => soundLightAlarmAutoResetMode;
- set
- {
- soundLightAlarmAutoResetMode = value;
- OnPropertyChanged(nameof(SoundLightAlarmAutoResetMode));
- }
- }
- /// <summary>
- /// 钢丝绳类型 0=塔吊单绳,1=电梯排绳
- /// </summary>
- public short WireRopeType
- {
- get => wireRopeType;
- set
- {
- wireRopeType = value;
- OnPropertyChanged(nameof(WireRopeType));
- }
- }
- /// <summary>
- ///钢丝绳数量 1字节
- /// </summary>
- public short WireRopeCount
- {
- get => wireRopeCount;
- set
- {
- wireRopeCount = value;
- OnPropertyChanged(nameof(WireRopeCount));
- }
- }
- /// <summary>
- /// 钢丝绳长度,单位:m 4字节浮点数
- /// </summary>
- public float WireRopeLength
- {
- get => wireRopeLength;
- set
- {
- wireRopeLength = value;
- OnPropertyChanged(nameof(WireRopeLength));
- }
- }
- /// <summary>
- /// 钢丝绳直径,单位:mm 4字节浮点数
- /// </summary>
- public float WireRopeDiameter
- {
- get => wireRopeDiameter;
- set
- {
- wireRopeDiameter = value;
- OnPropertyChanged(nameof(WireRopeDiameter));
- }
- }
- /// <summary>
- /// 钢丝绳股数 1字节
- /// </summary>
- public short WireRopeStrandCount
- {
- get => wireRopeStrandCount;
- set
- {
- wireRopeStrandCount = value;
- OnPropertyChanged(nameof(WireRopeStrandCount));
- }
- }
- /// <summary>
- /// 钢丝绳每股丝数,2字节整型
- /// </summary>
- public short WireRopeStrandWireCount
- {
- get => wireRopeStrandWireCount;
- set
- {
- wireRopeStrandWireCount = value;
- OnPropertyChanged(nameof(WireRopeStrandWireCount));
- }
- }
- /// <summary>
- /// 编码器方向,1=正向,2=反向
- /// </summary>
- public EncoderDirection EncoderDirection
- {
- get => encoderDirection;
- set
- {
- encoderDirection = value;
- OnPropertyChanged(nameof(EncoderDirection));
- }
- }
- /// <summary>
- /// 系统时间
- /// </summary>
- public DateTime? SystemTime
- {
- get => systemTime;
- set
- {
- systemTime = value;
- OnPropertyChanged(nameof(SystemTime));
- }
- }
- /// <summary>
- /// 判伤捻距系数,浮点数,判伤捻距默认为7d,可通过此参数设置系数来调整(与损伤判定相关)。
- /// 默认值为1.0,设置2.0表示判伤捻距为2 x 7 = 14d
- /// </summary>
- public float TwistFactor
- {
- get => twistFactor;
- set
- {
- twistFactor = value;
- OnPropertyChanged(nameof(TwistFactor));
- }
- }
- public event PropertyChangedEventHandler PropertyChanged;
- protected internal virtual void OnPropertyChanged(string propertyName)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- }
|