/// <summary> /// Disposes of this object and cleans up any dependent resources. /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: dispose managed state (managed objects). StopTimer(); // In case it's running. if (_commandTimer != null) { _commandTimer.Dispose(); } if (ChessEngineController != null) { ChessEngineController.ErrorReceived -= EngineController_ErrorReceived; ChessEngineController = null; } } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }
public void Start(IEngineController remoteController) { killLingeringProcesses(); _controller = remoteController; // Watch UseShellExecute. var start = new ProcessStartInfo { UseShellExecute = false, WorkingDirectory = _project.ProjectPath.ToFullPath(), FileName = "dotnet" }; var framework = _project.Framework; #if NET46 framework = framework ?? "net46"; #else framework = framework ?? "netcoreapp1.0"; #endif // TODO -- need to lock this down somehow start.Arguments = $"run --framework {framework} -- {_project.Port}"; _testCommand = $"dotnet run --framework {framework} -- test"; _command = $"dotnet {start.Arguments}"; _process = Process.Start(start); _process.Exited += _process_Exited; lock (_readyLock) { _agentReady = false; } Task.Delay(5.Seconds()).ContinueWith(t => { lock (_readyLock) { if (!_agentReady) { } } if (_process.HasExited) { sendFailedToStartMessage(); } }); if (_process.HasExited) { sendFailedToStartMessage(); } }
public void Start(IEngineController remoteController) { _agent = new StorytellerAgent(_project.Port, _system); _agent.Receive(new StartProject { Project = _project }); }
public VehicleFacade(IEngineController engineController, ITransmissionController transmissionController, ITractionControlController tractionControlController, ITachometerController tachometerController) { _engineController = engineController; _transmissionController = transmissionController; _tractionControlController = tractionControlController; _tachometerController = tachometerController; }
public WashMachine( IEngineController engineController, IHeaterController heaterController, IPumpController pumpController) { _engineController = engineController; _heaterController = heaterController; _pumpController = pumpController; }
public ChessterController(IEngineController engineController, ILoggerFactory loggerFactory) { _logger = loggerFactory.CreateLogger("ChessterController") ?? throw new ArgumentNullException(nameof(loggerFactory)); _logger.LogTrace("Constructing ChessterController"); if (null == engineController) { throw new ArgumentNullException(nameof(engineController)); } _uci = new UniversalChessInterface(engineController); }
public CommandRunnerTester() { theCommand = new RecordingCommand <RunSpec>(); var app = Substitute.For <IApplication>(); theRemoteController = Substitute.For <IEngineController>(); app.Engine.Returns(theRemoteController); theRunner = new CommandRunner(app, new ICommand[] { theCommand }); }
public void Start(IEngineController remoteController) { killLingeringProcesses(); _controller = remoteController; // Watch UseShellExecute. var start = new ProcessStartInfo { UseShellExecute = false, WorkingDirectory = _project.ProjectPath.ToFullPath(), FileName = "dotnet", Arguments = _project.ToAgentCommandLine() }; _testCommand = _project.ToTestCommandLine(); _command = $"dotnet {start.Arguments}"; _process = Process.Start(start); _process.Exited += _process_Exited; lock (_readyLock) { _agentReady = false; } Task.Delay(5.Seconds()).ContinueWith(t => { lock (_readyLock) { if (!_agentReady) { } } if (_process.HasExited) { sendFailedToStartMessage(); } }); if (_process.HasExited) { sendFailedToStartMessage(); } }
public void Start(IEngineController controller) { _domain = AppDomain.CreateDomain("Storyteller-SpecRunning-Domain", null, _remoteSetup.Setup); try { var proxyType = typeof(RemoteProxy); _proxy = (RemoteProxy)_domain.CreateInstanceAndUnwrap(proxyType.Assembly.FullName, proxyType.FullName); _proxy.Start(_project); } catch (Exception) { ConsoleWriter.Write(ConsoleColor.Yellow, "Storyteller was unable to start an AppDomain for the specification project. Check that the project has already been compiled."); throw; } }
public SmartMetrics(SmartResolver resolver, ExecuteEngine executeEngine) { this.resolver = resolver; engineController = executeEngine; }
void Start() => _engineController = new EngineController(TorqueWheels);
public void Initialize() { _engineController = TestflowRunner.GetInstance().EngineController; }
/// <summary> /// Performs initialization for the factory. /// </summary> /// <param name="engineController">Instance of <see cref="IEngineController"/> which will be /// associated with a command during creation so the command can receive messages from the /// chess engine.</param> public ChessCommandFactory(IEngineController engineController) { _chessEngineController = engineController; }
public void Start(IEngineController remoteController) { _agent = new StorytellerAgent(_project.Port, _system); _agent.Receive(new StartProject {Project = _project}); }
public ApplicationController(OpenInput input, IEngineController engine, IWebApplicationRunner website) { _input = input; Engine = engine; Website = website; }
public Task <BatchRunResponse> StartBatch(IEngineController controller) { var request = GetBatchRunRequest(); return(controller.Send(request).AndWaitFor <BatchRunResponse>()); }
public Task<BatchRunResponse> StartBatch(IEngineController controller) { var request = GetBatchRunRequest(); return controller.Send(request).AndWaitFor<BatchRunResponse>(); }
/// <summary> /// Performs initialization for the chess interface to the engine given the specified /// <paramref name="engineController" />. /// </summary> public UniversalChessInterface(IEngineController engineController) { Logger.LogTrace("UniversalChessInterface() with an injected engineController"); ChessEngineController = engineController; Initialize(); }