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