添加 MX-PD-盘古 项目文件
将 MX-PD-盘古 - new 目录下的所有文件添加到主仓库
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
using MainShell.Filewritable;
|
||||
using MXJM.FileWritable;
|
||||
using Stylet;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MainShell.ParaSetting.Model
|
||||
{
|
||||
public class AxisSoftLimitSetting : JsonFileWritableBase
|
||||
{
|
||||
private List<AxisSoftLimitItem> _axisSoftLimitItems = new List<AxisSoftLimitItem>();
|
||||
|
||||
public override string Dir => Paths.CalibSettingPath;
|
||||
|
||||
public override string FileName => "AxisSoftLimitSetting.json";
|
||||
|
||||
public List<AxisSoftLimitItem> AxisSoftLimitItems
|
||||
{
|
||||
get
|
||||
{
|
||||
return _axisSoftLimitItems;
|
||||
}
|
||||
set
|
||||
{
|
||||
_axisSoftLimitItems = value ?? new List<AxisSoftLimitItem>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AxisSoftLimitItem : PropertyChangedBase
|
||||
{
|
||||
private string _axisName;
|
||||
private string _cardName;
|
||||
private int _cardNum;
|
||||
private int _axisNum;
|
||||
private double _negativeSoftLimit;
|
||||
private double _positiveSoftLimit;
|
||||
|
||||
public string AxisName
|
||||
{
|
||||
get
|
||||
{
|
||||
return _axisName;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _axisName, value);
|
||||
}
|
||||
}
|
||||
|
||||
public string CardName
|
||||
{
|
||||
get
|
||||
{
|
||||
return _cardName;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _cardName, value);
|
||||
}
|
||||
}
|
||||
|
||||
public int CardNum
|
||||
{
|
||||
get
|
||||
{
|
||||
return _cardNum;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _cardNum, value);
|
||||
}
|
||||
}
|
||||
|
||||
public int AxisNum
|
||||
{
|
||||
get
|
||||
{
|
||||
return _axisNum;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _axisNum, value);
|
||||
}
|
||||
}
|
||||
|
||||
public double NegativeSoftLimit
|
||||
{
|
||||
get
|
||||
{
|
||||
return _negativeSoftLimit;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _negativeSoftLimit, value);
|
||||
}
|
||||
}
|
||||
|
||||
public double PositiveSoftLimit
|
||||
{
|
||||
get
|
||||
{
|
||||
return _positiveSoftLimit;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _positiveSoftLimit, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,447 @@
|
||||
using MwFramework.Controls.UIControl;
|
||||
using MwFramework.ManagerService;
|
||||
using Stylet;
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace MainShell.ParaSetting.Model
|
||||
{
|
||||
[Export(typeof(IParameter))]
|
||||
public class DeviceFoundationSetting : ParameterBase
|
||||
{
|
||||
public DeviceFoundationSetting()
|
||||
{
|
||||
SaveSettingItem = new DeviceSaveSettingItem();
|
||||
CameraSettingItem = new DeviceCameraSettingItem();
|
||||
}
|
||||
|
||||
public DeviceSaveSettingItem SaveSettingItem { get; set; }
|
||||
|
||||
public DeviceCameraSettingItem CameraSettingItem { get; set; }
|
||||
|
||||
public override void Copy(IParameter source)
|
||||
{
|
||||
DeviceFoundationSetting setting = source as DeviceFoundationSetting;
|
||||
if (setting == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (SaveSettingItem == null)
|
||||
{
|
||||
SaveSettingItem = new DeviceSaveSettingItem();
|
||||
}
|
||||
|
||||
if (CameraSettingItem == null)
|
||||
{
|
||||
CameraSettingItem = new DeviceCameraSettingItem();
|
||||
}
|
||||
|
||||
SaveSettingItem.CopyFrom(setting.SaveSettingItem);
|
||||
CameraSettingItem.CopyFrom(setting.CameraSettingItem);
|
||||
}
|
||||
}
|
||||
|
||||
public class DeviceSaveSettingItem : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
private FileSaveSettingItem _fileSaveSetting = new FileSaveSettingItem();
|
||||
|
||||
public FileSaveSettingItem FileSaveSetting
|
||||
{
|
||||
get
|
||||
{
|
||||
return _fileSaveSetting;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _fileSaveSetting, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ImageSaveSettingItem _imageSaveSetting = new ImageSaveSettingItem();
|
||||
|
||||
public ImageSaveSettingItem ImageSaveSetting
|
||||
{
|
||||
get
|
||||
{
|
||||
return _imageSaveSetting;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _imageSaveSetting, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyFrom(DeviceSaveSettingItem source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (FileSaveSetting == null)
|
||||
{
|
||||
FileSaveSetting = new FileSaveSettingItem();
|
||||
}
|
||||
|
||||
if (ImageSaveSetting == null)
|
||||
{
|
||||
ImageSaveSetting = new ImageSaveSettingItem();
|
||||
}
|
||||
|
||||
FileSaveSetting.CopyFrom(source.FileSaveSetting);
|
||||
ImageSaveSetting.CopyFrom(source.ImageSaveSetting);
|
||||
}
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
DeviceSaveSettingItem item = new DeviceSaveSettingItem();
|
||||
item.CopyFrom(this);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
public class FileSaveSettingItem : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
private bool _isSaveEnabled = true;
|
||||
|
||||
public bool IsSaveEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isSaveEnabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _isSaveEnabled, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _saveFolder = @"D:\RecordData\File\";
|
||||
|
||||
public string SaveFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return _saveFolder;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _saveFolder, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isCreateDateFolder = true;
|
||||
|
||||
public bool IsCreateDateFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isCreateDateFolder;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _isCreateDateFolder, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyFrom(FileSaveSettingItem source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IsSaveEnabled = source.IsSaveEnabled;
|
||||
SaveFolder = source.SaveFolder;
|
||||
IsCreateDateFolder = source.IsCreateDateFolder;
|
||||
}
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
FileSaveSettingItem item = new FileSaveSettingItem();
|
||||
item.CopyFrom(this);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
public class ImageSaveSettingItem : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
private bool _isSaveEnabled = true;
|
||||
|
||||
public bool IsSaveEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isSaveEnabled;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _isSaveEnabled, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _saveFolder = @"D:\RecordData\Image\";
|
||||
|
||||
public string SaveFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return _saveFolder;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _saveFolder, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isCreateDateFolder = true;
|
||||
|
||||
public bool IsCreateDateFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isCreateDateFolder;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _isCreateDateFolder, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isSaveUpCameraImage = true;
|
||||
|
||||
public bool IsSaveUpCameraImage
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isSaveUpCameraImage;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _isSaveUpCameraImage, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isSaveDownCameraImage = true;
|
||||
|
||||
public bool IsSaveDownCameraImage
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isSaveDownCameraImage;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _isSaveDownCameraImage, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isSaveMapCameraImage = true;
|
||||
|
||||
public bool IsSaveMapCameraImage
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isSaveMapCameraImage;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _isSaveMapCameraImage, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyFrom(ImageSaveSettingItem source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IsSaveEnabled = source.IsSaveEnabled;
|
||||
SaveFolder = source.SaveFolder;
|
||||
IsCreateDateFolder = source.IsCreateDateFolder;
|
||||
IsSaveUpCameraImage = source.IsSaveUpCameraImage;
|
||||
IsSaveDownCameraImage = source.IsSaveDownCameraImage;
|
||||
IsSaveMapCameraImage = source.IsSaveMapCameraImage;
|
||||
}
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
ImageSaveSettingItem item = new ImageSaveSettingItem();
|
||||
item.CopyFrom(this);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
public class DeviceCameraSettingItem : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
private CameraFovSettingItem _upCamera = new CameraFovSettingItem("上相机");
|
||||
|
||||
public CameraFovSettingItem UpCamera
|
||||
{
|
||||
get
|
||||
{
|
||||
return _upCamera;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _upCamera, value);
|
||||
}
|
||||
}
|
||||
|
||||
private CameraFovSettingItem _downCamera = new CameraFovSettingItem("下相机");
|
||||
|
||||
public CameraFovSettingItem DownCamera
|
||||
{
|
||||
get
|
||||
{
|
||||
return _downCamera;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _downCamera, value);
|
||||
}
|
||||
}
|
||||
|
||||
private CameraFovSettingItem _mapCamera = new CameraFovSettingItem("Map相机");
|
||||
|
||||
public CameraFovSettingItem MapCamera
|
||||
{
|
||||
get
|
||||
{
|
||||
return _mapCamera;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _mapCamera, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void EnsureDefaultCameras()
|
||||
{
|
||||
if (UpCamera == null)
|
||||
{
|
||||
UpCamera = new CameraFovSettingItem("上相机");
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(UpCamera.CameraName))
|
||||
{
|
||||
UpCamera.CameraName = "上相机";
|
||||
}
|
||||
|
||||
if (DownCamera == null)
|
||||
{
|
||||
DownCamera = new CameraFovSettingItem("下相机");
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(DownCamera.CameraName))
|
||||
{
|
||||
DownCamera.CameraName = "下相机";
|
||||
}
|
||||
|
||||
if (MapCamera == null)
|
||||
{
|
||||
MapCamera = new CameraFovSettingItem("Map相机");
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(MapCamera.CameraName))
|
||||
{
|
||||
MapCamera.CameraName = "Map相机";
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyFrom(DeviceCameraSettingItem source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EnsureDefaultCameras();
|
||||
source.EnsureDefaultCameras();
|
||||
|
||||
UpCamera.CopyFrom(source.UpCamera);
|
||||
DownCamera.CopyFrom(source.DownCamera);
|
||||
MapCamera.CopyFrom(source.MapCamera);
|
||||
}
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
DeviceCameraSettingItem item = new DeviceCameraSettingItem();
|
||||
item.CopyFrom(this);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
public class CameraFovSettingItem : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
public CameraFovSettingItem()
|
||||
{
|
||||
}
|
||||
|
||||
public CameraFovSettingItem(string cameraName)
|
||||
{
|
||||
_cameraName = cameraName;
|
||||
_fovX = 1.0;
|
||||
_fovY = 1.0;
|
||||
}
|
||||
|
||||
private string _cameraName;
|
||||
|
||||
public string CameraName
|
||||
{
|
||||
get
|
||||
{
|
||||
return _cameraName;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _cameraName, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _fovX;
|
||||
|
||||
public double FovX
|
||||
{
|
||||
get
|
||||
{
|
||||
return _fovX;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _fovX, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _fovY;
|
||||
|
||||
public double FovY
|
||||
{
|
||||
get
|
||||
{
|
||||
return _fovY;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _fovY, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyFrom(CameraFovSettingItem source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CameraName = source.CameraName;
|
||||
FovX = source.FovX;
|
||||
FovY = source.FovY;
|
||||
}
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
CameraFovSettingItem item = new CameraFovSettingItem();
|
||||
item.CopyFrom(this);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
using MwFramework.Controls.UIControl;
|
||||
using MwFramework.ManagerService;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell.ParaSetting.Model
|
||||
{
|
||||
[Export(typeof(IParameter))]
|
||||
public class EquipmentParaSysSetting : ParameterBase
|
||||
{
|
||||
public SafeParaSysItem SafeParaSysItem { get; set; }=new SafeParaSysItem();
|
||||
|
||||
public override void Copy(IParameter source)
|
||||
{
|
||||
if(source is EquipmentParaSysSetting equipmentParaSys)
|
||||
{
|
||||
ReflectionExtension.Copy(this.SafeParaSysItem, equipmentParaSys.SafeParaSysItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SafeParaSysItem : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
private double _z1GeneralSafeHeight = 200.0;
|
||||
[WatchValue("Z1通用安全高度")]
|
||||
public double Z1GeneralSafeHeight
|
||||
{
|
||||
get { return _z1GeneralSafeHeight; }
|
||||
set { SetAndNotify(ref _z1GeneralSafeHeight, value); }
|
||||
}
|
||||
|
||||
private double _z3GeneralSafeHeight = 200.0;
|
||||
[WatchValue("Z3通用安全高度")]
|
||||
public double Z3GeneralSafeHeight
|
||||
{
|
||||
get { return _z3GeneralSafeHeight; }
|
||||
set { SetAndNotify(ref _z3GeneralSafeHeight, value); }
|
||||
}
|
||||
|
||||
private double _z4GeneralSafeHeight = 200.0;
|
||||
[WatchValue("Z4通用安全高度")]
|
||||
public double Z4GeneralSafeHeight
|
||||
{
|
||||
get { return _z4GeneralSafeHeight; }
|
||||
set { SetAndNotify(ref _z4GeneralSafeHeight, value); }
|
||||
}
|
||||
|
||||
private double _z5GeneralSafeHeight = 200.0;
|
||||
[WatchValue("Z5通用安全高度")]
|
||||
public double Z5GeneralSafeHeight
|
||||
{
|
||||
get { return _z5GeneralSafeHeight; }
|
||||
set { SetAndNotify(ref _z5GeneralSafeHeight, value); }
|
||||
}
|
||||
|
||||
private double _z6GeneralSafeHeight = 200.0;
|
||||
[WatchValue("Z6通用安全高度")]
|
||||
public double Z6GeneralSafeHeight
|
||||
{
|
||||
get { return _z6GeneralSafeHeight; }
|
||||
set { SetAndNotify(ref _z6GeneralSafeHeight, value); }
|
||||
}
|
||||
|
||||
private double _z1InRingSafeHeight = 200.0;
|
||||
[WatchValue("Z1环内最低安全高度")]
|
||||
public double Z1InRingSafeHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _z1InRingSafeHeight;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _z1InRingSafeHeight, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _z1OutRingSafeHeight = 100.0;
|
||||
[WatchValue("Z1环外最低安全高度")]
|
||||
public double Z1OutRingSafeHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _z1OutRingSafeHeight;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _z1OutRingSafeHeight, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _z1OnRingSafeHeight = 100.0;
|
||||
[WatchValue("Z1环上最低安全高度")]
|
||||
public double Z1OnRingSafeHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _z1OnRingSafeHeight;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _z1OnRingSafeHeight, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _z3OutRingSafeHeight = 100.0;
|
||||
[WatchValue("Z3环外最低安全高度")]
|
||||
public double Z3OutRingSafeHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _z3OutRingSafeHeight;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _z3OutRingSafeHeight, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _z4OutRingSafeHeight = 100.0;
|
||||
[WatchValue("Z4环外最低安全高度")]
|
||||
public double Z4OutRingSafeHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _z4OutRingSafeHeight;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _z4OutRingSafeHeight, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _z5OutRingSafeHeight = 100.0;
|
||||
[WatchValue("Z5环外最低安全高度")]
|
||||
public double Z5OutRingSafeHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _z5OutRingSafeHeight;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _z5OutRingSafeHeight, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _z6OutRingSafeHeight = 100.0;
|
||||
[WatchValue("Z6环外最低安全高度")]
|
||||
public double Z6OutRingSafeHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _z6OutRingSafeHeight;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _z6OutRingSafeHeight, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _needleReferenceX1X3Max = 100.0;
|
||||
[WatchValue("刺晶头基准X1-X3最大值")]
|
||||
public double NeedleReferenceX1X3Max
|
||||
{
|
||||
get { return _needleReferenceX1X3Max; }
|
||||
set { SetAndNotify(ref _needleReferenceX1X3Max, value); }
|
||||
}
|
||||
|
||||
private double _needleReferenceX1X3Min = 0.0;
|
||||
[WatchValue("刺晶头基准X1-X3最小值")]
|
||||
public double NeedleReferenceX1X3Min
|
||||
{
|
||||
get { return _needleReferenceX1X3Min; }
|
||||
set { SetAndNotify(ref _needleReferenceX1X3Min, value); }
|
||||
}
|
||||
|
||||
private double _positionLightReferenceX1X3Max = 100.0;
|
||||
[WatchValue("定位光源基准X1-X3最大值")]
|
||||
public double PositionLightReferenceX1X3Max
|
||||
{
|
||||
get { return _positionLightReferenceX1X3Max; }
|
||||
set { SetAndNotify(ref _positionLightReferenceX1X3Max, value); }
|
||||
}
|
||||
|
||||
private double _positionLightReferenceX1X3Min = 0.0;
|
||||
[WatchValue("定位光源基准X1-X3最小值")]
|
||||
public double PositionLightReferenceX1X3Min
|
||||
{
|
||||
get { return _positionLightReferenceX1X3Min; }
|
||||
set { SetAndNotify(ref _positionLightReferenceX1X3Min, value); }
|
||||
}
|
||||
|
||||
private double _wideFieldLightX2X3Max = 100.0;
|
||||
[WatchValue("大视野光源X2-X3最大值")]
|
||||
public double WideFieldLightX2X3Max
|
||||
{
|
||||
get { return _wideFieldLightX2X3Max; }
|
||||
set { SetAndNotify(ref _wideFieldLightX2X3Max, value); }
|
||||
}
|
||||
|
||||
private double _wideFieldLightX2X3Min = 0.0;
|
||||
[WatchValue("大视野光源X2-X3最小值")]
|
||||
public double WideFieldLightX2X3Min
|
||||
{
|
||||
get { return _wideFieldLightX2X3Min; }
|
||||
set { SetAndNotify(ref _wideFieldLightX2X3Min, value); }
|
||||
}
|
||||
|
||||
private double _wsInnerRingRadius = 0.0;
|
||||
[WatchValue("WS内环半径")]
|
||||
public double WsInnerRingRadius
|
||||
{
|
||||
get { return _wsInnerRingRadius; }
|
||||
set { SetAndNotify(ref _wsInnerRingRadius, value); }
|
||||
}
|
||||
|
||||
private double _needleRadius = 0.0;
|
||||
[WatchValue("刺晶头半径")]
|
||||
public double NeedleRadius
|
||||
{
|
||||
get { return _needleRadius; }
|
||||
set { SetAndNotify(ref _needleRadius, value); }
|
||||
}
|
||||
|
||||
private double _needleCalibSafeHeight;
|
||||
[WatchValue("刺晶头对刀安全高度")]
|
||||
public double NeedleCalibSafeHeight
|
||||
{
|
||||
get { return _needleCalibSafeHeight; }
|
||||
set { SetAndNotify(ref _needleCalibSafeHeight, value); }
|
||||
}
|
||||
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
return this.MemberwiseClone() as IParameterItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using MainShell.Models;
|
||||
using MwFramework.ManagerService;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell.ParaSetting.Model
|
||||
{
|
||||
public class EquipmentPointSetting : ParameterBase
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class EquipmentPointItem : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
private double _substrateLoadY1;
|
||||
|
||||
public double SubstrateLoadY1
|
||||
{
|
||||
get { return _substrateLoadY1; }
|
||||
set { SetAndNotify(ref _substrateLoadY1, value); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
return (IParameterItem)this.MemberwiseClone();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
using MainShell.Common;
|
||||
using MwFramework.Controls.UIControl;
|
||||
using MwFramework.ManagerService;
|
||||
using Stylet;
|
||||
|
||||
namespace MainShell.ParaSetting.Model
|
||||
{
|
||||
public abstract class RunProcessParameterItemBase : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
private bool _enableProcess;
|
||||
|
||||
public bool EnableProcess
|
||||
{
|
||||
get { return _enableProcess; }
|
||||
set { SetAndNotify(ref _enableProcess, value); }
|
||||
}
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
return this.MemberwiseClone() as IParameterItem;
|
||||
}
|
||||
}
|
||||
|
||||
public class ProductLoadProcessParameter : RunProcessParameterItemBase
|
||||
{
|
||||
}
|
||||
|
||||
public class ProductUnloadProcessParameter : RunProcessParameterItemBase
|
||||
{
|
||||
}
|
||||
|
||||
public class ProductPositionProcessParameter : RunProcessParameterItemBase
|
||||
{
|
||||
|
||||
private double _glassMarkDisMaxOffset = 0.01;
|
||||
[WatchValue("<22><>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>ƫ<EFBFBD><C6AB>")]
|
||||
public double GlassMarkDisMaxOffset
|
||||
{
|
||||
get { return _glassMarkDisMaxOffset; }
|
||||
set { SetAndNotify(ref _glassMarkDisMaxOffset, value); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
private double _pcbLimitAngle = 0.5;
|
||||
|
||||
public double PcbLimitAngle
|
||||
{
|
||||
get { return _pcbLimitAngle; }
|
||||
set { SetAndNotify(ref _pcbLimitAngle, value); }
|
||||
}
|
||||
}
|
||||
|
||||
public class ProductHeightMeasureProcessParameter : RunProcessParameterItemBase
|
||||
{
|
||||
private double _heightMeasureLimit = 0.04;
|
||||
public double HeightMeasureLimit
|
||||
{
|
||||
get { return _heightMeasureLimit; }
|
||||
set { SetAndNotify(ref _heightMeasureLimit, value); }
|
||||
}
|
||||
|
||||
private bool _useHeightOffset = true;
|
||||
[WatchValue("ʹ<>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD>")]
|
||||
public bool UseHeightOffset
|
||||
{
|
||||
get { return _useHeightOffset; }
|
||||
set { SetAndNotify(ref _useHeightOffset, value); }
|
||||
}
|
||||
}
|
||||
|
||||
public class WaferLoadProcessParameter : RunProcessParameterItemBase
|
||||
{
|
||||
}
|
||||
|
||||
public class WaferUnloadProcessParameter : RunProcessParameterItemBase
|
||||
{
|
||||
}
|
||||
|
||||
public class WaferStraightenProcessParameter : RunProcessParameterItemBase
|
||||
{
|
||||
private bool _useSingleStraighten;
|
||||
[WatchValue("ʹ<>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>ֱ")]
|
||||
public bool UseSingleStraighten
|
||||
{
|
||||
get { return _useSingleStraighten; }
|
||||
set { SetAndNotify(ref _useSingleStraighten, value); }
|
||||
}
|
||||
|
||||
|
||||
private bool _straightAngleDirX = true;
|
||||
[WatchValue("<22><>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD>X")]
|
||||
public bool StraightAngleDirX
|
||||
{
|
||||
get { return _straightAngleDirX; }
|
||||
set { SetAndNotify(ref _straightAngleDirX, value); }
|
||||
}
|
||||
|
||||
private int _maxBadDieCount = 100;
|
||||
|
||||
public int MaxBadDieCount
|
||||
{
|
||||
get { return _maxBadDieCount; }
|
||||
set { SetAndNotify(ref _maxBadDieCount, value); }
|
||||
}
|
||||
}
|
||||
|
||||
public class DieRecognizeProcessParameter : RunProcessParameterItemBase
|
||||
{
|
||||
private bool _useSingleWaferPosition;
|
||||
[WatchValue("ʹ<>õ<EFBFBD><C3B5><EFBFBD>оƬ<D0BE><C6AC>λ")]
|
||||
public bool UseSingleWaferPosition
|
||||
{
|
||||
get { return _useSingleWaferPosition; }
|
||||
set { SetAndNotify(ref _useSingleWaferPosition, value); }
|
||||
}
|
||||
|
||||
private bool _useWaferWaveCheck;
|
||||
public bool UseWaferWaveCheck
|
||||
{
|
||||
get { return _useWaferWaveCheck; }
|
||||
set { SetAndNotify(ref _useWaferWaveCheck, value); }
|
||||
}
|
||||
|
||||
private bool _changePid = true;
|
||||
[WatchValue("PID<49>л<EFBFBD>")]
|
||||
public bool ChangePid
|
||||
{
|
||||
get { return _changePid; }
|
||||
set { SetAndNotify(ref _changePid, value); }
|
||||
}
|
||||
|
||||
private double _dieAngleThreshold = 3;
|
||||
[WatchValue("<22><><EFBFBD><EFBFBD><EFBFBD>Ƕ<EFBFBD><C7B6><EFBFBD>ֵ")]
|
||||
public double DieAngleThreshold
|
||||
{
|
||||
get { return _dieAngleThreshold; }
|
||||
set { SetAndNotify(ref _dieAngleThreshold, value); }
|
||||
}
|
||||
|
||||
private WaferScanMode _waferScanMode = WaferScanMode.FullScan;
|
||||
[WatchValue("оƬɨ<C6AC><C9A8>ģʽ")]
|
||||
public WaferScanMode WaferScanMode
|
||||
{
|
||||
get { return _waferScanMode; }
|
||||
set { SetAndNotify(ref _waferScanMode, value); }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class BondingProcessParameter : RunProcessParameterItemBase
|
||||
{
|
||||
|
||||
|
||||
private bool _isNeedleUpWhenBonding;
|
||||
[WatchValue("<22><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>̧<EFBFBD><CCA7>")]
|
||||
public bool IsNeedleUpWhenBonding
|
||||
{
|
||||
get { return _isNeedleUpWhenBonding; }
|
||||
set { SetAndNotify(ref _isNeedleUpWhenBonding, value); }
|
||||
}
|
||||
|
||||
|
||||
private bool _useAllDie;
|
||||
[WatchValue("<22><><EFBFBD><EFBFBD>100%<25><><EFBFBD><EFBFBD>")]
|
||||
public bool UseAllDie
|
||||
{
|
||||
get { return _useAllDie; }
|
||||
set { SetAndNotify(ref _useAllDie, value); }
|
||||
}
|
||||
|
||||
private bool _useAirCoolAllProduce = true;
|
||||
[WatchValue("ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")]
|
||||
public bool UseAirCoolAllProduce
|
||||
{
|
||||
get { return _useAirCoolAllProduce; }
|
||||
set { SetAndNotify(ref _useAirCoolAllProduce, value); }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class RecheckProcessParameter : RunProcessParameterItemBase
|
||||
{
|
||||
private bool _useIrregularRecheck;
|
||||
[WatchValue("<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>")]
|
||||
public bool UseIrregularRecheck
|
||||
{
|
||||
get { return _useIrregularRecheck; }
|
||||
set { SetAndNotify(ref _useIrregularRecheck, value); }
|
||||
}
|
||||
}
|
||||
|
||||
public class GlobalRunParameter : RunProcessParameterItemBase
|
||||
{
|
||||
private int _needleCheckBondingGlassNum;
|
||||
[WatchValue("<22>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҪBonding<6E><67><EFBFBD><EFBFBD>")]
|
||||
public int NeedleCheckBondingGlassNum
|
||||
{
|
||||
get { return _needleCheckBondingGlassNum; }
|
||||
set { SetAndNotify(ref _needleCheckBondingGlassNum, value); }
|
||||
}
|
||||
|
||||
private bool _isUseMesLeiMan;
|
||||
[WatchValue("<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>MES-<2D><><EFBFBD><EFBFBD>")]
|
||||
public bool IsUseMesLeiMan
|
||||
{
|
||||
get { return _isUseMesLeiMan; }
|
||||
set { SetAndNotify(ref _isUseMesLeiMan, value); }
|
||||
}
|
||||
|
||||
private RunningMode _runningMode = RunningMode.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
[WatchValue("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")]
|
||||
public RunningMode RunningMode
|
||||
{
|
||||
get { return _runningMode; }
|
||||
set { SetAndNotify(ref _runningMode, value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
using MainShell.Common;
|
||||
using MwFramework.Controls.UIControl;
|
||||
using MwFramework.ManagerService;
|
||||
using Newtonsoft.Json;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
using static MainShell.ParaSetting.Model.SpeedSetting;
|
||||
|
||||
namespace MainShell.ParaSetting.Model
|
||||
{
|
||||
[Export(typeof(IParameter))]
|
||||
public class RunSetting : ParameterBase
|
||||
{
|
||||
public ProductLoadProcessParameter ProductLoadProcessParameter { get; set; } = new ProductLoadProcessParameter();
|
||||
public ProductUnloadProcessParameter ProductUnloadProcessParameter { get; set; } = new ProductUnloadProcessParameter();
|
||||
public ProductPositionProcessParameter ProductPositionProcessParameter { get; set; } = new ProductPositionProcessParameter();
|
||||
public ProductHeightMeasureProcessParameter ProductHeightMeasureProcessParameter { get; set; } = new ProductHeightMeasureProcessParameter();
|
||||
public WaferLoadProcessParameter WaferLoadProcessParameter { get; set; } = new WaferLoadProcessParameter();
|
||||
public WaferUnloadProcessParameter WaferUnloadProcessParameter { get; set; } = new WaferUnloadProcessParameter();
|
||||
public WaferStraightenProcessParameter WaferStraightenProcessParameter { get; set; } = new WaferStraightenProcessParameter();
|
||||
public DieRecognizeProcessParameter DieRecognizeProcessParameter { get; set; } = new DieRecognizeProcessParameter();
|
||||
public BondingProcessParameter BondingProcessParameter { get; set; } = new BondingProcessParameter();
|
||||
public RecheckProcessParameter RecheckProcessParameter { get; set; } = new RecheckProcessParameter();
|
||||
public GlobalRunParameter GlobalRunParameter { get; set; } = new GlobalRunParameter();
|
||||
|
||||
[JsonIgnore]
|
||||
[XmlIgnore]
|
||||
public FlowControlItem FlowControlItem
|
||||
{
|
||||
get
|
||||
{
|
||||
FlowControlItem item = new FlowControlItem();
|
||||
item.SubStrateLoadEnable = ProductLoadProcessParameter.EnableProcess;
|
||||
item.SubStrateUnLoadEnable = ProductUnloadProcessParameter.EnableProcess;
|
||||
item.SubstratePositionEnable = ProductPositionProcessParameter.EnableProcess;
|
||||
item.SubstrateHeightMeasureEnable = ProductHeightMeasureProcessParameter.EnableProcess;
|
||||
item.WaferLoadEnable = WaferLoadProcessParameter.EnableProcess;
|
||||
item.WaferUnLoadEnable = WaferUnloadProcessParameter.EnableProcess;
|
||||
item.WaferStraightenEnable = WaferStraightenProcessParameter.EnableProcess;
|
||||
item.WaferPositionEnable = DieRecognizeProcessParameter.EnableProcess;
|
||||
item.BondingEnable = BondingProcessParameter.EnableProcess;
|
||||
item.SubstrateRecheckEnable = RecheckProcessParameter.EnableProcess;
|
||||
return item;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ProductLoadProcessParameter.EnableProcess = value.SubStrateLoadEnable;
|
||||
ProductUnloadProcessParameter.EnableProcess = value.SubStrateUnLoadEnable;
|
||||
ProductPositionProcessParameter.EnableProcess = value.SubstratePositionEnable;
|
||||
ProductHeightMeasureProcessParameter.EnableProcess = value.SubstrateHeightMeasureEnable;
|
||||
WaferLoadProcessParameter.EnableProcess = value.WaferLoadEnable;
|
||||
WaferUnloadProcessParameter.EnableProcess = value.WaferUnLoadEnable;
|
||||
WaferStraightenProcessParameter.EnableProcess = value.WaferStraightenEnable;
|
||||
DieRecognizeProcessParameter.EnableProcess = value.WaferPositionEnable;
|
||||
BondingProcessParameter.EnableProcess = value.BondingEnable;
|
||||
RecheckProcessParameter.EnableProcess = value.SubstrateRecheckEnable;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Copy(IParameter source)
|
||||
{
|
||||
if (source is RunSetting setting)
|
||||
{
|
||||
ReflectionExtension.Copy(ProductLoadProcessParameter, setting.ProductLoadProcessParameter);
|
||||
ReflectionExtension.Copy(ProductUnloadProcessParameter, setting.ProductUnloadProcessParameter);
|
||||
ReflectionExtension.Copy(ProductPositionProcessParameter, setting.ProductPositionProcessParameter);
|
||||
ReflectionExtension.Copy(ProductHeightMeasureProcessParameter, setting.ProductHeightMeasureProcessParameter);
|
||||
ReflectionExtension.Copy(WaferLoadProcessParameter, setting.WaferLoadProcessParameter);
|
||||
ReflectionExtension.Copy(WaferUnloadProcessParameter, setting.WaferUnloadProcessParameter);
|
||||
ReflectionExtension.Copy(WaferStraightenProcessParameter, setting.WaferStraightenProcessParameter);
|
||||
ReflectionExtension.Copy(DieRecognizeProcessParameter, setting.DieRecognizeProcessParameter);
|
||||
ReflectionExtension.Copy(BondingProcessParameter, setting.BondingProcessParameter);
|
||||
ReflectionExtension.Copy(RecheckProcessParameter, setting.RecheckProcessParameter);
|
||||
ReflectionExtension.Copy(GlobalRunParameter, setting.GlobalRunParameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class FlowControlItem : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
private bool _substrateLoadEnable;
|
||||
|
||||
public bool SubStrateLoadEnable
|
||||
{
|
||||
get { return _substrateLoadEnable; }
|
||||
set { SetAndNotify(ref _substrateLoadEnable, value); }
|
||||
}
|
||||
|
||||
private bool _substrateUnLoadEnable;
|
||||
|
||||
public bool SubStrateUnLoadEnable
|
||||
{
|
||||
get { return _substrateUnLoadEnable; }
|
||||
set { SetAndNotify(ref _substrateUnLoadEnable, value); }
|
||||
}
|
||||
|
||||
private bool _substratePositionEnable;
|
||||
|
||||
public bool SubstratePositionEnable
|
||||
{
|
||||
get { return _substratePositionEnable; }
|
||||
set { SetAndNotify(ref _substratePositionEnable, value); }
|
||||
}
|
||||
|
||||
private bool _substrateHeightMeasureEnable;
|
||||
|
||||
public bool SubstrateHeightMeasureEnable
|
||||
{
|
||||
get { return _substrateHeightMeasureEnable; }
|
||||
set { SetAndNotify(ref _substrateHeightMeasureEnable, value); }
|
||||
}
|
||||
|
||||
private bool _waferLoadEnable;
|
||||
|
||||
public bool WaferLoadEnable
|
||||
{
|
||||
get { return _waferLoadEnable; }
|
||||
set { SetAndNotify(ref _waferLoadEnable, value); }
|
||||
}
|
||||
|
||||
private bool _waferUnLoadEnable;
|
||||
|
||||
public bool WaferUnLoadEnable
|
||||
{
|
||||
get { return _waferUnLoadEnable; }
|
||||
set { SetAndNotify(ref _waferUnLoadEnable, value); }
|
||||
}
|
||||
|
||||
private bool _waferStraightenEnable;
|
||||
|
||||
public bool WaferStraightenEnable
|
||||
{
|
||||
get { return _waferStraightenEnable; }
|
||||
set { SetAndNotify(ref _waferStraightenEnable, value); }
|
||||
}
|
||||
|
||||
private bool _waferPositionEnable;
|
||||
|
||||
public bool WaferPositionEnable
|
||||
{
|
||||
get { return _waferPositionEnable; }
|
||||
set { SetAndNotify(ref _waferPositionEnable, value); }
|
||||
}
|
||||
|
||||
private bool _bondingEnable;
|
||||
|
||||
public bool BondingEnable
|
||||
{
|
||||
get { return _bondingEnable; }
|
||||
set { SetAndNotify(ref _bondingEnable, value); }
|
||||
}
|
||||
|
||||
private bool _substrateRecheckEnable;
|
||||
|
||||
public bool SubstrateRecheckEnable
|
||||
{
|
||||
get { return _substrateRecheckEnable; }
|
||||
set { SetAndNotify(ref _substrateRecheckEnable, value); }
|
||||
}
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
return this.MemberwiseClone() as IParameterItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
using MainShell.Common;
|
||||
using MainShell.Hardware;
|
||||
using MwFramework.Controls.UIControl;
|
||||
using MwFramework.Device;
|
||||
using MwFramework.ManagerService;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell.ParaSetting.Model
|
||||
{
|
||||
[Export(typeof(IParameter))]
|
||||
public class SpeedSetting : ParameterBase
|
||||
{
|
||||
[Export(typeof(IParameter))]
|
||||
public class SpeedParaSysSetting : ParameterBase
|
||||
{
|
||||
[WatchValue("速度参数")]
|
||||
public SpeedTypeItemCollection SpeedTypeItemCollection { get; set; } = new SpeedTypeItemCollection();
|
||||
public SpeedType CurrentSpeedType { get; set; } = SpeedType.Low;
|
||||
public override void Copy(IParameter source)
|
||||
{
|
||||
if (source is SpeedParaSysSetting setting)
|
||||
{
|
||||
ReflectionExtension.Copy(SpeedTypeItemCollection, setting.SpeedTypeItemCollection);
|
||||
CurrentSpeedType = setting.CurrentSpeedType;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class SpeedTypeItemCollection : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
|
||||
private ObservableCollection<SpeedTypeItem> _speedTypeItemList = new ObservableCollection<SpeedTypeItem>();
|
||||
[WatchValue("SpeedTypeItemList")]
|
||||
public ObservableCollection<SpeedTypeItem> SpeedTypeItemList
|
||||
{
|
||||
get { return _speedTypeItemList; }
|
||||
set { if (_speedTypeItemList != value) { _speedTypeItemList = value; OnPropertyChanged(nameof(SpeedTypeItemList)); } }
|
||||
}
|
||||
|
||||
private SpeedTypeItem _currentSelectSpeedTypeItemList = new SpeedTypeItem();
|
||||
public SpeedTypeItem CurrentSelectSpeedTypeItemList
|
||||
{
|
||||
get { return _currentSelectSpeedTypeItemList; }
|
||||
set { if (_currentSelectSpeedTypeItemList != value) { _currentSelectSpeedTypeItemList = value; OnPropertyChanged(nameof(CurrentSelectSpeedTypeItemList)); } }
|
||||
}
|
||||
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
return this.MemberwiseClone() as IParameterItem;
|
||||
}
|
||||
}
|
||||
public class SpeedTypeItem : PropertyChangedBase, IParameterItem
|
||||
{
|
||||
|
||||
private string _axisName;
|
||||
[WatchValue("轴名称")]
|
||||
public string AxisName
|
||||
{
|
||||
get { return _axisName; }
|
||||
set { SetAndNotify(ref _axisName, value); }
|
||||
}
|
||||
|
||||
private double _speed = 10.0;
|
||||
[WatchValue("速度")]
|
||||
public double Speed
|
||||
{
|
||||
get { return _speed; }
|
||||
set { if (_speed != value) { _speed = value; OnPropertyChanged(nameof(Speed)); } }
|
||||
}
|
||||
private double _acc = 100.0;
|
||||
[WatchValue("加速度")]
|
||||
public double Acc
|
||||
{
|
||||
get { return _acc; }
|
||||
set { if (_acc != value) { _acc = value; OnPropertyChanged(nameof(Acc)); } }
|
||||
}
|
||||
private double _dec = 100.0;
|
||||
[WatchValue("减速度")]
|
||||
public double Dec
|
||||
{
|
||||
get { return _dec; }
|
||||
set { if (_dec != value) { _dec = value; OnPropertyChanged(nameof(Dec)); } }
|
||||
}
|
||||
private double _jerk = 1000.0;
|
||||
[WatchValue("加加速度")]
|
||||
public double Jerk
|
||||
{
|
||||
get { return _jerk; }
|
||||
set { if (_jerk != value) { _jerk = value; OnPropertyChanged(nameof(Jerk)); } }
|
||||
}
|
||||
private double _lowPercent = 20;
|
||||
[WatchValue("低速")]
|
||||
public double LowPercent
|
||||
{
|
||||
get { return _lowPercent; }
|
||||
set { LimitPercent(ref value); SetAndNotify(ref _lowPercent, value); }
|
||||
}
|
||||
|
||||
private double _medianPercent = 50;
|
||||
[WatchValue("中速")]
|
||||
public double MedianPercent
|
||||
{
|
||||
get { return _medianPercent; }
|
||||
set { LimitPercent(ref value); SetAndNotify(ref _medianPercent, value); }
|
||||
}
|
||||
|
||||
private double _highPercent = 100;
|
||||
[WatchValue("高速")]
|
||||
public double HighPercent
|
||||
{
|
||||
get { return _highPercent; }
|
||||
set { LimitPercent(ref value); SetAndNotify(ref _highPercent, value); }
|
||||
}
|
||||
|
||||
private void LimitPercent(ref double percent)
|
||||
{
|
||||
if (percent < 0) percent = 1;
|
||||
else if (percent > 100) percent = 100;
|
||||
|
||||
}
|
||||
public IParameterItem Clone()
|
||||
{
|
||||
return this.MemberwiseClone() as IParameterItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.BondingProcessParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="260" d:DesignWidth="1000">
|
||||
<Grid Margin="4" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<GroupBox Header="{DynamicResource ProcessControlGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnableBondingProcess}" IsChecked="{Binding Parameter.EnableProcess}"/>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource IsNeedleUpWhenBonding}" IsChecked="{Binding Parameter.IsNeedleUpWhenBonding}"/>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="{DynamicResource BondingProcessParameterGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource ProcessLabelStyle}" Content="{DynamicResource UseAllDieLabel}"/>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnabledLabel}" IsChecked="{Binding Parameter.UseAllDie}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,24,0">
|
||||
<Label Style="{StaticResource ProcessLabelStyle}" Content="{DynamicResource AirCoolAllProduceLabel}"/>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnabledLabel}" IsChecked="{Binding Parameter.UseAirCoolAllProduce}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class BondingProcessParameterView : UserControl
|
||||
{
|
||||
public BondingProcessParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.DieRecognizeProcessParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
xmlns:common="clr-namespace:MainShell.Common"
|
||||
xmlns:conv="clr-namespace:MainShell.Converter"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="220" d:DesignWidth="900">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<conv:EnumBindingSourceExtension x:Key="WaferScanModeEnums" UseDescription="True" EnumType="{x:Type common:WaferScanMode}"/>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Grid Margin="4" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<GroupBox Header="{DynamicResource ProcessControlGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnableDieRecognize}" IsChecked="{Binding Parameter.EnableProcess}"/>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource SingleWaferPosition}" IsChecked="{Binding Parameter.UseSingleWaferPosition}"/>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource WaferWaveCheck}" IsChecked="{Binding Parameter.UseWaferWaveCheck}"/>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource ChangePid}" IsChecked="{Binding Parameter.ChangePid}"/>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="{DynamicResource DieRecognizeStrategyGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<StackPanel>
|
||||
<Grid Margin="0,0,0,12">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="220"/>
|
||||
<ColumnDefinition Width="260"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Style="{StaticResource ProcessLabelStyle}" Content="{DynamicResource DieAngleThreshold}"/>
|
||||
<mw:NumberBox Grid.Column="1" Style="{StaticResource ProcessLargeNumberBoxStyle}" Value="{Binding Parameter.DieAngleThreshold}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="1000" Minimum="-1000" Increment="0.5"/>
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource ProcessUnitTextStyle}" Text="°"/>
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="220"/>
|
||||
<ColumnDefinition Width="260"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Style="{StaticResource ProcessLabelStyle}" Content="{DynamicResource WaferScanModeLabel}"/>
|
||||
<ComboBox Grid.Column="1" Style="{StaticResource ProcessLargeComboBoxStyle}" DisplayMemberPath="Description" SelectedValuePath="Value" SelectedValue="{Binding Parameter.WaferScanMode}" ItemsSource="{StaticResource WaferScanModeEnums}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class DieRecognizeProcessParameterView : UserControl
|
||||
{
|
||||
public DieRecognizeProcessParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.ProductHeightMeasureProcessParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="180" d:DesignWidth="800">
|
||||
<Grid Margin="4" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<GroupBox Header="{DynamicResource ProcessControlGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<StackPanel>
|
||||
<WrapPanel>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnableProductHeightMeasureFlow}" IsChecked="{Binding Parameter.EnableProcess}"/>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource UseHeightOffset}" IsChecked="{Binding Parameter.UseHeightOffset}"/>
|
||||
</WrapPanel>
|
||||
<Border Style="{StaticResource ProcessDividerStyle}"/>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="220"/>
|
||||
<ColumnDefinition Width="260"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Style="{StaticResource ProcessLabelStyle}" Content="{DynamicResource HeightMeasureLimit}"/>
|
||||
<mw:NumberBox Grid.Column="1" Style="{StaticResource ProcessLargeNumberBoxStyle}" Value="{Binding Parameter.HeightMeasureLimit}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="1" Minimum="0" Increment="0.01"/>
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource ProcessUnitTextStyle}" Text="mm"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class ProductHeightMeasureProcessParameterView : UserControl
|
||||
{
|
||||
public ProductHeightMeasureProcessParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.ProductLoadProcessParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="160" d:DesignWidth="800">
|
||||
<Grid Margin="4" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<GroupBox Header="{DynamicResource ProcessControlGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnableProductLoad}" IsChecked="{Binding Parameter.EnableProcess}"/>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class ProductLoadProcessParameterView : UserControl
|
||||
{
|
||||
public ProductLoadProcessParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.ProductPositionProcessParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="240" d:DesignWidth="900">
|
||||
<Grid Margin="4" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<GroupBox Header="{DynamicResource ProcessControlGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnableProductPosition}" IsChecked="{Binding Parameter.EnableProcess}"/>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="{DynamicResource PositionThresholdGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<StackPanel>
|
||||
<Grid Margin="0,0,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="220"/>
|
||||
<ColumnDefinition Width="260"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Style="{StaticResource ProcessLabelStyle}" Content="{DynamicResource GlassMarkDisMaxOffset}"/>
|
||||
<mw:NumberBox Grid.Column="1" Style="{StaticResource ProcessLargeNumberBoxStyle}" Value="{Binding Parameter.GlassMarkDisMaxOffset}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="1000" Minimum="-1000" Increment="0.5"/>
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource ProcessUnitTextStyle}" Text="mm"/>
|
||||
</Grid>
|
||||
<Border Style="{StaticResource ProcessDividerStyle}"/>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="220"/>
|
||||
<ColumnDefinition Width="260"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Style="{StaticResource ProcessLabelStyle}" Content="{DynamicResource PcbLimitAngle}"/>
|
||||
<mw:NumberBox Grid.Column="1" Style="{StaticResource ProcessLargeNumberBoxStyle}" Value="{Binding Parameter.PcbLimitAngle}" DecimalPlaces="3" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10" Minimum="0" Increment="0.1"/>
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource ProcessUnitTextStyle}" Text="°"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class ProductPositionProcessParameterView : UserControl
|
||||
{
|
||||
public ProductPositionProcessParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.ProductUnloadProcessParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="160" d:DesignWidth="800">
|
||||
<Grid Margin="4" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<GroupBox Header="{DynamicResource ProcessControlGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnableProductUnload}" IsChecked="{Binding Parameter.EnableProcess}"/>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class ProductUnloadProcessParameterView : UserControl
|
||||
{
|
||||
public ProductUnloadProcessParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.RecheckProcessParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="160" d:DesignWidth="800">
|
||||
<Grid Margin="4" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<GroupBox Header="{DynamicResource ProcessControlGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnableRecheckProcess}" IsChecked="{Binding Parameter.EnableProcess}"/>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource IrregularRecheck}" IsChecked="{Binding Parameter.UseIrregularRecheck}"/>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class RecheckProcessParameterView : UserControl
|
||||
{
|
||||
public RecheckProcessParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.WaferLoadProcessParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="160" d:DesignWidth="800">
|
||||
<Grid Margin="4" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<GroupBox Header="{DynamicResource ProcessControlGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnableWaferLoad}" IsChecked="{Binding Parameter.EnableProcess}"/>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class WaferLoadProcessParameterView : UserControl
|
||||
{
|
||||
public WaferLoadProcessParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.WaferStraightenProcessParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="220" d:DesignWidth="900">
|
||||
<Grid Margin="4" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<GroupBox Header="{DynamicResource ProcessControlGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnableWaferStraighten}" IsChecked="{Binding Parameter.EnableProcess}"/>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource SingleStraighten}" IsChecked="{Binding Parameter.UseSingleStraighten}"/>
|
||||
<ToggleButton Style="{StaticResource ProcessSmallToggleStyle}" Content="{DynamicResource XAxisDirectionLabel}" IsChecked="{Binding Parameter.StraightAngleDirX}"/>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="{DynamicResource StraightenThresholdGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,24,0">
|
||||
<Label Style="{StaticResource ProcessLabelStyle}" Content="{DynamicResource MaxBadDieCount}"/>
|
||||
<mw:IntNumberBox Style="{StaticResource ProcessIntNumberBoxStyle}" Value="{Binding Parameter.MaxBadDieCount}" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="6000" Minimum="1" Increment="1"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class WaferStraightenProcessParameterView : UserControl
|
||||
{
|
||||
public WaferStraightenProcessParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.WaferUnloadProcessParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="160" d:DesignWidth="800">
|
||||
<Grid Margin="4" HorizontalAlignment="Stretch">
|
||||
<StackPanel>
|
||||
<GroupBox Header="{DynamicResource ProcessControlGroup}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<ToggleButton Style="{StaticResource ProcessToggleStyle}" Content="{DynamicResource EnableWaferUnload}" IsChecked="{Binding Parameter.EnableProcess}"/>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class WaferUnloadProcessParameterView : UserControl
|
||||
{
|
||||
public WaferUnloadProcessParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using MainShell.Models;
|
||||
using MainShell.ParaSetting.Model;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public abstract class ProcessSectionViewModelBase<TParameter> : BaseScreen where TParameter : class
|
||||
{
|
||||
private TParameter _parameter;
|
||||
|
||||
public TParameter Parameter
|
||||
{
|
||||
get { return _parameter; }
|
||||
private set
|
||||
{
|
||||
_parameter = value;
|
||||
OnPropertyChanged(nameof(Parameter));
|
||||
}
|
||||
}
|
||||
|
||||
public void SetParameter(TParameter parameter)
|
||||
{
|
||||
Parameter = parameter;
|
||||
}
|
||||
}
|
||||
|
||||
public class ProductLoadProcessParameterViewModel : ProcessSectionViewModelBase<ProductLoadProcessParameter>
|
||||
{
|
||||
}
|
||||
|
||||
public class ProductUnloadProcessParameterViewModel : ProcessSectionViewModelBase<ProductUnloadProcessParameter>
|
||||
{
|
||||
}
|
||||
|
||||
public class ProductPositionProcessParameterViewModel : ProcessSectionViewModelBase<ProductPositionProcessParameter>
|
||||
{
|
||||
}
|
||||
|
||||
public class ProductHeightMeasureProcessParameterViewModel : ProcessSectionViewModelBase<ProductHeightMeasureProcessParameter>
|
||||
{
|
||||
}
|
||||
|
||||
public class WaferLoadProcessParameterViewModel : ProcessSectionViewModelBase<WaferLoadProcessParameter>
|
||||
{
|
||||
}
|
||||
|
||||
public class WaferUnloadProcessParameterViewModel : ProcessSectionViewModelBase<WaferUnloadProcessParameter>
|
||||
{
|
||||
}
|
||||
|
||||
public class WaferStraightenProcessParameterViewModel : ProcessSectionViewModelBase<WaferStraightenProcessParameter>
|
||||
{
|
||||
}
|
||||
|
||||
public class DieRecognizeProcessParameterViewModel : ProcessSectionViewModelBase<DieRecognizeProcessParameter>
|
||||
{
|
||||
}
|
||||
|
||||
public class BondingProcessParameterViewModel : ProcessSectionViewModelBase<BondingProcessParameter>
|
||||
{
|
||||
}
|
||||
|
||||
public class RecheckProcessParameterViewModel : ProcessSectionViewModelBase<RecheckProcessParameter>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.AxisSoftLimitSettingView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:behavior="clr-namespace:MainShell.Common.ControlAttribute"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<Style x:Key="AxisSoftLimitTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="AxisSoftLimitNumericEditingTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource AxisSoftLimitTextBoxStyle}">
|
||||
<Setter Property="behavior:ControlBehavior.IsNumericOnly" Value="True"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="{StaticResource ProcessPageBackgroundBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="60"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Grid.Row="0"
|
||||
Margin="4,4,4,8"
|
||||
Header="{DynamicResource AxisSoftLimitGroupHeader}"
|
||||
Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0"
|
||||
Style="{StaticResource ProcessLabelStyle}"
|
||||
Content="{DynamicResource AxisSoftLimitFilePathLabel}"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Style="{StaticResource AxisSoftLimitTextBoxStyle}"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding ParameterFilePath}"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<DataGrid Grid.Row="1"
|
||||
Margin="4,0,4,4"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserSortColumns="False"
|
||||
ItemsSource="{Binding AxisSoftLimitItems}"
|
||||
SelectedItem="{Binding SelectedAxisSoftLimitItem}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{DynamicResource AxisName}" Binding="{Binding AxisName}" IsReadOnly="True" Width="2*"/>
|
||||
<DataGridTextColumn Header="{DynamicResource AxisSoftLimitCardName}" Binding="{Binding CardName}" IsReadOnly="True" Width="2*"/>
|
||||
<DataGridTextColumn Header="{DynamicResource AxisSoftLimitCardNum}" Binding="{Binding CardNum}" IsReadOnly="True" Width="*"/>
|
||||
<DataGridTextColumn Header="{DynamicResource AxisSoftLimitAxisNum}" Binding="{Binding AxisNum}" IsReadOnly="True" Width="*"/>
|
||||
<DataGridTextColumn Header="{DynamicResource AxisSoftLimitNegativeLabel}" Width="2*" EditingElementStyle="{StaticResource AxisSoftLimitNumericEditingTextBoxStyle}">
|
||||
<DataGridTextColumn.Binding>
|
||||
<Binding Path="NegativeSoftLimit" UpdateSourceTrigger="PropertyChanged"/>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Header="{DynamicResource AxisSoftLimitPositiveLabel}" Width="2*" EditingElementStyle="{StaticResource AxisSoftLimitNumericEditingTextBoxStyle}">
|
||||
<DataGridTextColumn.Binding>
|
||||
<Binding Path="PositiveSoftLimit" UpdateSourceTrigger="PropertyChanged"/>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="2" Margin="4,8,4,4">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Content="{DynamicResource AxisSoftLimitApplyAllButton}"
|
||||
Click="{mw:Action BtnApplyAll}"
|
||||
Style="{StaticResource SaveButtonStyle}"
|
||||
Margin="0,0,8,0"/>
|
||||
<Button Content="{DynamicResource AxisSoftLimitApplyButton}"
|
||||
Click="{mw:Action BtnApply}"
|
||||
Style="{StaticResource SaveButtonStyle}"
|
||||
Margin="0,0,8,0"/>
|
||||
<Button Content="{DynamicResource Save}"
|
||||
Click="{mw:Action BtnSave}"
|
||||
Style="{StaticResource SaveButtonStyle}"
|
||||
HorizontalAlignment="Right"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class AxisSoftLimitSettingView : UserControl
|
||||
{
|
||||
public AxisSoftLimitSettingView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.CameraParameterView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style x:Key="CameraParameterLabelStyle" TargetType="Label" BasedOn="{StaticResource ProcessLabelStyle}">
|
||||
<Setter Property="Width" Value="78"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CameraParameterNumberBoxStyle" TargetType="{x:Type mw:NumberBox}" BasedOn="{StaticResource ProcessLargeNumberBoxStyle}">
|
||||
<Setter Property="Margin" Value="8,0,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CameraParameterCardGroupBoxStyle" TargetType="GroupBox" BasedOn="{StaticResource ProcessCardGroupBoxStyle}">
|
||||
<Setter Property="Width" Value="320"/>
|
||||
<Setter Property="Margin" Value="0,0,18,18"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="{StaticResource ProcessPageBackgroundBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="60"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ScrollViewer Grid.Row="0"
|
||||
Margin="4,4,4,0"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="0,0,4,0">
|
||||
<StackPanel Margin="0,0,0,4">
|
||||
<GroupBox Header="{DynamicResource FovPara}" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<ItemsControl ItemsSource="{Binding CameraItems}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<GroupBox Header="{Binding CameraName}" Style="{StaticResource CameraParameterCardGroupBoxStyle}">
|
||||
<StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource CameraParameterLabelStyle}" Content="{DynamicResource FovX}"/>
|
||||
<mw:NumberBox Style="{StaticResource CameraParameterNumberBoxStyle}" Value="{Binding FovX, UpdateSourceTrigger=PropertyChanged}" mw:NumericKeypadAttach.IsEnabled="True"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource CameraParameterLabelStyle}" Content="{DynamicResource FovY}"/>
|
||||
<mw:NumberBox Style="{StaticResource CameraParameterNumberBoxStyle}" Value="{Binding FovY, UpdateSourceTrigger=PropertyChanged}" mw:NumericKeypadAttach.IsEnabled="True"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Row="1" Margin="4,8,4,4">
|
||||
<Button Content="{DynamicResource Save}" Click="{mw:Action BtnSave}" Style="{StaticResource SaveButtonStyle}" HorizontalAlignment="Right"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class CameraParameterView : UserControl
|
||||
{
|
||||
public CameraParameterView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.DeviceFoundationView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MainShell.ParaSetting.View"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<Style TargetType="Label" BasedOn="{StaticResource {x:Type Label}}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
<Setter Property="Height" Value="35"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border Background="{StaticResource BackgroundBrush}" BorderBrush="{StaticResource BorderBrush}" BorderThickness="2,2,2,2">
|
||||
<TabControl mw:TabControlAttach.FontSize="14">
|
||||
<TabItem Header="{DynamicResource MenuMaterialBoxPara}">
|
||||
|
||||
</TabItem>
|
||||
<TabItem Header="{DynamicResource MenuAxisParameters}">
|
||||
<ContentControl mw:View.Model="{Binding AxisParameterSettingViewModel}" />
|
||||
</TabItem>
|
||||
<TabItem Header="{DynamicResource FileSavePara}" >
|
||||
<ContentControl mw:View.Model="{Binding SaveSettingViewModel}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="{DynamicResource CameraPara}">
|
||||
<ContentControl mw:View.Model="{Binding CameraParameterViewModel}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="{DynamicResource OtherPara}">
|
||||
<ContentControl/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Border>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
/// <summary>
|
||||
/// DeviceFoundationView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DeviceFoundationView : UserControl
|
||||
{
|
||||
public DeviceFoundationView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.DevicePositionView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MainShell.ParaSetting.View"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<TabControl>
|
||||
<TabItem Header="{DynamicResource WaferAllPosition}">
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="{DynamicResource SubstrateAllPosition}">
|
||||
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
/// <summary>
|
||||
/// DevicePositionView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DevicePositionView : UserControl
|
||||
{
|
||||
public DevicePositionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.DeviceRunSettingView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MainShell.ParaSetting.View"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Border Background="{StaticResource BackgroundBrush}" BorderBrush="{StaticResource BorderBrush}" BorderThickness="2,2,2,2">
|
||||
<TabControl mw:TabControlAttach.FontSize="14">
|
||||
<TabItem Header="{DynamicResource ProcessParameterSettings}">
|
||||
<ContentControl mw:View.Model="{Binding ProcessParameterSettingViewModel}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="{DynamicResource SpeedParameters}">
|
||||
<ContentControl mw:View.Model="{Binding SpeedSettingViewModel}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="{DynamicResource GlobalRunParameters}">
|
||||
<ContentControl mw:View.Model="{Binding OtherProduceViewModel}"/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Border>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
/// <summary>
|
||||
/// DeviceRunSettingView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DeviceRunSettingView : UserControl
|
||||
{
|
||||
public DeviceRunSettingView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.DeviceSafetyView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="900"
|
||||
d:DesignWidth="1200">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style x:Key="DeviceSafetyLabelStyle" TargetType="Label" BasedOn="{StaticResource ProcessLabelStyle}">
|
||||
<Setter Property="Width" Value="168"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DeviceSafetyWideLabelStyle" TargetType="Label" BasedOn="{StaticResource ProcessLabelStyle}">
|
||||
<Setter Property="Width" Value="210"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DeviceSafetyCompactLabelStyle" TargetType="Label" BasedOn="{StaticResource ProcessLabelStyle}">
|
||||
<Setter Property="Width" Value="150"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DeviceSafetyNumberBoxStyle" TargetType="{x:Type mw:NumberBox}" BasedOn="{StaticResource ProcessNumberBoxStyle}">
|
||||
<Setter Property="Margin" Value="8,0,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DeviceSafetyLargeNumberBoxStyle" TargetType="{x:Type mw:NumberBox}" BasedOn="{StaticResource ProcessLargeNumberBoxStyle}">
|
||||
<Setter Property="Margin" Value="8,0,0,0"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="{StaticResource ProcessPageBackgroundBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ScrollViewer Grid.Row="0"
|
||||
Margin="4,4,4,0"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="0,0,4,0">
|
||||
<StackPanel Margin="0,0,0,4">
|
||||
<GroupBox Header="安全干涉设置" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<StackPanel Width="302" Margin="0,0,18,0">
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z1环内最低安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z1InRingSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z1通用安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z1GeneralSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z5通用安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z5GeneralSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z4环外最低安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z4OutRingSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="刺晶头对刀安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.NeedleCalibSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Width="302" Margin="0,0,18,0">
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z1环上最低安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z1OnRingSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z3通用安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z3GeneralSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z6通用安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z6GeneralSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z5环外最低安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z5OutRingSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Width="302">
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z1环外最低安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z1OutRingSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z4通用安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z4GeneralSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z3环外最低安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z3OutRingSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyLabelStyle}" Content="Z6环外最低安全高度:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.Z6OutRingSafeHeight}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="基准与范围设置" Style="{StaticResource ProcessWideCardGroupBoxStyle}">
|
||||
<WrapPanel>
|
||||
<StackPanel Width="392" Margin="0,0,18,0">
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyWideLabelStyle}" Content="刺晶头基准 X1-X3最大值:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyLargeNumberBoxStyle}" Value="{Binding SafeParaSysItem.NeedleReferenceX1X3Max}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyWideLabelStyle}" Content="刺晶头基准 X1-X3最小值:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyLargeNumberBoxStyle}" Value="{Binding SafeParaSysItem.NeedleReferenceX1X3Min}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Width="392">
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyWideLabelStyle}" Content="定位光源基准 X1-X3最大值:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyLargeNumberBoxStyle}" Value="{Binding SafeParaSysItem.PositionLightReferenceX1X3Max}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyWideLabelStyle}" Content="定位光源基准 X1-X3最小值:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyLargeNumberBoxStyle}" Value="{Binding SafeParaSysItem.PositionLightReferenceX1X3Min}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</GroupBox>
|
||||
|
||||
<WrapPanel>
|
||||
<GroupBox Header="大视野光源设置" Style="{StaticResource ProcessCardGroupBoxStyle}" Width="430" Margin="0,0,18,18">
|
||||
<StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyCompactLabelStyle}" Content="X2-X3最大值:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.WideFieldLightX2X3Max}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyCompactLabelStyle}" Content="X2-X3最小值:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.WideFieldLightX2X3Min}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="半径设置" Style="{StaticResource ProcessCardGroupBoxStyle}" Width="430" Margin="0,0,0,18">
|
||||
<StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyCompactLabelStyle}" Content="WS内环半径:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.WsInnerRingRadius}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource DeviceSafetyCompactLabelStyle}" Content="刺晶头半径:"/>
|
||||
<mw:NumberBox Style="{StaticResource DeviceSafetyNumberBoxStyle}" Value="{Binding SafeParaSysItem.NeedleRadius}" DecimalPlaces="4" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="10000" Minimum="-10000" Increment="0.5"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Row="1" Margin="4,8,4,4">
|
||||
<Button Content="{DynamicResource Save}" Style="{StaticResource SaveButtonStyle}" HorizontalAlignment="Right"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
/// <summary>
|
||||
/// DeviceSafetyView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DeviceSafetyView : UserControl
|
||||
{
|
||||
public DeviceSafetyView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.OtherProduceView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MainShell.ParaSetting.View"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<Style TargetType="ToggleButton" BasedOn="{StaticResource {x:Type ToggleButton}}" >
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="Margin" Value="3"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="120"/>
|
||||
</Style>
|
||||
<Style TargetType="Label" BasedOn="{StaticResource {x:Type Label}}">
|
||||
<Setter Property="Width" Value="95"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="60"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<GroupBox Header="{DynamicResource GlobalRunFeatureSettings}" Margin="3,3,3,3" Style="{StaticResource GroupBoxSecondary}">
|
||||
<UniformGrid Columns="3">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource NeedleCheckBondingGlassNum}" VerticalAlignment="Center"/>
|
||||
<mw:IntNumberBox Value="{Binding GlobalRunParameter.NeedleCheckBondingGlassNum}" mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True" Maximum="1000" Minimum="0" HorizontalAlignment="Left" Height="30" Width="85" VerticalAlignment="Center" FontSize="12"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource UseMes}"/>
|
||||
<ToggleButton IsChecked="{Binding GlobalRunParameter.IsUseMesLeiMan}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource AirCoolAllProduceLabel}"/>
|
||||
<ToggleButton IsChecked="{Binding BondingProcessParameter.UseAirCoolAllProduce}" />
|
||||
</StackPanel>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="{DynamicResource GlobalRunModeSettings}" Style="{StaticResource GroupBoxSecondary}" Margin="3">
|
||||
<UniformGrid Rows="3" HorizontalAlignment="Center">
|
||||
<ToggleButton Content="{DynamicResource ProduceTest}" Margin="5" IsChecked="{Binding GlobalRunParameter.RunningMode, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource RunningModeToBoolConverter}, ConverterParameter='1'}" />
|
||||
<ToggleButton Content="{DynamicResource WholeMachineAging}" Margin="5" IsChecked="{Binding GlobalRunParameter.RunningMode, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource RunningModeToBoolConverter}, ConverterParameter='2'}" />
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
|
||||
<Button Content="{DynamicResource Save}" Click="{mw:Action BtnSave}" Grid.Row="2" Style="{StaticResource SaveButtonStyle}" HorizontalAlignment="Right"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
/// <summary>
|
||||
/// OtherProduceView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class OtherProduceView : UserControl
|
||||
{
|
||||
public OtherProduceView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.ParaSettingView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MainShell.ParaSetting.View"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Margin="-40,0,0,0" Grid.Column="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<mw:SideMenu ItemsSource="{Binding MenuItemWraps}"
|
||||
SelectedItem="{Binding SelectedMenuItem, Mode=TwoWay}"
|
||||
Grid.Row ="0" Width="180"
|
||||
ExpandMode="Accordion"
|
||||
AutoSelect="True"
|
||||
>
|
||||
<mw:SideMenu.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type mw:SideMenuItem}" BasedOn="{StaticResource SideMenuItemHeaderAccordionBaseStyle}">
|
||||
<Setter Property="Header" Value="{Binding Header}" />
|
||||
<Setter Property="Tag" Value="{Binding Tag}" />
|
||||
</Style>
|
||||
</mw:SideMenu.ItemContainerStyle>
|
||||
</mw:SideMenu>
|
||||
|
||||
</Grid>
|
||||
|
||||
<ContentControl Margin="5,0" Grid.Column="2" mw:View.Model="{Binding CurrentScreen}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
/// <summary>
|
||||
/// ParaSettingView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ParaSettingView : UserControl
|
||||
{
|
||||
public ParaSettingView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.ProcessParameterSettingView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid Background="{StaticResource ProcessPageBackgroundBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="60"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="220"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Grid.Column="0" Margin="8,8,6,8" Background="{StaticResource ProcessCardBackgroundBrush}" BorderBrush="{StaticResource ProcessCardBorderBrush}" BorderThickness="1" CornerRadius="6">
|
||||
<ListBox Margin="6"
|
||||
ItemsSource="{Binding ProcessMenuItemWraps}"
|
||||
SelectedItem="{Binding SelectedProcessMenuItem, Mode=TwoWay}"
|
||||
DisplayMemberPath="Header"
|
||||
Style="{StaticResource ProcessNavigationListBoxStyle}"/>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="0" Grid.Column="1" Margin="6,8,8,8" Background="{StaticResource ProcessCardBackgroundBrush}" BorderBrush="{StaticResource ProcessCardBorderBrush}" BorderThickness="1" CornerRadius="6">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Padding="8">
|
||||
<ContentControl HorizontalAlignment="Stretch" mw:View.Model="{Binding CurrentScreen}"/>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
||||
<Button Grid.Row="1" Grid.Column="1" Margin="0,6,8,0" Content="{DynamicResource Save}" Click="{mw:Action BtnSave}" Style="{StaticResource SaveButtonStyle}" HorizontalAlignment="Right"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class ProcessParameterSettingView : UserControl
|
||||
{
|
||||
public ProcessParameterSettingView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/MainShell;component/Resources/Styles/ProcessParameterStyles.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,227 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.ProduceControlView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MainShell.ParaSetting.View"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<!-- ToggleButton样式 - 金属光泽开关样式 -->
|
||||
<Style x:Key="MetallicToggleStyle" TargetType="ToggleButton">
|
||||
<Setter Property="Width" Value="60"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Grid>
|
||||
<!-- 外部方形区域(金属边框效果) -->
|
||||
<Border x:Name="OuterBorder"
|
||||
Width="60"
|
||||
Height="30"
|
||||
CornerRadius="4"
|
||||
Background="White"
|
||||
BorderBrush="#C0C0C0"
|
||||
BorderThickness="2">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect ShadowDepth="1"
|
||||
BlurRadius="2"
|
||||
Opacity="0.3"/>
|
||||
</Border.Effect>
|
||||
</Border>
|
||||
|
||||
<!-- 内部轨道 -->
|
||||
<Border x:Name="Track"
|
||||
Width="54"
|
||||
Height="24"
|
||||
CornerRadius="3"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="#F0F0F0"
|
||||
BorderBrush="#D0D0D0"
|
||||
BorderThickness="1">
|
||||
<!--<Border.Effect>
|
||||
--><!--<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="#E8E8E8" Offset="0"/>
|
||||
<GradientStop Color="#F8F8F8" Offset="1"/>
|
||||
</LinearGradientBrush>--><!--
|
||||
</Border.Effect>-->
|
||||
</Border>
|
||||
|
||||
<!-- 圆形开关按钮 -->
|
||||
<Border x:Name="Knob"
|
||||
Width="28"
|
||||
Height="28"
|
||||
CornerRadius="14"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Margin="1,0,0,0">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop x:Name="KnobGradient1" Color="#D0D0D0" Offset="0"/>
|
||||
<GradientStop x:Name="KnobGradient2" Color="#E0E0E0" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
<Border.Effect>
|
||||
<DropShadowEffect ShadowDepth="2"
|
||||
BlurRadius="3"
|
||||
Opacity="0.3"/>
|
||||
</Border.Effect>
|
||||
<Border.BorderBrush>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="#B0B0B0" Offset="0"/>
|
||||
<GradientStop Color="#C0C0C0" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.BorderBrush>
|
||||
<Border.BorderThickness>
|
||||
1
|
||||
</Border.BorderThickness>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
<!-- 开状态 -->
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="Knob" Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter TargetName="Knob" Property="Margin" Value="0,0,1,0"/>
|
||||
<Setter TargetName="Track" Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="#E0F7E0" Offset="0"/>
|
||||
<GradientStop Color="#F0FFF0" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter TargetName="Knob" Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="#4CAF50" Offset="0"/>
|
||||
<GradientStop Color="#66BB6A" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter TargetName="Knob" Property="BorderBrush">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="#388E3C" Offset="0"/>
|
||||
<GradientStop Color="#4CAF50" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
|
||||
<!-- 悬停效果 -->
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="#A0A0A0"/>
|
||||
<Setter TargetName="OuterBorder" Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect ShadowDepth="1.5"
|
||||
BlurRadius="3"
|
||||
Opacity="0.4"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
|
||||
<!-- 禁用状态 -->
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="OuterBorder" Property="Opacity" Value="0.6"/>
|
||||
<Setter TargetName="Knob" Property="Opacity" Value="0.6"/>
|
||||
<Setter TargetName="Track" Property="Opacity" Value="0.6"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border Background="White" CornerRadius="8" BorderBrush="#E0E0E0" BorderThickness="1" Padding="10">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="60"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!-- 开关控制区域 -->
|
||||
<ItemsControl Grid.Row="1" ItemsSource="{Binding SubProcesses}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="6" Rows="4" HorizontalAlignment="Center"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Width="140"
|
||||
Height="90"
|
||||
Margin="5"
|
||||
Background="#F9F9F9"
|
||||
CornerRadius="6"
|
||||
BorderBrush="#E8E8E8"
|
||||
BorderThickness="1"
|
||||
Padding="5">
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<!-- 流程名称 -->
|
||||
<TextBlock Text="{Binding ProcessName}"
|
||||
FontSize="13"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="#34495E"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,0,0,8"
|
||||
TextWrapping="Wrap"/>
|
||||
|
||||
<!-- 开关控件 -->
|
||||
<ToggleButton x:Name="ProcessToggle"
|
||||
IsChecked="{Binding IsEnabled, Mode=TwoWay}"
|
||||
Style="{StaticResource MetallicToggleStyle}"
|
||||
HorizontalAlignment="Center"
|
||||
Cursor="Hand"
|
||||
ToolTip="{Binding ToolTipText}"/>
|
||||
|
||||
<!-- 状态文本 -->
|
||||
<TextBlock Text="{Binding StatusText}"
|
||||
FontSize="11"
|
||||
Foreground="#7F8C8D"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,5,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 边框悬停效果 -->
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsEnabled}" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#4CAF50"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="#F1F8E9" Offset="0"/>
|
||||
<GradientStop Color="#FFFFFF" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#BDC3C7"/>
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect ShadowDepth="1"
|
||||
BlurRadius="5"
|
||||
Opacity="0.2"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<Button Content="保存" Click="{mw:Action BtnSave}" Grid.Row="2" Style="{StaticResource SaveButtonStyle}" HorizontalAlignment="Right"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
/// <summary>
|
||||
/// ProduceControlView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ProduceControlView : UserControl
|
||||
{
|
||||
public ProduceControlView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.SaveSettingView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style x:Key="SaveSettingLabelStyle" TargetType="Label" BasedOn="{StaticResource ProcessLabelStyle}">
|
||||
<Setter Property="Width" Value="220"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SaveSettingToggleStyle" TargetType="ToggleButton" BasedOn="{StaticResource ProcessToggleStyle}">
|
||||
<Setter Property="MinWidth" Value="54"/>
|
||||
<Setter Property="Width" Value="54"/>
|
||||
<Setter Property="Margin" Value="8,0,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SaveSettingTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
|
||||
<Setter Property="Height" Value="32"/>
|
||||
<Setter Property="MinWidth" Value="320"/>
|
||||
<Setter Property="Margin" Value="8,0,0,0"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Background" Value="{StaticResource ProcessCardBackgroundBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource ProcessCardBorderBrush}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource ProcessBodyForegroundBrush}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SaveSettingBrowseButtonStyle" TargetType="Button" BasedOn="{StaticResource SettingsButtonStyle}">
|
||||
<Setter Property="Height" Value="32"/>
|
||||
<Setter Property="MinWidth" Value="88"/>
|
||||
<Setter Property="Margin" Value="8,0,0,0"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="{StaticResource ProcessPageBackgroundBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="60"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ScrollViewer Grid.Row="0"
|
||||
Margin="4,4,4,0"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="0,0,4,0">
|
||||
<StackPanel Margin="0,0,0,4">
|
||||
<GroupBox Header="{DynamicResource FileRelatedSaveSetting}" Style="{StaticResource ProcessWideCardGroupBoxStyle}" DataContext="{Binding SaveSettingItem.FileSaveSetting}">
|
||||
<StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource SaveSettingLabelStyle}" Content="{DynamicResource DeviceFoundationSaveEnable}"/>
|
||||
<ToggleButton Style="{StaticResource SaveSettingToggleStyle}" IsChecked="{Binding IsSaveEnabled}"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Margin="0,0,0,10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Grid.Column="0" Style="{StaticResource SaveSettingLabelStyle}" Content="{DynamicResource DeviceFoundationSavePath}"/>
|
||||
<TextBox Grid.Column="1" Style="{StaticResource SaveSettingTextBoxStyle}" IsReadOnly="True" Text="{Binding SaveFolder, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
<Button Grid.Column="2" Style="{StaticResource SaveSettingBrowseButtonStyle}" Content="{DynamicResource Browse}" Click="{mw:Action BrowseFileSaveFolder}"/>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource SaveSettingLabelStyle}" Content="{DynamicResource DeviceFoundationCreateDateFolder}"/>
|
||||
<ToggleButton Style="{StaticResource SaveSettingToggleStyle}" IsChecked="{Binding IsCreateDateFolder}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="{DynamicResource ImageRelatedSaveSetting}" Style="{StaticResource ProcessWideCardGroupBoxStyle}" DataContext="{Binding SaveSettingItem.ImageSaveSetting}">
|
||||
<StackPanel>
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource SaveSettingLabelStyle}" Content="{DynamicResource DeviceFoundationSaveEnable}"/>
|
||||
<ToggleButton Style="{StaticResource SaveSettingToggleStyle}" IsChecked="{Binding IsSaveEnabled}"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Margin="0,0,0,10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Grid.Column="0" Style="{StaticResource SaveSettingLabelStyle}" Content="{DynamicResource DeviceFoundationSavePath}"/>
|
||||
<TextBox Grid.Column="1" Style="{StaticResource SaveSettingTextBoxStyle}" IsReadOnly="True" Text="{Binding SaveFolder, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
<Button Grid.Column="2" Style="{StaticResource SaveSettingBrowseButtonStyle}" Content="{DynamicResource Browse}" Click="{mw:Action BrowseImageSaveFolder}"/>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource SaveSettingLabelStyle}" Content="{DynamicResource DeviceFoundationCreateDateFolder}"/>
|
||||
<ToggleButton Style="{StaticResource SaveSettingToggleStyle}" IsChecked="{Binding IsCreateDateFolder}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource SaveSettingLabelStyle}" Content="{DynamicResource DeviceFoundationSaveUpCameraImage}"/>
|
||||
<ToggleButton Style="{StaticResource SaveSettingToggleStyle}" IsChecked="{Binding IsSaveUpCameraImage}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource SaveSettingLabelStyle}" Content="{DynamicResource DeviceFoundationSaveDownCameraImage}"/>
|
||||
<ToggleButton Style="{StaticResource SaveSettingToggleStyle}" IsChecked="{Binding IsSaveDownCameraImage}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Style="{StaticResource ProcessParameterRowStyle}">
|
||||
<Label Style="{StaticResource SaveSettingLabelStyle}" Content="{DynamicResource DeviceFoundationSaveMapCameraImage}"/>
|
||||
<ToggleButton Style="{StaticResource SaveSettingToggleStyle}" IsChecked="{Binding IsSaveMapCameraImage}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Row="1" Margin="4,8,4,4">
|
||||
<Button Content="{DynamicResource Save}" Click="{mw:Action BtnSave}" Style="{StaticResource SaveButtonStyle}" HorizontalAlignment="Right"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
public partial class SaveSettingView : UserControl
|
||||
{
|
||||
public SaveSettingView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
<UserControl x:Class="MainShell.ParaSetting.View.SpeedSettingView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MainShell.ParaSetting.View"
|
||||
xmlns:common="clr-namespace:MainShell.Common"
|
||||
xmlns:mw="http://www.maxwell-gp.com/"
|
||||
xmlns:attribute="clr-namespace:MainShell.Common.ControlAttribute"
|
||||
xmlns:conv="clr-namespace:MainShell.Converter"
|
||||
mw:ParameterAttach.DelayAcceptValue ="{Binding ParameterHelper}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<conv:EnumBindingSourceExtension x:Key="SpeedEnums" UseDescription="True" EnumType="{x:Type common:SpeedType}" />
|
||||
<Style x:Key="CommonLabelStyle" TargetType="Label">
|
||||
<Setter Property="HorizontalAlignment" Value="Right"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Width" Value="120"/>
|
||||
<Setter Property="Height" Value="40"/>
|
||||
<Setter Property="FontSize" Value="15"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border BorderBrush="{StaticResource PgBackground}" BorderThickness="2">
|
||||
<Grid >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Style="{StaticResource LabelStyle}"
|
||||
Text="{DynamicResource SpeedSetting}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Margin="15,0,15,0"
|
||||
FontSize="18"
|
||||
FontFamily="Segoe UI"
|
||||
FontWeight="Bold"
|
||||
Foreground="#424A4D"/>
|
||||
<mw:NumberBox DecimalPlaces="4" Value="{Binding Speed}" Height="30" Width="110"
|
||||
mw:NumericKeypadAttach.IsEnabled="True" ShowUpDownButton="True"
|
||||
Maximum="2000" Minimum="0" Increment="0.5" Grid.Column="3"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Button Click="{mw:Action btnRowData}" Content="{DynamicResource ChangeSingleData}" Margin="20,0,10,0" Style="{StaticResource Button}"/>
|
||||
<Button Click="{mw:Action btnPageData}" Content="{DynamicResource ChangeAllData}" Margin="20,0,10,0" Style="{StaticResource Button}"/>
|
||||
<!--<Button Click="{mw:Action btnPageGantryData}" Content="{DynamicResource ChangeMainData}" Margin="20,0,10,0" Style="{StaticResource Button}"/>-->
|
||||
<!--<Button Click="{mw:Action btnPageZAndTHData}" Content="修改Z和TH轴数据" Margin="20,0,10,0" Style="{StaticResource Button}"/>-->
|
||||
|
||||
</StackPanel>
|
||||
<DataGrid AutoGenerateColumns="False"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
Margin="20,10,0,10"
|
||||
Grid.Row="1"
|
||||
RowStyle="{StaticResource DataGridRowErrorStyle}"
|
||||
ItemsSource="{Binding SpeedParaSysSetting.SpeedTypeItemCollection.SpeedTypeItemList}"
|
||||
SelectedItem="{Binding SpeedParaSysSetting.SpeedTypeItemCollection.CurrentSelectSpeedTypeItemList}"
|
||||
CanUserSortColumns="False">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{DynamicResource AxisName}" Width="*" Binding="{Binding AxisName}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{DynamicResource Speed}" Width="*">
|
||||
<DataGridTextColumn.Binding>
|
||||
<Binding Path="Speed" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<attribute:NumericValidationRule/>
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="{DynamicResource Acc}" Width="*">
|
||||
<DataGridTextColumn.Binding>
|
||||
<Binding Path="Acc" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<attribute:NumericValidationRule/>
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="{DynamicResource Dec}" Width="*">
|
||||
<DataGridTextColumn.Binding>
|
||||
<Binding Path="Dec" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<attribute:NumericValidationRule/>
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="{DynamicResource Jerk}" Width="*">
|
||||
<DataGridTextColumn.Binding>
|
||||
<Binding Path="Jerk" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<attribute:NumericValidationRule/>
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="{DynamicResource HighPercent}" Width="*">
|
||||
<DataGridTextColumn.Binding>
|
||||
<Binding Path="HighPercent" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<attribute:NumericValidationRule/>
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="{DynamicResource MedianPercent}" Width="*">
|
||||
<DataGridTextColumn.Binding>
|
||||
<Binding Path="MedianPercent" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<attribute:NumericValidationRule/>
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="{DynamicResource LowPercent}" Width="*">
|
||||
<DataGridTextColumn.Binding>
|
||||
<Binding Path="LowPercent" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<attribute:NumericValidationRule/>
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Border Grid.Row="2">
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<TextBlock Margin="5,0" Style="{StaticResource LargeBlodTextblockStyle}" Text="{DynamicResource SpeedMode}"/>
|
||||
<ComboBox Width="150" DisplayMemberPath="Description" FontFamily="微软雅黑"
|
||||
SelectedValuePath="Value"
|
||||
FontSize="18"
|
||||
FontWeight="Bold"
|
||||
SelectedValue="{Binding SpeedParaSysSetting.CurrentSpeedType, Mode=TwoWay}"
|
||||
ItemsSource="{StaticResource SpeedEnums}" Margin="5,0">
|
||||
|
||||
</ComboBox>
|
||||
<Button Content="{DynamicResource Save}" HorizontalAlignment="Right" Style="{StaticResource SaveButtonStyle}" VerticalAlignment="Center" Width="110" Height="35" Click="{mw:Action btnSet}"/>
|
||||
</StackPanel>
|
||||
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MainShell.ParaSetting.View
|
||||
{
|
||||
/// <summary>
|
||||
/// SpeedSettingView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SpeedSettingView : UserControl
|
||||
{
|
||||
public SpeedSettingView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
using MainShell.Common;
|
||||
using MainShell.Filewritable;
|
||||
using MainShell.Hardware;
|
||||
using MainShell.Log;
|
||||
using MainShell.Models;
|
||||
using MainShell.ParaSetting.Model;
|
||||
using MwFramework.Device;
|
||||
using MwFramework.Device.Drivers;
|
||||
using MwFramework.Device.Motion;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class AxisSoftLimitSettingViewModel : BaseScreen
|
||||
{
|
||||
private const string AxisSoftLimitSettingFileName = "AxisSoftLimitSetting.json";
|
||||
|
||||
private readonly HardwareManager _hardwareManager;
|
||||
private readonly string _axisSoftLimitSettingFilePath;
|
||||
|
||||
private AxisSoftLimitSetting _axisSoftLimitSetting;
|
||||
|
||||
private ObservableCollection<AxisSoftLimitItemViewModel> _axisSoftLimitItems = new ObservableCollection<AxisSoftLimitItemViewModel>();
|
||||
public ObservableCollection<AxisSoftLimitItemViewModel> AxisSoftLimitItems
|
||||
{
|
||||
get
|
||||
{
|
||||
return _axisSoftLimitItems;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _axisSoftLimitItems, value);
|
||||
}
|
||||
}
|
||||
|
||||
private AxisSoftLimitItemViewModel _selectedAxisSoftLimitItem;
|
||||
public AxisSoftLimitItemViewModel SelectedAxisSoftLimitItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return _selectedAxisSoftLimitItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _selectedAxisSoftLimitItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _parameterFilePath;
|
||||
public string ParameterFilePath
|
||||
{
|
||||
get
|
||||
{
|
||||
return _parameterFilePath;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _parameterFilePath, value);
|
||||
}
|
||||
}
|
||||
|
||||
public AxisSoftLimitSettingViewModel(HardwareManager hardwareManager)
|
||||
{
|
||||
_hardwareManager = hardwareManager ?? throw new ArgumentNullException(nameof(hardwareManager));
|
||||
_axisSoftLimitSettingFilePath = System.IO.Path.Combine(Paths.CalibSettingPath, AxisSoftLimitSettingFileName);
|
||||
ParameterFilePath = _axisSoftLimitSettingFilePath;
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded()
|
||||
{
|
||||
base.OnViewLoaded();
|
||||
LoadAxisSoftLimitItems();
|
||||
}
|
||||
|
||||
public void BtnSave()
|
||||
{
|
||||
if (!ValidateAxisSoftLimitItems())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBoxResult confirmResult = LocalizedMessageBox.Show(MessageKey.AxisSoftLimitSaveConfirm, MessageKey.TitleConfirm, MessageBoxButton.OKCancel, MessageBoxImage.Question);
|
||||
if (confirmResult != MessageBoxResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(Paths.CalibSettingPath);
|
||||
AxisSoftLimitSetting axisSoftLimitSetting = CreateAxisSoftLimitSetting();
|
||||
foreach (AxisSoftLimitItemViewModel axisSoftLimitItem in AxisSoftLimitItems)
|
||||
{
|
||||
AxisSoftLimitItem axisSoftLimitItemModel = new AxisSoftLimitItem();
|
||||
axisSoftLimitItemModel.AxisName = axisSoftLimitItem.AxisName;
|
||||
axisSoftLimitItemModel.CardName = axisSoftLimitItem.CardName;
|
||||
axisSoftLimitItemModel.CardNum = axisSoftLimitItem.CardNum;
|
||||
axisSoftLimitItemModel.AxisNum = axisSoftLimitItem.AxisNum;
|
||||
axisSoftLimitItemModel.NegativeSoftLimit = axisSoftLimitItem.NegativeSoftLimit;
|
||||
axisSoftLimitItemModel.PositiveSoftLimit = axisSoftLimitItem.PositiveSoftLimit;
|
||||
axisSoftLimitSetting.AxisSoftLimitItems.Add(axisSoftLimitItemModel);
|
||||
UpdateAxisCheckLimit(axisSoftLimitItem);
|
||||
}
|
||||
|
||||
axisSoftLimitSetting.Write(_axisSoftLimitSettingFilePath);
|
||||
_axisSoftLimitSetting = axisSoftLimitSetting;
|
||||
LocalizedMessageBox.Show(MessageKey.CommonSaveSucceeded, MessageKey.TitleInfo);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.LogSysError(ex);
|
||||
LocalizedMessageBox.ShowFormat(MessageKey.AxisSoftLimitSaveFailedWithReason, MessageKey.TitleError, MessageBoxButton.OK, MessageBoxImage.Error, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public void BtnApply()
|
||||
{
|
||||
if (!ValidateAxisSoftLimitItems())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AxisSoftLimitItemViewModel axisSoftLimitItem = SelectedAxisSoftLimitItem;
|
||||
if (axisSoftLimitItem == null)
|
||||
{
|
||||
LocalizedMessageBox.Show(MessageKey.AxisSoftLimitSelectedAxisRequired, MessageKey.TitleError);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ApplyAxisSoftLimitToController(axisSoftLimitItem);
|
||||
LocalizedMessageBox.ShowFormat(MessageKey.AxisSoftLimitApplySucceeded, MessageKey.TitleInfo, MessageBoxButton.OK, MessageBoxImage.Information, axisSoftLimitItem.AxisName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.LogSysError(ex);
|
||||
LocalizedMessageBox.ShowFormat(MessageKey.AxisSoftLimitApplyFailedWithReason, MessageKey.TitleError, MessageBoxButton.OK, MessageBoxImage.Error, axisSoftLimitItem.AxisName, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public void BtnApplyAll()
|
||||
{
|
||||
if (!ValidateAxisSoftLimitItems())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (AxisSoftLimitItems == null || AxisSoftLimitItems.Count == 0)
|
||||
{
|
||||
LocalizedMessageBox.Show(MessageKey.AxisSoftLimitNoAxisData, MessageKey.TitleError);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
int appliedAxisCount = 0;
|
||||
foreach (AxisSoftLimitItemViewModel axisSoftLimitItem in AxisSoftLimitItems)
|
||||
{
|
||||
ApplyAxisSoftLimitToController(axisSoftLimitItem);
|
||||
appliedAxisCount++;
|
||||
}
|
||||
|
||||
LocalizedMessageBox.ShowFormat(MessageKey.AxisSoftLimitApplyAllSucceeded, MessageKey.TitleInfo, MessageBoxButton.OK, MessageBoxImage.Information, appliedAxisCount);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.LogSysError(ex);
|
||||
LocalizedMessageBox.ShowFormat(MessageKey.AxisSoftLimitApplyAllFailedWithReason, MessageKey.TitleError, MessageBoxButton.OK, MessageBoxImage.Error, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadAxisSoftLimitItems()
|
||||
{
|
||||
try
|
||||
{
|
||||
AxisSoftLimitSetting axisSoftLimitSetting = CreateAxisSoftLimitSetting();
|
||||
if (System.IO.File.Exists(_axisSoftLimitSettingFilePath))
|
||||
{
|
||||
axisSoftLimitSetting.Read(_axisSoftLimitSettingFilePath);
|
||||
}
|
||||
|
||||
_axisSoftLimitSetting = axisSoftLimitSetting;
|
||||
AxisSoftLimitItems = BuildAxisSoftLimitItems(axisSoftLimitSetting);
|
||||
SelectedAxisSoftLimitItem = AxisSoftLimitItems.FirstOrDefault();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.LogSysError(ex);
|
||||
_axisSoftLimitSetting = CreateAxisSoftLimitSetting();
|
||||
AxisSoftLimitItems = BuildAxisSoftLimitItems(_axisSoftLimitSetting);
|
||||
SelectedAxisSoftLimitItem = AxisSoftLimitItems.FirstOrDefault();
|
||||
LocalizedMessageBox.ShowFormat(MessageKey.AxisSoftLimitLoadFailedWithReason, MessageKey.TitleError, MessageBoxButton.OK, MessageBoxImage.Error, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<AxisSoftLimitItemViewModel> BuildAxisSoftLimitItems(AxisSoftLimitSetting axisSoftLimitSetting)
|
||||
{
|
||||
ObservableCollection<AxisSoftLimitItemViewModel> items = new ObservableCollection<AxisSoftLimitItemViewModel>();
|
||||
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, IAxis>> axisPairs = Enumerable.Empty<System.Collections.Generic.KeyValuePair<string, IAxis>>();
|
||||
if (_hardwareManager.AxesDic != null)
|
||||
{
|
||||
axisPairs = _hardwareManager.AxesDic.OrderBy(item => item.Key);
|
||||
}
|
||||
|
||||
foreach (System.Collections.Generic.KeyValuePair<string, IAxis> axisPair in axisPairs)
|
||||
{
|
||||
IAxis axis = axisPair.Value;
|
||||
if (axis == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
AxisCardParaPO axisCardParaPo = axis.AxisPO as AxisCardParaPO;
|
||||
int cardNum = axisCardParaPo != null ? axisCardParaPo.AxisCardNum : -1;
|
||||
string cardName = axisCardParaPo != null ? axisCardParaPo.AxisCardName : string.Empty;
|
||||
AxisSoftLimitItem axisSoftLimitItem = FindAxisSoftLimitItem(axisSoftLimitSetting, cardNum, axis.AxisIndex);
|
||||
double negativeSoftLimit = axisSoftLimitItem != null ? axisSoftLimitItem.NegativeSoftLimit : 0d;
|
||||
double positiveSoftLimit = axisSoftLimitItem != null
|
||||
? axisSoftLimitItem.PositiveSoftLimit
|
||||
: axisCardParaPo != null ? axisCardParaPo.MaxCheckPos : 0d;
|
||||
|
||||
AxisSoftLimitItemViewModel item = new AxisSoftLimitItemViewModel(axis, axisPair.Key, cardName, cardNum, axis.AxisIndex, negativeSoftLimit, positiveSoftLimit);
|
||||
items.Add(item);
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
private static AxisSoftLimitItem FindAxisSoftLimitItem(AxisSoftLimitSetting axisSoftLimitSetting, int cardNum, int axisNum)
|
||||
{
|
||||
if (axisSoftLimitSetting == null || axisSoftLimitSetting.AxisSoftLimitItems == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return axisSoftLimitSetting.AxisSoftLimitItems.FirstOrDefault(item => item != null && item.CardNum == cardNum && item.AxisNum == axisNum);
|
||||
}
|
||||
|
||||
private static void UpdateAxisCheckLimit(AxisSoftLimitItemViewModel axisSoftLimitItem)
|
||||
{
|
||||
AxisCardParaPO axisCardParaPo = axisSoftLimitItem.Axis == null ? null : axisSoftLimitItem.Axis.AxisPO as AxisCardParaPO;
|
||||
if (axisCardParaPo != null)
|
||||
{
|
||||
axisCardParaPo.MaxCheckPos = axisSoftLimitItem.PositiveSoftLimit;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ApplyAxisSoftLimitToController(AxisSoftLimitItemViewModel axisSoftLimitItem)
|
||||
{
|
||||
if (axisSoftLimitItem == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(axisSoftLimitItem));
|
||||
}
|
||||
|
||||
IAxis axis = axisSoftLimitItem.Axis;
|
||||
if (axis == null)
|
||||
{
|
||||
throw new InvalidOperationException("当前轴对象无效,无法下发软限位设置。");
|
||||
}
|
||||
|
||||
IAxisFunc axisFunc = axis as IAxisFunc;
|
||||
if (axisFunc == null)
|
||||
{
|
||||
throw new InvalidOperationException($"轴 {axisSoftLimitItem.AxisName} 不支持软限位设置接口。");
|
||||
}
|
||||
|
||||
IMotionController controller = axis.Parent;
|
||||
if (controller == null || !controller.IsOpen)
|
||||
{
|
||||
throw new InvalidOperationException($"轴 {axisSoftLimitItem.AxisName} 所属控制器未连接或未打开。");
|
||||
}
|
||||
|
||||
EnsureMotionCommandSucceeded(axisFunc.SetSoftMel(axisSoftLimitItem.NegativeSoftLimit), axisSoftLimitItem.AxisName, "负软限位");
|
||||
EnsureMotionCommandSucceeded(axisFunc.SetSoftPel(axisSoftLimitItem.PositiveSoftLimit), axisSoftLimitItem.AxisName, "正软限位");
|
||||
EnsureMotionCommandSucceeded(axisFunc.IssueParam(), axisSoftLimitItem.AxisName, "参数下发");
|
||||
UpdateAxisCheckLimit(axisSoftLimitItem);
|
||||
}
|
||||
|
||||
private static void EnsureMotionCommandSucceeded(MotionErrorCode motionErrorCode, string axisName, string actionName)
|
||||
{
|
||||
if (motionErrorCode != MotionErrorCode.NoError)
|
||||
{
|
||||
throw new InvalidOperationException($"轴 {axisName} {actionName}失败,错误码:{motionErrorCode}");
|
||||
}
|
||||
}
|
||||
|
||||
private bool ValidateAxisSoftLimitItems()
|
||||
{
|
||||
foreach (AxisSoftLimitItemViewModel axisSoftLimitItem in AxisSoftLimitItems)
|
||||
{
|
||||
if (axisSoftLimitItem.PositiveSoftLimit < axisSoftLimitItem.NegativeSoftLimit)
|
||||
{
|
||||
LocalizedMessageBox.ShowFormat(MessageKey.AxisSoftLimitRangeInvalid, MessageKey.TitleError, MessageBoxButton.OK, MessageBoxImage.Error, axisSoftLimitItem.AxisName);
|
||||
SelectedAxisSoftLimitItem = axisSoftLimitItem;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static AxisSoftLimitSetting CreateAxisSoftLimitSetting()
|
||||
{
|
||||
return new AxisSoftLimitSetting();
|
||||
}
|
||||
}
|
||||
|
||||
public class AxisSoftLimitItemViewModel : PropertyChangedBase
|
||||
{
|
||||
private double _negativeSoftLimit;
|
||||
private double _positiveSoftLimit;
|
||||
|
||||
public AxisSoftLimitItemViewModel(IAxis axis, string axisName, string cardName, int cardNum, int axisNum, double negativeSoftLimit, double positiveSoftLimit)
|
||||
{
|
||||
Axis = axis;
|
||||
AxisName = axisName;
|
||||
CardName = cardName;
|
||||
CardNum = cardNum;
|
||||
AxisNum = axisNum;
|
||||
_negativeSoftLimit = negativeSoftLimit;
|
||||
_positiveSoftLimit = positiveSoftLimit;
|
||||
}
|
||||
|
||||
public IAxis Axis { get; private set; }
|
||||
|
||||
public string AxisName { get; private set; }
|
||||
|
||||
public string CardName { get; private set; }
|
||||
|
||||
public int CardNum { get; private set; }
|
||||
|
||||
public int AxisNum { get; private set; }
|
||||
|
||||
public double NegativeSoftLimit
|
||||
{
|
||||
get
|
||||
{
|
||||
return _negativeSoftLimit;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _negativeSoftLimit, value);
|
||||
}
|
||||
}
|
||||
|
||||
public double PositiveSoftLimit
|
||||
{
|
||||
get
|
||||
{
|
||||
return _positiveSoftLimit;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _positiveSoftLimit, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using MainShell.Common;
|
||||
using MainShell.Log;
|
||||
using MainShell.Models;
|
||||
using MainShell.ParaSetting.Model;
|
||||
using MaxwellFramework.Core.Interfaces;
|
||||
using MwFramework.ManagerService;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class CameraParameterViewModel : BaseScreen
|
||||
{
|
||||
private readonly IParamList _paramList;
|
||||
private DeviceFoundationSetting _deviceFoundationSetting;
|
||||
|
||||
public CameraParameterViewModel(IParameterManager parameterManager)
|
||||
{
|
||||
_paramList = parameterManager as IParamList;
|
||||
if (_paramList == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(parameterManager));
|
||||
}
|
||||
}
|
||||
|
||||
private DeviceCameraSettingItem _cameraSettingItem;
|
||||
|
||||
public DeviceCameraSettingItem CameraSettingItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return _cameraSettingItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _cameraSettingItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
private BindableCollection<CameraFovSettingItem> _cameraItems;
|
||||
|
||||
public BindableCollection<CameraFovSettingItem> CameraItems
|
||||
{
|
||||
get
|
||||
{
|
||||
return _cameraItems;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _cameraItems, value);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded()
|
||||
{
|
||||
base.OnViewLoaded();
|
||||
_deviceFoundationSetting = _paramList.GetParameter<DeviceFoundationSetting>();
|
||||
RefreshState();
|
||||
}
|
||||
|
||||
public void BtnSave()
|
||||
{
|
||||
try
|
||||
{
|
||||
_deviceFoundationSetting.Write();
|
||||
MwMessageBox.Show("保存完成", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.LogSysError(ex.ToString());
|
||||
MwMessageBox.Show(ex.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshState()
|
||||
{
|
||||
if (_deviceFoundationSetting.CameraSettingItem == null)
|
||||
{
|
||||
_deviceFoundationSetting.CameraSettingItem = new DeviceCameraSettingItem();
|
||||
}
|
||||
|
||||
CameraSettingItem = _deviceFoundationSetting.CameraSettingItem;
|
||||
CameraSettingItem.EnsureDefaultCameras();
|
||||
|
||||
BindableCollection<CameraFovSettingItem> cameraItems = new BindableCollection<CameraFovSettingItem>();
|
||||
cameraItems.Add(CameraSettingItem.UpCamera);
|
||||
cameraItems.Add(CameraSettingItem.DownCamera);
|
||||
cameraItems.Add(CameraSettingItem.MapCamera);
|
||||
CameraItems = cameraItems;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using MainShell.Models;
|
||||
using MaxwellFramework.Core.Interfaces;
|
||||
using MwFramework.Controls.UIControl.Axis;
|
||||
using StyletIoC;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class DeviceFoundationViewModel : BaseScreen, IPage
|
||||
{
|
||||
private ProduceControlViewModel _produceControlViewModel;
|
||||
[Inject]
|
||||
public ProduceControlViewModel ProduceControlViewModel
|
||||
{
|
||||
get { return _produceControlViewModel; }
|
||||
set
|
||||
{
|
||||
_produceControlViewModel = value;
|
||||
OnPropertyChanged(nameof(ProduceControlViewModel));
|
||||
}
|
||||
}
|
||||
|
||||
private AxisSoftLimitSettingViewModel _axisSoftLimitSettingViewModel;
|
||||
[Inject]
|
||||
public AxisSoftLimitSettingViewModel AxisSoftLimitSettingViewModel
|
||||
{
|
||||
get { return _axisSoftLimitSettingViewModel; }
|
||||
set
|
||||
{
|
||||
_axisSoftLimitSettingViewModel = value;
|
||||
OnPropertyChanged(nameof(AxisSoftLimitSettingViewModel));
|
||||
}
|
||||
}
|
||||
|
||||
private AxisParameterSettingViewModel _axisParameterSettingViewModel;
|
||||
[Inject]
|
||||
public AxisParameterSettingViewModel AxisParameterSettingViewModel
|
||||
{
|
||||
get { return _axisParameterSettingViewModel; }
|
||||
set
|
||||
{
|
||||
_axisParameterSettingViewModel = value;
|
||||
OnPropertyChanged(nameof(AxisParameterSettingViewModel));
|
||||
}
|
||||
}
|
||||
|
||||
private SaveSettingViewModel _saveSettingViewModel;
|
||||
[Inject]
|
||||
public SaveSettingViewModel SaveSettingViewModel
|
||||
{
|
||||
get { return _saveSettingViewModel; }
|
||||
set
|
||||
{
|
||||
_saveSettingViewModel = value;
|
||||
OnPropertyChanged(nameof(SaveSettingViewModel));
|
||||
}
|
||||
}
|
||||
|
||||
private CameraParameterViewModel _cameraParameterViewModel;
|
||||
[Inject]
|
||||
public CameraParameterViewModel CameraParameterViewModel
|
||||
{
|
||||
get { return _cameraParameterViewModel; }
|
||||
set
|
||||
{
|
||||
_cameraParameterViewModel = value;
|
||||
OnPropertyChanged(nameof(CameraParameterViewModel));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using MainShell.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class DevicePositionViewModel : BaseScreen
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using Stylet;
|
||||
using StyletIoC;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MainShell.Models;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class DeviceRunSettingViewModel:BaseScreen
|
||||
{
|
||||
private ProcessParameterSettingViewModel _processParameterSettingViewModel;
|
||||
[Inject]
|
||||
public ProcessParameterSettingViewModel ProcessParameterSettingViewModel
|
||||
{
|
||||
get { return _processParameterSettingViewModel; }
|
||||
set { _processParameterSettingViewModel = value; }
|
||||
}
|
||||
|
||||
private SpeedSettingViewModel _speedSettingViewModel;
|
||||
[Inject]
|
||||
public SpeedSettingViewModel SpeedSettingViewModel
|
||||
{
|
||||
get { return _speedSettingViewModel; }
|
||||
set { _speedSettingViewModel = value; }
|
||||
}
|
||||
|
||||
|
||||
private ProduceControlViewModel _produceControlViewModel;
|
||||
[Inject]
|
||||
public ProduceControlViewModel ProduceControlViewModel
|
||||
{
|
||||
get { return _produceControlViewModel; }
|
||||
set { _produceControlViewModel = value; }
|
||||
}
|
||||
private OtherProduceViewModel _otherProduceViewModel;
|
||||
[Inject]
|
||||
public OtherProduceViewModel OtherProduceViewModel
|
||||
{
|
||||
get { return _otherProduceViewModel; }
|
||||
set { _otherProduceViewModel = value; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using MainShell.Models;
|
||||
using MainShell.ParaSetting.Model;
|
||||
using MaxwellFramework.Core.Interfaces;
|
||||
using MwFramework.ManagerService;
|
||||
using Stylet;
|
||||
using System;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class DeviceSafetyViewModel : BaseScreen
|
||||
{
|
||||
private readonly IParamList _paramList;
|
||||
|
||||
private EquipmentParaSysSetting _equipmentParaSysSetting;
|
||||
|
||||
public DeviceSafetyViewModel(IParameterManager parameterManager)
|
||||
{
|
||||
_paramList = parameterManager as IParamList;
|
||||
if (_paramList == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(parameterManager));
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded()
|
||||
{
|
||||
base.OnViewLoaded();
|
||||
_equipmentParaSysSetting = _paramList.GetParameter<EquipmentParaSysSetting>();
|
||||
if (_equipmentParaSysSetting != null)
|
||||
{
|
||||
SafeParaSysItem = _equipmentParaSysSetting.SafeParaSysItem;
|
||||
}
|
||||
}
|
||||
|
||||
private SafeParaSysItem _safeParaSysItem = new SafeParaSysItem();
|
||||
|
||||
public SafeParaSysItem SafeParaSysItem
|
||||
{
|
||||
get { return _safeParaSysItem; }
|
||||
set
|
||||
{
|
||||
_safeParaSysItem = value;
|
||||
OnPropertyChanged(nameof(SafeParaSysItem));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using MainShell.Models;
|
||||
using MainShell.ParaSetting.Model;
|
||||
using MaxwellFramework.Core.Interfaces;
|
||||
using MwFramework.ManagerService;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class OtherProduceViewModel:BaseScreen
|
||||
{
|
||||
private readonly IParamList _paramList;
|
||||
|
||||
private RunSetting _runSetting;
|
||||
|
||||
public RunSetting RunSetting
|
||||
{
|
||||
get => _runSetting;
|
||||
set
|
||||
{
|
||||
_runSetting = value;
|
||||
OnPropertyChanged("RunSetting");
|
||||
}
|
||||
}
|
||||
|
||||
private GlobalRunParameter _globalRunParameter;
|
||||
|
||||
public GlobalRunParameter GlobalRunParameter
|
||||
{
|
||||
get => _globalRunParameter;
|
||||
set
|
||||
{
|
||||
_globalRunParameter = value;
|
||||
OnPropertyChanged("GlobalRunParameter");
|
||||
}
|
||||
}
|
||||
|
||||
private BondingProcessParameter _bondingProcessParameter;
|
||||
|
||||
public BondingProcessParameter BondingProcessParameter
|
||||
{
|
||||
get => _bondingProcessParameter;
|
||||
set
|
||||
{
|
||||
_bondingProcessParameter = value;
|
||||
OnPropertyChanged("BondingProcessParameter");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public OtherProduceViewModel(IParameterManager parameterManager)
|
||||
{
|
||||
_paramList = parameterManager as IParamList;
|
||||
if (_paramList == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(parameterManager));
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded()
|
||||
{
|
||||
base.OnViewLoaded();
|
||||
RunSetting = _paramList.GetParameter<RunSetting>();
|
||||
GlobalRunParameter = RunSetting.GlobalRunParameter;
|
||||
BondingProcessParameter = RunSetting.BondingProcessParameter;
|
||||
}
|
||||
|
||||
public void BtnSave()
|
||||
{
|
||||
RunSetting.Write();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
using MainShell.HeightMeasure.ViewModel;
|
||||
using MainShell.Models;
|
||||
using MaxwellFramework.Core.Interfaces;
|
||||
using Stylet;
|
||||
using StyletIoC;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
internal class ParaSettingViewModel : BaseScreen, IPage
|
||||
{
|
||||
public string Name => "PageSettings";
|
||||
private const string DEVICEPOSITION = "设备点位参数";
|
||||
private const string DEVICERUNSETTING = "设备运行参数";
|
||||
private const string DEVICESAFESETTING = "设备安全参数";
|
||||
private const string DEVICEBASESETTING = "设备基础参数";
|
||||
private readonly Dictionary<string, Screen> _viewModelDict = new Dictionary<string, Screen>();
|
||||
public ObservableCollection<MenuItemWrap> MenuItemWraps { get; private set; }
|
||||
|
||||
private MenuItemWrap _selectedMenuItem;
|
||||
|
||||
public MenuItemWrap SelectedMenuItem
|
||||
{
|
||||
get { return _selectedMenuItem; }
|
||||
set
|
||||
{
|
||||
if (SetAndNotify(ref _selectedMenuItem, value))
|
||||
{
|
||||
CurrentScreen = _viewModelDict[value.Header];
|
||||
}
|
||||
}
|
||||
}
|
||||
private Screen _currentScreen;
|
||||
|
||||
public Screen CurrentScreen
|
||||
{
|
||||
get { return _currentScreen; }
|
||||
set { SetAndNotify(ref _currentScreen, value); }
|
||||
}
|
||||
|
||||
private DeviceRunSettingViewModel _deviceRunSettingViewModel;
|
||||
[Inject]
|
||||
public DeviceRunSettingViewModel DeviceRunSettingViewModel
|
||||
{
|
||||
get { return _deviceRunSettingViewModel; }
|
||||
set { _deviceRunSettingViewModel = value; }
|
||||
}
|
||||
|
||||
private DevicePositionViewModel _devicePositionViewModel;
|
||||
[Inject]
|
||||
public DevicePositionViewModel DevicePositionViewModel
|
||||
{
|
||||
get { return _devicePositionViewModel; }
|
||||
set { _devicePositionViewModel = value; }
|
||||
}
|
||||
|
||||
private DeviceFoundationViewModel _deviceFoundationViewModel;
|
||||
[Inject]
|
||||
public DeviceFoundationViewModel DeviceFoundationViewModel
|
||||
{
|
||||
get { return _deviceFoundationViewModel; }
|
||||
set { _deviceFoundationViewModel = value; }
|
||||
}
|
||||
|
||||
private DeviceSafetyViewModel _deviceSafetyViewModel;
|
||||
[Inject]
|
||||
public DeviceSafetyViewModel DeviceSafetyViewModel
|
||||
{
|
||||
get { return _deviceSafetyViewModel; }
|
||||
set { _deviceSafetyViewModel = value; }
|
||||
}
|
||||
|
||||
public ParaSettingViewModel()
|
||||
{
|
||||
InitMenuItems();
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded()
|
||||
{
|
||||
base.OnViewLoaded();
|
||||
if (_viewModelDict.Count == 0)
|
||||
{
|
||||
InitViewModelDict();
|
||||
}
|
||||
if (SelectedMenuItem == null)
|
||||
SelectedMenuItem = MenuItemWraps[0];
|
||||
}
|
||||
private void InitMenuItems()
|
||||
{
|
||||
MenuItemWraps = new ObservableCollection<MenuItemWrap>
|
||||
{
|
||||
new MenuItemWrap() { Header=DEVICEPOSITION,Tag=DEVICEPOSITION },
|
||||
|
||||
new MenuItemWrap() { Header=DEVICERUNSETTING,Tag=DEVICERUNSETTING },
|
||||
|
||||
new MenuItemWrap() { Header=DEVICESAFESETTING,Tag=DEVICESAFESETTING },
|
||||
|
||||
new MenuItemWrap() { Header=DEVICEBASESETTING,Tag=DEVICEBASESETTING },
|
||||
};
|
||||
}
|
||||
private void InitViewModelDict()
|
||||
{
|
||||
_viewModelDict.Clear();
|
||||
_viewModelDict.Add(DEVICEPOSITION, DevicePositionViewModel);
|
||||
_viewModelDict.Add(DEVICERUNSETTING, DeviceRunSettingViewModel);
|
||||
_viewModelDict.Add(DEVICESAFESETTING, DeviceSafetyViewModel);
|
||||
_viewModelDict.Add(DEVICEBASESETTING, DeviceFoundationViewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,260 @@
|
||||
using MainShell.Models;
|
||||
using MainShell.ParaSetting.Model;
|
||||
using MaxwellFramework.Core.Interfaces;
|
||||
using MwFramework.ManagerService;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using StyletIoC;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class ProcessParameterSettingViewModel : BaseScreen
|
||||
{
|
||||
private readonly IParamList _paramList;
|
||||
private ObservableCollection<MenuItemWrap> _processMenuItemWraps;
|
||||
private MenuItemWrap _selectedProcessMenuItem;
|
||||
private object _currentScreen;
|
||||
|
||||
private ProductLoadProcessParameterViewModel _productLoadProcessParameterViewModel;
|
||||
[Inject]
|
||||
public ProductLoadProcessParameterViewModel ProductLoadProcessParameterViewModel
|
||||
{
|
||||
get { return _productLoadProcessParameterViewModel; }
|
||||
set { _productLoadProcessParameterViewModel = value; }
|
||||
}
|
||||
|
||||
private ProductUnloadProcessParameterViewModel _productUnloadProcessParameterViewModel;
|
||||
[Inject]
|
||||
public ProductUnloadProcessParameterViewModel ProductUnloadProcessParameterViewModel
|
||||
{
|
||||
get { return _productUnloadProcessParameterViewModel; }
|
||||
set { _productUnloadProcessParameterViewModel = value; }
|
||||
}
|
||||
|
||||
private ProductPositionProcessParameterViewModel _productPositionProcessParameterViewModel;
|
||||
[Inject]
|
||||
public ProductPositionProcessParameterViewModel ProductPositionProcessParameterViewModel
|
||||
{
|
||||
get { return _productPositionProcessParameterViewModel; }
|
||||
set { _productPositionProcessParameterViewModel = value; }
|
||||
}
|
||||
|
||||
private ProductHeightMeasureProcessParameterViewModel _productHeightMeasureProcessParameterViewModel;
|
||||
[Inject]
|
||||
public ProductHeightMeasureProcessParameterViewModel ProductHeightMeasureProcessParameterViewModel
|
||||
{
|
||||
get { return _productHeightMeasureProcessParameterViewModel; }
|
||||
set { _productHeightMeasureProcessParameterViewModel = value; }
|
||||
}
|
||||
|
||||
private WaferLoadProcessParameterViewModel _waferLoadProcessParameterViewModel;
|
||||
[Inject]
|
||||
public WaferLoadProcessParameterViewModel WaferLoadProcessParameterViewModel
|
||||
{
|
||||
get { return _waferLoadProcessParameterViewModel; }
|
||||
set { _waferLoadProcessParameterViewModel = value; }
|
||||
}
|
||||
|
||||
private WaferUnloadProcessParameterViewModel _waferUnloadProcessParameterViewModel;
|
||||
[Inject]
|
||||
public WaferUnloadProcessParameterViewModel WaferUnloadProcessParameterViewModel
|
||||
{
|
||||
get { return _waferUnloadProcessParameterViewModel; }
|
||||
set { _waferUnloadProcessParameterViewModel = value; }
|
||||
}
|
||||
|
||||
private WaferStraightenProcessParameterViewModel _waferStraightenProcessParameterViewModel;
|
||||
[Inject]
|
||||
public WaferStraightenProcessParameterViewModel WaferStraightenProcessParameterViewModel
|
||||
{
|
||||
get { return _waferStraightenProcessParameterViewModel; }
|
||||
set { _waferStraightenProcessParameterViewModel = value; }
|
||||
}
|
||||
|
||||
private DieRecognizeProcessParameterViewModel _dieRecognizeProcessParameterViewModel;
|
||||
[Inject]
|
||||
public DieRecognizeProcessParameterViewModel DieRecognizeProcessParameterViewModel
|
||||
{
|
||||
get { return _dieRecognizeProcessParameterViewModel; }
|
||||
set { _dieRecognizeProcessParameterViewModel = value; }
|
||||
}
|
||||
|
||||
private BondingProcessParameterViewModel _bondingProcessParameterViewModel;
|
||||
[Inject]
|
||||
public BondingProcessParameterViewModel BondingProcessParameterViewModel
|
||||
{
|
||||
get { return _bondingProcessParameterViewModel; }
|
||||
set { _bondingProcessParameterViewModel = value; }
|
||||
}
|
||||
|
||||
private RecheckProcessParameterViewModel _recheckProcessParameterViewModel;
|
||||
[Inject]
|
||||
public RecheckProcessParameterViewModel RecheckProcessParameterViewModel
|
||||
{
|
||||
get { return _recheckProcessParameterViewModel; }
|
||||
set { _recheckProcessParameterViewModel = value; }
|
||||
}
|
||||
|
||||
private RunSetting _runSetting;
|
||||
|
||||
public RunSetting RunSetting
|
||||
{
|
||||
get { return _runSetting; }
|
||||
set
|
||||
{
|
||||
_runSetting = value;
|
||||
OnPropertyChanged(nameof(RunSetting));
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<MenuItemWrap> ProcessMenuItemWraps
|
||||
{
|
||||
get { return _processMenuItemWraps; }
|
||||
private set
|
||||
{
|
||||
_processMenuItemWraps = value;
|
||||
OnPropertyChanged(nameof(ProcessMenuItemWraps));
|
||||
}
|
||||
}
|
||||
|
||||
public MenuItemWrap SelectedProcessMenuItem
|
||||
{
|
||||
get { return _selectedProcessMenuItem; }
|
||||
set
|
||||
{
|
||||
_selectedProcessMenuItem = value;
|
||||
CurrentScreen = value != null ? value.Tag : null;
|
||||
OnPropertyChanged(nameof(SelectedProcessMenuItem));
|
||||
OnPropertyChanged(nameof(CurrentProcessHeader));
|
||||
}
|
||||
}
|
||||
|
||||
public object CurrentScreen
|
||||
{
|
||||
get { return _currentScreen; }
|
||||
private set
|
||||
{
|
||||
_currentScreen = value;
|
||||
OnPropertyChanged(nameof(CurrentScreen));
|
||||
}
|
||||
}
|
||||
|
||||
public string CurrentProcessHeader
|
||||
{
|
||||
get { return SelectedProcessMenuItem != null ? SelectedProcessMenuItem.Header : string.Empty; }
|
||||
}
|
||||
|
||||
public ProcessParameterSettingViewModel(IParameterManager parameterManager)
|
||||
{
|
||||
_paramList = parameterManager as IParamList;
|
||||
if (_paramList == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(parameterManager));
|
||||
}
|
||||
|
||||
ProcessMenuItemWraps = new ObservableCollection<MenuItemWrap>();
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded()
|
||||
{
|
||||
base.OnViewLoaded();
|
||||
RunSetting = _paramList.GetParameter<RunSetting>();
|
||||
BindSectionParameters();
|
||||
InitializeProcessMenuItems();
|
||||
}
|
||||
|
||||
private void BindSectionParameters()
|
||||
{
|
||||
if (RunSetting == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ProductLoadProcessParameterViewModel.SetParameter(RunSetting.ProductLoadProcessParameter);
|
||||
ProductUnloadProcessParameterViewModel.SetParameter(RunSetting.ProductUnloadProcessParameter);
|
||||
ProductPositionProcessParameterViewModel.SetParameter(RunSetting.ProductPositionProcessParameter);
|
||||
ProductHeightMeasureProcessParameterViewModel.SetParameter(RunSetting.ProductHeightMeasureProcessParameter);
|
||||
WaferLoadProcessParameterViewModel.SetParameter(RunSetting.WaferLoadProcessParameter);
|
||||
WaferUnloadProcessParameterViewModel.SetParameter(RunSetting.WaferUnloadProcessParameter);
|
||||
WaferStraightenProcessParameterViewModel.SetParameter(RunSetting.WaferStraightenProcessParameter);
|
||||
DieRecognizeProcessParameterViewModel.SetParameter(RunSetting.DieRecognizeProcessParameter);
|
||||
BondingProcessParameterViewModel.SetParameter(RunSetting.BondingProcessParameter);
|
||||
RecheckProcessParameterViewModel.SetParameter(RunSetting.RecheckProcessParameter);
|
||||
|
||||
RunSetting.WaferStraightenProcessParameter.PropertyChanged -= OnWaferStraightenProcessParameterChanged;
|
||||
RunSetting.WaferStraightenProcessParameter.PropertyChanged += OnWaferStraightenProcessParameterChanged;
|
||||
}
|
||||
|
||||
private void InitializeProcessMenuItems()
|
||||
{
|
||||
ProcessMenuItemWraps.Clear();
|
||||
ProcessMenuItemWraps.Add(CreateProcessMenuItem("ProcessTabProductLoad", ProductLoadProcessParameterViewModel));
|
||||
ProcessMenuItemWraps.Add(CreateProcessMenuItem("ProcessTabProductUnload", ProductUnloadProcessParameterViewModel));
|
||||
ProcessMenuItemWraps.Add(CreateProcessMenuItem("ProcessTabProductPosition", ProductPositionProcessParameterViewModel));
|
||||
ProcessMenuItemWraps.Add(CreateProcessMenuItem("ProcessTabProductHeightMeasure", ProductHeightMeasureProcessParameterViewModel));
|
||||
ProcessMenuItemWraps.Add(CreateProcessMenuItem("ProcessTabWaferLoad", WaferLoadProcessParameterViewModel));
|
||||
ProcessMenuItemWraps.Add(CreateProcessMenuItem("ProcessTabWaferUnload", WaferUnloadProcessParameterViewModel));
|
||||
ProcessMenuItemWraps.Add(CreateProcessMenuItem("ProcessTabWaferStraighten", WaferStraightenProcessParameterViewModel));
|
||||
ProcessMenuItemWraps.Add(CreateProcessMenuItem("ProcessTabDieRecognize", DieRecognizeProcessParameterViewModel));
|
||||
ProcessMenuItemWraps.Add(CreateProcessMenuItem("ProcessTabBonding", BondingProcessParameterViewModel));
|
||||
ProcessMenuItemWraps.Add(CreateProcessMenuItem("ProcessTabRecheck", RecheckProcessParameterViewModel));
|
||||
|
||||
if (ProcessMenuItemWraps.Count > 0)
|
||||
{
|
||||
SelectedProcessMenuItem = ProcessMenuItemWraps[0];
|
||||
}
|
||||
}
|
||||
|
||||
private MenuItemWrap CreateProcessMenuItem(string resourceKey, object screen)
|
||||
{
|
||||
MenuItemWrap menuItemWrap = new MenuItemWrap();
|
||||
menuItemWrap.Header = ResolveResourceText(resourceKey);
|
||||
menuItemWrap.Tag = screen;
|
||||
return menuItemWrap;
|
||||
}
|
||||
|
||||
private string ResolveResourceText(string resourceKey)
|
||||
{
|
||||
if (Application.Current == null)
|
||||
{
|
||||
return resourceKey;
|
||||
}
|
||||
|
||||
object resource = Application.Current.TryFindResource(resourceKey);
|
||||
string text = resource as string;
|
||||
if (string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
return resourceKey;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
private void OnWaferStraightenProcessParameterChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (RunSetting == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.PropertyName == nameof(WaferStraightenProcessParameter.UseSingleStraighten))
|
||||
{
|
||||
bool useSingleStraighten = RunSetting.WaferStraightenProcessParameter.UseSingleStraighten;
|
||||
if (RunSetting.DieRecognizeProcessParameter.UseSingleWaferPosition != useSingleStraighten)
|
||||
{
|
||||
RunSetting.DieRecognizeProcessParameter.UseSingleWaferPosition = useSingleStraighten;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void BtnSave()
|
||||
{
|
||||
if (RunSetting != null)
|
||||
{
|
||||
RunSetting.Write();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
using MainShell.Models;
|
||||
using MainShell.ParaSetting.Model;
|
||||
using MaxwellControl.Controls;
|
||||
using MaxwellFramework.Core.Interfaces;
|
||||
using MwFramework.ManagerService;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class ProduceControlViewModel : BaseScreen
|
||||
{
|
||||
private ObservableCollection<SubProcessItem> _subProcesses = new ObservableCollection<SubProcessItem>();
|
||||
|
||||
public ObservableCollection<SubProcessItem> SubProcesses
|
||||
{
|
||||
get => _subProcesses;
|
||||
set
|
||||
{
|
||||
_subProcesses = value;
|
||||
OnPropertyChanged("SubProcesses");
|
||||
}
|
||||
}
|
||||
|
||||
private RunSetting _runSetting;
|
||||
|
||||
public RunSetting RunSetting
|
||||
{
|
||||
get => _runSetting;
|
||||
set
|
||||
{
|
||||
_runSetting = value;
|
||||
OnPropertyChanged("RunSetting");
|
||||
}
|
||||
}
|
||||
|
||||
private IParamList _paramList;
|
||||
public ProduceControlViewModel(IParameterManager parameterManager)
|
||||
{
|
||||
_paramList = parameterManager as IParamList;
|
||||
if (_paramList == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(parameterManager));
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded()
|
||||
{
|
||||
base.OnViewLoaded();
|
||||
RunSetting = _paramList.GetParameter<RunSetting>();
|
||||
InitializeSubProcesses();
|
||||
}
|
||||
|
||||
private void InitializeSubProcesses()
|
||||
{
|
||||
if (SubProcesses.Count > 0) return;
|
||||
SubProcesses.Add(new SubProcessItem
|
||||
{
|
||||
ProcessName = "产品上料",
|
||||
IsEnabled = RunSetting.FlowControlItem.SubStrateLoadEnable,
|
||||
ToolTipText = "控制产品上料子流程的启用/禁用"
|
||||
});
|
||||
SubProcesses.Add(new SubProcessItem
|
||||
{
|
||||
ProcessName = "产品下料",
|
||||
IsEnabled = RunSetting.FlowControlItem.SubStrateUnLoadEnable,
|
||||
ToolTipText = "控制产品下料子流程的启用/禁用"
|
||||
});
|
||||
SubProcesses.Add(new SubProcessItem
|
||||
{
|
||||
ProcessName = "产品定位",
|
||||
IsEnabled = RunSetting.FlowControlItem.SubstratePositionEnable,
|
||||
ToolTipText = "控制产品高度测量子流程的启用/禁用"
|
||||
});
|
||||
SubProcesses.Add(new SubProcessItem
|
||||
{
|
||||
ProcessName = "产品高度测量",
|
||||
IsEnabled = RunSetting.FlowControlItem.SubstrateHeightMeasureEnable,
|
||||
ToolTipText = "控制产品高度测量子流程的启用/禁用"
|
||||
});
|
||||
SubProcesses.Add(new SubProcessItem
|
||||
{
|
||||
ProcessName = "方片上料",
|
||||
IsEnabled = RunSetting.FlowControlItem.WaferLoadEnable,
|
||||
ToolTipText = "控制方片下料子流程的启用/禁用"
|
||||
});
|
||||
SubProcesses.Add(new SubProcessItem
|
||||
{
|
||||
ProcessName = "方片下料",
|
||||
IsEnabled = RunSetting.FlowControlItem.WaferUnLoadEnable,
|
||||
ToolTipText = "控制方片下料子流程的启用/禁用"
|
||||
});
|
||||
SubProcesses.Add(new SubProcessItem
|
||||
{
|
||||
ProcessName = "方片拉直",
|
||||
IsEnabled = RunSetting.FlowControlItem.WaferStraightenEnable,
|
||||
ToolTipText = "控制方片拉直子流程的启用/禁用"
|
||||
});
|
||||
SubProcesses.Add(new SubProcessItem
|
||||
{
|
||||
ProcessName = "晶粒飞拍",
|
||||
IsEnabled = RunSetting.FlowControlItem.WaferPositionEnable,
|
||||
ToolTipText = "控制晶粒飞拍子流程的启用/禁用"
|
||||
});
|
||||
SubProcesses.Add(new SubProcessItem
|
||||
{
|
||||
ProcessName = "转移作业",
|
||||
IsEnabled = RunSetting.FlowControlItem.BondingEnable,
|
||||
ToolTipText = "控制转移作业子流程的启用/禁用"
|
||||
});
|
||||
SubProcesses.Add(new SubProcessItem
|
||||
{
|
||||
ProcessName = "复检",
|
||||
IsEnabled = RunSetting.FlowControlItem.SubstrateRecheckEnable,
|
||||
ToolTipText = "控制复检子流程的启用/禁用"
|
||||
});
|
||||
}
|
||||
|
||||
public void BtnSave()
|
||||
{
|
||||
RunSetting.FlowControlItem.SubStrateLoadEnable = SubProcesses.First(p => p.ProcessName == "产品上料").IsEnabled;
|
||||
RunSetting.FlowControlItem.SubStrateUnLoadEnable = SubProcesses.First(p => p.ProcessName == "产品下料").IsEnabled;
|
||||
RunSetting.FlowControlItem.WaferLoadEnable = SubProcesses.First(p => p.ProcessName == "方片上料").IsEnabled;
|
||||
RunSetting.FlowControlItem.WaferUnLoadEnable = SubProcesses.First(p => p.ProcessName == "方片下料").IsEnabled;
|
||||
RunSetting.FlowControlItem.SubstratePositionEnable = SubProcesses.First(p => p.ProcessName == "产品定位").IsEnabled;
|
||||
RunSetting.FlowControlItem.SubstrateHeightMeasureEnable = SubProcesses.First(p => p.ProcessName == "产品高度测量").IsEnabled;
|
||||
RunSetting.FlowControlItem.WaferStraightenEnable = SubProcesses.First(p => p.ProcessName == "方片拉直").IsEnabled;
|
||||
RunSetting.FlowControlItem.WaferPositionEnable = SubProcesses.First(p => p.ProcessName == "晶粒飞拍").IsEnabled;
|
||||
RunSetting.FlowControlItem.BondingEnable = SubProcesses.First(p => p.ProcessName == "转移作业").IsEnabled;
|
||||
RunSetting.FlowControlItem.SubstrateRecheckEnable = SubProcesses.First(p => p.ProcessName == "复检").IsEnabled;
|
||||
RunSetting.Write();
|
||||
MessageBox.Show("保存完成");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class SubProcessItem : PropertyChangedBase
|
||||
{
|
||||
private string _processName;
|
||||
public string ProcessName
|
||||
{
|
||||
get { return _processName; }
|
||||
set { SetAndNotify(ref _processName, value); }
|
||||
}
|
||||
|
||||
private bool _isEnabled;
|
||||
public bool IsEnabled
|
||||
{
|
||||
get { return _isEnabled; }
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _isEnabled, value);
|
||||
if (value) StatusText = "已启用";
|
||||
else StatusText = "已禁用";
|
||||
}
|
||||
}
|
||||
|
||||
private string _toolTipText;
|
||||
public string ToolTipText
|
||||
{
|
||||
get { return _toolTipText; }
|
||||
set { SetAndNotify(ref _toolTipText, value); }
|
||||
}
|
||||
|
||||
private string _statusText;
|
||||
public string StatusText
|
||||
{
|
||||
get { return _statusText; }
|
||||
set { SetAndNotify(ref _statusText, value); }
|
||||
}
|
||||
//public string StatusText => IsEnabled ? "已启用" : "已禁用";
|
||||
//public Brush StatusColor => IsEnabled ? Brushes.Green : Brushes.Gray;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
using MainShell.Common;
|
||||
using MainShell.Log;
|
||||
using MainShell.Models;
|
||||
using MainShell.ParaSetting.Model;
|
||||
using MaxwellFramework.Core.Interfaces;
|
||||
using MwFramework.ManagerService;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using Forms = System.Windows.Forms;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class SaveSettingViewModel : BaseScreen
|
||||
{
|
||||
private readonly IParamList _paramList;
|
||||
|
||||
private DeviceFoundationSetting _deviceFoundationSetting;
|
||||
|
||||
public SaveSettingViewModel(IParameterManager parameterManager)
|
||||
{
|
||||
_paramList = parameterManager as IParamList;
|
||||
if (_paramList == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(parameterManager));
|
||||
}
|
||||
}
|
||||
|
||||
private DeviceSaveSettingItem _saveSettingItem;
|
||||
|
||||
public DeviceSaveSettingItem SaveSettingItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return _saveSettingItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _saveSettingItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded()
|
||||
{
|
||||
base.OnViewLoaded();
|
||||
_deviceFoundationSetting = _paramList.GetParameter<DeviceFoundationSetting>();
|
||||
RefreshState();
|
||||
}
|
||||
|
||||
public void BtnSave()
|
||||
{
|
||||
try
|
||||
{
|
||||
_deviceFoundationSetting.Write();
|
||||
MwMessageBox.Show("保存完成", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.LogSysError(ex.ToString());
|
||||
MwMessageBox.Show(ex.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
public void BrowseFileSaveFolder()
|
||||
{
|
||||
string selectedPath = BrowseFolder(SaveSettingItem == null || SaveSettingItem.FileSaveSetting == null ? null : SaveSettingItem.FileSaveSetting.SaveFolder);
|
||||
if (string.IsNullOrWhiteSpace(selectedPath) || SaveSettingItem == null || SaveSettingItem.FileSaveSetting == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SaveSettingItem.FileSaveSetting.SaveFolder = selectedPath;
|
||||
}
|
||||
|
||||
public void BrowseImageSaveFolder()
|
||||
{
|
||||
string selectedPath = BrowseFolder(SaveSettingItem == null || SaveSettingItem.ImageSaveSetting == null ? null : SaveSettingItem.ImageSaveSetting.SaveFolder);
|
||||
if (string.IsNullOrWhiteSpace(selectedPath) || SaveSettingItem == null || SaveSettingItem.ImageSaveSetting == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SaveSettingItem.ImageSaveSetting.SaveFolder = selectedPath;
|
||||
}
|
||||
|
||||
private void RefreshState()
|
||||
{
|
||||
if (_deviceFoundationSetting.SaveSettingItem == null)
|
||||
{
|
||||
_deviceFoundationSetting.SaveSettingItem = new DeviceSaveSettingItem();
|
||||
}
|
||||
|
||||
SaveSettingItem = _deviceFoundationSetting.SaveSettingItem;
|
||||
}
|
||||
|
||||
private static string BrowseFolder(string currentPath)
|
||||
{
|
||||
using (Forms.FolderBrowserDialog dialog = new Forms.FolderBrowserDialog())
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(currentPath) && Directory.Exists(currentPath))
|
||||
{
|
||||
dialog.SelectedPath = currentPath;
|
||||
}
|
||||
|
||||
Forms.DialogResult result = dialog.ShowDialog();
|
||||
if (result != Forms.DialogResult.OK)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return dialog.SelectedPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
using MainShell.Hardware;
|
||||
using MaxwellControl.Tools;
|
||||
using MaxwellFramework.Core.Interfaces;
|
||||
using MwFramework.Device;
|
||||
using MwFramework.Controls.UIControl;
|
||||
using MwFramework.ManagerService;
|
||||
using Stylet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using static MainShell.ParaSetting.Model.SpeedSetting;
|
||||
using MessageBox = MaxwellControl.Controls.MessageBox;
|
||||
|
||||
namespace MainShell.ParaSetting.ViewModel
|
||||
{
|
||||
public class SpeedSettingViewModel:Screen,IPage
|
||||
{
|
||||
public string Name { get; set; } = "SpeedParaSys";
|
||||
|
||||
private readonly IParamList _paramList;
|
||||
|
||||
private ParameterHelper _parameterHelper = new ParameterHelper();
|
||||
public ParameterHelper ParameterHelper
|
||||
{
|
||||
get
|
||||
{
|
||||
return _parameterHelper;
|
||||
}
|
||||
set
|
||||
{
|
||||
_parameterHelper = value;
|
||||
OnPropertyChanged(nameof(ParameterHelper));
|
||||
}
|
||||
}
|
||||
private SpeedParaSysSetting _speedParaSysSetting;
|
||||
public SpeedParaSysSetting SpeedParaSysSetting
|
||||
{
|
||||
get
|
||||
{
|
||||
return _speedParaSysSetting;
|
||||
}
|
||||
set
|
||||
{
|
||||
_speedParaSysSetting = value;
|
||||
OnPropertyChanged(nameof(SpeedParaSysSetting));
|
||||
}
|
||||
}
|
||||
private double _speed = 10;
|
||||
public double Speed
|
||||
{
|
||||
get
|
||||
{
|
||||
return _speed;
|
||||
}
|
||||
set
|
||||
{
|
||||
_speed = value;
|
||||
OnPropertyChanged(nameof(Speed));
|
||||
}
|
||||
}
|
||||
|
||||
private readonly HardwareManager _hardware;
|
||||
public SpeedSettingViewModel(IParameterManager parameterManager, HardwareManager hardware)
|
||||
{
|
||||
_paramList = parameterManager as IParamList;
|
||||
if (_paramList == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(parameterManager));
|
||||
}
|
||||
|
||||
_hardware = hardware ?? throw new ArgumentNullException(nameof(hardware));
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded()
|
||||
{
|
||||
base.OnViewLoaded();
|
||||
SpeedParaSysSetting = _paramList.GetParameter<SpeedParaSysSetting>();
|
||||
InitializeAxisSpeedItems();
|
||||
}
|
||||
|
||||
private void InitializeAxisSpeedItems()
|
||||
{
|
||||
Dictionary<string, IAxis> axisNameDic = _hardware.AxesDic;
|
||||
if (SpeedParaSysSetting.SpeedTypeItemCollection.SpeedTypeItemList.Count != axisNameDic.Count)
|
||||
{
|
||||
SpeedParaSysSetting.SpeedTypeItemCollection.SpeedTypeItemList.Clear();
|
||||
foreach (var axisByIndex in axisNameDic)
|
||||
{
|
||||
SpeedParaSysSetting.SpeedTypeItemCollection.SpeedTypeItemList.Add(new SpeedTypeItem
|
||||
{
|
||||
AxisName = axisByIndex.Key,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void btnSet()
|
||||
{
|
||||
if (MessageBox.Show("是否保存", null, "确认保存", MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.Cancel) == MessageBoxResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
SpeedParaSysSetting.Write();
|
||||
LogWatchValueManager.Save(SpeedParaSysSetting.SpeedTypeItemCollection, "SpeedPara_速度规划");
|
||||
ParameterHelper.RaiseValueAccept();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void btnRowData()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Confirm("是否修改当前选中数据的速度")) return;
|
||||
|
||||
IList<SpeedTypeItem> items = SpeedParaSysSetting?.SpeedTypeItemCollection?.SpeedTypeItemList;
|
||||
SpeedTypeItem selected = SpeedParaSysSetting?.SpeedTypeItemCollection?.CurrentSelectSpeedTypeItemList;
|
||||
if (items == null || selected == null)
|
||||
{
|
||||
MessageBox.Show("未找到速度项或未选择项。");
|
||||
return;
|
||||
}
|
||||
|
||||
// 找到轴索引相同的项并更新
|
||||
SpeedTypeItem item = items.FirstOrDefault(x => x.AxisName == selected.AxisName);
|
||||
if (item != null)
|
||||
{
|
||||
UpdateItem(item, Speed);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public void btnPageData()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Confirm("是否修改当前界面的速度")) return;
|
||||
|
||||
var items = SpeedParaSysSetting?.SpeedTypeItemCollection?.SpeedTypeItemList;
|
||||
if (items == null)
|
||||
{
|
||||
MessageBox.Show("未找到速度项。");
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyTo(items, Speed);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改当前界面的龙门速度
|
||||
/// </summary>
|
||||
public void btnPageGantryData()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Confirm("是否修改当前界面的龙门速度")) return;
|
||||
|
||||
var items = SpeedParaSysSetting?.SpeedTypeItemCollection?.SpeedTypeItemList;
|
||||
if (items == null)
|
||||
{
|
||||
MessageBox.Show("未找到速度项。");
|
||||
return;
|
||||
}
|
||||
|
||||
// 假设龙门轴号为 0..3(按 AxisIndex 判断,避免直接按列表索引)
|
||||
//var gantryItems = items.Where(x => x.AxisIndex >= 0 && x.AxisIndex <= 3);
|
||||
//ApplyTo(gantryItems, Speed);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改当前界面的Z和TH轴速度
|
||||
/// </summary>
|
||||
public void btnPageZAndTHData()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Confirm("是否修改当前界面的Z和TH轴速度")) return;
|
||||
|
||||
var items = SpeedParaSysSetting?.SpeedTypeItemCollection?.SpeedTypeItemList;
|
||||
if (items == null)
|
||||
{
|
||||
MessageBox.Show("未找到速度项。");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//var zthItems = items.Where(x => x.AxisIndex >= 4 && x.AxisIndex <= 6);
|
||||
//ApplyTo(zthItems, Speed);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
#region Helpers
|
||||
private bool Confirm(string message)
|
||||
{
|
||||
return MessageBox.Show(message, null, "确认修改", MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.Cancel) == MessageBoxResult.OK;
|
||||
}
|
||||
|
||||
private void ApplyTo(IEnumerable<SpeedTypeItem> items, double speed)
|
||||
{
|
||||
if (items == null) return;
|
||||
foreach (var it in items)
|
||||
{
|
||||
UpdateItem(it, speed);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateItem(SpeedTypeItem item, double speed)
|
||||
{
|
||||
if (item == null) return;
|
||||
item.Speed = speed;
|
||||
item.Acc = 10 * speed;
|
||||
item.Dec = 10 * speed;
|
||||
item.Jerk = 100 * speed;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user