You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4C/GummingEntity/PatternConfiguration.cs

649 lines
16 KiB

using Newtonsoft.Json;
using GummingCommon;
using GummingLine;
using System;
using System.Collections.Generic;
using System.Text;
namespace GummingEntity
{
public class PatternConfiguration : ViewModelBase
{
public object Clone()
{
var o = new PatternConfiguration()
{
PatternName = this.PatternName,
ManualOffsetX = this.ManualOffsetX,
ManualOffsetY = this.ManualOffsetY,
BounceWay = this.BounceWay,
TopBorder = this.TopBorder,
LeftBorder = this.LeftBorder,
RightBorder = this.RightBorder,
BottomBorder = this.BottomBorder,
BounceBorderX = this.BounceBorderX,//出绷位置设定
BounceBorderY = this.BounceBorderY,
YarnBorderX = this.YarnBorderX,//穿线位置设定
YarnBorderY = this.YarnBorderY,
TopMargin = this.TopMargin,
LeftMargin = this.LeftMargin,
RightMargin = this.RightMargin,
BottomMargin = this.BottomMargin,
NeedleSpace = this.NeedleSpace,
NeedleSpace2 = this.NeedleSpace2,
HardNeedleSpace = this.HardNeedleSpace,
HardNeedleLength = this.HardNeedleLength,
HardNeedleCount = this.HardNeedleCount,
NeedleSpeed = this.NeedleSpeed,
NeedleWay = this.NeedleWay,
PatternParameter = (PatternParameter)this.PatternParameter?.Clone(),
LocalPattern = (PatternPath)this.LocalPattern?.Clone(),
LeftKeyDown = this.LeftKeyDown,
RightKeyDown = this.RightKeyDown,
UpKeyDown = this.UpKeyDown,
DownKeyDown = this.DownKeyDown
};
o.PatternEntities = new List<PatternEntity>();
if(PatternEntities != null)
{
foreach (var t in this.PatternEntities)
{
o.PatternEntities.Add((PatternEntity)t.Clone());
}
}
o.PatternLines = new List<PatternLine>();
if (PatternLines != null)
{
foreach (var t in this.PatternLines)
{
o.PatternLines.Add((PatternLine)t.Clone());
}
}
o.ParallelEntities = new List<ParallelEntity>();
if (ParallelEntities != null)
{
foreach (var t in this.ParallelEntities)
{
o.ParallelEntities.Add((ParallelEntity)t.Clone());
}
}
return o;
}
private string _PatternName;
public string PatternName
{
get
{
return _PatternName;
}
set
{
_PatternName = value;
OnPropertyChanged("PatternName");
}
}
private double _ManualOffsetX;
public double ManualOffsetX
{
get
{
return _ManualOffsetX;
}
set
{
_ManualOffsetX = Math.Round(value, 1);
OnPropertyChanged("ManualOffsetX");
}
}
private double _ManualOffsetY;
public double ManualOffsetY
{
get
{
return _ManualOffsetY;
}
set
{
_ManualOffsetY = Math.Round(value, 1);
OnPropertyChanged("ManualOffsetY");
}
}
private int _BounceWay;
public int BounceWay
{
get
{
return _BounceWay;
}
set
{
if (_BounceWay != value)
{
Setting.Save("StyleDlg", "inputway", value.ToString());
}
_BounceWay = value;
OnPropertyChanged("BounceWay");
}
}
private int _dunjiaoyh;
public int dunjiaoyh
{
get
{
return _dunjiaoyh;
}
set
{
_dunjiaoyh = value;
OnPropertyChanged("dunjiaoyh");
}
}
private double _TopBorder;
public double TopBorder
{
get
{
return _TopBorder;
}
set
{
_TopBorder = value;
OnPropertyChanged("TopBorder");
}
}
private double _LeftBorder;
public double LeftBorder
{
get
{
return _LeftBorder;
}
set
{
_LeftBorder = value;
OnPropertyChanged("LeftBorder");
}
}
private double _RightBorder;
public double RightBorder
{
get
{
return _RightBorder;
}
set
{
_RightBorder = value;
OnPropertyChanged("RightBorder");
}
}
private double _BottomBorder;
public double BottomBorder
{
get
{
return _BottomBorder;
}
set
{
_BottomBorder = value;
OnPropertyChanged("BottomBorder");
}
}
private double _BounceBorderX;
public double BounceBorderX
{
get
{
return _BounceBorderX;
}
set
{
_BounceBorderX = value;
OnPropertyChanged("BounceBorderX");
}
}
private double _BounceBorderY;
public double BounceBorderY
{
get
{
return _BounceBorderY;
}
set
{
_BounceBorderY = value;
OnPropertyChanged("BounceBorderY");
}
}
private double _YarnBorderX;
public double YarnBorderX
{
get
{
return _YarnBorderX;
}
set
{
_YarnBorderX = value;
OnPropertyChanged("YarnBorderX");
}
}
private double _YarnBorderY;
public double YarnBorderY
{
get
{
return _YarnBorderY;
}
set
{
_YarnBorderY = value;
OnPropertyChanged("YarnBorderY");
}
}
private double _TopMargin;
public double TopMargin
{
get
{
return _TopMargin;
}
set
{
_TopMargin = value;
OnPropertyChanged("TopMargin");
}
}
private double _LeftMargin;
public double LeftMargin
{
get
{
return _LeftMargin;
}
set
{
_LeftMargin = value;
OnPropertyChanged("LeftMargin");
}
}
private double _RightMargin;
public double RightMargin
{
get
{
return _RightMargin;
}
set
{
_RightMargin = value;
OnPropertyChanged("RightMargin");
}
}
private double _BottomMargin;
public double BottomMargin
{
get
{
return _BottomMargin;
}
set
{
_BottomMargin = value;
OnPropertyChanged("BottomMargin");
}
}
private double _NeedleSpace;
public double NeedleSpace
{
get
{
return _NeedleSpace;
}
set
{
_NeedleSpace = value;
OnPropertyChanged("NeedleSpace");
}
}
private double _NeedleSpace2;
public double NeedleSpace2
{
get
{
return _NeedleSpace2;
}
set
{
_NeedleSpace2 = value;
OnPropertyChanged("NeedleSpace2");
}
}
private double _HardNeedleSpace;
public double HardNeedleSpace
{
get
{
return _HardNeedleSpace;
}
set
{
_HardNeedleSpace = value;
OnPropertyChanged("HardNeedleSpace");
}
}
private double _HardNeedleLength;
public double HardNeedleLength
{
get
{
return _HardNeedleLength;
}
set
{
_HardNeedleLength = value;
OnPropertyChanged("HardNeedleLength");
}
}
private int _HardNeedleCount;
public int HardNeedleCount
{
get
{
return _HardNeedleCount;
}
set
{
_HardNeedleCount = value;
OnPropertyChanged("HardNeedleCount");
}
}
private double _NeedleSpeed;
public double NeedleSpeed
{
get
{
return _NeedleSpeed;
}
set
{
_NeedleSpeed = value;
OnPropertyChanged("NeedleSpeed");
}
}
private double _NeedleSpeed2;
public double NeedleSpeed2
{
get
{
return _NeedleSpeed2;
}
set
{
_NeedleSpeed2 = value;
OnPropertyChanged("NeedleSpeed2");
}
}
private int _NeedleWay;
public int NeedleWay
{
get
{
return _NeedleWay;
}
set
{
_NeedleWay = value;
OnPropertyChanged("NeedleWay");
}
}
private int _PositionType;
public int PositionType
{
get
{
return _PositionType;
}
set
{
_PositionType = value;
OnPropertyChanged("PositionType");
}
}
private string _PositionTypeName;
public string PositionTypeName
{
get
{
return _PositionTypeName;
}
set
{
_PositionTypeName = value;
OnPropertyChanged("PositionTypeName");
}
}
private PatternParameter _PatternParameter;
public PatternParameter PatternParameter
{
get
{
return _PatternParameter;
}
set
{
_PatternParameter = value;
OnPropertyChanged("PatternParameter");
}
}
private PatternPath _LocalPattern;
public PatternPath LocalPattern
{
get
{
return _LocalPattern;
}
set
{
_LocalPattern = value;
OnPropertyChanged("LocalPattern");
}
}
private List<PatternEntity> _PatternEntities;
public List<PatternEntity> PatternEntities
{
get
{
return _PatternEntities;
}
set
{
_PatternEntities = value;
OnPropertyChanged("PatternEntities");
}
}
private List<PatternLine> _PatternLines;
[JsonIgnore]
public List<PatternLine> PatternLines
{
get
{
return _PatternLines;
}
set
{
_PatternLines = value;
OnPropertyChanged("PatternLines");
}
}
private List<PatternEntity> _PatternReverseEntities;
public List<PatternEntity> PatternReverseEntities
{
get
{
return _PatternReverseEntities;
}
set
{
_PatternReverseEntities = value;
OnPropertyChanged("PatternReverseEntities");
}
}
private List<ParallelEntity> _ParallelEntities;
public List<ParallelEntity> ParallelEntities
{
get
{
return _ParallelEntities;
}
set
{
_ParallelEntities = value;
OnPropertyChanged("ParallelEntities");
}
}
private List<ParallelEntity> _ParallelReverseEntities;
public List<ParallelEntity> ParallelReverseEntities
{
get
{
return _ParallelReverseEntities;
}
set
{
_ParallelReverseEntities = value;
OnPropertyChanged("ParallelReverseEntities");
}
}
private List<PatternEntity> _PatternParallelEntities;
public List<PatternEntity> PatternParallelEntities
{
get
{
return _PatternParallelEntities;
}
set
{
_PatternParallelEntities = value;
OnPropertyChanged("PatternParallelEntities");
}
}
private List<PatternEntity> _PatternParallelReverseEntities;
public List<PatternEntity> PatternParallelReverseEntities
{
get
{
return _PatternParallelReverseEntities;
}
set
{
_PatternParallelReverseEntities = value;
OnPropertyChanged("PatternParallelReverseEntities");
}
}
private int _Mode;
public int Mode
{
get
{
return _Mode;
}
set
{
_Mode = value;
OnPropertyChanged("Mode");
}
}
private bool _LeftKeyDown;
public bool LeftKeyDown
{
get
{
return _LeftKeyDown;
}
set
{
_LeftKeyDown = value;
OnPropertyChanged("LeftKeyDown");
}
}
private bool _RightKeyDown;
public bool RightKeyDown
{
get
{
return _RightKeyDown;
}
set
{
_RightKeyDown = value;
OnPropertyChanged("RightKeyDown");
}
}
private bool _UpKeyDown;
public bool UpKeyDown
{
get
{
return _UpKeyDown;
}
set
{
_UpKeyDown = value;
OnPropertyChanged("UpKeyDown");
}
}
private bool _DownKeyDown;
public bool DownKeyDown
{
get
{
return _DownKeyDown;
}
set
{
_DownKeyDown = value;
OnPropertyChanged("DownKeyDown");
}
}
private double _AccMoving;
public double AccMoving
{
get
{
return _AccMoving;
}
set
{
_AccMoving = value;
OnPropertyChanged("AccMoving");
}
}
private double _AccGumming;
public double AccGumming
{
get
{
return _AccGumming;
}
set
{
_AccGumming = value;
OnPropertyChanged("AccGumming");
}
}
}
}