Issue #861 fixed - Companion export problem (delay / duration in logical
switches)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user