public CommandConsole(string defaultPrompt)
            : base(defaultPrompt)
        {
            Commands = new Commands();

            Commands.AddCommand(
                "Help", false, "help", "help [<item>]",
                "Display help on a particular command or on a list of commands in a category", Help);
        }
Ejemplo n.º 2
0
        private void LoadPenUp()
        {
            if (LoadOptions.PenMoveType == LoadOptions.PenType.ZMove)
            {
                var r = new G00Command();
                if (LoadOptions.EngravePosInParameter)
                {
                    r.AddVariableParam('Z', "1", false);
                }
                else
                {
                    r.AddVariable('Z', LoadOptions.EngravePosUp);
                }

                Commands.AddCommand(r);
            }
            else // if (LoadOptions.PenMoveType == LoadInfo.PenType.Command)
            {
                LaserOff();
            }

            FinishCamBamPLine();
        }
Ejemplo n.º 3
0
        public override void Load()
        {
            PreLoad();
            var list = ReadHpglCommandList();

            RemoveFirstPenUp(list);
            RemoveLastPenUp(list);
            Smooth.CalculateAngles(list, null);

            if (LoadOptions.AutoScale)
            {
                var autoScale = new AutoScale
                {
                    LoadOptions = LoadOptions,
                    LoadX       = this
                };

                autoScale.AutoScaleList(list);
            }

            if (LoadOptions.SmoothType != LoadOptions.SmoothTypeEnum.NoSmooth)
            {
                var smooth = new Smooth
                {
                    LoadOptions = LoadOptions,
                    LoadX       = this
                };

                list = smooth.SmoothList(list);
            }

            if (LoadOptions.ConvertType != LoadOptions.ConvertTypeEnum.NoConvert)
            {
                var invert = new InvertLine
                {
                    LoadOptions = LoadOptions,
                    LoadX       = this
                };

                list = invert.ConvertInvert(list);
            }

            AddComment("PenMoveType", LoadOptions.PenMoveType.ToString());

            switch (LoadOptions.PenMoveType)
            {
            case LoadOptions.PenType.CommandString:
                AddCommentForLaser();
                break;

            case LoadOptions.PenType.ZMove:
                AddComment("PenDownSpeed", LoadOptions.EngraveDownSpeed);
                AddComment("PenUpPos", LoadOptions.EngravePosUp);
                AddComment("PenDownPos", LoadOptions.EngravePosDown);
                break;
            }

            AddComment("Speed", LoadOptions.MoveSpeed.ToString());

            if (LoadOptions.PenMoveType == LoadOptions.PenType.ZMove)
            {
                AddCommands("M3");

                if (LoadOptions.EngravePosInParameter)
                {
                    Commands.AddCommand(
                        new SetParameterCommand
                    {
                        ParameterNo = 1,
                        GCodeAdd    = LoadOptions.EngravePosUp.ToString(CultureInfo.InvariantCulture)
                    });
                    Commands.AddCommand(
                        new SetParameterCommand
                    {
                        ParameterNo = 2,
                        GCodeAdd    = LoadOptions.EngravePosDown.ToString(CultureInfo.InvariantCulture)
                    });
                }
            }

            if (LoadOptions.MoveSpeed.HasValue)
            {
                var setSpeed = new G01Command();
                setSpeed.AddVariable('F', LoadOptions.MoveSpeed.Value);
                Commands.Add(setSpeed);
            }

            foreach (var cmd in list)
            {
                if (!Command(cmd))
                {
                    Commands.Clear();
                    break;
                }
            }

            if (!_lastIsPenUp)
            {
                LoadPenUp();
            }

            if (LoadOptions.PenMoveType == LoadOptions.PenType.ZMove)
            {
                AddCommands("M5");
            }

            PostLoad();
        }
 public TPasswordEditor()
 {
     Commands.AddCommand("Save", Save, () => CanSave);
 }
Ejemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 public VmQuClient()
 {
     Commands.AddCommand("DoSendRequest", DoSendRequest);
 }
 public TDisablePersonalPin()
 {
     Commands.AddCommand("Apply", Apply, () => CanSave);
     Commands.AddCommand("ErrorOK", ErrorOK);
 }
