Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OpenSim_CommandEventHandler(object sender, ExecutedRoutedEventArgs e)
        {
            // Check the State of the Simulation. Only if the Simulation is stopped we can load an existing Simulation
            if (currentSimulationState != Simulation_State.Stop)
            {
                // Configure the message box to be displayed
                string           messageBoxText = "Simulation kann nicht geladen werden. Erst die Simulation stoppen.";
                string           caption        = "Simulation läuft";
                MessageBoxButton button         = MessageBoxButton.OK;
                MessageBoxImage  icon           = MessageBoxImage.Warning;

                // Display message box
                MessageBox.Show(messageBoxText, caption, button, icon);

                // Exit the Function
                return;
            }

            // Create the neded objects
            Simulation_ImportExport     mySimulationExporter = new Simulation_ImportExport();
            LinkedList <Simulation_Job> simulationJobs       = mySimulationExporter.ReadSimulationKonfiguration();

            if (simulationJobs != null)
            {
                // Clear all the Data if we loaded an Valid Data
                Jobs.Clear();

                foreach (Simulation_Job jobItem in simulationJobs)
                {
                    Jobs.Add(jobItem);
                }
            }
        }
Example #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveSim_CommandEventHandler(object sender, ExecutedRoutedEventArgs e)
        {
            // Try to exit the Edit Mode of the Cell
            JobsDataGrid.CommitEdit();
            JobsDataGrid.SelectedIndex = -1;
            JobsDataGrid.CommitEdit();

            LinkedList<Simulation_Job> simulationJobs = new LinkedList<Simulation_Job>();
            foreach (Simulation_Job jobItem in Jobs)
            {
                simulationJobs.AddLast(jobItem);
            }

            Simulation_ImportExport mySimulationExporter = new Simulation_ImportExport();
            mySimulationExporter.ExportSimulationDataToFileSystem(simulationJobs);
        }
Example #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="settings"></param>
        public Simulation_UI(string simPath)
        {
            // Init of the Class
            classInit();

            // Create the neded objects
            Simulation_ImportExport     mySimulationExporter = new Simulation_ImportExport();
            LinkedList <Simulation_Job> simulationJobs       = mySimulationExporter.ReadSimulationKonfiguration(simPath);

            if (simulationJobs != null)
            {
                // Clear all the Data if we loaded an Valid Data
                Jobs.Clear();

                foreach (Simulation_Job jobItem in simulationJobs)
                {
                    Jobs.Add(jobItem);
                }
            }
        }