Exemple #1
0
        public object Clone()
        {
            MeasureHeightCmd result = (MeasureHeightCmd)this.MemberwiseClone();

            result.position = (PointD)this.position.Clone();
            return(result);
        }
Exemple #2
0
        public MultiTracesCmd(RunnableModule runnableModule, MultiTracesCmdLine multiTracesCmdLine, MeasureHeightCmd mhCmd)
            : base(runnableModule, multiTracesCmdLine)
        {
            this.Valve = multiTracesCmdLine.Valve;
            var structure = runnableModule.CommandsModule.program.ModuleStructure;

            this.multiTracesCmdLine = multiTracesCmdLine;

            foreach (var trace in this.multiTracesCmdLine.Traces)
            {
                TraceBase newTrace = trace.Clone() as TraceBase;
                if (newTrace is TraceLine)
                {
                    TraceLine traceLine = newTrace as TraceLine;
                    traceLine.Start = structure.ToMachine(runnableModule, traceLine.Start);
                    traceLine.End   = structure.ToMachine(runnableModule, traceLine.End);
                }
                else
                {
                    TraceArc traceArc = newTrace as TraceArc;
                    traceArc.Start = structure.ToMachine(runnableModule, traceArc.Start);
                    traceArc.Mid   = structure.ToMachine(runnableModule, traceArc.Mid);
                    traceArc.End   = structure.ToMachine(runnableModule, traceArc.End);
                }
                this.traces.Add(newTrace);
            }

            LineStyle       = multiTracesCmdLine.LineStyle;
            IsWeightControl = multiTracesCmdLine.IsWeightControl;
            wholeWeight     = multiTracesCmdLine.WholeWeight;
            this.OffsetX    = multiTracesCmdLine.OffsetX;
            this.OffsetY    = multiTracesCmdLine.OffsetY;
            this.associatedMeasureHeightCmd = mhCmd;
            //this.CheckRepeat();
        }
Exemple #3
0
        public ArcCmd(RunnableModule runnableModule, ArcCmdLine arcCmdLine, MeasureHeightCmd mhCmd) : base(runnableModule, arcCmdLine)
        {
            this.Valve = arcCmdLine.Valve;
            var structure = runnableModule.CommandsModule.program.ModuleStructure;

            if (!runnableModule.CommandsModule.IsReversePattern)
            {
                start  = structure.ToMachine(runnableModule, arcCmdLine.Start);
                middle = structure.ToMachine(runnableModule, arcCmdLine.Middle);
                end    = structure.ToMachine(runnableModule, arcCmdLine.End);
                center = structure.ToMachine(runnableModule, arcCmdLine.Center);
                Degree = arcCmdLine.Degree;
            }
            else
            {
                start  = structure.ToMachine(runnableModule, arcCmdLine.End);
                middle = structure.ToMachine(runnableModule, arcCmdLine.Middle);
                end    = structure.ToMachine(runnableModule, arcCmdLine.Start);
                center = structure.ToMachine(runnableModule, arcCmdLine.Center);
                Degree = -arcCmdLine.Degree;
            }

            LineStyle       = arcCmdLine.LineStyle;
            IsWeightControl = arcCmdLine.IsWeightControl;
            weight          = arcCmdLine.Weight;
            this.associatedMeasureheightCmd = mhCmd;
        }
Exemple #4
0
        public DotCmd(RunnableModule runnableModule, DotCmdLine dotCmdLine, MeasureHeightCmd mhCmd)
            : base(runnableModule, dotCmdLine)
        {
            this.Valve = dotCmdLine.Valve;
            var structure = runnableModule.CommandsModule.program.ModuleStructure;

            position        = structure.ToMachine(runnableModule, dotCmdLine.Position);
            DotStyle        = dotCmdLine.DotStyle;
            IsWeightControl = dotCmdLine.IsWeightControl;
            Weight          = dotCmdLine.Weight;
            this.NumShots   = dotCmdLine.NumShots;
            this.IsAssign   = dotCmdLine.IsAssign;
            this.associatedMeasureHeightCmd = mhCmd;
        }
