You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
312 lines
8.0 KiB
312 lines
8.0 KiB
package yabl
|
|
|
|
import (
|
|
"reflect"
|
|
"time"
|
|
)
|
|
|
|
type AName string
|
|
type FName string
|
|
|
|
type unit uint
|
|
|
|
type Action interface {
|
|
GetUnitId() uint32
|
|
}
|
|
|
|
type Event struct {
|
|
unit
|
|
Tag *string
|
|
ActionName *AName
|
|
Field *FName
|
|
Object *Action //TODO Actually obj, or copy on event generation time?
|
|
Updated *time.Time
|
|
Value any
|
|
}
|
|
|
|
type SignedAirTemp8BitType int
|
|
type ConnectedOut8bitType uint
|
|
type ForceModeType uint
|
|
type SignedVoltage12bitType int
|
|
type DebugSwitchModeType uint
|
|
type OtherError4BitType uint
|
|
type ContactorModeType uint
|
|
type Power14BitType uint
|
|
type AuthStateType uint
|
|
type AuthModeType uint
|
|
type BoardReadyType uint
|
|
type BooleanType uint
|
|
type ErrorType uint
|
|
type ContactorInternalOtherErrorType uint
|
|
type ContactorGroupChangedType uint
|
|
type V2GModeType uint
|
|
type Voltage11BitType uint
|
|
type Current10BitType uint
|
|
type CpLineLevelType uint
|
|
type IsolationStateType uint
|
|
type Voltage9BitType float32
|
|
|
|
type fHelper interface {
|
|
getSize() uint8
|
|
setReflectedValue(value *reflect.Value)
|
|
fromBus(frame uint64) any
|
|
toBus(value any) uint64
|
|
}
|
|
|
|
type ContactorInternalState struct {
|
|
unit
|
|
ContactorReady *BoardReadyType
|
|
ContactorOn *BooleanType
|
|
UnexpectedState *ErrorType
|
|
Isolated *ErrorType
|
|
DebugEnabled *BooleanType
|
|
}
|
|
|
|
type ContactorInternalErrors struct {
|
|
unit
|
|
BoardReady *BoardReadyType
|
|
OtherError *ContactorInternalOtherErrorType
|
|
ContactorGroupChanged *ContactorGroupChangedType
|
|
UnexpectedFormation *ContactorInternalOtherErrorType
|
|
CpuNotReady *ErrorType
|
|
PuNotReady *ErrorType
|
|
Debug *BooleanType
|
|
PresentContactorMode *ContactorModeType
|
|
}
|
|
|
|
type ContactorsInternalForce struct {
|
|
unit
|
|
ForceModeEnabled *BooleanType
|
|
ForceModeValue *ForceModeType
|
|
}
|
|
|
|
type ContactorInternalDebug struct {
|
|
unit
|
|
DebugModeOn *BooleanType
|
|
DebugContactorOn *DebugSwitchModeType
|
|
}
|
|
|
|
type PuPresentEnergy struct {
|
|
unit
|
|
V2GMode *V2GModeType
|
|
VoltageBefore *Voltage11BitType
|
|
VoltageAfter *Voltage11BitType
|
|
PresentCurrent *Current10BitType
|
|
}
|
|
|
|
type PuPeriphery struct {
|
|
unit
|
|
ConnectorInsert *BooleanType
|
|
ContactorOn *BooleanType
|
|
ConnectorLocked *BooleanType
|
|
CpLineLevel *CpLineLevelType
|
|
IsolationState *IsolationStateType
|
|
ChargingAllowed *BooleanType
|
|
PwmEnabled *BooleanType
|
|
CpLineVoltage *Voltage9BitType
|
|
}
|
|
|
|
type LogicAuth struct {
|
|
unit
|
|
AuthMode *AuthModeType
|
|
AuthState *AuthStateType
|
|
}
|
|
|
|
type LogicEnergyMode struct {
|
|
unit
|
|
V2gMode *V2GModeType
|
|
CurrentMax *Current10BitType
|
|
VoltageMax *Voltage11BitType
|
|
PowerMax *Power14BitType
|
|
}
|
|
|
|
type LogicErrors struct {
|
|
unit
|
|
BoardReady *BoardReadyType
|
|
NotReadySettings *ErrorType
|
|
}
|
|
|
|
type LogicWorkingMode struct {
|
|
unit
|
|
TargetContactorMode *ContactorModeType
|
|
Availability *BooleanType
|
|
}
|
|
|
|
type LogicCommunicationMode struct {
|
|
unit
|
|
ReadyToHlc *BooleanType
|
|
}
|
|
|
|
type CpuPresentEnergy struct {
|
|
unit
|
|
PowerDirectionMode *V2GModeType
|
|
PresentCurrent *Current10BitType
|
|
PresentVoltage *Voltage11BitType
|
|
}
|
|
|
|
type CpuPeriphery struct {
|
|
unit
|
|
ContactorInput *BooleanType
|
|
CircuitBreakerInput *BooleanType
|
|
CircuitBreakerPowerCBInput *BooleanType
|
|
}
|
|
|
|
type CpuEnergySettings struct {
|
|
unit
|
|
CurrentMax *Current10BitType
|
|
VoltageMax *Voltage11BitType
|
|
PowerMax *Power14BitType
|
|
TargetBatteryVoltage *Voltage11BitType
|
|
TargetGoalVoltage *Voltage11BitType
|
|
}
|
|
|
|
type CpuErrors struct {
|
|
unit
|
|
BoardReady *BoardReadyType
|
|
OtherError *OtherError4BitType
|
|
RedButtonHard *ErrorType
|
|
RedButtonSoft *ErrorType
|
|
ModulesGone *ErrorType
|
|
GridVoltageHighErr *ErrorType
|
|
GridVoltageHighWarn *ErrorType
|
|
GridVoltageLowWarn *ErrorType
|
|
GridVoltageLowErr *ErrorType
|
|
GridVoltageLow *Voltage11BitType
|
|
GridVoltageHigh *Voltage11BitType
|
|
GridVoltageEmpty *ErrorType
|
|
NotReadySecc *ErrorType
|
|
NotReadyPu *ErrorType
|
|
NotReadyContactors *ErrorType
|
|
DebugConvertersEnabled *ErrorType
|
|
ContactorInputError *ErrorType
|
|
NotReadyPeriphery *ErrorType
|
|
}
|
|
|
|
type CpuDebug struct {
|
|
unit
|
|
DebugModeOn *BooleanType
|
|
DebugContactorInputOn *DebugSwitchModeType
|
|
DebugCircuitBreakerOn *DebugSwitchModeType
|
|
DebugRedButtonSoftware *DebugSwitchModeType
|
|
}
|
|
|
|
type PuErrors struct {
|
|
unit
|
|
BoardReady *BoardReadyType
|
|
OtherError *OtherError4BitType
|
|
IncorrectVoltage *ErrorType
|
|
IncorrectVoltageValue *Voltage11BitType
|
|
IncorrectCurrent *ErrorType
|
|
IncorrectCurrentValue *Current10BitType
|
|
IsolationBroken *ErrorType
|
|
CpLineBroken *ErrorType
|
|
CpLineGap69 *ErrorType
|
|
CableReady *BoardReadyType
|
|
NotReadyCpu *ErrorType
|
|
NotReadySecc *ErrorType
|
|
ContactorOutputError *ErrorType
|
|
DebugContactorOutputEnabled *BooleanType
|
|
OutputCircuitBreakerEnabled *ErrorType
|
|
OutputCircuitBreakerEnabledValue *SignedVoltage12bitType
|
|
}
|
|
|
|
type PuDebug struct {
|
|
unit
|
|
DebugModeOn *BooleanType
|
|
DebugContactorOutputOn *DebugSwitchModeType
|
|
}
|
|
|
|
type SeccTargetEnergy struct {
|
|
unit
|
|
TargetChargingAllow *BooleanType
|
|
TargetBatteryVoltage *Voltage11BitType
|
|
TargetGoalVoltage *Voltage11BitType
|
|
TargetCurrent *Current10BitType
|
|
AllowDynamicDistribution *BooleanType
|
|
}
|
|
|
|
type SeccErrors struct {
|
|
unit
|
|
BoardReady *BoardReadyType
|
|
NotReadyLogic *ErrorType
|
|
}
|
|
|
|
type PeripheryState struct {
|
|
unit
|
|
OtherErrorSeverity *BoardReadyType
|
|
OtherError *OtherError4BitType
|
|
ErrorShakeSensor *ErrorType
|
|
ErrorCoolingGroup *ErrorType
|
|
PeripheryErrorCoolingGroup *ErrorType
|
|
ErrorFireEmergency *ErrorType
|
|
ErrorFireEmergencyRun *ErrorType
|
|
ErrorFireEmergencyControl *ErrorType
|
|
ErrorOvervoltageIn *ErrorType
|
|
PeripheryErrorPowerSupply *ErrorType
|
|
ErrorFan *ErrorType
|
|
ErrorOvervoltageOut *ErrorType
|
|
ErrorStateRemoteMode *ErrorType
|
|
DebugShsnFanEnabled *BooleanType
|
|
DebugShptFanEnabled *BooleanType
|
|
DebugIoBoardTestLampEnabled *BooleanType
|
|
ErrorFireEmergencyCircuitBreaker *ErrorType
|
|
ErrorExtLightCircuitBreaker *ErrorType
|
|
ErrorIndicationCircuitBreaker *ErrorType
|
|
ErrorLowVoltagePowerCircuitBreaker *ErrorType
|
|
ErrorContactorsInternalCircuitBreaker *ErrorType
|
|
ErrorPlcCircuitBreaker *ErrorType
|
|
}
|
|
|
|
type PeripheryInfo struct {
|
|
unit
|
|
InfoDoorOpen *BooleanType
|
|
TempAirIn *SignedAirTemp8BitType
|
|
TempAirOut *SignedAirTemp8BitType
|
|
StateShsnFan *BooleanType
|
|
StateShptFan *BooleanType
|
|
}
|
|
|
|
type PeripheryDebug struct {
|
|
unit
|
|
DebugModeOn *BooleanType
|
|
DebugShsnFan *DebugSwitchModeType
|
|
DebugShptFan *DebugSwitchModeType
|
|
DebugIoBoardTestLamp *DebugSwitchModeType
|
|
}
|
|
|
|
type ConverterPresentEnergy struct {
|
|
unit
|
|
V2gMode *V2GModeType
|
|
PresentVoltage *Voltage11BitType
|
|
PresentCurrent *Current10BitType
|
|
ConnectedOut *ConnectedOut8bitType
|
|
}
|
|
|
|
type ConverterErrors struct {
|
|
unit
|
|
BoardReady *BoardReadyType
|
|
OtherError *OtherError4BitType
|
|
NotConnectedOut *ErrorType
|
|
NoCommunicationConverter *ErrorType
|
|
NoCommunicationPuConverter *ErrorType
|
|
InputGridVoltageHigh *ErrorType
|
|
InputGridVoltageLow *ErrorType
|
|
OutputGridVoltageHigh *ErrorType
|
|
OutputGridVoltageLow *ErrorType
|
|
InputGridVoltage *Voltage11BitType
|
|
OutputGridVoltage *Voltage11BitType
|
|
ShortCircuit *ErrorType
|
|
OverHeat *ErrorType
|
|
FanBroken *ErrorType
|
|
OtherHardwareError *ErrorType
|
|
DebugConvEnabled *BooleanType
|
|
DebugConvDisabled *BooleanType
|
|
}
|
|
|
|
type ConverterDebug struct {
|
|
unit
|
|
DebugModeOn *BooleanType
|
|
DebugEnergyOn *DebugSwitchModeType
|
|
DebugTargetVoltage *Voltage11BitType
|
|
DebugTargetCurrent *Current10BitType
|
|
}
|
|
|