Ejemplo n.º 1
0
        private Machine(string pathToSettings)
        {
            Settings      = ControllerSettings.Load(pathToSettings);
            _commandQueue = new Queue <string>();

            Location = new Coordinate(0, 0, 0);
        }
Ejemplo n.º 2
0
        public static ControllerSettings Load(string fileName)
        {
            ControllerSettings settings;

            if (!File.Exists(fileName))
            {
                settings = new ControllerSettings();
            }
            else
            {
                string xml = File.ReadAllText(fileName);
                settings = XMLSerializer.DeserializeObject(xml, typeof(ControllerSettings)) as ControllerSettings;
            }

            settings._fileName = fileName;
            return(settings);
        }
Ejemplo n.º 3
0
        public static ControllerSettings Load(string fileName)
        {
            ControllerSettings settings;

            if (!File.Exists(fileName))
            {
                settings = new ControllerSettings();
            }
            else
            {
                string xml = File.ReadAllText(fileName);
                settings = XMLSerializer.DeserializeObject(xml, typeof(ControllerSettings)) as ControllerSettings;
            }

            settings._fileName = fileName;
            return settings;
        }
Ejemplo n.º 4
0
 private void Settings_Load(object sender, EventArgs e)
 {
     _settings = Machine.GetMachine().Settings;
     PopulateSettings();
 }
Ejemplo n.º 5
0
        private void Positions_Load(object sender, EventArgs e)
        {
            toolStripStatusLabel.Text = "";

            _machine = Machine.GetMachine();
            _settings = _machine.Settings;

            // Subscribe to events
            _machine.OnCommandResponse += Machine_OnCommandResponse;
            _machine.OnCommandSending += Machine_OnCommandSending;
            _machine.OnLocationChanged += Machine_OnLocationChanged;
            _machine.OnEStopNotification += Machine_OnEStopNotification;

            txtSpeed.Text = _machine.Settings.FeedRateManual.ToString();

            UpdateCurrentPositionDisplay();
            UpdateDisplayLabels();

            PopulateOffsetSetting();
        }