123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650 |
- using CCDCount.DLL;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Security.Cryptography.X509Certificates;
- using System.Text;
- using System.Threading.Tasks;
- namespace CCDCountWpf
- {
- public class PlcMessageShowBindingClass : INotifyPropertyChanged
- {
- /// <summary>
- /// 使能完成
- /// </summary>
- private bool enableCompletion;
- public bool EnableCompletion
- {
- get { return enableCompletion; }
- set
- {
- enableCompletion = value;
- OnPropertyChanged("EnableCompletion");
- }
- }
- /// <summary>
- /// 归零完成
- /// </summary>
- private bool returnToZeroCompletion;
- public bool ReturnToZeroCompletion
- {
- get { return returnToZeroCompletion; }
- set
- {
- returnToZeroCompletion = value;
- OnPropertyChanged("ReturnToZeroCompletion");
- }
- }
- /// <summary>
- /// 停止完成
- /// </summary>
- private bool stopCompletion;
- public bool StopCompletion
- {
- get { return stopCompletion; }
- set
- {
- stopCompletion = value;
- OnPropertyChanged("StopCompletion");
- }
- }
- /// <summary>
- /// 速度运行
- /// </summary>
- private bool speedRunning;
- public bool SpeedRunning
- {
- get { return speedRunning; }
- set
- {
- speedRunning = value;
- OnPropertyChanged("SpeedRunning");
- }
- }
- /// <summary>
- /// 回零中
- /// </summary>
- private bool returnToZero;
- public bool ReturnToZero
- {
- get { return returnToZero; }
- set
- {
- returnToZero = value;
- OnPropertyChanged("ReturnToZero");
- }
- }
- /// <summary>
- /// 中转阀开定位完成
- /// </summary>
- private bool transferValveOpenCompletion;
- public bool TransferValveOpenCompletion
- {
- get { return transferValveOpenCompletion; }
- set
- {
- transferValveOpenCompletion = value;
- OnPropertyChanged("TransferValveOpenCompletion");
- }
- }
- /// <summary>
- /// 中转阀关定位完成
- /// </summary>
- private bool transferValveCloseCompletion;
- public bool TransferValveCloseCompletion
- {
- get { return transferValveCloseCompletion; }
- set
- {
- transferValveCloseCompletion = value;
- OnPropertyChanged("TransferValveCloseCompletion");
- }
- }
- /// <summary>
- /// 允许数据交换
- /// </summary>
- private bool allowsDataExchange;
- public bool AllowsDataExchange
- {
- get { return allowsDataExchange; }
- set
- {
- allowsDataExchange = value;
- OnPropertyChanged("AllowsDataExchange");
- }
- }
- /// <summary>
- /// 暂停数据交换
- /// </summary>
- private bool pauseDataExchange;
- public bool PauseDataExchange
- {
- get { return pauseDataExchange; }
- set
- {
- pauseDataExchange = value;
- OnPropertyChanged("PauseDataExchange");
- }
- }
- /// <summary>
- /// 缓存计数延迟完成
- /// </summary>
- private bool cacheCountDelayed;
- public bool CacheCountDelayed
- {
- get { return cacheCountDelayed; }
- set
- {
- cacheCountDelayed = value;
- OnPropertyChanged("CacheCountDelayed");
- }
- }
- /// <summary>
- /// 使能
- /// </summary>
- private bool enable;
- public bool Enable
- {
- get { return enable; }
- set
- {
- enable = value;
- OnPropertyChanged("Enable");
- }
- }
- /// <summary>
- /// 速度模式运行速度
- /// </summary>
- private float speedModeRunningSpeed;
- public string SpeedModeRunningSpeed
- {
- get { return speedModeRunningSpeed.ToString("F2"); }
- set
- {
- if (float.TryParse(value, out float result))
- {
- speedModeRunningSpeed = result;
- PlcSettingMessageBus.pLCManagement.WriteSpeedModeRunningSpeed(result);
- OnPropertyChanged("SpeedModeRunningSpeed");
- }
- }
- }
- /// <summary>
- /// 点动速度
- /// </summary>
- private float jogSpeed;
- public string JogSpeed
- {
- get { return jogSpeed.ToString("F2"); }
- set
- {
- if (float.TryParse(value, out float result))
- {
- jogSpeed = result;
- PlcSettingMessageBus.pLCManagement.WriteJogSpeed(result);
- OnPropertyChanged("JogSpeed");
- }
- }
- }
- /// <summary>
- /// 瓶装设定值
- /// </summary>
- private UInt16 bottValueSet;
- public UInt16 BottValueSet
- {
- get { return bottValueSet; }
- set
- {
- bottValueSet = value;
- PlcSettingMessageBus.pLCManagement.WriteBottValueSet(value);
- OnPropertyChanged("BottValueSet");
- }
- }
- /// <summary>
- /// 中转阀打开速度
- /// </summary>
- private float transferValveOpeningSpeed;
- public string TransferValveOpeningSpeed
- {
- get { return transferValveOpeningSpeed.ToString("F2"); }
- set
- {
- if (float.TryParse(value, out float result))
- {
- transferValveOpeningSpeed = result;
- PlcSettingMessageBus.pLCManagement.WriteTransferValveOpeningSpeed(result);
- OnPropertyChanged("TransferValveOpeningSpeed");
- }
- }
- }
- /// <summary>
- /// 中转阀打开时间
- /// </summary>
- private UInt32 transferValveOpeningTime;
- public UInt32 TransferValveOpeningTime
- {
- get { return transferValveOpeningTime; }
- set
- {
- transferValveOpeningTime = value;
- PlcSettingMessageBus.pLCManagement.WriteTransferValveOpeningTime(value);
- OnPropertyChanged("TransferValveOpeningTime");
- }
- }
- /// <summary>
- /// 罐装减速值
- /// </summary>
- private UInt16 bottingDecelerationValue;
- public UInt16 BottingDecelerationValue
- {
- get { return bottingDecelerationValue; }
- set
- {
- bottingDecelerationValue = value;
- PlcSettingMessageBus.pLCManagement.WriteBottingDecelerationValue(value);
- OnPropertyChanged("BottingDecelerationValue");
- }
- }
- /// <summary>
- /// 缓存减速值
- /// </summary>
- private UInt16 cacheDecelerationValue { get; set;}
- public UInt16 CacheDecelerationValue
- {
- get { return cacheDecelerationValue; }
- set
- {
- cacheDecelerationValue = value;
- PlcSettingMessageBus.pLCManagement.WriteCacheDecelerationValue(value);
- OnPropertyChanged("CacheDecelerationValue");
- }
- }
- /// <summary>
- /// 缓存计数延迟时间
- /// </summary>
- private UInt32 cacheCountDelayTiming;
- public UInt32 CacheCountDelayTiming
- {
- get { return cacheCountDelayTiming; }
- set
- {
- cacheCountDelayTiming = value;
- PlcSettingMessageBus.pLCManagement.WriteCacheCountDelayTiming(value);
- OnPropertyChanged("CacheCountDelayTiming");
- }
- }
- /// <summary>
- /// 缓存停机值
- /// </summary>
- private UInt16 cacheShutdownValue;
- public UInt16 CacheShutdownValue
- {
- get { return cacheShutdownValue; }
- set
- {
- cacheShutdownValue = value;
- PlcSettingMessageBus.pLCManagement.WriteCacheShutdownValue(value);
- OnPropertyChanged("CacheShutdownValue");
- }
- }
- /// <summary>
- /// 罐装料筒震台高速值
- /// </summary>
- private UInt16 bottingMaterialCylinderVibrationTableHighSpeedValue;
- public UInt16 BottingMaterialCylinderVibrationTableHighSpeedValue
- {
- get { return bottingMaterialCylinderVibrationTableHighSpeedValue; }
- set
- {
- bottingMaterialCylinderVibrationTableHighSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteBottingMaterialCylinderVibrationTableHighSpeedValue(value);
- OnPropertyChanged("BottingMaterialCylinderVibrationTableHighSpeedValue");
- }
- }
- /// <summary>
- /// 罐装过滤震台高速值
- /// </summary>
- private UInt16 bottingFilterVibrationTableHighSpeedValue;
- public UInt16 BottingFilterVibrationTableHighSpeedValue
- {
- get { return bottingFilterVibrationTableHighSpeedValue; }
- set
- {
- bottingFilterVibrationTableHighSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteBottingFilterVibrationTableHighSpeedValue(value);
- OnPropertyChanged("BottingFilterVibrationTableHighSpeedValue");
- }
- }
- /// <summary>
- /// 罐装计数震台高速值
- /// </summary>
- private UInt16 bottingCountVibrationTableHighSpeedValue;
- public UInt16 BottingCountVibrationTableHighSpeedValue
- {
- get { return bottingCountVibrationTableHighSpeedValue; }
- set
- {
- bottingCountVibrationTableHighSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteBottingCountVibrationTableHighSpeedValue(value);
- OnPropertyChanged("BottingCountVibrationTableHighSpeedValue");
- }
- }
- /// <summary>
- /// 罐装料筒震台减速值
- /// </summary>
- private UInt16 bottingMaterialCylinderVibrationTableDecelerationSpeedValue;
- public UInt16 BottingMaterialCylinderVibrationTableDecelerationSpeedValue
- {
- get { return bottingMaterialCylinderVibrationTableDecelerationSpeedValue; }
- set
- {
- bottingMaterialCylinderVibrationTableDecelerationSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteBottingMaterialCylinderVibrationTableDecelerationSpeedValue(value);
- OnPropertyChanged("BottingMaterialCylinderVibrationTableDecelerationSpeedValue");
- }
- }
- /// <summary>
- /// 罐装过滤震台减速值
- /// </summary>
- private UInt16 bottingFilterVibrationTableDecelerationSpeedValue;
- public UInt16 BottingFilterVibrationTableDecelerationSpeedValue
- {
- get { return bottingFilterVibrationTableDecelerationSpeedValue; }
- set
- {
- bottingFilterVibrationTableDecelerationSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteBottingFilterVibrationTableDecelerationSpeedValue(value);
- OnPropertyChanged("BottingFilterVibrationTableDecelerationSpeedValue");
- }
- }
- /// <summary>
- /// 罐装计数震台减速值
- /// </summary>
- private UInt16 bottingCountVibrationTableDecelerationSpeedValue;
- public UInt16 BottingCountVibrationTableDecelerationSpeedValue
- {
- get { return bottingCountVibrationTableDecelerationSpeedValue; }
- set
- {
- bottingCountVibrationTableDecelerationSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteBottingCountVibrationTableDecelerationSpeedValue(value);
- OnPropertyChanged("BottingCountVibrationTableDecelerationSpeedValue");
- }
- }
- /// <summary>
- /// 缓存料筒震台高速值
- /// </summary>
- private UInt16 cacheMaterialCylinderVibrationTableHighSpeedValue;
- public UInt16 CacheMaterialCylinderVibrationTableHighSpeedValue
- {
- get { return cacheMaterialCylinderVibrationTableHighSpeedValue; }
- set
- {
- cacheMaterialCylinderVibrationTableHighSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteCacheMaterialCylinderVibrationTableHighSpeedValue(value);
- OnPropertyChanged("CacheMaterialCylinderVibrationTableHighSpeedValue");
- }
- }
- /// <summary>
- /// 缓存过滤震台高速值
- /// </summary>
- private UInt16 cacheFilterVibrationTableHighSpeedValue;
- public UInt16 CacheFilterVibrationTableHighSpeedValue
- {
- get { return cacheFilterVibrationTableHighSpeedValue; }
- set
- {
- cacheFilterVibrationTableHighSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteCacheFilterVibrationTableHighSpeedValue(value);
- OnPropertyChanged("CacheFilterVibrationTableHighSpeedValue");
- }
- }
- /// <summary>
- /// 缓存计数震台高速值
- /// </summary>
- private UInt16 cacheCountVibrationTableHighSpeedValue;
- public UInt16 CacheCountVibrationTableHighSpeedValue
- {
- get { return cacheCountVibrationTableHighSpeedValue; }
- set
- {
- cacheCountVibrationTableHighSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteCacheCountVibrationTableHighSpeedValue(value);
- OnPropertyChanged("CacheCountVibrationTableHighSpeedValue");
- }
- }
- /// <summary>
- /// 缓存料筒震台减速值
- /// </summary>
- private UInt16 cacheMaterialCylinderVibrationTableDecelerationSpeedValue;
- public UInt16 CacheMaterialCylinderVibrationTableDecelerationSpeedValue
- {
- get { return cacheMaterialCylinderVibrationTableDecelerationSpeedValue; }
- set
- {
- cacheMaterialCylinderVibrationTableDecelerationSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteCacheMaterialCylinderVibrationTableDecelerationSpeedValue(value);
- OnPropertyChanged("CacheMaterialCylinderVibrationTableDecelerationSpeedValue");
- }
- }
- /// <summary>
- /// 缓存过滤震台减速值
- /// </summary>
- private UInt16 cacheFilterVibrationTableDecelerationSpeedValue;
- public UInt16 CacheFilterVibrationTableDecelerationSpeedValue
- {
- get { return cacheFilterVibrationTableDecelerationSpeedValue; }
- set
- {
- cacheFilterVibrationTableDecelerationSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteCacheFilterVibrationTableDecelerationSpeedValue(value);
- OnPropertyChanged("CacheFilterVibrationTableDecelerationSpeedValue");
- }
- }
- /// <summary>
- /// 缓存计数震台减速值
- /// </summary>
- private UInt16 cacheCountVibrationTableDecelerationSpeedValue;
- public UInt16 CacheCountVibrationTableDecelerationSpeedValue
- {
- get { return cacheCountVibrationTableDecelerationSpeedValue; }
- set
- {
- cacheCountVibrationTableDecelerationSpeedValue = value;
- PlcSettingMessageBus.pLCManagement.WriteCacheCountVibrationTableDecelerationSpeedValue(value);
- OnPropertyChanged("CacheCountVibrationTableDecelerationSpeedValue");
- }
- }
- /// <summary>
- /// 阀门打开延时
- /// </summary>
- private UInt32 gateOpeningDelay;
- public UInt32 GateOpeningDelay
- {
- get { return gateOpeningDelay; }
- set
- {
- gateOpeningDelay = value;
- PlcSettingMessageBus.pLCManagement.WriteGateOpeningDelay(value);
- OnPropertyChanged("GateOpeningDelay");
- }
- }
- /// <summary>
- /// 回零偏移值
- /// </summary>
- private float returnToZeroOffsetValue;
- public string ReturnToZeroOffsetValue
- {
- get { return returnToZeroOffsetValue.ToString("F2"); }
- set
- {
- if (float.TryParse(value, out float result))
- {
- returnToZeroOffsetValue = result;
- PlcSettingMessageBus.pLCManagement.WriteReturnToZeroOffsetValue(result);
- OnPropertyChanged("ReturnToZeroOffsetValue");
- }
- }
- }
- /// <summary>
- /// 回零偏移速度
- /// </summary>
- private float returnToZeroOffsetSpeed;
- public string ReturnToZeroOffsetSpeed
- {
- get { return returnToZeroOffsetSpeed.ToString("F2"); }
- set
- {
- if (float.TryParse(value, out float result))
- {
- returnToZeroOffsetSpeed = result;
- PlcSettingMessageBus.pLCManagement.WriteReturnToZeroOffsetSpeed(result);
- OnPropertyChanged("ReturnToZeroOffsetSpeed");
- }
- }
- }
- /// <summary>
- /// 中转阀关闭速度
- /// </summary>
- private float transferValveClosingSpeed;
- public string TransferValveClosingSpeed
- {
- get { return transferValveClosingSpeed.ToString("F2"); }
- set
- {
- if (float.TryParse(value, out float result))
- {
- transferValveClosingSpeed = result;
- PlcSettingMessageBus.pLCManagement.WriteTransferValveClosingSpeed(result);
- OnPropertyChanged("TransferValveClosingSpeed");
- }
- }
- }
- /// <summary>
- /// 中转阀开位置
- /// </summary>
- private float transferValveOpenPosition;
- public string TransferValveOpenPosition
- {
- get { return transferValveOpenPosition.ToString("F2"); }
- set
- {
- if (float.TryParse(value, out float result))
- {
- transferValveOpenPosition = result;
- PlcSettingMessageBus.pLCManagement.WriteTransferValveOpenPosition(result);
- OnPropertyChanged("TransferValveOpenPosition");
- }
- }
- }
- /// <summary>
- /// 中转阀关位置
- /// </summary>
- private float transferValveClosePosition;
- public string TransferValveClosePosition
- {
- get { return transferValveClosePosition.ToString("F2"); }
- set
- {
- if (float.TryParse(value, out float result))
- {
- transferValveClosePosition = result;
- PlcSettingMessageBus.pLCManagement.WriteTransferValveClosePosition(result);
- OnPropertyChanged("TransferValveClosePosition");
- }
- }
- }
- /// <summary>
- /// 气阀开延时
- /// </summary>
- private UInt32 airValveOpeningDelay;
- public UInt32 AirValveOpeningDelay
- {
- get { return airValveOpeningDelay; }
- set
- {
- airValveOpeningDelay = value;
- PlcSettingMessageBus.pLCManagement.WriteAirValveOpeningDelay(value);
- OnPropertyChanged("AirValveOpeningDelay");
- }
- }
- /// <summary>
- /// 装瓶停机值
- /// </summary>
- private UInt16 bottlingShutdownValue;
- public UInt16 BottlingShutdownValue
- {
- get { return bottlingShutdownValue; }
- set
- {
- bottlingShutdownValue = value;
- PlcSettingMessageBus.pLCManagement.WriteBottlingShutdownValue(value);
- OnPropertyChanged("BottlingShutdownValue");
- }
- }
- /// <summary>
- /// 装瓶停机时间
- /// </summary>
- private UInt32 bottlingShutdownTime;
- public UInt32 BottlingShutdownTime
- {
- get { return bottlingShutdownTime; }
- set
- {
- bottlingShutdownTime = value;
- PlcSettingMessageBus.pLCManagement.WriteBottlingShutdownTime(value);
- OnPropertyChanged("BottlingShutdownTime");
- }
- }
- //数据绑定核心实现
- public event PropertyChangedEventHandler PropertyChanged;
- protected void OnPropertyChanged(string propertyName)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- }
|