feragstring is a Go package for creating a FERAG string file ("TSL file") programmatically.
Find a file
2020-05-29 14:24:01 +02:00
.idea Initial commit 2020-05-27 21:23:36 +02:00
test Removed default test file and added tests in test/ subdirectory 2020-05-29 14:19:35 +02:00
ferag.go Added method NextRouteCode to feragstring - returns the next autoincrement route code. 2020-05-29 14:20:18 +02:00
ferag_message.go Added test for minimal example. Omit optional values when not set. Added messages for route info, production drop and route end. 2020-05-29 11:02:33 +02:00
go.mod Initial commit 2020-05-27 21:23:36 +02:00
product_reference.go Added a constructor function for struct MissingParameter to allow access from outside 2020-05-29 14:24:01 +02:00
production_drop.go Added test for minimal example. Omit optional values when not set. Added messages for route info, production drop and route end. 2020-05-29 11:02:33 +02:00
README.md README 2020-05-29 11:03:57 +02:00
route_end.go Added test for minimal example. Omit optional values when not set. Added messages for route info, production drop and route end. 2020-05-29 11:02:33 +02:00
route_info.go Added test for minimal example. Omit optional values when not set. Added messages for route info, production drop and route end. 2020-05-29 11:02:33 +02:00
route_list.go Set default ramp number to -1 to allow the use of 0 as a real ramp number 2020-05-29 14:22:45 +02:00
title_end.go Initial commit 2020-05-27 21:23:36 +02:00
title_info.go New flag showEmptyAdditionalInfo shows segment additional info (+08) even when it is empty 2020-05-29 14:22:16 +02:00
title_info_test.go Initial commit 2020-05-27 21:23:36 +02:00

feragstring

feragstring is a Go package for creating a FERAG string file from a JSON data structure. If you don't know what FERAG (the company) or a FERAG string is you probably don't need this package ;-)

The shortest possible FERAG string

According to FERAG's documentation this is the shortest possible FERAG string:

%2440+40DEMO2009!
%2401+11E1_ROUTE_100 !
%2402+11E1_ROUTE_100 +590+91000000+20E1                            !
%2403+12R100RE001 +1300123!
%2406+11E1_ROUTE_100 !
%2441+40DEMO2009!

The variable values are:

  • the title is 'DEMO2009'
  • a route named 'E1_ROUTE_100'
  • an edition called 'E1'
  • a production drop 'R100RE001' with 123 copies

Usage

fs := NewFeragString()
fs.SetTitleName("EDITION1")

fs.TitleInfo.SetPrintObjectName("EDITION1A")
fs.TitleInfo.SetPublicationDate("2020-05-31")
fs.TitleInfo.SetCountryCode("13")
fs.TitleInfo.SetPrintObjectColor("00000000")

pr1 := NewProductReference()
pr1.SetProductName("MAIN")
pr1.SetCopiesAssigned(25000)
pr1.SetSupervision(1)
pr1.SetOverlap(5)
mp := MissingParameter{
    missingRate: 1,
    missingSize: 1,
}
pr1.SetMissingParameter(mp)
pr1.SetIssueReference("MAIN01")
fs.AddProductReference(pr1)

Supported messages

  • Title Info (%2440)
  • Title End (%2441)
  • Product Reference (%2450)
  • Route List Entry (%2401)
  • Route Info (%2402)
  • Production Drop (%2403)
  • Route End (%2406)

Installation

go get -u github.com/jakoubek/feragstring