Skip to content

Commit 645e540

Browse files
committed
Reorder sockets to maintain backwards compatibility
1 parent 8c145d5 commit 645e540

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/src/main/java/edu/wpi/grip/core/operations/composite/FindBlobsOperation.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public FindBlobsOperation(InputSocket.Factory inputSocketFactory, OutputSocket.F
6262
this.inputSocket = inputSocketFactory.create(inputHint);
6363
this.minAreaSocket = inputSocketFactory.create(minAreaHint);
6464
this.circularitySocket = inputSocketFactory.create(circularityHint);
65+
this.colorSocket = inputSocketFactory.create(colorHint);
6566
this.convexitySocket = inputSocketFactory.create(convexityHint);
6667
this.inertiaRatioSocket = inputSocketFactory.create(inertiaRatioHint);
67-
this.colorSocket = inputSocketFactory.create(colorHint);
6868

6969
this.outputSocket = outputSocketFactory.create(blobsHint);
7070
}
@@ -75,9 +75,10 @@ public List<InputSocket> getInputSockets() {
7575
inputSocket,
7676
minAreaSocket,
7777
circularitySocket,
78+
colorSocket,
79+
//Sockets placed last to maintain backwards compatibility in deserialization
7880
convexitySocket,
79-
inertiaRatioSocket,
80-
colorSocket
81+
inertiaRatioSocket
8182
);
8283
}
8384

@@ -94,10 +95,9 @@ public void perform() {
9495
final Mat input = inputSocket.getValue().get().getCpu();
9596
final Number minArea = minAreaSocket.getValue().get();
9697
final List<Number> circularity = circularitySocket.getValue().get();
98+
final Boolean darkBlobs = colorSocket.getValue().get();
9799
final List<Number> convexity = convexitySocket.getValue().get();
98100
final List<Number> inertiaRatio = inertiaRatioSocket.getValue().get();
99-
final Boolean darkBlobs = colorSocket.getValue().get();
100-
101101

102102
final SimpleBlobDetector blobDetector = SimpleBlobDetector.create(new SimpleBlobDetector
103103
.Params()

0 commit comments

Comments
 (0)