Exemple #5
0
        public NozzleCheckCmd(RunnableModule runnableModule, NozzleCheckCmdLine nozzleCheckCmdLine, MeasureHeightCmd mhCmd) : base(runnableModule, nozzleCheckCmdLine)
        {
            // 转换成机械坐标
            var structure = runnableModule.CommandsModule.program.ModuleStructure;

            position     = structure.ToMachine(runnableModule, nozzleCheckCmdLine.Position);
            DotStyle     = nozzleCheckCmdLine.DotStyle;
            modelFindPrm = nozzleCheckCmdLine.ModelFindPrm;
            GrayCheckPrm = nozzleCheckCmdLine.GrayCheckPrm;
            CheckThm     = nozzleCheckCmdLine.CheckThm;
            IsOkAlarm    = nozzleCheckCmdLine.IsOkAlarm;
            this.associatedMeasureHeightCmd = mhCmd;
            IsWeightControl  = nozzleCheckCmdLine.IsWeightControl;
            Weight           = nozzleCheckCmdLine.Weight;
            this.nozzleStyle = nozzleCheckCmdLine.NozzleStyle;
            this.isGlobal    = nozzleCheckCmdLine.isGlobal;
        }
Exemple #6
0
        public LineCmd(RunnableModule runnableModule, LineCmdLine lineCmdLine, MeasureHeightCmd mhCmd) : base(runnableModule, lineCmdLine)
        {
            this.Valve = lineCmdLine.Valve;
            var    structure = runnableModule.CommandsModule.program.ModuleStructure;
            PointD start, end;

            this.lineCmdLine = lineCmdLine;
            if (!runnableModule.CommandsModule.IsReversePattern)
            {
                foreach (LineCoordinate line in lineCmdLine.LineCoordinateList)
                {
                    start = structure.ToMachine(runnableModule, line.Start);
                    end   = structure.ToMachine(runnableModule, line.End);
                    LineCoordinate newLine = new LineCoordinate(start, end);
                    newLine.Weight     = line.Weight;
                    newLine.LineStyle  = line.LineStyle;
                    newLine.LookOffset = line.LookOffset;//偏移量
                    lineCoordinateList.Add(newLine);
                }
            }
            else
            {
                List <LineCoordinate> lineCoordinateRevs = new List <LineCoordinate>();
                lineCoordinateRevs.AddRange(lineCmdLine.LineCoordinateList);
                lineCoordinateRevs.Reverse();
                foreach (LineCoordinate line in lineCoordinateRevs)
                {
                    start = structure.ToMachine(runnableModule, line.End);
                    end   = structure.ToMachine(runnableModule, line.Start);
                    LineCoordinate newLine = new LineCoordinate(start, end);
                    newLine.Weight         = line.Weight;
                    newLine.LineStyle      = line.LineStyle;
                    newLine.LookOffsetRevs = line.LookOffsetRevs;//偏移量
                    lineCoordinateList.Add(newLine);
                }
            }

            LineStyle       = lineCmdLine.LineStyle;
            IsWeightControl = lineCmdLine.IsWeightControl;
            wholeWeight     = lineCmdLine.WholeWeight;
            this.associatedMeasureHeightCmd = mhCmd;

            this.CheckRepeat();
        }
Exemple #7
0
 public FinishShotCmd(RunnableModule runnableModule, FinishShotCmdLine dotCmdLine, MeasureHeightCmd mhCmd) : base(runnableModule, dotCmdLine, mhCmd)
 {
 }
Exemple #8
0
 public CircleCmd(RunnableModule runnableModule, CircleCmdLine circleCmdLine, MeasureHeightCmd mhCmd)
     : base(runnableModule, circleCmdLine, mhCmd)
 {
 }
