Esempio n. 1
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);
        }
Esempio n. 2
0
        public static void Get()
        {
            Comms.com.DataReceived += new DataReceivedHandler(GrblParserState.Process);

            Comms.com.PurgeQueue();
            Comms.com.WriteCommand(GrblConstants.CMD_GETPARSERSTATE);

            while (Comms.com.CommandState == Comms.State.DataReceived || Comms.com.CommandState == Comms.State.AwaitAck)
            {
                Application.DoEvents();
            }

            Comms.com.DataReceived -= GrblParserState.Process;

            GrblInfo.LatheXMode = GrblParserState.IsActive("G7") == null ? LatheMode.Radius : LatheMode.Diameter;
        }