Ejemplo n.º 7
0
 public TSetupPage6(TSetupWizard parent, double progressPercent) : base(parent, progressPercent)
 {
     Commands.AddCommand("Apply", Apply, () => CanApply);
 }
Ejemplo n.º 8
0
 /// <summary>
 ///
 /// </summary>
 public VmQuServer()
 {
     Commands.AddCommand("DoConnect", x => ThreadPool.QueueUserWorkItem(y => DoConnect()));
     Commands.AddCommand("DoActiveSensed", x => ThreadPool.QueueUserWorkItem(y => DoActiveSensed()));
     Commands.AddCommand("DoReplyGetSystemState", x => DoReplyGetSystemState());
 }
 public TPersonalPinEditor()
 {
     Commands.AddCommand("Apply", Apply);
     Commands.AddCommand("ErrorOK", ErrorOK);
 }
Ejemplo n.º 10
0
 public TRequireAnApplicationPassword()
 {
     Commands.AddCommand("Apply", Apply);
 }
Ejemplo n.º 11
0
 public TNewDeviceAddingPage2(TWizard parent, double progressPercent) : base(parent, progressPercent)
 {
     Commands.AddCommand("ErrorOK", ErrorOK);
     IsConnecting = false;
 }
 public TSetupPersonalPin()
 {
     Commands.AddCommand("Apply", Apply);
     Commands.AddCommand("ErrorOK", ErrorOK);
 }
Ejemplo n.º 13
0
 public TApplicationPasswordEditor()
 {
     Commands.AddCommand("Apply", Apply);
 }
Ejemplo n.º 14
0
 public TExtention07()
 {
     // HIOStaticValues.AdminExtention.ShowOnly(this);
     Commands.AddCommand("Apply", Apply);
 }
Ejemplo n.º 15
0
        private bool Command(HpglCommand cmd)
        {
            bool isPenUp = true;

            if (cmd.IsPenCommand)
            {
                switch (cmd.CommandType)
                {
                case HpglCommand.HpglCommandType.PenDown:
                    isPenUp = false;
                    break;

                case HpglCommand.HpglCommandType.PenUp:
                    isPenUp = true;
                    break;
                }

                Point3D pt = Adjust(cmd.PointTo);

                if (isPenUp != _lastIsPenUp)
                {
                    if (isPenUp)
                    {
                        LoadPenUp();
                    }
                    else
                    {
                        LoadPenDown(Adjust(cmd.PointFrom));
                    }

                    _lastIsPenUp = isPenUp;
                }

                string  hpglCmd;
                Command r;
                if (isPenUp)
                {
                    r       = new G00Command();
                    hpglCmd = "PU";
                }
                else
                {
                    r = new G01Command();
                    AddCamBamPoint(pt);
                    hpglCmd = "PD";
                }

                r.AddVariable('X', pt.X0, false);
                r.AddVariable('Y', pt.Y0, false);
                if (_needSpeed)
                {
                    _needSpeed = false;
                    r.AddVariable('F', LoadOptions.MoveSpeed ?? 0);
                }

                Commands.AddCommand(r);

                r.ImportInfo = $"{hpglCmd}{(int)(pt.X0 * 40.0)},{(int)(pt.Y0 * 40.0)}";
            }
            else
            {
                var r = new GxxCommand();
                r.SetCode($";Hpgl={cmd.CommandString}");
                r.ImportInfo = cmd.CommandString;
                Commands.AddCommand(r);
            }

            return(true);
        }
 public void Initialize(IConfigSource source)
 {
     m_commands.AddCommand("Help", false, "help", "help [<item>]",
                           "Display help on a particular command or on a list of commands in a category", Help);
 }
Ejemplo n.º 17
0
 public TMagicLockManager(TTabManager parent) : base(parent)
 {
     Users = new ObservableCollection <TUser>();
     Commands.AddCommand("ChangePassword", ChangePassword);
 }
 public void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn)
 {
     m_commands.AddCommand(module, shared, command, help, longhelp, fn);
 }
Ejemplo n.º 19
0
 public TWizard()
 {
     Commands.AddCommand("ErrorOK", ErrorOK);
     ProgressAnimationDuration = 1500;
 }