示例#1
0
        private void UpdateDisplay()
        {
            display.WriteCentered("Power management", LCDColor.Grey);
            display.Write("");
            display.WriteCentered("Solar power status", new LCDColor(1, 1, 2));
            display.Write(" Currently " + solarState.GetName());
            display.Write(" Output: " + SolarDisplay.FormatRatio(solarManager.MaxOutput, solarManager.MaxHistoricalOutput));
            display.DrawRatio(solarManager.MaxOutput, solarManager.MaxHistoricalOutput);
            display.Write("");
            display.Write("");
            display.WriteCentered("Main batteries status", new LCDColor(1, 1, 2));
            WriteBatteryStatus(mainBatteriesManager);
            display.Write("");
            display.Write("");
            display.WriteCentered("Connected batteries status", new LCDColor(1, 1, 2));
            WriteBatteryStatus(connectedBatteriesManager);
            display.Write("");
            display.Write("");
            display.WriteCentered("Time management", new LCDColor(1, 1, 2));
            TimeStruct time = dayTracker.GetTime();

            display.Write("Time of day: " + time.GetTime().ToString());
            display.Write("Length of day: " + time.GetDayLength().ToString());
            display.Write(solarManager.GetOutputHistory());
            display.Flush();
        }
示例#2
0
 private void WriteBatteryStatus(BatteryManager batteryManager)
 {
     display.Write(" Charge: " + SolarDisplay.FormatRatio(batteryManager.CurrentCharge, batteryManager.MaxCharge));
     display.DrawRatio(batteryManager.CurrentCharge, batteryManager.MaxCharge);
     display.Write(" Input: " + SolarDisplay.FormatRatio(batteryManager.CurentInput, batteryManager.MaxInput));
     display.DrawRatio(batteryManager.CurentInput, batteryManager.MaxInput);
     display.Write(" Output: " + SolarDisplay.FormatRatio(batteryManager.CurentOutput, batteryManager.MaxOutput));
     display.DrawRatio(batteryManager.CurentOutput, batteryManager.MaxOutput, true);
 }