Exemple #9
0
        public SymbolLinesCmd(RunnableModule runnableModule, SymbolLinesCmdLine symbolLinesCmdLine /*, MeasureHeightCmd mhCmd*/) : base(runnableModule, symbolLinesCmdLine)
        {
            this.Valve = symbolLinesCmdLine.Valve;
            var structure = runnableModule.CommandsModule.program.ModuleStructure;

            this.symbols  = new List <SymbolLine>();
            this.arcSpeed = symbolLinesCmdLine.ArcSpeed;
            foreach (SymbolLine symbolLine in symbolLinesCmdLine.Symbols)
            {
                //此处计算轨迹旋转角没用,轨迹执行时再计算每段轨迹的起始角度和结束角度
                SymbolLine newSymbolLine = symbolLine.Clone() as SymbolLine;
                for (int i = 0; i < newSymbolLine.symbolPoints.Count; i++)
                {
                    newSymbolLine.symbolPoints[i] = structure.ToMachine(runnableModule, newSymbolLine.symbolPoints[i]);
                }
                this.symbols.Add(newSymbolLine);
            }
            // 添加每一段需要的测高
            for (int i = 0; i < this.symbols.Count; i++)
            {
                ////轨迹首点测高
                //if (i == 0)
                //{
                //    MeasureHeightCmd mhCmd = new MeasureHeightCmd(runnableModule, symbolLinesCmdLine.BindMHCmdLine);
                //    mhCmd.Position.X = this.symbols[i].symbolPoints[0].X;
                //    mhCmd.Position.Y = this.symbols[i].symbolPoints[0].Y;
                //    this.symbols[i].MHCmdList.Add(mhCmd);
                //}
                //if (this.symbols[i].symbolType != SymbolType.Arc)
                //{
                //    for (int j = 0; j < this.symbols[i].MHCount; j++)
                //    {
                //        PointD newPosition = SymbolLineMathTools.GetScalePointOnLine(this.symbols[i].symbolPoints[0], this.symbols[i].symbolPoints[1], (double)(j+1) / this.symbols[i].MHCount);
                //        MeasureHeightCmd mhCmd = new MeasureHeightCmd(runnableModule, symbolLinesCmdLine.BindMHCmdLine);
                //        mhCmd.Position.X = newPosition.X;
                //        mhCmd.Position.Y = newPosition.Y;
                //        this.symbols[i].MHCmdList.Add(mhCmd);
                //    }
                //}


                //圆弧测高只测圆弧的中点
                if (this.symbols[i].symbolType == SymbolType.Arc)
                {
                    MeasureHeightCmd mhCmd = new MeasureHeightCmd(runnableModule, symbolLinesCmdLine.BindMHCmdLine);
                    mhCmd.Position.X = this.symbols[i].symbolPoints[1].X;
                    mhCmd.Position.Y = this.symbols[i].symbolPoints[1].Y;
                    this.symbols[i].MHCmdList.Add(mhCmd);
                }
                else
                {
                    for (int j = 0; j < this.symbols[i].MHCount; j++)
                    {
                        PointD           newPosition = SymbolLineMathTools.GetScalePointOnLine(this.symbols[i].symbolPoints[0], this.symbols[i].symbolPoints[1], (double)(j + 1) / (this.symbols[i].MHCount + 1));
                        MeasureHeightCmd mhCmd       = new MeasureHeightCmd(runnableModule, symbolLinesCmdLine.BindMHCmdLine);
                        mhCmd.Position.X = newPosition.X;
                        mhCmd.Position.Y = newPosition.Y;
                        this.symbols[i].MHCmdList.Add(mhCmd);
                    }
                }
            }

            this.LineParam = this.RunnableModule.CommandsModule.Program.ProgramSettings.GetLineParam(symbolLinesCmdLine.LineStyle);

            this.OffsetX = symbolLinesCmdLine.OffsetX;
            this.OffsetY = symbolLinesCmdLine.OffsetY;
        }
Exemple #10
0
 public DoMultipassCmd(RunnableModule runnableModule, RunnableModule associatedRunnableModule, MeasureHeightCmd mhCmd) : base(runnableModule)
 {
     this.associatedRunnableModule   = associatedRunnableModule;
     this.associatedMeasureheightCmd = mhCmd;
 }