private static void OnTimedEvent(Object source, ElapsedEventArgs e) { if (BossWavePlugin.Instance != null) { PlugLog.WriteLog(id, dirpath, fullpath); BossWavePlugin.Instance.host.WriteLog(LogLevel.Warning, "Log updated. (Notice: \\etc\\log\\HH:mm)"); } }
public override bool Init(uint data1, uint data2) { host = mHost_; bwCommands = new BossWaveCommands(); bwItems = new List <string>(); knxItems = new Dictionary <string, int>(); /** Initializing the observers with the corresponding methods **/ knxObserver = new GenericObserver(KNXItemValueChanged); bwObserver = new GenericObserver(BWItemValueChanged); /** Loading the configuration file from the etx folder **/ using (StreamReader r = new StreamReader(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\etc\\bwconfig.json")) { config = JObject.Parse(r.ReadToEnd()); } PlugLog.EnableLogging(120000); // Enable Logging /** Initializing all the options **/ subscribeOptions = new ItemCreateOptions { Description = "Subscription", Datatype = typeof(string), AccessRights = ItemAccess.ReadWrite }; publishOptions = new ItemCreateOptions { Description = "Publishing", Datatype = typeof(string), AccessRights = ItemAccess.ReadWrite }; entityOptions = new ItemCreateOptions { Description = "Entity", Datatype = typeof(string), AccessRights = ItemAccess.ReadWrite }; bwCommands.Init(); // Connect to BossWave return(true); }
public static void Stop() { PlugLog.WriteLog(id, dirpath, fullpath); BossWavePlugin.Instance.host.WriteLog(LogLevel.Info, "Committing last log. (Notice: \\etc\\log\\HH:mm)"); }