using System; using System.Collections.Generic; using System.Text; namespace GummingEntity { public enum SegmentType { PreviousStitch = 1, //起始固缝线段 LastStitch = 2, //结尾固缝线段 PreviousGumming = 3,//起始固缝线段 LastGumming = 4,//结尾固缝线段 } public class PatternEntity : ICloneable { public int m_Type; //m_Type变量用于判断是直线(0),圆弧(1),拖线(2),结束(-1) public double x1, y1, x2, y2;//起始点和终止点坐标 public double x, y;//圆心坐标 public double r;//半径 public double angle;//度数 public double m_Speed, m_length;//速度和弧长 public int m_Direction; //运行方向 public string Content; public double previousX, previousY;//圆心坐标 public double AngleForward; public double AngleReverse; public int Index; public SegmentType SegmentTypeTag; public bool IsTightSegment;//是否固缝段,true 固缝 public bool IsPreviousSegment;//是否起针段 public int RootIndex; public double Acc; public double NextAngle; public double NextNextAngle; public double PreviousAngle; public int fromType; public bool isSegmentEnd; public void SetContent() { Content = string.Format("m_Type:{0},x:{1},y:{2},x1:{3},y1:{4},x2:{5},y2:{6},m_Speed:{7},m_length:{8},m_Direction:{9},IsTightSegment:{10}", m_Type, x, y, x1, y1, x2, y2, m_Speed, m_length, m_Direction, IsTightSegment); } public object Clone() { PatternEntity clone = new PatternEntity() { m_Type = this.m_Type, x = this.x, y = this.y, x1 = this.x1, y1 = this.y1, x2 = this.x2, y2 = this.y2, m_Speed = this.m_Speed, m_length = this.m_length, m_Direction = this.m_Direction, Content = this.Content, AngleForward = this.AngleForward, AngleReverse = this.AngleReverse, Index = this.Index, SegmentTypeTag = this.SegmentTypeTag, IsTightSegment = this.IsTightSegment, IsPreviousSegment = this.IsPreviousSegment, RootIndex = this.RootIndex, Acc = this.Acc, NextAngle = this.NextAngle, NextNextAngle = this.NextNextAngle, PreviousAngle = this.PreviousAngle, angle = this.angle, fromType = this.fromType, isSegmentEnd = this.isSegmentEnd, }; return clone; } } public class Point { public double x, y; public Point() { } public Point(double x1, double y1) { this.x = x1; this.y = y1; } } }