Beispiel #1
0
        public NcMachine(ControllerType controllerType, MachineGeometry machineGeometry)
        {
            ControllerType  = controllerType;
            MachineGeometry = machineGeometry;

            HomePosition         = new MachinePosition();
            ProgStartPosition    = new MachinePosition();
            MachineCode          = new CNCMachineCode();
            commandDictionary    = new CommandDictionary();
            FeedrateUnits        = FeedrateUnits.InPerMin;
            InverseFeedrateUnits = FeedrateUnits.InverseMins;
        }
        public override string AsNcString(INcMachine ncMachine)
        {
            try
            {
                string line = ncMachine.MachineCode.LineNumberPrefix + LineNumber.ToString() + " ";

                if (Feedrate.Inverted)
                {
                    line += ncMachine.MachineCode.InverseFeed + " ";
                }
                line += ncMachine.MoveGCode(this.moveType, this.blockType) + " ";
                line += MachinePosition.AsNcString(ncMachine, prevPosition, blockType, moveType) + " " + Feedrate.AsNcString(ncMachine);
                return(line);
            }
            catch (Exception)
            {
                throw;
            }
        }