private void OnGetMotorRoundPerSecondHandler(object recvData) { char[] motorRpsData = (char[])recvData; uint motorRps = DigitUtility.GetUInt32(motorRpsData); this.m_motorRoundPerSecond = motorRps; }
private void OnReceiveSkaterBatteryPowerHandler(object recvData) { char[] batteryPowerData = (char[])recvData; uint voltHandred = DigitUtility.GetUInt32(batteryPowerData); float volt = voltHandred * 0.01f; //太小则说明外部电源没接入 int percentageRemainPower = SystemController.GetPercentageBatteryPower(volt); if (percentageRemainPower < GlobalDefine.MIN_BATTERY_VOLT) { Debug.Log("主电源开关没打开"); } SetBatteryLevel(percentageRemainPower); }
private void OnGetMotorGearResponse(object data) { char[] gearData = (char[])data; this.m_currentGear = GetGear(((DigitUtility.GetUInt32(gearData) + 1) * 0.001f)); }