Beispiel #1
0
        private void Window_Closed(object sender, EventArgs e)
        {
            // Reload Hotkeys so dont need to close and re-open program
            HotKeys.LoadHotKeys(); // Load Hotkeys

            Properties.Settings.Default.Save();
        }
Beispiel #2
0
        public MainWindow()
        {
            AppDomain.CurrentDomain.UnhandledException += UnhandledException;
            InitializeComponent();

            Logger.Info("++++++ 3RDD GCode Sender v{0} START ++++++", System.Reflection.Assembly.GetEntryAssembly().GetName().Version);

            // Check for any updates
            Logger.Info("Checking for Updates");
            AutoUpdater.ParseUpdateInfoEvent += AutoUpdaterOnParseUpdateInfoEvent;
            //AutoUpdater.Start("https://api.github.com/repos/3RD-Dimension/3RDD-GCode-Sender-Issues/releases/latest");

            openFileDialogGCode.FileOk += OpenFileDialogGCode_FileOk;
            saveFileDialogGCode.FileOk += SaveFileDialogGCode_FileOk;

            machine.ConnectionStateChanged += Machine_ConnectionStateChanged;

            machine.NonFatalException += Machine_NonFatalException;
            machine.Info           += Machine_Info;
            machine.LineReceived   += Machine_LineReceived;
            machine.LineReceived   += settingsWindow.LineReceived;
            machine.LineReceived   += workOffsetsWindows.parseG5xOffsets;
            machine.StatusReceived += Machine_StatusReceived;
            machine.LineSent       += Machine_LineSent;

            machine.PositionUpdateReceived += Machine_PositionUpdateReceived;
            machine.StatusChanged          += Machine_StatusChanged;
            machine.DistanceModeChanged    += Machine_DistanceModeChanged;
            machine.UnitChanged            += Machine_UnitChanged;
            machine.PlaneChanged           += Machine_PlaneChanged;
            machine.BufferStateChanged     += Machine_BufferStateChanged;
            machine.OperatingModeChanged   += Machine_OperatingMode_Changed;
            machine.FileChanged            += Machine_FileChanged;
            machine.FilePositionChanged    += Machine_FilePositionChanged;
            machine.OverrideChanged        += Machine_OverrideChanged;
            machine.PinStateChanged        += Machine_PinStateChanged;

            Machine_OperatingMode_Changed();
            Machine_PositionUpdateReceived();

            Properties.Settings.Default.SettingChanging += Default_SettingChanging;
            FileRuntimeTimer.Tick += FileRuntimeTimer_Tick;

            machine.ProbeFinished += Machine_ProbeFinished_UserOutput;

            LoadMacros();

            settingsWindow.SendLine     += machine.SendLine;
            workOffsetsWindows.SendLine += machine.SendLine;

            ButtonRestoreViewport_Click(null, null);

            HotKeys.LoadHotKeys(); // Load Hotkeys
        }