Skip to content

Commit 4dcfefc

Browse files
committed
Initial support for multiple chlorinators;
enforce chlor assignment to REM chem; tagyoureit/nodejs-poolController#896
1 parent 0787ce7 commit 4dcfefc

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

scripts/config/chemistry.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,15 @@
452452
el.find('div.picValueSpinner[data-bind="orp.maxDailyVolume"]').hide();
453453
el.find('div.picValueSpinner[data-bind="orp.startDelay"]').hide();
454454
el.find('div.picValueSpinner[data-bind="orp.dosingMethod"]').hide();
455-
el.find('div.pnl-orpDose-time').hide();
455+
456456
//el.find('.pnl-orpDose-mix').hide();
457457
el.find('div.pnl-orpDose-mixtime').hide();
458+
el.find('div.pnl-orpDose-time').hide();
458459
el.find('.grp-dosingparams hr').hide()
459460
el.find('div.picPickList[data-bind="orp.chlorDosingMethod"]').show();
461+
el.find('div.picPickList[data-bind="orp.chlorId"]').show();
462+
/*
463+
2024.12.25 RSG - support for multiple chlors; but let's not overcomplicate things so leave the settings enabled but ignore them later
460464
if (data.orp.chlorDosingMethod > 0) {
461465
// need to adjust for more than one chlor... but since there is only a single
462466
// "useChlorinator" field this would be a lot of changes across the board
@@ -468,7 +472,7 @@
468472
$('div.picValueSpinner[data-bind="poolSetpoint"]').removeClass('disabled');
469473
$('div.picValueSpinner[data-bind="spaSetpoint"]').removeClass('disabled');
470474
$('div.cfgChlorinator').find('div.picPickList[data-bind="body"]').removeClass('disabled');
471-
}
475+
} */
472476
}
473477
else {
474478
el.find('div.picPickList[data-bind="orp.dosingMethod"]').show();
@@ -481,6 +485,8 @@
481485
$('div.picValueSpinner[data-bind="poolSetpoint"]').removeClass('disabled');
482486
$('div.picValueSpinner[data-bind="spaSetpoint"]').removeClass('disabled');
483487
$('div.cfgChlorinator').find('div.picPickList[data-bind="body"]').removeClass('disabled');
488+
el.find('div.picPickList[data-bind="orp.chlorId"]').hide();
489+
el.find('div.pnl-orpDose-time').show();
484490
}
485491
}
486492
},
@@ -545,6 +551,19 @@
545551
}
546552
}).css({ marginRight: '1rem' });
547553
line = $('<div></div>').appendTo(grpDose);
554+
$('<div></div>').appendTo(line).pickList({
555+
binding: 'orp.chlorId',
556+
bindColumn: 0, displayColumn: 1,
557+
labelText: 'Chlorinator',
558+
columns: [{ binding: 'id', text: 'id', hidden: true }, { binding: 'name', text: 'Name', style: { whiteSpace: 'nowrap' } }],
559+
items: o.chlorinators.filter(chlor => chlor.isActive),
560+
inputAttrs: { style: { width: '16rem' } },
561+
labelAttrs: { style: { width: '6rem' } }
562+
})
563+
.on('selchanged', function (evt) {
564+
console.log(`changed chlorinator to ${evt.newItem.name}`);
565+
self._showOptions();
566+
}).css({ marginRight: '1rem' });
548567
$('<div></div>').appendTo(line).pickList({
549568
binding: 'orp.chlorDosingMethod',
550569
bindColumn: 0, displayColumn: 2,

0 commit comments

Comments
 (0)