コード例 #1
0
        // Configure to match Grbl settings (if loaded)
        public bool Config()
        {
            if (GrblSettings.Loaded)
            {
                double val;
                if (!(val = GrblSettings.GetDouble(GrblSetting.JogStepDistance)).Equals(double.NaN))
                {
                    jogDistance[(int)JogMode.Step] = val;
                }
                if (!(val = GrblSettings.GetDouble(GrblSetting.JogSlowDistance)).Equals(double.NaN))
                {
                    jogDistance[(int)JogMode.Slow] = val;
                }
                if (!(val = GrblSettings.GetDouble(GrblSetting.JogFastDistance)).Equals(double.NaN))
                {
                    jogDistance[(int)JogMode.Fast] = val;
                }
                if (!(val = GrblSettings.GetDouble(GrblSetting.JogStepSpeed)).Equals(double.NaN))
                {
                    jogSpeed[(int)JogMode.Step] = val;
                }
                if (!(val = GrblSettings.GetDouble(GrblSetting.JogSlowSpeed)).Equals(double.NaN))
                {
                    jogSpeed[(int)JogMode.Slow] = val;
                }
                if (!(val = GrblSettings.GetDouble(GrblSetting.JogFastSpeed)).Equals(double.NaN))
                {
                    jogSpeed[(int)JogMode.Fast] = val;
                }
            }

            return(GrblSettings.Loaded);
        }
コード例 #2
0
        public bool Update()
        {
            if (GrblSettings.Loaded)
            {
                xspeed  = GrblSettings.GetDouble(GrblSetting.AxisSetting_XMaxRate);
                xaccel  = GrblSettings.GetDouble(GrblSetting.AxisSetting_XAcceleration);
                zspeed  = GrblSettings.GetDouble(GrblSetting.AxisSetting_ZMaxRate);
                zaccel  = GrblSettings.GetDouble(GrblSetting.AxisSetting_ZAcceleration);
                rpm_min = GrblSettings.GetDouble(GrblSetting.RpmMin);
                rpm_max = GrblSettings.GetDouble(GrblSetting.RpmMax);

                GrblParserState.Get();

                metric = GrblParserState.IsActive("G21") != null;
                if (!xmodelock)
                {
                    xmode = GrblInfo.LatheXMode;
                }

                if (dialog != null)
                {
                    dialog.InitUI(); // use event instead?
                }
            }

            return(GrblSettings.Loaded);
        }