示例#1
0
    private void OnGetMotorRoundPerSecondHandler(object recvData)
    {
        char[] motorRpsData = (char[])recvData;
        uint   motorRps     = DigitUtility.GetUInt32(motorRpsData);

        this.m_motorRoundPerSecond = motorRps;
    }
示例#2
0
    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);
    }
示例#3
0
 private void OnGetMotorGearResponse(object data)
 {
     char[] gearData = (char[])data;
     this.m_currentGear = GetGear(((DigitUtility.GetUInt32(gearData) + 1) * 0.001f));
 }