This commit is contained in:
@@ -126,9 +126,30 @@ namespace MembranePoreTester.ViewModels
|
||||
_plcConfig = App.PlcConfig;
|
||||
|
||||
PressCommand = new RelayCommand(async () => await TogglePressAsync());
|
||||
//BurstCommand = new RelayCommand(async () => await ReadBurstPressureAsync());
|
||||
StartCommand = new RelayCommand(async () => await WriteCoilAsync(_plcConfig.StartCoil, true));
|
||||
StopCommand = new RelayCommand(async () => await WriteCoilAsync(_plcConfig.StopCoil, true));
|
||||
|
||||
|
||||
// 在 StationItem 构造函数中
|
||||
StartCommand = new RelayCommand(async () =>
|
||||
{
|
||||
// 启动PLC
|
||||
await WriteCoilAsync(_plcConfig.StartCoil, true);
|
||||
|
||||
// 启动孔分布自动采集
|
||||
PoreDistributionVM.StartCollecting();
|
||||
|
||||
});
|
||||
|
||||
StopCommand = new RelayCommand(async () =>
|
||||
{
|
||||
// 停止自动采集
|
||||
PoreDistributionVM.StopCollecting();
|
||||
// 停止PLC
|
||||
await WriteCoilAsync(_plcConfig.StopCoil, true);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// 启动定时器,每秒读取一次 M21 状态
|
||||
_timer = new System.Windows.Threading.DispatcherTimer();
|
||||
_timer.Interval = TimeSpan.FromSeconds(1);
|
||||
@@ -242,7 +263,12 @@ namespace MembranePoreTester.ViewModels
|
||||
}
|
||||
|
||||
|
||||
|
||||
private bool _isPoreDistributionActive;
|
||||
public bool IsPoreDistributionActive
|
||||
{
|
||||
get => _isPoreDistributionActive;
|
||||
set => SetProperty(ref _isPoreDistributionActive, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user