feat(labels): the Label Designer — QSO and address labels for paper QSL
The designer's data model lives in internal/labels: STOCKS are the physical roll in the printer (geometry in mm, margins, dpi — seeded with the common Brother DK sizes, the QL family being what prompted the feature), TEMPLATES are one design each, of two kinds: the QSO label glued on the card, whose repeating table carries several contacts of the same station, and the address label for the envelope, whose lines collapse when a variable is empty. Everything is measured in millimetres — labels are sold in mm, and an operator lining a design up against a physical sticker thinks in mm; pixels exist only in the renderer, at the stock's dpi. The canvas renderer is shared between the editor's preview and the future print path, so there is no second implementation for the preview to disagree with. The preview is fed with the log's latest contacts rather than lorem ipsum: real data shows a too-narrow column immediately. Printing (PDF, one page per label at exact size) is the next module; nothing here prints yet.
This commit is contained in:
@@ -44,6 +44,7 @@ import (
|
||||
"hamlog/internal/gridcache"
|
||||
"hamlog/internal/integrations/udp"
|
||||
"hamlog/internal/kpa"
|
||||
"hamlog/internal/labels"
|
||||
"hamlog/internal/lookup"
|
||||
"hamlog/internal/lotwusers"
|
||||
"hamlog/internal/netctl"
|
||||
@@ -735,6 +736,7 @@ type App struct {
|
||||
uls *uls.Store // US callsign→county/grid (offline FCC ULS), lazily opened
|
||||
awardRefs *awardref.Repo
|
||||
qslTemplates *qslcard.Repo
|
||||
labelRepo *labels.Repo // label designer (stocks + templates)
|
||||
operating *operating.Repo
|
||||
udp *udp.Manager
|
||||
udpRepo *udp.Repo
|
||||
@@ -1185,6 +1187,7 @@ func (a *App) startup(ctx context.Context) {
|
||||
}
|
||||
a.awardRefs = awardref.NewRepo(conn)
|
||||
a.qslTemplates = qslcard.NewRepo(conn)
|
||||
a.labelRepo = labels.NewRepo(conn)
|
||||
a.migrateAwardDefs() // upgrade legacy award definitions (enable + new fields)
|
||||
a.seedBuiltinReferences() // first-run: populate built-in award reference lists
|
||||
a.mirrorAwards() // keep <data>/awards/*.json in step with the database
|
||||
|
||||
Reference in New Issue
Block a user