public ProgramManager(HomeGenieService hg) { homegenie = hg; macroRecorder = new MacroRecorder(this); scheduler = new SchedulerService(this); scheduler.Start(); }
public CSharpAppFactory(HomeGenieService hg) { homegenie = hg; masterControlProgram = homegenie.ProgramEngine; //AppDomain currentDomain = AppDomain.CurrentDomain; //currentDomain.AssemblyResolve += new ResolveEventHandler(AssemblyLookup); }
public NetHelper(HomeGenieService hg) { homegenie = hg; // TODO: SSL connection certificate validation // TODO: this is just an hack not meant to be used in production enviroment ServicePointManager.ServerCertificateValidationCallback = Validator; }
public ProgramEngine(HomeGenieService hg) { homegenie = hg; scriptingHost = new CSharpAppFactory(homegenie); macroRecorder = new MacroRecorder(this); scheduler = new SchedulerService(this); scheduler.Start(); }
public void SetHost(HomeGenieService hg, int programId) { homegenie = hg; netHelper = new NetHelper(homegenie); programHelper = new ProgramHelper(homegenie, programId); eventsHelper = new EventsHelper(homegenie, programId); serialPortHelper = new SerialPortHelper(); tcpClientHelper = new TcpClientHelper(); schedulerHelper = new SchedulerHelper(homegenie); }
static void Main(string[] args) { AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper; AppDomain.CurrentDomain.SetupInformation.ShadowCopyFiles = "true"; Console.CancelKeyPress += new ConsoleCancelEventHandler(Console_CancelKeyPress); _homegenie = new HomeGenieService(); do { System.Threading.Thread.Sleep(2000); } while (_isrunning); }
// if setup has been done public ProgramHelper(HomeGenieService hg, int programId) { homegenie = hg; myProgramId = programId; // //var oldModule = homegenie.VirtualModules.Find(rm => rm.ParentId == myProgramId.ToString() && rm.Address == myProgramId.ToString()); //if (oldModule == null) //{ // AddControlWidget(""); // no control widget --> not visible //} // reset features and other values Reset(); }
private static void ShutDown() { Console.Write("HomeGenie is now exiting...\n"); // if (_homegenie != null) { _homegenie.Stop(); _homegenie = null; } // int exitCode = 0; if (_restart) { exitCode = 1; Console.Write("\n\n...RESTART!\n\n"); } else { Console.Write("\n\n...QUIT!\n\n"); } // Environment.Exit(exitCode); }
protected override void OnStart(string[] args) { base.OnStart(args); // hg = new HomeGenie.Service.HomeGenieService(); hg.LogEventAction += new Action <HomeGenie.Data.LogEntry>(hg_LogEventAction); hg.Start(); if (hgmanagerservice != null) { hgmanagerservice.Close(); } // Create a ServiceHost for the CalculatorService type and // provide the base address. ManagerService mgs = new ManagerService(); hgmanagerservice = new ServiceHost(mgs); // Open the ServiceHostBase to create listeners and start // listening for messages. hgmanagerservice.Open(); // mgs.SetHomeGenieHost(hg); }
internal void SetHomeGenieHost(HomeGenie.Service.HomeGenieService hg) { homegenie = hg; }
public BackupManager(HomeGenieService hg) { homegenie = hg; }
public void SetHost(HomeGenieService hg) { (this as IProgramEngine).Unload(); homegenie = hg; (this as IProgramEngine).Load(); }
//private HomeGenieService homegenie = null; public CSharpAppFactory(HomeGenieService hg) { //homegenie = hg; }
// TODO: add automatic interval check and "UpdateAvailable", "UpdateChecking" events public UpdateChecker(HomeGenieService hg) { homegenie = hg; // checkInterval = new Timer(1000 * 60 * 60 * 24); // 24 hours interval between update checks checkInterval.AutoReset = true; checkInterval.Elapsed += checkInterval_Elapsed; // remoteUpdates = new List<ReleaseInfo>(); }
public void SetHost(HomeGenieService hg) { homegenie = hg; // force ScriptingHost assignment this.Type = codeType; }
public NetHelper(HomeGenieService hg) { ServicePointManager.ServerCertificateValidationCallback = Validator; homegenie = hg; }
public WizardEngine(HomeGenieService homegenie) { this.homegenie = homegenie; }
public Automation(HomeGenieService hg) { homegenie = hg; }
public ModulesManager(HomeGenieService hg) { homegenie = hg; }
public void SetHost(HomeGenieService hg, SchedulerItem item) { homegenie = hg; schedulerItem = item; Reset(); netHelper = new NetHelper(homegenie); serialPortHelper = new SerialPortHelper(); tcpClientHelper = new TcpClientHelper(); udpClientHelper = new UdpClientHelper(); mqttClientHelper = new MqttClientHelper(); knxClientHelper = new KnxClientHelper(); schedulerHelper = new SchedulerHelper(homegenie); programHelper = new ProgramHelperBase(homegenie); }
public PackageManager(HomeGenieService hg) { homegenie = hg; widgetBasePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html", "pages", "control", "widgets"); }
public ModuleHelper(HomeGenieService hg, Module module) : base(hg) { this.module = module; }
public VirtualMeter(HomeGenieService hg) { homegenie = hg; Start(); }
public EventsHelper(HomeGenieService hg, int programId) { homegenie = hg; myProgramId = programId; }
public SettingsHelper(HomeGenieService hg) { homegenie = hg; }
static void Main(string[] args) { AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper; Console.OutputEncoding = Encoding.UTF8; /* Change current culture CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US"); System.Threading.Thread.CurrentThread.CurrentCulture = culture; System.Threading.Thread.CurrentThread.CurrentUICulture = culture; */ var os = Environment.OSVersion; var platform = os.Platform; // TODO: run "uname" to determine OS type if (platform == PlatformID.Unix) { var libusblink = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "libusb-1.0.so"); // RaspBerry Pi armel dependency check and needed symlink // TODO: check for armhf version if (File.Exists("/lib/arm-linux-gnueabi/libusb-1.0.so.0.1.0") && !File.Exists(libusblink)) { ShellCommand("ln", " -s \"/lib/arm-linux-gnueabi/libusb-1.0.so.0.1.0\" \"" + libusblink + "\""); } // Debian/Ubuntu 64bit dependency and needed symlink check if (File.Exists("/lib/x86_64-linux-gnu/libusb-1.0.so.0") && !File.Exists(libusblink)) { ShellCommand("ln", " -s \"/lib/x86_64-linux-gnu/libusb-1.0.so.0\" \"" + libusblink + "\""); } // lirc var liblirclink = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "liblirc_client.so"); if (File.Exists("/usr/lib/liblirc_client.so") && !File.Exists(liblirclink)) { ShellCommand("ln", " -s \"/usr/lib/liblirc_client.so\" \"" + liblirclink + "\""); } else if (File.Exists("/usr/lib/liblirc_client.so.0") && !File.Exists(liblirclink)) { ShellCommand("ln", " -s \"/usr/lib/liblirc_client.so.0\" \"" + liblirclink + "\""); } // video 4 linux interop if (Raspberry.Board.Current.IsRaspberryPi) { ShellCommand("cp", " -f \"" + Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "v4l/raspbian_libCameraCaptureV4L.so") + "\" \"" + Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "libCameraCaptureV4L.so") + "\""); // //if (File.Exists("/usr/lib/libgdiplus.so") && !File.Exists("/usr/local/lib/libgdiplus.so")) //{ // ShellCommand("ln", " -s \"/usr/lib/libgdiplus.so\" \"/usr/local/lib/libgdiplus.so\""); //} } else // fallback (ubuntu and other 64bit debians) { string v4lfile = "v4l/debian64_libCameraCaptureV4L.so.gd3"; if (!File.Exists("/usr/lib/x86_64-linux-gnu/libgd.so.3")) { v4lfile = "v4l/debian64_libCameraCaptureV4L.so"; } ShellCommand( "cp", " -f \"" + Path.Combine( AppDomain.CurrentDomain.BaseDirectory, v4lfile ) + "\" \"" + Path.Combine( AppDomain.CurrentDomain.BaseDirectory, "libCameraCaptureV4L.so" ) + "\"" ); } // var lircrcFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), ".lircrc"); if (!File.Exists(lircrcFile)) { var lircrc = "begin\n" + " prog = homegenie\n" + " button = KEY_1\n" + " repeat = 3\n" + " config = KEY_1\n" + "end\n"; try { File.WriteAllText(lircrcFile, lircrc); } catch { } } } // Console.CancelKeyPress += new ConsoleCancelEventHandler(Console_CancelKeyPress); // AppDomain.CurrentDomain.SetupInformation.ShadowCopyFiles = "true"; // _homegenie = new HomeGenieService(); // do { System.Threading.Thread.Sleep(2000); } while (_isrunning); }
public SchedulerHelper(HomeGenieService hg) { homegenie = hg; }
internal void SetHomeGenieHost(HomeGenie.Service.HomeGenieService hghost) { _hghost = hghost; }