예제 #1
0
        private static void LoadSettings()
        {
            UpsAction                 = Settings.Default.upsAction;
            ShutdownAction            = Settings.Default.shutdownAction;
            ShutdownVoltage           = float.Parse(Settings.Default.shutdownVoltage, CultureInfo.InvariantCulture.NumberFormat);
            SecondsTillShutdownAction = Convert.ToInt32(Settings.Default.shutdownActionTimeout);
            BatteryVoltageMax         = float.Parse(Settings.Default.batteryVoltage_max, CultureInfo.InvariantCulture.NumberFormat);
            BatteryVoltageMin         = float.Parse(Settings.Default.batteryVoltage_min, CultureInfo.InvariantCulture.NumberFormat);
            BatteryVoltageMaxOnLoad   = float.Parse(Settings.Default.batteryVoltage_maxOnLoad, CultureInfo.InvariantCulture.NumberFormat);
            UpsVA = float.Parse(Settings.Default.upsVA, CultureInfo.InvariantCulture.NumberFormat);

            for (int i = 0; i < 60; i++) //заполнение у графика оси Y (напряжения) нулями
            {
                InputVoltageHistory.Enqueue(0);
                OutputVoltageHistory.Enqueue(0);
            }
        }
예제 #2
0
 public void LogMessage(string text, Color color)
 {
     LogMessages.Enqueue($"<color=#{ColorUtility.ToHtmlStringRGB(color)}>{text}");
     LogText.Clear();
     foreach (var s in LogMessages)
     {
         LogText.AppendLine(s);
     }
     Log.text = LogText.ToString();
 }