From ab19ba4211f525c2f923dd09d8a0bcae79e089f8 Mon Sep 17 00:00:00 2001 From: Nonoo Date: Wed, 4 Nov 2020 09:31:46 +0100 Subject: [PATCH] Calibrate S display --- civcontrol.go | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/civcontrol.go b/civcontrol.go index 7e63e48..ba597d0 100644 --- a/civcontrol.go +++ b/civcontrol.go @@ -307,11 +307,27 @@ func (s *civControlStruct) decodeVdAndS(d []byte) { } else { sStr += "9+" - if sValue > 18 { + switch sValue { + case 10: + sStr += "10" + case 11: + sStr += "20" + case 12: + sStr += "30" + case 13: + sStr += "40" + case 14: + sStr += "40" + case 15: + sStr += "40" + case 16: + sStr += "40" + case 17: + sStr += "50" + case 18: + sStr += "50" + default: sStr += "60" - } else { - dB := (float64((sValue - 9)) / 9) * 60 - sStr += fmt.Sprint(int(math.Round(dB/10) * 10)) } } statusLog.reportS(sStr)