添加 MX-PD-盘古 项目文件
将 MX-PD-盘古 - new 目录下的所有文件添加到主仓库
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using MainShell.Hardware;
|
||||
using MainShell.Models;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell.ToolBox.ViewModel
|
||||
{
|
||||
public class MapCamLightViewModel : PropertyChangedBase
|
||||
{
|
||||
private MapCamLightConfig _mapCamLightConfig = new MapCamLightConfig();
|
||||
|
||||
public MapCamLightConfig MapCamLightConfig
|
||||
{
|
||||
get { return _mapCamLightConfig; }
|
||||
set { SetAndNotify(ref _mapCamLightConfig, value); }
|
||||
}
|
||||
private readonly HardwareManager _hardwareManager;
|
||||
public MapCamLightViewModel(HardwareManager hardwareManager)
|
||||
{
|
||||
this._hardwareManager = hardwareManager;
|
||||
_mapCamLightConfig.PropertyChanged -= MapCamLightConfig_PropertyChanged;
|
||||
_mapCamLightConfig.PropertyChanged += MapCamLightConfig_PropertyChanged;
|
||||
}
|
||||
|
||||
private void MapCamLightConfig_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if(e.PropertyName==nameof(MapCamLightConfig.BlueLight))
|
||||
{
|
||||
_hardwareManager.Map_BlueLight.SetIntensity(MapCamLightConfig.BlueLight);
|
||||
}
|
||||
else if(e.PropertyName==nameof(MapCamLightConfig.RedLight))
|
||||
{
|
||||
_hardwareManager.Map_RedLight.SetIntensity(MapCamLightConfig.RedLight);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user