From e8d1c806fc5c9f5f24881bf19ab418ea816001b7 Mon Sep 17 00:00:00 2001 From: Oliver Jakoubek Date: Fri, 24 Mar 2023 16:03:31 +0100 Subject: [PATCH] Added bundle parameters to production drop Fixes #17 --- production_drop.go | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/production_drop.go b/production_drop.go index 6bdbb4a..34bcc90 100644 --- a/production_drop.go +++ b/production_drop.go @@ -9,6 +9,12 @@ type ProductionDrop struct { agentName string numberOfCopies int ControlCharacters ControlCharacterSet + limit int + maxStack int + standard int + parameterN int + maxBundle int + parameterSz int dontProduce bool topsheetData string productReferenceNumbers []int @@ -34,6 +40,54 @@ func (pd *ProductionDrop) TopsheetData() string { return message(&fm, tsdSegment) } +func (pd *ProductionDrop) MaxBundle() string { + return fmt.Sprintf("+34%04d", pd.maxBundle) +} + +func (pd *ProductionDrop) SetMaxBundle(maxBundle int) { + pd.maxBundle = maxBundle +} + +func (pd *ProductionDrop) ParameterN() string { + return fmt.Sprintf("+33%04d", pd.parameterN) +} + +func (pd *ProductionDrop) SetParameterN(parameterN int) { + pd.parameterN = parameterN +} + +func (pd *ProductionDrop) Standard() string { + return fmt.Sprintf("+32%04d", pd.standard) +} + +func (pd *ProductionDrop) SetStandard(standard int) { + pd.standard = standard +} + +func (pd *ProductionDrop) MaxStack() string { + return fmt.Sprintf("+31%04d", pd.maxStack) +} + +func (pd *ProductionDrop) SetMaxStack(maxStack int) { + pd.maxStack = maxStack +} + +func (pd *ProductionDrop) Limit() string { + return fmt.Sprintf("+30%04d", pd.limit) +} + +func (pd *ProductionDrop) SetLimit(limit int) { + pd.limit = limit +} + +func (pd *ProductionDrop) ParameterSz() string { + return fmt.Sprintf("+35%04d", pd.parameterSz) +} + +func (pd *ProductionDrop) SetParameterSz(parameterSz int) { + pd.parameterSz = parameterSz +} + // SetTopsheetData sets the topsheet data to a given string func (pd *ProductionDrop) SetTopsheetData(topsheetData string) { pd.topsheetData = topsheetData @@ -92,6 +146,12 @@ func (pd *ProductionDrop) Payload() string { data := pd.AgentName() data += pd.NumberOfCopies() data += pd.ControlCharacters.GetControlCharactersMessage() + data += pd.Limit() + data += pd.MaxStack() + data += pd.Standard() + data += pd.ParameterN() + data += pd.MaxBundle() + data += pd.ParameterSz() data += pd.ProductReferenceNumbers() return data }