| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using Newtonsoft.Json;
- using Prism.Mvvm;
- using SKMC.Api.Motion.Model;
- using System;
- namespace SKMC.Api.Recipe.Model
- {
- /// <summary>
- /// 点位单轴位置模型
- /// </summary>
- [JsonObject(MemberSerialization.OptIn)]
- public class RecipePointPosition : BindableBase, ICloneable
- {
- private short _axisNo;
- /// <summary>
- /// 电机序号
- /// </summary>
- [JsonProperty]
- public short AxisNo
- {
- get { return _axisNo; }
- set { _axisNo = value; RaisePropertyChanged(); }
- }
- /// <summary>
- /// 电机对象
- /// </summary>
- public MotionAxis MotionAxis { get; set; }
- private double _position;
- /// <summary>
- /// 位置值(通常为绝对值)
- /// </summary>
- [JsonProperty]
- public double Position
- {
- get { return _position; }
- set { _position = Math.Round(value, 3); RaisePropertyChanged(); }
- }
- private double _offset;
- /// <summary>
- /// 偏移量
- /// </summary>
- [JsonProperty]
- public double Offset
- {
- get { return _offset; }
- set { _offset = Math.Round(value, 3); RaisePropertyChanged(); }
- }
- private double _fixsetVal;
- /// <summary>
- /// 补偿值(只生效一次)
- /// </summary>
- public double FixsetVal
- {
- get { return _fixsetVal; }
- set { _fixsetVal = value; }
- }
- public double PosVal
- {
- get => _position + _offset;
- }
- public double PosValFixset
- {
- get => PosVal + _fixsetVal;
- }
- /// <summary>
- /// 单轴速度码, 可以从点位的速度码继承
- /// </summary>
- public string SpeedCode { get; set; }
- public object Clone()
- {
- var model = new RecipePointPosition
- {
- AxisNo = this.AxisNo,
- MotionAxis = this.MotionAxis,
- Position = this.Position,
- Offset = this.Offset,
- SpeedCode = this.SpeedCode
- };
- return model;
- }
- }
- }
|