| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- using Prism.Mvvm;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace SKMC.Api.Device.Material.Tray
- {
- /// <summary>
- /// 基础物料盘的配置模型
- /// </summary>
- public class TrayConfig : BindableBase
- {
- private long _id;
- public long Id
- {
- get { return _id; }
- set { _id = value; }
- }
- private int _length;
- /// <summary>
- /// Tray长度mm
- /// </summary>
- public int Length
- {
- get { return _length; }
- set { _length = value; RaisePropertyChanged(); }
- }
- private int _width;
- /// <summary>
- /// Tray宽度mm
- /// </summary>
- public int Width
- {
- get { return _width; }
- set { _width = value; RaisePropertyChanged(); }
- }
- private long _profileId;
- /// <summary>
- /// 档案Id
- /// </summary>
- public long ProfileId
- {
- get { return _profileId; }
- set { _profileId = value; RaisePropertyChanged(); }
- }
- private int _row;
- /// <summary>
- /// Tray物料行数
- /// </summary>
- public int Row
- {
- get { return _row; }
- set { _row = value; RaisePropertyChanged(); }
- }
- private int _col;
- /// <summary>
- /// Tray物料列数
- /// </summary>
- public int Col
- {
- get { return _col; }
- set { _col = value; RaisePropertyChanged(); }
- }
- /// <summary>
- /// Tray的最大物料数(行*列)
- /// </summary>
- public int Number { get => _row * _col; }
- private double _xStart;
- /// <summary>
- /// Tray的首个物料位起始位置的X位置mm
- /// </summary>
- public double XStart
- {
- get { return _xStart; }
- set { _xStart = value; RaisePropertyChanged(); }
- }
- private double _xPitch;
- /// <summary>
- /// Tray的X方向(列与列)物料间隔mm
- /// </summary>
- public double XPitch
- {
- get { return _xPitch; }
- set { _xPitch = value; RaisePropertyChanged(); }
- }
- private double _yStart;
- /// <summary>
- /// Tray的首个物料位起始位置的Y位置mm
- /// </summary>
- public double YStart
- {
- get { return _yStart; }
- set { _yStart = value; RaisePropertyChanged(); }
- }
- private double _yPitch;
- /// <summary>
- /// Tray的Y方向(行与行)物料间隔mm
- /// </summary>
- public double YPitch
- {
- get { return _yPitch; }
- set { _yPitch = value; RaisePropertyChanged(); }
- }
- private double _height;
- /// <summary>
- /// Tray的高度
- /// </summary>
- public double Height
- {
- get { return _height; }
- set { _height = value; RaisePropertyChanged(); }
- }
- public double XWidth => XStart + Col * XPitch;
- public double YWidth => YStart + Row * YPitch;
- private string _linePath;
- /// <summary>
- /// Tray的走线路径(物料格序号集字符串, 空格分隔)
- /// </summary>
- public string LinePath
- {
- get { return _linePath; }
- set { _linePath = value; RaisePropertyChanged(); }
- }
- /// <summary>
- /// Tray的走线路径(物料格序号集)
- /// </summary>
- public List<int> LinePathList
- {
- get
- {
- string linePath = Regex.Replace(_linePath.Trim(), @"\s+", " ", RegexOptions.Multiline);
- return linePath.Split(' ').Select(Int32.Parse).ToList();
- }
- }
- /// <summary>
- /// 物料格开关(用于跳过走线与作业)
- /// </summary>
- public List<bool> SiteSwitchs { get; set; } = new List<bool>();
- }
- }
|