コード例 #1
0
ファイル: HSPI.cs プロジェクト: lulzzz/HS3_EnOcean_Plugin
        public string InitIO(string port)
        {
            Console.WriteLine("InitIO called!");
            Thread.Sleep(5000);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
            Thread.CurrentThread.CurrentCulture   = new CultureInfo("en-US");

            mCore = new EnOceanManager(hsHost, hsHostCB, this);
            mCore.Initialize();
            hsHostCB.RegisterEventCB(Enums.HSEvent.CONFIG_CHANGE, Name, "");
            //hsHostCB.RegisterEventCB(Enums.HSEvent.LOG, Name, "");
            hsHostCB.RegisterEventCB(Enums.HSEvent.SETUP_CHANGE, Name, "");
            //hsHostCB.RegisterEventCB(Enums.HSEvent.STRING_CHANGE, Name, "");
            hsHostCB.RegisterEventCB(Enums.HSEvent.GENERIC, Name, "");

            this.mPageBuilder = new PageBuilder(hsHost, hsHostCB, this, mCore);

            hsHost.RegisterPage(Constants.PLUGIN_STRING_ID, Name, "");
            hsHost.RegisterPage(Constants.PLUGIN_STRING_ID + "_Interfaces", Name, "");

            WebPageDesc wpd = new WebPageDesc();

            wpd.link       = Constants.PLUGIN_STRING_ID;
            wpd.linktext   = "Configuration";
            wpd.page_title = "Configuration";
            wpd.plugInName = Name;
            hsHostCB.RegisterLink(wpd);
            hsHostCB.RegisterConfigLink(wpd);

            WebPageDesc wpi = new WebPageDesc();

            wpi.link       = Constants.PLUGIN_STRING_ID + "_Interfaces";
            wpi.linktext   = "Interfaces";
            wpi.page_title = "Interfaces";
            wpi.plugInName = Name;
            hsHostCB.RegisterLink(wpi);

            Console.WriteLine("INIT IO complete");
            return(""); // empty == OK
        }
コード例 #2
0
 public PageBuilder(IHSApplication pHS, IAppCallbackAPI pHSCB, HSPI_EnOcean.HSPI pluginInstance, EnOceanManager pCore)
     : base(pHS, pHSCB, pluginInstance)
 {
     mCore = pCore;
     HS = pHS;
 }