Closed lo-co closed 8 years ago
This was not an initialization issue. This was a UI issue. Array containing all of the power data was in the wrong order.
Matt, the power controls in the UI are now jumbled after this fix. For example, pump
is controlling the o3 lamp, ozone gen
is controlling the denuder, tec
is controlling the sample pump
Arrrrggggh...thought I got rid of this one! I see what you are saying.
OK. So, this was related to the UI (again). In cvt-service.js
, we had code to convert the integer response.data.general.power
to a binary string:
var power = Number(response.data.general.power).toString(2);
while (power.length < 5) {
power += "0";
}
cvt.power.Pump = power[1] == '1';
cvt.power.O3Gen = power[2] == '1';
cvt.power.Denuder = power[4] == '1';
cvt.power.Laser = power[3] == '1';
cvt.power.TEC = power[0] == '1';
So, this works if the value is something like 3 - converts to the string 11
and results in the 5-bit string 11000
. But when we have 11, this looks like 10110
and this was wrong. What we wanted was 01011
and the power array reversed. So, in the end, we wound up with this:
var power = Number(response.data.general.power).toString(2);
while (power.length < 5) {
power = "0"+ power;
}
cvt.power.Pump = power[3] == '1';
cvt.power.O3Gen = power[2] == '1';
cvt.power.Denuder = power[0] == '1';
cvt.power.Laser = power[1] == '1';
cvt.power.TEC = power[4] == '1';
Hi Matt, the logic is still not right - we are seeing the same issues as noted above (e.g. O3
controlling denuder, pump
controlling O3 etc)
Another oddity is that behaviour seems to change. Upon cycling denuder
for the first time after launching the system it controlled the laser power supply. After this initial cycling, control of the laser cycling deferred to laser
. I didn;t observe this change for the other controls.
We need to go over this together whenever you are around.
Dave made some changes to this last night and it looks like it is now working. Issues was with consistency in ordeing. Closing this now.
Ozone and pump power supplies not following ini file.