|
|
|
@ -7,7 +7,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_011, i} |
|
|
|
|
cpe := &CpuPresentEnergy{UnitId: 1} |
|
|
|
|
cpuPresentEnergyArray[i] = cpe |
|
|
|
|
fields := []field{ |
|
|
|
|
fields := []*field{ |
|
|
|
|
{length: 2, setter: cpe.setPowerDirectionMode, name: FPowerDirectionMode}, |
|
|
|
|
{length: 10, setter: cpe.setPresentCurrent, name: FPresentCurrent}, |
|
|
|
|
{length: 11, setter: cpe.setPresentVoltage, name: FPresentVoltage}, |
|
|
|
@ -16,7 +16,7 @@ func initialize() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cpuPeripheryInstance = &CpuPeriphery{UnitId: 0} |
|
|
|
|
fields := []field{ |
|
|
|
|
fields := []*field{ |
|
|
|
|
{length: 2, setter: cpuPeripheryInstance.setContactorInput, name: FContactorInput}, |
|
|
|
|
{length: 2, setter: cpuPeripheryInstance.setCircuitBreakerInput, name: FCircuitBreakerInput}, |
|
|
|
|
{length: 2, setter: cpuPeripheryInstance.setCircuitBreakerPowerCBInput, name: FCircuitBreakerPowerCBInput}, |
|
|
|
@ -32,7 +32,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_015, i} |
|
|
|
|
ces := &CpuEnergySettings{UnitId: i} |
|
|
|
|
cpuEnergySettingsArray[i] = ces |
|
|
|
|
fields := []field{ |
|
|
|
|
fields := []*field{ |
|
|
|
|
{length: 10, setter: ces.setCurrentMax, name: FCurrentMax}, |
|
|
|
|
{length: 11, setter: ces.setVoltageMax, name: FVoltageMax}, |
|
|
|
|
{length: 14, setter: ces.setPowerMax, name: FPowerMax}, |
|
|
|
@ -43,7 +43,7 @@ func initialize() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cpuErrorsInstance = &CpuErrors{UnitId: 0} |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 3, setter: cpuErrorsInstance.setBoardReady, name: FBoardReady}, |
|
|
|
|
{length: 4, setter: cpuErrorsInstance.setOtherError, name: FOtherError}, |
|
|
|
|
{length: 2, setter: cpuErrorsInstance.setRedButtonHard, name: FRedButtonHard}, |
|
|
|
@ -71,7 +71,7 @@ func initialize() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cpuDebugInstance = &CpuDebug{UnitId: 0} |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 2, setter: cpuDebugInstance.setDebugModeOn, name: FDebugModeOn}, |
|
|
|
|
{length: 3, setter: cpuDebugInstance.setDebugContactorInputOn, name: FDebugContactorInputOn}, |
|
|
|
|
{length: 3, setter: cpuDebugInstance.setDebugCircuitBreakerOn, name: FDebugCircuitBreakerOn}, |
|
|
|
@ -88,7 +88,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_021, i} |
|
|
|
|
ppe := &PuPresentEnergy{UnitId: i} |
|
|
|
|
puPresentEnergyArray[i] = ppe |
|
|
|
|
fields := []field{ |
|
|
|
|
fields := []*field{ |
|
|
|
|
{length: 2, setter: ppe.setV2GMode, name: FV2GMode}, |
|
|
|
|
{length: 11, setter: ppe.setVoltageBefore, name: FVoltageBefore}, |
|
|
|
|
{length: 11, setter: ppe.setVoltageAfter, name: FVoltageAfter}, |
|
|
|
@ -101,7 +101,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_022, i} |
|
|
|
|
pp := &PuPeriphery{UnitId: i} |
|
|
|
|
puPeripheryArray[i] = pp |
|
|
|
|
fields := []field{ |
|
|
|
|
fields := []*field{ |
|
|
|
|
{length: 2, setter: pp.setConnectorInsert, name: FConnectorInsert}, |
|
|
|
|
{length: 2, setter: pp.setContactorOn, name: FContactorOn}, |
|
|
|
|
{length: 2, setter: pp.setConnectorLocked, name: FConnectorLocked}, |
|
|
|
@ -118,7 +118,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_023, i} |
|
|
|
|
pe := &PuErrors{UnitId: 1} |
|
|
|
|
puErrorsArray[i] = pe |
|
|
|
|
fields := []field{ |
|
|
|
|
fields := []*field{ |
|
|
|
|
{length: 3, setter: pe.setBoardReady, name: FBoardReady}, |
|
|
|
|
{length: 4, setter: pe.setOtherError, name: FOtherError}, |
|
|
|
|
{length: 2, setter: pe.setIncorrectVoltage, name: FIncorrectVoltage}, |
|
|
|
@ -143,7 +143,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_02A, i} |
|
|
|
|
pd := &PuDebug{UnitId: i} |
|
|
|
|
puDebugArray[i] = pd |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 2, setter: pd.setDebugModeOn, name: FDebugModeOn}, |
|
|
|
|
{length: 3, setter: pd.setDebugContactorOutputOn, name: FDebugContactorOutputOn}, |
|
|
|
|
} |
|
|
|
@ -154,7 +154,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_041, i} |
|
|
|
|
ste := &SeccTargetEnergy{UnitId: i} |
|
|
|
|
seccTargetEnergyArray[i] = ste |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 2, setter: ste.setTargetChargingAllow, name: FTargetChargingAllow}, |
|
|
|
|
{length: 11, setter: ste.setTargetBatteryVoltage, name: FTargetBatteryVoltage}, |
|
|
|
|
{length: 11, setter: ste.setTargetGoalVoltage, name: FTargetGoalVoltage}, |
|
|
|
@ -167,7 +167,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_042, i} |
|
|
|
|
se := &SeccErrors{UnitId: i} |
|
|
|
|
seccErrorsArray[i] = se |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 3, setter: se.setBoardReady, name: FBoardReady}, |
|
|
|
|
{length: 2, setter: se.setNotReadyLogic, name: FNotReadyLogic}, |
|
|
|
|
} |
|
|
|
@ -178,7 +178,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_046, i} |
|
|
|
|
la := &LogicAuth{UnitId: i} |
|
|
|
|
logicAuthArray[i] = la |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 2, setter: la.setAuthMode, name: FAuthMode}, |
|
|
|
|
{length: 3, setter: la.setAuthState, name: FAuthState}, |
|
|
|
|
} |
|
|
|
@ -189,7 +189,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_047, i} |
|
|
|
|
lem := &LogicEnergyMode{UnitId: i} |
|
|
|
|
logicEnergyMode[i] = lem |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 2, setter: lem.setV2gMode, name: FV2gMode}, |
|
|
|
|
{length: 10, setter: lem.setCurrentMax, name: FCurrentMax}, |
|
|
|
|
{length: 11, setter: lem.setVoltageMax, name: FVoltageMax}, |
|
|
|
@ -199,7 +199,7 @@ func initialize() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
logicErrorsInstance = &LogicErrors{UnitId: 0} |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 3, setter: logicErrorsInstance.setBoardReady, name: FBoardReady}, |
|
|
|
|
{length: 2, setter: logicErrorsInstance.setNotReadySettings, name: FNotReadySettings}, |
|
|
|
|
} |
|
|
|
@ -211,7 +211,7 @@ func initialize() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
logicWorkingMode = &LogicWorkingMode{UnitId: 0} |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 5, setter: logicWorkingMode.setTargetContactorMode, name: FTargetContactorMode}, |
|
|
|
|
{length: 2, setter: logicWorkingMode.setAvailability, name: FAvailability}, |
|
|
|
|
} |
|
|
|
@ -226,7 +226,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_071, i} |
|
|
|
|
cis := &ContactorInternalState{UnitId: i} |
|
|
|
|
contactorInternalStateArray[i] = cis |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 3, setter: cis.setContactorReady, name: FContactorReady}, |
|
|
|
|
{length: 2, setter: cis.setContactorOn, name: FContactorOn}, |
|
|
|
|
{length: 2, setter: cis.setUnexpectedState, name: FUnexpectedState}, |
|
|
|
@ -237,7 +237,7 @@ func initialize() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
contactorInternalErrorsInstance = &ContactorInternalErrors{UnitId: 0} |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 3, setter: contactorInternalErrorsInstance.setBoardReady, name: FBoardReady}, |
|
|
|
|
{length: 4, setter: contactorInternalErrorsInstance.setOtherError, name: FOtherError}, |
|
|
|
|
{length: 3, setter: contactorInternalErrorsInstance.setContactorGroupChanged, name: FContactorGroupChanged}, |
|
|
|
@ -255,7 +255,7 @@ func initialize() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
contactorsInternalForce = &ContactorsInternalForce{UnitId: 0} |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 2, setter: contactorsInternalForce.setForceModeEnabled, name: FForceModeEnabled}, |
|
|
|
|
{length: 4, setter: contactorsInternalForce.setForceModeValue, name: FForceModeValue}, |
|
|
|
|
} |
|
|
|
@ -270,7 +270,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_075, i} |
|
|
|
|
cid := &ContactorInternalDebug{UnitId: i} |
|
|
|
|
contactorInternalDebugArray[i] = cid |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 2, setter: cid.setDebugModeOn, name: FDebugModeOn}, |
|
|
|
|
{length: 3, setter: cid.setDebugContactorOn, name: FDebugContactorOn}, |
|
|
|
|
} |
|
|
|
@ -281,7 +281,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_067, i} |
|
|
|
|
ps := &PeripheryState{UnitId: i} |
|
|
|
|
peripheryStateArray[i] = ps |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 3, setter: ps.setOtherErrorSeverity, name: FOtherErrorSeverity}, |
|
|
|
|
{length: 4, setter: ps.setOtherError, name: FOtherError}, |
|
|
|
|
{length: 2, setter: ps.setErrorShakeSensor, name: FErrorShakeSensor}, |
|
|
|
@ -312,7 +312,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_068, i} |
|
|
|
|
pi := &PeripheryInfo{UnitId: i} |
|
|
|
|
peripheryInfoArray[i] = pi |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 2, setter: pi.setInfoDoorOpen, name: FInfoDoorOpen}, |
|
|
|
|
{length: 8, setter: pi.setTempAirIn, name: FTempAirIn}, |
|
|
|
|
{length: 8, setter: pi.setTempAirOut, name: FTempAirOut}, |
|
|
|
@ -326,7 +326,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_06C, i} |
|
|
|
|
pd := &PeripheryDebug{UnitId: i} |
|
|
|
|
peripheryDebugArray[i] = pd |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 2, setter: pd.setDebugModeOn, name: FDebugModeOn}, |
|
|
|
|
{length: 3, setter: pd.setDebugShsnFan, name: FDebugShsnFan}, |
|
|
|
|
{length: 3, setter: pd.setDebugShptFan, name: FDebugShptFan}, |
|
|
|
@ -339,7 +339,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_061, i} |
|
|
|
|
cpe := &ConverterPresentEnergy{UnitId: i} |
|
|
|
|
converterPresentEnergyArray[i] = cpe |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 2, setter: cpe.setV2gMode, name: FV2gMode}, |
|
|
|
|
{length: 11, setter: cpe.setPresentVoltage, name: FPresentVoltage}, |
|
|
|
|
{length: 10, setter: cpe.setPresentCurrent, name: FPresentCurrent}, |
|
|
|
@ -352,7 +352,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_062, i} |
|
|
|
|
ce := &ConverterErrors{UnitId: i} |
|
|
|
|
converterErrorsArray[i] = ce |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 3, setter: ce.setBoardReady, name: FBoardReady}, |
|
|
|
|
{length: 4, setter: ce.setOtherError, name: FOtherError}, |
|
|
|
|
{length: 2, setter: ce.setNotConnectedOut, name: FNotConnectedOut}, |
|
|
|
@ -378,7 +378,7 @@ func initialize() { |
|
|
|
|
key := key{can.CAN_ID_065, i} |
|
|
|
|
cd := &ConverterDebug{UnitId: i} |
|
|
|
|
converterDebugArray[i] = cd |
|
|
|
|
fields = []field{ |
|
|
|
|
fields = []*field{ |
|
|
|
|
{length: 3, setter: cd.setDebugModeOn, name: FDebugModeOn}, |
|
|
|
|
{length: 4, setter: cd.setDebugEnergyOn, name: FDebugEnergyOn}, |
|
|
|
|
{length: 2, setter: cd.setDebugTargetVoltage, name: FDebugTargetVoltage}, |
|
|
|
@ -386,4 +386,10 @@ func initialize() { |
|
|
|
|
} |
|
|
|
|
protocolMap[key] = action{fields: fields, interval: 1000, name: PConverterDebug, object: cd} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for _, element := range protocolMap { |
|
|
|
|
for _, f := range element.fields { |
|
|
|
|
f.value = ^uint64(0) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|