Skip to content

Commit

Permalink
added acu scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
BK1031 committed Jun 14, 2024
1 parent 4321c0d commit bf6dde8
Showing 1 changed file with 270 additions and 1 deletion.
271 changes: 270 additions & 1 deletion gr24/service/acu_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,276 @@ func ACUFromBytes(data []byte) model.ACU {

// scaleAcu scales the acu values
func scaleACU(acu model.ACU) model.ACU {
// TODO: yea this shits gonna be a pain to write
acu.AccumulatorVoltage = acu.AccumulatorVoltage * 0.01
acu.AccumulatorCurrent = acu.AccumulatorCurrent * 0.01
acu.MaxCellTemp = acu.MaxCellTemp * 0.01
acu.TSVoltage = acu.TSVoltage * 0.01
acu.MaxBalResistorTemp = acu.MaxBalResistorTemp * 0.01
acu.SDCVoltage = acu.SDCVoltage / 16
acu.GLVVoltage = acu.GLVVoltage / 16
acu.Fan1Speed = acu.Fan1Speed * 0.5
acu.Fan2Speed = acu.Fan2Speed * 0.5
acu.Fan3Speed = acu.Fan3Speed * 0.5
acu.PumpSpeed = acu.PumpSpeed * 0.5
acu.ACUTemp1 = acu.ACUTemp1 * 0.5
acu.ACUTemp2 = acu.ACUTemp2 * 0.5
acu.ACUTemp3 = acu.ACUTemp3 * 0.5
acu.Cell0Voltage = acu.Cell0Voltage*0.01 + 2
acu.Cell1Voltage = acu.Cell1Voltage*0.01 + 2
acu.Cell2Voltage = acu.Cell2Voltage*0.01 + 2
acu.Cell3Voltage = acu.Cell3Voltage*0.01 + 2
acu.Cell4Voltage = acu.Cell4Voltage*0.01 + 2
acu.Cell5Voltage = acu.Cell5Voltage*0.01 + 2
acu.Cell6Voltage = acu.Cell6Voltage*0.01 + 2
acu.Cell7Voltage = acu.Cell7Voltage*0.01 + 2
acu.Cell8Voltage = acu.Cell8Voltage*0.01 + 2
acu.Cell9Voltage = acu.Cell9Voltage*0.01 + 2
acu.Cell10Voltage = acu.Cell10Voltage*0.01 + 2
acu.Cell11Voltage = acu.Cell11Voltage*0.01 + 2
acu.Cell12Voltage = acu.Cell12Voltage*0.01 + 2
acu.Cell13Voltage = acu.Cell13Voltage*0.01 + 2
acu.Cell14Voltage = acu.Cell14Voltage*0.01 + 2
acu.Cell15Voltage = acu.Cell15Voltage*0.01 + 2
acu.Cell16Voltage = acu.Cell16Voltage*0.01 + 2
acu.Cell17Voltage = acu.Cell17Voltage*0.01 + 2
acu.Cell18Voltage = acu.Cell18Voltage*0.01 + 2
acu.Cell19Voltage = acu.Cell19Voltage*0.01 + 2
acu.Cell20Voltage = acu.Cell20Voltage*0.01 + 2
acu.Cell21Voltage = acu.Cell21Voltage*0.01 + 2
acu.Cell22Voltage = acu.Cell22Voltage*0.01 + 2
acu.Cell23Voltage = acu.Cell23Voltage*0.01 + 2
acu.Cell24Voltage = acu.Cell24Voltage*0.01 + 2
acu.Cell25Voltage = acu.Cell25Voltage*0.01 + 2
acu.Cell26Voltage = acu.Cell26Voltage*0.01 + 2
acu.Cell27Voltage = acu.Cell27Voltage*0.01 + 2
acu.Cell28Voltage = acu.Cell28Voltage*0.01 + 2
acu.Cell29Voltage = acu.Cell29Voltage*0.01 + 2
acu.Cell30Voltage = acu.Cell30Voltage*0.01 + 2
acu.Cell31Voltage = acu.Cell31Voltage*0.01 + 2
acu.Cell32Voltage = acu.Cell32Voltage*0.01 + 2
acu.Cell33Voltage = acu.Cell33Voltage*0.01 + 2
acu.Cell34Voltage = acu.Cell34Voltage*0.01 + 2
acu.Cell35Voltage = acu.Cell35Voltage*0.01 + 2
acu.Cell36Voltage = acu.Cell36Voltage*0.01 + 2
acu.Cell37Voltage = acu.Cell37Voltage*0.01 + 2
acu.Cell38Voltage = acu.Cell38Voltage*0.01 + 2
acu.Cell39Voltage = acu.Cell39Voltage*0.01 + 2
acu.Cell40Voltage = acu.Cell40Voltage*0.01 + 2
acu.Cell41Voltage = acu.Cell41Voltage*0.01 + 2
acu.Cell42Voltage = acu.Cell42Voltage*0.01 + 2
acu.Cell43Voltage = acu.Cell43Voltage*0.01 + 2
acu.Cell44Voltage = acu.Cell44Voltage*0.01 + 2
acu.Cell45Voltage = acu.Cell45Voltage*0.01 + 2
acu.Cell46Voltage = acu.Cell46Voltage*0.01 + 2
acu.Cell47Voltage = acu.Cell47Voltage*0.01 + 2
acu.Cell48Voltage = acu.Cell48Voltage*0.01 + 2
acu.Cell49Voltage = acu.Cell49Voltage*0.01 + 2
acu.Cell50Voltage = acu.Cell50Voltage*0.01 + 2
acu.Cell51Voltage = acu.Cell51Voltage*0.01 + 2
acu.Cell52Voltage = acu.Cell52Voltage*0.01 + 2
acu.Cell53Voltage = acu.Cell53Voltage*0.01 + 2
acu.Cell54Voltage = acu.Cell54Voltage*0.01 + 2
acu.Cell55Voltage = acu.Cell55Voltage*0.01 + 2
acu.Cell56Voltage = acu.Cell56Voltage*0.01 + 2
acu.Cell57Voltage = acu.Cell57Voltage*0.01 + 2
acu.Cell58Voltage = acu.Cell58Voltage*0.01 + 2
acu.Cell59Voltage = acu.Cell59Voltage*0.01 + 2
acu.Cell60Voltage = acu.Cell60Voltage*0.01 + 2
acu.Cell61Voltage = acu.Cell61Voltage*0.01 + 2
acu.Cell62Voltage = acu.Cell62Voltage*0.01 + 2
acu.Cell63Voltage = acu.Cell63Voltage*0.01 + 2
acu.Cell64Voltage = acu.Cell64Voltage*0.01 + 2
acu.Cell65Voltage = acu.Cell65Voltage*0.01 + 2
acu.Cell66Voltage = acu.Cell66Voltage*0.01 + 2
acu.Cell67Voltage = acu.Cell67Voltage*0.01 + 2
acu.Cell68Voltage = acu.Cell68Voltage*0.01 + 2
acu.Cell69Voltage = acu.Cell69Voltage*0.01 + 2
acu.Cell70Voltage = acu.Cell70Voltage*0.01 + 2
acu.Cell71Voltage = acu.Cell71Voltage*0.01 + 2
acu.Cell72Voltage = acu.Cell72Voltage*0.01 + 2
acu.Cell73Voltage = acu.Cell73Voltage*0.01 + 2
acu.Cell74Voltage = acu.Cell74Voltage*0.01 + 2
acu.Cell75Voltage = acu.Cell75Voltage*0.01 + 2
acu.Cell76Voltage = acu.Cell76Voltage*0.01 + 2
acu.Cell77Voltage = acu.Cell77Voltage*0.01 + 2
acu.Cell78Voltage = acu.Cell78Voltage*0.01 + 2
acu.Cell79Voltage = acu.Cell79Voltage*0.01 + 2
acu.Cell80Voltage = acu.Cell80Voltage*0.01 + 2
acu.Cell81Voltage = acu.Cell81Voltage*0.01 + 2
acu.Cell82Voltage = acu.Cell82Voltage*0.01 + 2
acu.Cell83Voltage = acu.Cell83Voltage*0.01 + 2
acu.Cell84Voltage = acu.Cell84Voltage*0.01 + 2
acu.Cell85Voltage = acu.Cell85Voltage*0.01 + 2
acu.Cell86Voltage = acu.Cell86Voltage*0.01 + 2
acu.Cell87Voltage = acu.Cell87Voltage*0.01 + 2
acu.Cell88Voltage = acu.Cell88Voltage*0.01 + 2
acu.Cell89Voltage = acu.Cell89Voltage*0.01 + 2
acu.Cell90Voltage = acu.Cell90Voltage*0.01 + 2
acu.Cell91Voltage = acu.Cell91Voltage*0.01 + 2
acu.Cell92Voltage = acu.Cell92Voltage*0.01 + 2
acu.Cell93Voltage = acu.Cell93Voltage*0.01 + 2
acu.Cell94Voltage = acu.Cell94Voltage*0.01 + 2
acu.Cell95Voltage = acu.Cell95Voltage*0.01 + 2
acu.Cell96Voltage = acu.Cell96Voltage*0.01 + 2
acu.Cell97Voltage = acu.Cell97Voltage*0.01 + 2
acu.Cell98Voltage = acu.Cell98Voltage*0.01 + 2
acu.Cell99Voltage = acu.Cell99Voltage*0.01 + 2
acu.Cell100Voltage = acu.Cell100Voltage*0.01 + 2
acu.Cell101Voltage = acu.Cell101Voltage*0.01 + 2
acu.Cell102Voltage = acu.Cell102Voltage*0.01 + 2
acu.Cell103Voltage = acu.Cell103Voltage*0.01 + 2
acu.Cell104Voltage = acu.Cell104Voltage*0.01 + 2
acu.Cell105Voltage = acu.Cell105Voltage*0.01 + 2
acu.Cell106Voltage = acu.Cell106Voltage*0.01 + 2
acu.Cell107Voltage = acu.Cell107Voltage*0.01 + 2
acu.Cell108Voltage = acu.Cell108Voltage*0.01 + 2
acu.Cell109Voltage = acu.Cell109Voltage*0.01 + 2
acu.Cell110Voltage = acu.Cell110Voltage*0.01 + 2
acu.Cell111Voltage = acu.Cell111Voltage*0.01 + 2
acu.Cell112Voltage = acu.Cell112Voltage*0.01 + 2
acu.Cell113Voltage = acu.Cell113Voltage*0.01 + 2
acu.Cell114Voltage = acu.Cell114Voltage*0.01 + 2
acu.Cell115Voltage = acu.Cell115Voltage*0.01 + 2
acu.Cell116Voltage = acu.Cell116Voltage*0.01 + 2
acu.Cell117Voltage = acu.Cell117Voltage*0.01 + 2
acu.Cell118Voltage = acu.Cell118Voltage*0.01 + 2
acu.Cell119Voltage = acu.Cell119Voltage*0.01 + 2
acu.Cell120Voltage = acu.Cell120Voltage*0.01 + 2
acu.Cell121Voltage = acu.Cell121Voltage*0.01 + 2
acu.Cell122Voltage = acu.Cell122Voltage*0.01 + 2
acu.Cell123Voltage = acu.Cell123Voltage*0.01 + 2
acu.Cell124Voltage = acu.Cell124Voltage*0.01 + 2
acu.Cell125Voltage = acu.Cell125Voltage*0.01 + 2
acu.Cell126Voltage = acu.Cell126Voltage*0.01 + 2
acu.Cell127Voltage = acu.Cell127Voltage*0.01 + 2
acu.Cell0Temp = acu.Cell0Temp*0.25 + 10
acu.Cell1Temp = acu.Cell1Temp*0.25 + 10
acu.Cell2Temp = acu.Cell2Temp*0.25 + 10
acu.Cell3Temp = acu.Cell3Temp*0.25 + 10
acu.Cell4Temp = acu.Cell4Temp*0.25 + 10
acu.Cell5Temp = acu.Cell5Temp*0.25 + 10
acu.Cell6Temp = acu.Cell6Temp*0.25 + 10
acu.Cell7Temp = acu.Cell7Temp*0.25 + 10
acu.Cell8Temp = acu.Cell8Temp*0.25 + 10
acu.Cell9Temp = acu.Cell9Temp*0.25 + 10
acu.Cell10Temp = acu.Cell10Temp*0.25 + 10
acu.Cell11Temp = acu.Cell11Temp*0.25 + 10
acu.Cell12Temp = acu.Cell12Temp*0.25 + 10
acu.Cell13Temp = acu.Cell13Temp*0.25 + 10
acu.Cell14Temp = acu.Cell14Temp*0.25 + 10
acu.Cell15Temp = acu.Cell15Temp*0.25 + 10
acu.Cell16Temp = acu.Cell16Temp*0.25 + 10
acu.Cell17Temp = acu.Cell17Temp*0.25 + 10
acu.Cell18Temp = acu.Cell18Temp*0.25 + 10
acu.Cell19Temp = acu.Cell19Temp*0.25 + 10
acu.Cell20Temp = acu.Cell20Temp*0.25 + 10
acu.Cell21Temp = acu.Cell21Temp*0.25 + 10
acu.Cell22Temp = acu.Cell22Temp*0.25 + 10
acu.Cell23Temp = acu.Cell23Temp*0.25 + 10
acu.Cell24Temp = acu.Cell24Temp*0.25 + 10
acu.Cell25Temp = acu.Cell25Temp*0.25 + 10
acu.Cell26Temp = acu.Cell26Temp*0.25 + 10
acu.Cell27Temp = acu.Cell27Temp*0.25 + 10
acu.Cell28Temp = acu.Cell28Temp*0.25 + 10
acu.Cell29Temp = acu.Cell29Temp*0.25 + 10
acu.Cell30Temp = acu.Cell30Temp*0.25 + 10
acu.Cell31Temp = acu.Cell31Temp*0.25 + 10
acu.Cell32Temp = acu.Cell32Temp*0.25 + 10
acu.Cell33Temp = acu.Cell33Temp*0.25 + 10
acu.Cell34Temp = acu.Cell34Temp*0.25 + 10
acu.Cell35Temp = acu.Cell35Temp*0.25 + 10
acu.Cell36Temp = acu.Cell36Temp*0.25 + 10
acu.Cell37Temp = acu.Cell37Temp*0.25 + 10
acu.Cell38Temp = acu.Cell38Temp*0.25 + 10
acu.Cell39Temp = acu.Cell39Temp*0.25 + 10
acu.Cell40Temp = acu.Cell40Temp*0.25 + 10
acu.Cell41Temp = acu.Cell41Temp*0.25 + 10
acu.Cell42Temp = acu.Cell42Temp*0.25 + 10
acu.Cell43Temp = acu.Cell43Temp*0.25 + 10
acu.Cell44Temp = acu.Cell44Temp*0.25 + 10
acu.Cell45Temp = acu.Cell45Temp*0.25 + 10
acu.Cell46Temp = acu.Cell46Temp*0.25 + 10
acu.Cell47Temp = acu.Cell47Temp*0.25 + 10
acu.Cell48Temp = acu.Cell48Temp*0.25 + 10
acu.Cell49Temp = acu.Cell49Temp*0.25 + 10
acu.Cell50Temp = acu.Cell50Temp*0.25 + 10
acu.Cell51Temp = acu.Cell51Temp*0.25 + 10
acu.Cell52Temp = acu.Cell52Temp*0.25 + 10
acu.Cell53Temp = acu.Cell53Temp*0.25 + 10
acu.Cell54Temp = acu.Cell54Temp*0.25 + 10
acu.Cell55Temp = acu.Cell55Temp*0.25 + 10
acu.Cell56Temp = acu.Cell56Temp*0.25 + 10
acu.Cell57Temp = acu.Cell57Temp*0.25 + 10
acu.Cell58Temp = acu.Cell58Temp*0.25 + 10
acu.Cell59Temp = acu.Cell59Temp*0.25 + 10
acu.Cell60Temp = acu.Cell60Temp*0.25 + 10
acu.Cell61Temp = acu.Cell61Temp*0.25 + 10
acu.Cell62Temp = acu.Cell62Temp*0.25 + 10
acu.Cell63Temp = acu.Cell63Temp*0.25 + 10
acu.Cell64Temp = acu.Cell64Temp*0.25 + 10
acu.Cell65Temp = acu.Cell65Temp*0.25 + 10
acu.Cell66Temp = acu.Cell66Temp*0.25 + 10
acu.Cell67Temp = acu.Cell67Temp*0.25 + 10
acu.Cell68Temp = acu.Cell68Temp*0.25 + 10
acu.Cell69Temp = acu.Cell69Temp*0.25 + 10
acu.Cell70Temp = acu.Cell70Temp*0.25 + 10
acu.Cell71Temp = acu.Cell71Temp*0.25 + 10
acu.Cell72Temp = acu.Cell72Temp*0.25 + 10
acu.Cell73Temp = acu.Cell73Temp*0.25 + 10
acu.Cell74Temp = acu.Cell74Temp*0.25 + 10
acu.Cell75Temp = acu.Cell75Temp*0.25 + 10
acu.Cell76Temp = acu.Cell76Temp*0.25 + 10
acu.Cell77Temp = acu.Cell77Temp*0.25 + 10
acu.Cell78Temp = acu.Cell78Temp*0.25 + 10
acu.Cell79Temp = acu.Cell79Temp*0.25 + 10
acu.Cell80Temp = acu.Cell80Temp*0.25 + 10
acu.Cell81Temp = acu.Cell81Temp*0.25 + 10
acu.Cell82Temp = acu.Cell82Temp*0.25 + 10
acu.Cell83Temp = acu.Cell83Temp*0.25 + 10
acu.Cell84Temp = acu.Cell84Temp*0.25 + 10
acu.Cell85Temp = acu.Cell85Temp*0.25 + 10
acu.Cell86Temp = acu.Cell86Temp*0.25 + 10
acu.Cell87Temp = acu.Cell87Temp*0.25 + 10
acu.Cell88Temp = acu.Cell88Temp*0.25 + 10
acu.Cell89Temp = acu.Cell89Temp*0.25 + 10
acu.Cell90Temp = acu.Cell90Temp*0.25 + 10
acu.Cell91Temp = acu.Cell91Temp*0.25 + 10
acu.Cell92Temp = acu.Cell92Temp*0.25 + 10
acu.Cell93Temp = acu.Cell93Temp*0.25 + 10
acu.Cell94Temp = acu.Cell94Temp*0.25 + 10
acu.Cell95Temp = acu.Cell95Temp*0.25 + 10
acu.Cell96Temp = acu.Cell96Temp*0.25 + 10
acu.Cell97Temp = acu.Cell97Temp*0.25 + 10
acu.Cell98Temp = acu.Cell98Temp*0.25 + 10
acu.Cell99Temp = acu.Cell99Temp*0.25 + 10
acu.Cell100Temp = acu.Cell100Temp*0.25 + 10
acu.Cell101Temp = acu.Cell101Temp*0.25 + 10
acu.Cell102Temp = acu.Cell102Temp*0.25 + 10
acu.Cell103Temp = acu.Cell103Temp*0.25 + 10
acu.Cell104Temp = acu.Cell104Temp*0.25 + 10
acu.Cell105Temp = acu.Cell105Temp*0.25 + 10
acu.Cell106Temp = acu.Cell106Temp*0.25 + 10
acu.Cell107Temp = acu.Cell107Temp*0.25 + 10
acu.Cell108Temp = acu.Cell108Temp*0.25 + 10
acu.Cell109Temp = acu.Cell109Temp*0.25 + 10
acu.Cell110Temp = acu.Cell110Temp*0.25 + 10
acu.Cell111Temp = acu.Cell111Temp*0.25 + 10
acu.Cell112Temp = acu.Cell112Temp*0.25 + 10
acu.Cell113Temp = acu.Cell113Temp*0.25 + 10
acu.Cell114Temp = acu.Cell114Temp*0.25 + 10
acu.Cell115Temp = acu.Cell115Temp*0.25 + 10
acu.Cell116Temp = acu.Cell116Temp*0.25 + 10
acu.Cell117Temp = acu.Cell117Temp*0.25 + 10
acu.Cell118Temp = acu.Cell118Temp*0.25 + 10
acu.Cell119Temp = acu.Cell119Temp*0.25 + 10
acu.Cell120Temp = acu.Cell120Temp*0.25 + 10
acu.Cell121Temp = acu.Cell121Temp*0.25 + 10
acu.Cell122Temp = acu.Cell122Temp*0.25 + 10
acu.Cell123Temp = acu.Cell123Temp*0.25 + 10
acu.Cell124Temp = acu.Cell124Temp*0.25 + 10
acu.Cell125Temp = acu.Cell125Temp*0.25 + 10
acu.Cell126Temp = acu.Cell126Temp*0.25 + 10
acu.Cell127Temp = acu.Cell127Temp*0.25 + 10
return acu
}

Expand Down

0 comments on commit bf6dde8

Please sign in to comment.