public RBCP_Monitor() { InitializeComponent(); pbxLogo.Image = Properties.Resources.RBCPlusBanner5; RBCP_Log.RichLog = rtbLogOutput; RBCP_Log.AddMessage(LogType.Info, "****** Monitoring Started ******"); }
private void LoadConfig() { // Init Test // Create Required Files txbStatusOutput.AppendText("[INFO]\tSearching for Config-Files...\r\n"); if (!File.Exists(@"C:\RBCPlus\config\rbcplus.ini")) { btnStartSystem.Enabled = false; btnStopSystem.Enabled = false; btnSystemMonitor.Enabled = false; btnSystemSettings.Enabled = false; RBCP_Log.AddMessage(LogType.Error, "No System Configurations Found!"); RBCP_Log.AddMessage(LogType.Blank, "Configure the System by clicking on"); RBCP_Log.AddMessage(LogType.Setup, ""); Thread.Sleep(500); } else { RBCP_Log.AddMessage(LogType.Info, "Config-File found!"); RBCP_Log.AddMessage(LogType.Blank, "Loading config..."); Thread.Sleep(500); StreamReader sr = new StreamReader(@"C:\RBCPlus\config\rbcplus.ini"); string line; string[] dataParts = new string[2]; while ((line = sr.ReadLine()) != null) { if (line.StartsWith("[")) { continue; } dataParts = line.Split('='); RBCP_Config.Set((Config)Enum.Parse(typeof(Config), dataParts[0]), dataParts[1]); RBCP_Log.AddMessage(LogType.Load, "Loading: " + dataParts[0]); Thread.Sleep(5); } sr.Close(); RBCP_Log.AddMessage(LogType.Info, "Load Completed!"); } }
private void btnSystemSetup_Click(object sender, EventArgs e) { RBCP_Setup rbcp_setup = new RBCP_Setup(); if (rbcp_setup.ShowDialog() == DialogResult.OK) { MessageBox.Show("OK"); } else { MessageBox.Show("Setup-Process has been aborted.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); RBCP_Log.AddMessage(LogType.Info, "Setup Aborted."); } }
private void btnCloseMonitor_Click(object sender, EventArgs e) { RBCP_Log.AddMessage(LogType.Info, "****** Monitoring Stopped ******"); this.Close(); }