private void SetBatteryScreen() { gBattery.Update(); SetDisplayColor(lSurface[2], 100 - (int)gBattery.Percentage, ref iStateBattery); lSurface[2].WriteText(string.Format("Battery\n{0:0.0}%", gBattery.Percentage)); }
public void Update() { if (_isDisposed) { return; } Info.Update(); Battery.Update(); Processor.Update(); Memory.Update(); Network.Update(); }
static void WriteBatteryInfo() { Battery b = new Battery(); b.Update(); Console.WriteLine("Battery Information:"); Console.WriteLine("Status: \t" + b.Status); if (b.Status == BatteryStatus.Unavailable) { return; } Console.WriteLine("Charge: \t" + b.ChargePercent + " %"); Console.WriteLine("Voltage:\t" + b.CurrentVoltage + " V"); Console.WriteLine("Charge rate:\t" + b.ChargeRate + " W"); Console.WriteLine("Time remaining:\t" + b.TimeToDischarge); Console.WriteLine(); }
public void Main(string _, UpdateType updateSource) { if ((updateSource & UpdateType.Update10) != 0) { if (gCockpit.IsUnderControl) { gBattery.Update(); gSurface.WriteText(string.Format(sFormat, gBattery.CurrentPower, gBattery.MaxPower, gBattery.Percentage)); } else { Runtime.UpdateFrequency = UpdateFrequency.Update100; } } else if (gCockpit.IsUnderControl) { Runtime.UpdateFrequency = UpdateFrequency.Update10; } }
public void UpdateTask(object sender, EventArgs e) { battery.Update(); GraphUpdate(); UIUpdate(); }