添加 MX-PD-盘古 项目文件
将 MX-PD-盘古 - new 目录下的所有文件添加到主仓库
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using MaxwellFramework.Core.Attributes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell.Models.RunTime
|
||||
{
|
||||
[Singleton]
|
||||
public class BaseBoardRunTime
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using MainShell.Common;
|
||||
using MaxwellFramework.Core.Attributes;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell
|
||||
{
|
||||
[Singleton]
|
||||
public class MachineState : PropertyChangedBase
|
||||
{
|
||||
private readonly object _sync = new object();
|
||||
|
||||
private MachineMode _currentMode = MachineMode.Manual;
|
||||
private bool _isExiting = false;
|
||||
|
||||
public MachineMode CurrentMode
|
||||
{
|
||||
get { lock (_sync) { return _currentMode; } }
|
||||
set
|
||||
{
|
||||
bool changed;
|
||||
lock (_sync)
|
||||
{
|
||||
changed = _currentMode != value;
|
||||
_currentMode = value;
|
||||
}
|
||||
// 在锁外触发通知,避免死锁
|
||||
if (changed)
|
||||
NotifyOfPropertyChange(nameof(CurrentMode));
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsExiting
|
||||
{
|
||||
get { lock (_sync) { return _isExiting; } }
|
||||
set
|
||||
{
|
||||
bool changed;
|
||||
lock (_sync)
|
||||
{
|
||||
changed = _isExiting != value;
|
||||
_isExiting = value;
|
||||
}
|
||||
if (changed)
|
||||
NotifyOfPropertyChange(nameof(IsExiting));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user