New flag showEmptyAdditionalInfo shows segment additional info (+08) even when it is empty

This commit is contained in:
Oliver Jakoubek 2020-05-29 14:22:16 +02:00
parent 0eebc491d4
commit eadeedcc3a

View file

@ -13,6 +13,11 @@ type TitleInfo struct {
countryCode string
printObjectColor string
additionalInfo string
showEmptyAdditionalInfo bool
}
func (ti *TitleInfo) ShowEmptyAdditionalInfo() {
ti.showEmptyAdditionalInfo = true
}
func (ti *TitleInfo) SetPrintObjectName(printObjectName string) {
@ -20,7 +25,7 @@ func (ti *TitleInfo) SetPrintObjectName(printObjectName string) {
}
func (ti *TitleInfo) AdditionalInfo() string {
if ti.additionalInfo == "" {
if ti.additionalInfo == "" && ti.showEmptyAdditionalInfo == false {
return ""
}
return fmt.Sprintf("+08%-50s", ti.additionalInfo)
@ -101,6 +106,7 @@ func (ti *TitleInfo) SetTitleName(titleName string) {
func NewTitleInfo() *TitleInfo {
t := TitleInfo{
FeragMessage: FeragMessage{"2440", "!"},
showEmptyAdditionalInfo: false,
}
return &t
}