fixed gain slider not updating

This commit is contained in:
ori agranat
2020-02-27 21:18:25 +02:00
parent 4629e2052c
commit 9bba0f3798

View File

@@ -52,7 +52,8 @@ public class SocketHandler {
@SuppressWarnings("unchecked")
void onBinaryMessage(WsBinaryMessageContext context) throws Exception {
Map<String, Object> deserialized = objectMapper.readValue((byte[]) ArrayUtils.toPrimitive(context.data()),
new TypeReference<>(){});
new TypeReference<>() {
});
for (Map.Entry<String, Object> entry : deserialized.entrySet()) {
try {
VisionProcess currentProcess = VisionManager.getCurrentUIVisionProcess();
@@ -168,6 +169,10 @@ public class SocketHandler {
currentCamera.setBrightness((Integer) entry.getValue());
break;
}
case "gain": {
currentCamera.setGain((Integer) entry.getValue());
break;
}
case "videoModeIndex": {
if (currentPipeline instanceof StandardCVPipeline)
((StandardCVPipeline) currentPipeline).settings.point = new ArrayList<>();//This will reset the calibration