Exemple #1
0
 public SolutionController(Solution solution, SolutionWindow solutionWindow, AnomalyController controller, PropertiesEditor objectEditor)
 {
     this.controller     = controller;
     this.solution       = solution;
     this.solutionWindow = solutionWindow;
     solutionWindow.setSolution(solution);
     this.objectEditor = objectEditor;
     solutionWindow.InterfaceChosen += solutionWindow_InterfaceChosen;
     controller.SelectionController.OnSelectionChanged += SelectionController_OnSelectionChanged;
 }
Exemple #2
0
        /// <summary>
        /// Calculate and Dsiplay the Solution
        /// </summary>
        /// <param name="displayFormula"></param>
        /// <param name="output"></param>
        /// <param name="val1"></param>
        /// <param name="val2"></param>
        internal void CalculateAndDisplayTrigAnswer(bool displayFormula, bool output, double val1, double val2)
        {
            double answer;
            string formula, answerContext;

            answer = CalculateAnswer(output, val1, val2);

            formula = BuildFormula(displayFormula);

            answerContext = BuildAnswerContext(output);

            SolutionWindow solutionForm = new SolutionWindow(new SolutionInfo(answer, formula, answerContext));

            solutionForm.ShowDialog();
        }
Exemple #3
0
        private IEnumerable <IdleStatus> finishInitialization()
        {
            splashScreen.updateStatus(10, "Loading Solution");
            yield return(IdleStatus.Ok);

            //Load the config file and set the resource root up.
            VirtualFileSystem.Instance.addArchive(solution.ResourceRoot);

            resourceController = new ResourceController(this);

            solution.loadExternalFiles(this);

            MyGUIPlugin.ResourceManager.Instance.load("Anomaly.Resources.AnomalyImagesets.xml");

            //Initialize controllers
            instanceBuilder = new InstanceBuilder();
            sceneController.initialize(this);
            sceneController.OnSceneLoaded    += sceneController_OnSceneLoaded;
            sceneController.OnSceneUnloading += sceneController_OnSceneUnloading;
            simObjectController = new SimObjectController(this);

            fixedUpdate = new FullSpeedUpdateListener(sceneController);
            mainTimer.addUpdateListener(fixedUpdate);

            splashScreen.updateStatus(60, "Creating GUI");
            yield return(IdleStatus.Ok);

            propertiesEditor = new PropertiesEditor("Properties", "Anomaly.GUI.Properties", false);
            guiManager.addManagedDialog(propertiesEditor);

            interfaceRenderer = new EditInterfaceRendererController(pluginManager.RendererPlugin, mainTimer, sceneController, propertiesEditor);

            solutionWindow = new SolutionWindow();
            guiManager.addManagedDialog(solutionWindow);

            mainObjectEditor = new PropertiesEditor("Object Editor", "Anomaly.GUI.ObjectEditor", true);
            mainObjectEditor.AllowedDockLocations = DockLocation.Floating;
            mainObjectEditor.CurrentDockLocation  = DockLocation.Floating;
            guiManager.addManagedDialog(mainObjectEditor);

            solutionController = new SolutionController(solution, solutionWindow, this, propertiesEditor);

            //Initialize the windows
            propertiesEditor.AutoExpand = true;

            //Create GUI
            consoleWindow = new LogWindow();
            guiManager.addManagedDialog(consoleWindow);
            Log.Default.addLogListener(consoleWindow);

            debugVisualizer = new DebugVisualizer(pluginManager, sceneController);
            guiManager.addManagedDialog(debugVisualizer);


            if (File.Exists(AnomalyConfig.WindowsFile))
            {
                ConfigFile configFile = new ConfigFile(AnomalyConfig.WindowsFile);
                configFile.loadConfigFile();
                guiManager.loadSavedUI(configFile, new Version("1.0.0.0"));

                //Show Windows Default
                solutionWindow.Visible   = true;
                propertiesEditor.Visible = true;
                consoleWindow.Visible    = true;
                debugVisualizer.Visible  = true;
            }
            else
            {
                //Show Windows Default
                solutionWindow.Visible = true;
                propertiesEditor.showRelativeTo(solutionWindow, WindowAlignment.Right);
                consoleWindow.Visible   = true;
                debugVisualizer.Visible = true;
            }

            yield return(IdleStatus.Ok);

            splashScreen.updateStatus(80, "Building Scene");

            buildScene();
            yield return(IdleStatus.Ok);

            splashScreen.updateStatus(100, "Loaded");

            splashScreen.hide();
            yield return(IdleStatus.Ok);

            if (FullyLoaded != null)
            {
                FullyLoaded.Invoke(this);
            }
        }