Logic working mode for multiple connectors
This commit is contained in:
+14
-10
@@ -212,16 +212,20 @@ func (c *converter) initialize() {
|
||||
object: c.logicErrorsInstance,
|
||||
}
|
||||
|
||||
c.logicWorkingMode = &LogicWorkingMode{unit: 0}
|
||||
fields = []*field{
|
||||
{length: 5, setter: c.logicWorkingMode.setTargetContactorMode, name: FTargetContactorMode},
|
||||
{length: 2, setter: c.logicWorkingMode.setAvailability, name: FAvailability},
|
||||
}
|
||||
c.protocolMap[key{can.CAN_ID_049, 0}] = action{
|
||||
fields: fields,
|
||||
interval: 1000,
|
||||
name: PLogicWorkingMode,
|
||||
object: c.logicWorkingMode,
|
||||
for i := uint(0); i <= CONNECTOR_COUNT; i++ {
|
||||
key := key{can.CAN_ID_049, i}
|
||||
lwm := &LogicWorkingMode{unit: unit(i)}
|
||||
c.logicWorkingMode[i] = lwm
|
||||
fields = []*field{
|
||||
{length: 5, setter: lwm.setTargetContactorMode, name: FTargetContactorMode},
|
||||
{length: 2, setter: lwm.setAvailability, name: FAvailability},
|
||||
}
|
||||
c.protocolMap[key] = action{
|
||||
fields: fields,
|
||||
interval: 1000,
|
||||
name: PLogicWorkingMode,
|
||||
object: lwm,
|
||||
}
|
||||
}
|
||||
|
||||
for i := uint(0); i < CONTACTOR_MAX; i++ {
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ type converter struct {
|
||||
logicAuthArray [CONNECTOR_MAX]*LogicAuth
|
||||
logicEnergyMode [CONNECTOR_MAX]*LogicEnergyMode
|
||||
logicErrorsInstance *LogicErrors
|
||||
logicWorkingMode *LogicWorkingMode
|
||||
logicWorkingMode [CONNECTOR_MAX]*LogicWorkingMode
|
||||
contactorInternalStateArray [CONTACTOR_MAX]*ContactorInternalState
|
||||
contactorInternalErrorsInstance *ContactorInternalErrors
|
||||
contactorsInternalForce *ContactorsInternalForce
|
||||
|
||||
Reference in New Issue
Block a user