Open mickp opened 5 years ago
[...] We should perhaps query this once on device init, and store it on the device instance.
Definitely.
[...] I suspect it's because the laser is reporting its max power incorrectly. [...]
Any clue why this is happening? Is this another case of the laser sending garbage back?
Cockpit calls set_power_mw(value) on laser devices to set laser power. This appears to work correctly for a dummy laser device and the DeepStar lasers, but does not always work correctly for Cobolt lasers.
Monitoring the Cobolt log shows that sometimes the laser power is set correctly, other times it is set to zero, or 0.0001W, often several times in quick succession.
In the LaserDevice base class:
In the Cobolt implementation:
The correct power is not getting to CoboltLaser._set_power_mw. I suspect it's because the laser is reporting its max power incorrectly in the bounds check in LaserDevice.set_power_mw. We should perhaps query this once on device init, and store it on the device instance.