public static Shape GetInstance(ShapeType shapeType) { Shape shape = null; switch (shapeType) { case ShapeType.Begin: break; case ShapeType.Process: shape = new ProcessShape(); break; case ShapeType.End: break; case ShapeType.Conditional: break; } return(shape); }
/// <summary> /// 实例化一道工序为指定参数 /// </summary> /// <param name="stationNo">工位号</param> /// <param name="processType">加工类型</param> /// <param name="processShape">加工形状</param> /// <param name="number">工序号</param> /// <param name="startPoint">工序的起始点</param> public Process(ProcessType processType, ProcessShape processShape, bool isOutside, int number, Point startPoint) : this() { //保存加工类型 this.ProcessType = processType; //保存加工形状 this.ProcessShape = processShape; //保存工序号 this.Number = number; //保存起始点 setStartPoint(startPoint); this.IsOutside = isOutside; //获取加工面类型 getSideType(); }
/// <summary> /// 向工位添加一道工序 /// </summary> /// <param name="processType">加工类型</param> /// <param name="processShape">加工形状</param> /// <param name="isOutside">指示是否为外侧面</param> /// <param name="startPoint">起始点坐标</param> public void Add(ProcessType processType, ProcessShape processShape, bool isOutside, Point startPoint) { //新建一道工序 Process process = new Process(processType, processShape, isOutside, ProcessNum, startPoint); this.Add(process); }