Пример #1
0
        public async Task StartSimulationAsync(uint stepsToRun = 0)
        {
            if (CoreProxy == null)
            {
                Log.Error("Cannot start simulation, not connected to a core");
                throw new InvalidOperationException("Core proxy does not exist, cannot start");
            }

            Log.Info("Starting simulation");
            await CoreProxy.RunAsync(stepsToRun);
        }
Пример #2
0
        public async Task PerformBrainStepAsync()
        {
            if (CoreProxy == null)
            {
                Log.Error("Cannot perform brain step, not connected to a core");
                throw new InvalidOperationException("Core proxy does not exist, cannot step");
            }

            Log.Info("Performing brain step");
            await CoreProxy.RunAsync(1);
        }
Пример #3
0
        private void FinishDisconnect()
        {
            CoreState oldState = CoreProxy.State;

            UnregisterCoreEvents();

            CoreProxy.Dispose();
            CoreProxy = null;

            StateChanged?.Invoke(this, new StateChangedEventArgs(oldState, CoreState.Disconnected));
            Log.Info("Disconnected from core");
        }
Пример #4
0
        public async Task ShutdownAsync()
        {
            if (!IsConnected)
            {
                Log.Warn("Cannot shut down, not connected.");
                return;
            }

            if ((CoreProxy != null) && m_isCoreLocal)
            {
                Log.Info("Shutting down the core");
                await CoreProxy.ShutdownAsync();
            }

            AfterShutdown();
        }
Пример #5
0
 public async Task ClearBlueprintAsync()
 {
     Log.Info("Clearing blueprint");
     await CoreProxy.ClearAsync();
 }
Пример #6
0
 public async Task RunToBodyStepAsync()
 {
     Log.Info("Running to next body step");
     await CoreProxy.RunAsync(runToBodyStep : true);
 }
Пример #7
0
 public async Task PauseSimulationAsync()
 {
     Log.Info("Pausing simulation");
     await CoreProxy.PauseAsync();
 }
Пример #8
0
 private async Task SendConfigurationAsync(CoreConfiguration coreConfiguration)
 {
     Log.Info("Sending core configuration");
     await CoreProxy.SendConfigurationAsync(coreConfiguration);
 }
Пример #9
0
 public async Task LoadBlueprintAsync(string blueprint)
 {
     Log.Info("Loading blueprint");
     await CoreProxy.LoadBlueprintAsync(blueprint);
 }