public HomeAutomationNetworkContext(RoomieEngine engine, ThreadPool threadPool, IDeviceHistory deviceHistory, INetworkHistory networkHistory) { _engine = engine; ThreadPool = threadPool; //TODO: ninject? History = new MasterHistory(deviceHistory, networkHistory); Triggers = new TriggerCollection(); }
public MainWindow() { InitializeComponent(); _engine = new RoomieEngine(); Events = new ObservableCollection <RoomieEvent>(); _engine.ScriptMessageSent += engine_ScriptMessageSent; _engine.EngineStateChanged += _engine_EngineStateChanged; EventListing.ItemsSource = Events; AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException; }
public WebHookEngine(RoomieEngine roomieController, string computerName, string apiBaseUrl, string accessKey, string encryptionKey) { this.roomieController = roomieController; this.computerName = computerName; string threadPoolName = "Web Hook (to " + apiBaseUrl + ")"; this.threadPool = roomieController.CreateThreadPool(threadPoolName); this.running = false; apiClient = new RoomieApiClient(apiBaseUrl, accessKey); }
static void Main(string[] args) { var engine = new RoomieEngine(); setOutput(engine); //engine.TerminalMessageSent += new TerminalOutputEventHandler(controller_TerminalMessageSent); engine.Start(); var line = ""; var input = ""; var xmlInput = new XmlDocument(); //TODO: improve this. Make the while loop directly depend on the engine's internal state. while (!input.Contains("Core.ShutDown")) { //TODO: pull reading from a text stream into Roomie.Desktop.Engine.RoomieEngine line = Console.ReadLine().Trim(); if (!String.IsNullOrEmpty(line)) { if (input.Length > 0) { input += "\n"; } input += line.TrimEnd('_'); //TODO: read multiple lines if (!line.EndsWith("_")) { try { var script = ScriptCommandList.FromText(input); engine.Threads.AddCommands(script); Console.WriteLine("Command accepted."); input = ""; } catch (Exception exception) { Console.WriteLine("Error. " + exception.Message); } } } else { if (input != "") { input = ""; Console.WriteLine("Input cleared."); } } } }
protected override void OnStart(string[] args) { engine = new RoomieEngine(); engine.Start(); }
public SpeechResponder(RoomieEngine engine) { RegisteredCommands = new Dictionary <string, ScriptCommandList>(); _speechRecognizer = new NamedSpeechRecognizer(TimeSpan.FromSeconds(10), "Roomie"); ThreadPool = engine.CreateThreadPool("Speech Recognizer"); }
static void setOutput(RoomieEngine engine) { var streamWriter = new RoomieEventTextStream(engine, Console.Out, new TimeSpan(hours: 0, minutes: 0, seconds: 30)); }
public HomeAutomationNetworkContext(RoomieEngine engine, ThreadPool threadPool) : this(engine, threadPool, new DeviceHistory(), new NetworkHistory()) { }