From 2df098c7a60c5877bb74143c0769a4167be6e9fd Mon Sep 17 00:00:00 2001 From: bsongis Date: Tue, 25 Mar 2014 17:46:49 +0100 Subject: [PATCH] Issue #861 fixed - Companion export problem (delay / duration in logical switches) --- companion/src/eepromimportexport.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/companion/src/eepromimportexport.h b/companion/src/eepromimportexport.h index 242c1f7f7..39faaf525 100644 --- a/companion/src/eepromimportexport.h +++ b/companion/src/eepromimportexport.h @@ -638,27 +638,27 @@ class ConversionField: public TransformedField { virtual void beforeExport() { - int val = field; + _field = field; if (scale) { - val /= scale; + _field /= scale; } if (table) { - if (table->exportValue(val, _field)) + if (table->exportValue(_field, _field)) return; if (!error.isEmpty()) EEPROMWarnings += error + "\n"; } if (shift) { - if (val < min) _field = min + shift; - else if (val > max) _field = max + shift; - else _field = val + shift; + if (_field < min) _field = min + shift; + else if (_field > max) _field = max + shift; + else _field += shift; } if (exportFunc) { - _field = exportFunc(val); + _field = exportFunc(_field); } } @@ -669,7 +669,7 @@ class ConversionField: public TransformedField { return; } - field = _field - shift; + field -= shift; if (importFunc) { field = importFunc(_field);