# HG changeset patch # User Sascha L. Teichmann # Date 1589274050 -7200 # Node ID fc999a902d877d30f82a05cf5ab256368f27e9d0 # Parent d4e4f72325134574185d25c798a1768507bf2c67 Write LCD columns. diff -r d4e4f7232513 -r fc999a902d87 pkg/controllers/fwa.go --- a/pkg/controllers/fwa.go Tue May 12 10:45:52 2020 +0200 +++ b/pkg/controllers/fwa.go Tue May 12 11:00:50 2020 +0200 @@ -310,7 +310,7 @@ label, finish := interval(mode, from) - var shipableDays int + var totalDays, shipableDays int allClasses := make([][]time.Duration, len(validities)) missingLDCs := make([]int, len(validities)) @@ -362,16 +362,26 @@ if shipable { shipableDays++ } + totalDays++ // TODO: Accumulate daily statistics into time segment. if finish(next) { + record[0] = label(current) + + if availability { + record[1] = strconv.Itoa(totalDays - shipableDays) + record[2] = strconv.Itoa(shipableDays) + } else { + shPerc := float64(shipableDays) * 100 / float64(totalDays) + record[1] = fmt.Sprintf("%.3f", 100-shPerc) + record[2] = fmt.Sprintf("%.3f", shPerc) + } + // TODO: depending on mode write out results. - l := label(current) - _ = l // Reset counters - shipableDays = 0 + shipableDays, totalDays = 0, 0 } current = next