public void Get(Framebuffer frameBuffer) { Monitor.MonitorStatus status; _monitor.GetStatus(out status); string ch0VoltageString = String.Format("0: {0,6:0.00}v", status.ch0.voltage); string ch0CurrentString = String.Format("0: {0,6:0.00}mA", status.ch0.current); float ch0Power = status.ch0.voltage * status.ch0.current; string ch1VoltageString = String.Format("1: {0,6:0.00}v", status.ch1.voltage); string ch1CurrentString = String.Format("1: {0,6:0.00}mA", status.ch1.current); float ch1Power = status.ch1.voltage * status.ch1.current; string ch2VoltageString = String.Format("2: {0,6:0.00}v", status.ch2.voltage); string ch2CurrentString = String.Format("2: {0,6:0.00}mA", status.ch2.current); float ch2Power = status.ch2.voltage * status.ch2.current; float totalPower = (ch0Power + ch1Power + ch2Power) / 1000; string totalPowerString = String.Format("{0,6:0.00}w", totalPower); frameBuffer.SetText(totalPowerString, 5, 29); frameBuffer.SetText(ch0VoltageString, 5, 1); frameBuffer.SetText(ch0CurrentString, 7, 1); frameBuffer.SetText(ch1VoltageString, 9, 5); frameBuffer.SetText(ch1CurrentString, 11, 5); frameBuffer.SetText(ch2VoltageString, 9, 25); frameBuffer.SetText(ch2CurrentString, 11, 25); frameBuffer.SetText("waiting ...", 5, 14); _waitingBar += 50; frameBuffer.SetSpeed(_waitingBar % 8000); if ((_waitingBar / 1000) % 2 == 0) { frameBuffer.SetBgColor(0x0D, Colors.ColorIndex.Yellow); frameBuffer.SetBgColor(0x0E, Colors.ColorIndex.Blue); } else { frameBuffer.SetBgColor(0x0D, Colors.ColorIndex.Blue); frameBuffer.SetBgColor(0x0E, Colors.ColorIndex.Yellow); } }
public bool Get(Framebuffer frameBuffer) { Acc.PhysikInfo pInfo; Acc.GraphicInfo gInfo; if (!_acc.GetData(out pInfo, out gInfo)) { return(false); } SetTc(frameBuffer, pInfo.tcInAction); SetAbs(frameBuffer, pInfo.absInAction); // TODO: unused values // ------------------- // gInfo.iLastTime // gInfo.isDeltaPositive // gInfo.iDeltaLapTime // gInfo.isValidLap // pInfo.carDamage[0]); // pInfo.carDamage[1]); // pInfo.carDamage[2]); // pInfo.carDamage[3]); // pInfo.carDamage[4]); string speedString = String.Format("{0,3} kph", (int)Math.Round(pInfo.speedKmh)); frameBuffer.SetText(speedString, 5, 4); string lapString = String.Format("{0,2} lap", gInfo.numberOfLaps); frameBuffer.SetText(lapString, 7, 5); string fuelString = String.Format("{0,5:F2} l", pInfo.fuel); frameBuffer.SetText(fuelString, 5, 31); string rpmString = String.Format("{0,4} rpm", pInfo.rpm); frameBuffer.SetText(rpmString, 7, 31); SetCurrentTime(frameBuffer, gInfo.iCurrentTime); SetBestTime(frameBuffer, gInfo.iBestTime); string posString = String.Format("pos {0,2}", gInfo.position); frameBuffer.SetText(posString, 15, 17); string tyre0String = String.Format("{0,2}° {1,2:F1}bar", (int)pInfo.tyreCoreTemp[0], UnitConverter.PsiToBar(pInfo.wheelPressure[0])); string tyre1String = String.Format("{0,2}° {1,2:F1}bar", (int)pInfo.tyreCoreTemp[1], UnitConverter.PsiToBar(pInfo.wheelPressure[1])); string tyre2String = String.Format("{0,2}° {1,2:F1}bar", (int)pInfo.tyreCoreTemp[2], UnitConverter.PsiToBar(pInfo.wheelPressure[2])); string tyre3String = String.Format("{0,2}° {1,2:F1}bar", (int)pInfo.tyreCoreTemp[3], UnitConverter.PsiToBar(pInfo.wheelPressure[3])); frameBuffer.SetText(tyre0String, 9, 5); frameBuffer.SetText(tyre1String, 9, 25); frameBuffer.SetText(tyre2String, 11, 5); frameBuffer.SetText(tyre3String, 11, 25); string tcString = String.Format("tc {0,1}", gInfo.tc); frameBuffer.SetText(tcString, 13, 25); string absString = String.Format("abs {0,1}", gInfo.abs); frameBuffer.SetText(absString, 13, 33); int brakeBiasPercent = (pInfo.brakeBias == 0.0) ? 0 : (int)(pInfo.brakeBias * 100) - 14; // TODO: offset only valid for Lexus RFC string biasString = String.Format("bias {0,2}%", brakeBiasPercent); frameBuffer.SetText(biasString, 15, 25); string brakeTemp0String = String.Format("{0,3:F1}°", pInfo.brakeTemp[0]); string brakeTemp1String = String.Format("{0,3:F1}°", pInfo.brakeTemp[1]); string brakeTemp2String = String.Format("{0,3:F1}°", pInfo.brakeTemp[2]); string brakeTemp3String = String.Format("{0,3:F1}°", pInfo.brakeTemp[3]); frameBuffer.SetText(brakeTemp0String, 13, 2); frameBuffer.SetText(brakeTemp1String, 13, 10); frameBuffer.SetText(brakeTemp2String, 15, 2); frameBuffer.SetText(brakeTemp3String, 15, 10); SetGear(frameBuffer, pInfo.gear); frameBuffer.SetSpeed(pInfo.rpm); return(true); }