Files
test_demo/MX-PD-盘古 - new/PanGu.DieBonderApp/MainShell/DeviceMaintance/ViewModel/State/CylinderPageState.cs
Shi.Ji e31d3560bb 添加 MX-PD-盘古 项目文件
将 MX-PD-盘古 - new 目录下的所有文件添加到主仓库
2026-05-18 11:43:09 +08:00

84 lines
2.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using MainShell.Manual.ViewModel.State;
using Stylet;
using System;
using System.Collections.ObjectModel;
using System.Windows.Input;
namespace MainShell.DeviceMaintance.ViewModel.State
{
public class CylinderPageState : PropertyChangedBase
{
private DateTime _lastActionTime = DateTime.MinValue;
private string _lastActionMessage = "等待气缸控制操作";
public DateTime LastActionTime
{
get { return _lastActionTime; }
set { SetAndNotify(ref _lastActionTime, value); }
}
public string LastActionMessage
{
get { return _lastActionMessage; }
set { SetAndNotify(ref _lastActionMessage, value); }
}
public ObservableCollection<CylinderItemState> Cylinders { get; } = new ObservableCollection<CylinderItemState>();
}
public class CylinderItemState : PropertyChangedBase
{
private bool _isBusy;
public string Name { get; set; }
public string Description { get; set; }
public string Module { get; set; }
public string ControlTypeText { get; set; }
public bool IsBusy
{
get { return _isBusy; }
set { SetAndNotify(ref _isBusy, value); }
}
public ObservableCollection<CylinderSignalState> OutputSignals { get; } = new ObservableCollection<CylinderSignalState>();
public ObservableCollection<CylinderSignalState> FeedbackSignals { get; } = new ObservableCollection<CylinderSignalState>();
public ICommand ExtendCommand { get; set; }
public ICommand RetractCommand { get; set; }
}
public class CylinderSignalState : PropertyChangedBase
{
private bool _isOn;
public string PointReference { get; set; }
public string PointKey { get; set; }
public string Name { get; set; }
public string LineNo { get; set; }
public bool IsOutput { get; set; }
public string IoNameText
{
get { return string.IsNullOrWhiteSpace(PointReference) ? string.Empty : "IO Name" + PointReference; }
}
public bool IsOn
{
get { return _isOn; }
set
{
if (SetAndNotify(ref _isOn, value))
{
OnPropertyChanged(nameof(StateText));
}
}
}
public string StateText
{
get { return IsOn ? "ON" : "OFF"; }
}
}
}