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.
201 lines
3.7 KiB
201 lines
3.7 KiB
package yabl
|
|
|
|
import "fmt"
|
|
|
|
func (t BooleanType) String() string {
|
|
switch t {
|
|
case ON:
|
|
return "ON"
|
|
case OFF:
|
|
return "OFF"
|
|
default:
|
|
panic("BooleanType not defended")
|
|
}
|
|
}
|
|
|
|
func (t ErrorType) String() string {
|
|
switch t {
|
|
case NO_ERROR:
|
|
return "OK"
|
|
case ERROR:
|
|
return "ERROR"
|
|
default:
|
|
panic("ErrorType not defended")
|
|
}
|
|
}
|
|
|
|
func (t BoardReadyType) String() string {
|
|
switch t {
|
|
case BOARD_READY_OK:
|
|
return "OK"
|
|
case BOARD_READY_INFO:
|
|
return "INFO"
|
|
case BOARD_READY_WARNING:
|
|
return "WARNING"
|
|
case BOARD_READY_DEBUG:
|
|
return "DEBUG"
|
|
case BOARD_READY_DEP_ERROR:
|
|
return "DEP_ERROR"
|
|
case BOARD_READY_ERROR:
|
|
return "ERROR"
|
|
case BOARD_READY_CRITICAL:
|
|
return "CRITICAL"
|
|
default:
|
|
panic("BoardReadyType not defended")
|
|
}
|
|
}
|
|
|
|
func (t ContactorInternalOtherErrorType) String() string {
|
|
switch t {
|
|
case OTHER_NO_ERROR:
|
|
return "OK"
|
|
default:
|
|
return fmt.Sprintf("ERROR_CODE_%d", t)
|
|
}
|
|
}
|
|
|
|
func (t ContactorGroupChangedType) String() string {
|
|
switch t {
|
|
case NO_PENDING_CHANGES:
|
|
return "NO_PENDING"
|
|
case INITIALIZED_CHANGE:
|
|
return "INITIALIZED"
|
|
case CHANGE_IN_PROGRESS:
|
|
return "IN_PROGRESS"
|
|
default:
|
|
panic("ContactorGroupChangedType not defended")
|
|
}
|
|
}
|
|
|
|
func (t V2GModeType) String() string {
|
|
switch t {
|
|
case V2G_MODE_G2V:
|
|
return "G2V"
|
|
case V2G_MODE_V2G:
|
|
return "V2G"
|
|
case V2G_MODE_INV:
|
|
return "INV"
|
|
default:
|
|
panic("V2GModeType not defended")
|
|
}
|
|
}
|
|
|
|
func (t Voltage11BitType) String() string {
|
|
return fmt.Sprintf("%dV", t)
|
|
}
|
|
|
|
func (t Current10BitType) String() string {
|
|
return fmt.Sprintf("%dA", t)
|
|
}
|
|
|
|
func (t CpLineLevelType) String() string {
|
|
switch t {
|
|
case NOT_ENABLE:
|
|
return "NOT_ENABLE"
|
|
case TWELVE:
|
|
return "12V_NOT_CONNECTED"
|
|
case NINE:
|
|
return "9V_CONNECTED"
|
|
case SIX:
|
|
return "6V_CHARGING"
|
|
case THREE:
|
|
return "3V"
|
|
case MINUS_TWELVE:
|
|
return "-12V"
|
|
default:
|
|
panic("CpLineLevelType not defended")
|
|
}
|
|
}
|
|
|
|
func (t IsolationStateType) String() string {
|
|
switch t {
|
|
case ISOLATION_STATE_UNKNOWN:
|
|
return "ISOLATION_STATE_UNKNOWN"
|
|
case ONGOING:
|
|
return "ONGOING"
|
|
case PASSED:
|
|
return "PASSED"
|
|
case WARNING:
|
|
return "WARNING"
|
|
case FAILED:
|
|
return "FAILED"
|
|
default:
|
|
panic("IsolationStateType not defended")
|
|
}
|
|
}
|
|
|
|
func (t Voltage9BitType) String() string {
|
|
return fmt.Sprintf("%.1fV", t)
|
|
}
|
|
|
|
func (t AuthModeType) String() string {
|
|
switch t {
|
|
case AUTH:
|
|
return "AUTH"
|
|
case PNC:
|
|
return "PNC"
|
|
default:
|
|
panic("AuthModeType not defended")
|
|
}
|
|
}
|
|
|
|
func (a AuthStateType) String() string {
|
|
switch a {
|
|
case AUTH_STATE_UNKNOWN:
|
|
return "UNKNOWN"
|
|
case AUTH_STATE_ALLOW:
|
|
return "ALLOW"
|
|
case AUTH_STATE_DENY:
|
|
return "DENY"
|
|
default:
|
|
panic("AuthStateType not defended")
|
|
}
|
|
}
|
|
|
|
func (p Power14BitType) String() string {
|
|
return fmt.Sprintf("%dW", p)
|
|
}
|
|
|
|
func (c ContactorModeType) String() string {
|
|
switch c {
|
|
case CONTACTOR_NO_MODE:
|
|
return "NO_MODE"
|
|
case CONTACTOR_TRANSACTION_PROCESS:
|
|
return "TRANSACTION_PROCESS"
|
|
case CONTACTOR_CUSTOM_MODE:
|
|
return "CUSTOM_MODE"
|
|
case CONTACTOR_ONLY_ONE_OUT_MODE:
|
|
return "ONLY_ONE_OUT_MODE"
|
|
case CONTACTOR_ONE_TO_ONE_OUT_MODE:
|
|
return "ONE_TO_ONE_OUT_MODE"
|
|
case CONTACTOR_SIMPLE_DYNAMIC_MODE:
|
|
return "SIMPLE_DYNAMIC_MODE"
|
|
default:
|
|
panic("ContactorModeType not defended")
|
|
}
|
|
}
|
|
|
|
func (e OtherError4BitType) String() string {
|
|
return fmt.Sprintf("ErrCode_%d", e)
|
|
}
|
|
|
|
func (d DebugSwitchModeType) String() string {
|
|
switch d {
|
|
case DEBUG_SWITCH_MODE_AUTO:
|
|
return "AUTO"
|
|
case DEBUG_SWITCH_MODE_OFF:
|
|
return "OFF"
|
|
case DEBUG_SWITCH_MODE_ON:
|
|
return "ON"
|
|
case DEBUG_SWITCH_MODE_PERMANENT_OFF:
|
|
return "PERMANENT_OFF"
|
|
case DEBUG_SWITCH_MODE_PERMANENT_ON:
|
|
return "PERMANENT_ON"
|
|
default:
|
|
panic("DebugSwitchModeType not defended")
|
|
}
|
|
}
|
|
|
|
func (s SignedVoltage12bitType) String() string {
|
|
return fmt.Sprintf("%d", s)
|
|
}
|
|
|