コード例 #1
0
        private void Options_Click(object sender, RoutedEventArgs e)
        {
            Window setup = new SetupDialog();

            setup.Owner = this;
            if (setup.ShowDialog() ?? false)
            {
                using (new WaitCursor())
                {
                    // stop modules and dispatcher timer
                    FormManager.Default.ObjectRefreshStop();
                    ModuleManager.Default.ModulesStop();

                    // save settings if dialog result was success
                    FrameworkSettingsFile.Default.CopySettingsFrom(SetupDialog.CurrentSettings);
                    FrameworkSettingsFile.Default.Save();

                    // reload modules
                    ModuleManager.Default.ModulesLoad();
                    ModuleManager.Default.ModulesInitializeAndStart();

                    // reload startup form
                    SetupFormSettings   form_settings = FrameworkSettingsFile.Default.GetSettings <SetupFormSettings>();
                    MainGeneralSettings main_settings = FrameworkSettingsFile.Default.GetSettings <MainGeneralSettings>();

                    FormManager.Default.LoadForm(form_settings.StartupForm, main_settings.ModulesPath, main_settings.FormsPath);

                    // restart modules and dispatcher timer
                    FormManager.Default.ObjectRefreshStart();
                }
            }
        }
コード例 #2
0
        public void Load()
        {
            MainGeneralSettings settings = FrameworkSettingsFile.Default.GetSettings <MainGeneralSettings>();

            FormManager.Default.AvailableFormRefresh(settings.FormsPath);
            m_available_forms = FormManager.Default.AvailableForms;

            m_settings = SetupDialog.CurrentSettings.GetSettings <SetupFormSettings>();
        }
コード例 #3
0
        public MainWindow()
        {
            // load config file and get settings
            FrameworkSettingsFile.Default.Load();

            // load modules
            ModuleManager.Default.AddMainModule(new ModuleInterface());
            ModuleManager.Default.ModulesLoad();

            // init controls
            InitializeComponent();

            FormManager.Default.SetFormParent(FormContainer);

            // create communicators
            CreateUDPCommunicator();
            CreateUARTCommunicator();
            CreateUSBCommunicator();

            CommunicationManager.Default.PacketLogCreate("packet_log.txt");

            // create realtime objects
            CreateRealtimeObjects();

            // load startup form
            SetupFormSettings   form_settings = FrameworkSettingsFile.Default.GetSettings <SetupFormSettings>();
            MainGeneralSettings main_settings = FrameworkSettingsFile.Default.GetSettings <MainGeneralSettings>();

            FormManager.Default.LoadForm(form_settings.StartupForm, main_settings.ModulesPath, main_settings.FormsPath);

            // start modules
            ModuleManager.Default.ModulesInitializeAndStart();

            // start communication manager
            CommunicationManager.Default.Start();
        }