Beispiel #1
0
        void Awake()
        {
            sunMove    = new SunMove();
            pSim       = new PlanetSimulator(5, 10, SunFunction, sunAngle, angularVelocity);
            simDisplay = new SimulatorDisplay(pSim, DisplayMapType.PRESSURE_MAP);
            aRenderer  = new AxisRenderer();
            debug      = new DebugGUI(pSim);
            //cloudSystem = new CloudSystem(pSim);

            pSim.bufferFlip += simDisplay.OnBufferChange;


            if (mainCamera == null)
            {
                mainCamera = GameObject.Find("Main Camera");
                SetCamera();
            }
        }
Beispiel #2
0
        //private void OnBrowseManifest(object sender, ExecutedRoutedEventArgs e)
        //{
        //    var dlg = new OpenFileDialog();
        //    if (curManifest != null && curManifest.Length > 0)
        //        dlg.FileName = curManifest;
        //    dlg.DefaultExt = ".manifest.xml";
        //    dlg.Filter = "DSS Manifest (.manifest.xml)|*.manifest.xml";
        //    if (dlg.ShowDialog(this) == true)
        //    {
        //        lock (connectionThreadLock)
        //        {
        //            curManifest = dlg.FileName;
        //            if (connectionThread == null || connectionThread.IsAlive == false)
        //            {
        //                connectionThread = new Thread(new ThreadStart(delegate() { connect(); }));
        //                connectionThread.Start();
        //            }
        //        }
        //    }
        //}

        //private void ToggleConnect(object sender, RoutedEventArgs e)
        //{
        //    if (curManifest == null || curManifest.Length <= 0)
        //        BrowseManifest(sender, e);

        //    lock (connectionThreadLock)
        //    {
        //        if (connectionThread == null || connectionThread.IsAlive == false)
        //        {
        //            connectionThread = new Thread(new ThreadStart(delegate() { connect(); }));
        //            connectionThread.Start();
        //        }
        //    }
        //}

        private void OnInitialized(object sender, EventArgs e)
        {
            try
            {
                Robot.RobotStateChangeEvent += OnRobotStateChange;

                commandWindow.StartScripting();
                commandWindow.PythonExecuting +=
                    delegate(object source, EventArgs e2)
                {
                    Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                                      new ThreadStart(delegate() { topBar.IsRunning = true; }));
                };
                commandWindow.PythonFinished +=
                    delegate(object source, EventArgs e2)
                {
                    Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                                      new ThreadStart(delegate() { topBar.IsRunning = false; }));
                };
                editor = new Editor(this);
                editor.InsertedEditor  += OnEditorInserted;
                editor.RemovedEditor   += OnEditorRemoved;
                editor.ActivatedEditor += OnEditorActivated;
                editor.ModifiedChanged += OnEditorNameChanged;
                editor.NameChanged     += OnEditorNameChanged;
                //SetButtonsEnabled();

                editor.RequestNewDocument();

                webcamDisplay.StartUpdate();

                simDisplay = new SimulatorDisplay();
                simDisplay.SimulatorFound += OnFoundSimulator;
                simDisplay.Start();
            }
            catch (Exception err)
            {
                GUIUtilities.ReportUnexpectedException(err);
            }
        }