Skip to content

Commit 0e95afb

Browse files
committed
Merge remote-tracking branch 'origin/master' into image-snapshots
2 parents aae316c + c9438f1 commit 0e95afb

28 files changed

+336
-112
lines changed

.travis-scripts/install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
44

55
# Install some custom requirements on OS X
6-
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u66-b17/jdk-8u66-macosx-x64.dmg
7-
hdiutil mount jdk-8u66-macosx-x64.dmg
8-
sudo installer -pkg /Volumes/JDK\ 8\ Update\ 66/JDK\ 8\ Update\ 66.pkg -target LocalSystem
6+
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-macosx-x64.dmg
7+
hdiutil mount jdk-8u92-macosx-x64.dmg
8+
sudo installer -pkg /Volumes/JDK\ 8\ Update\ 92/JDK\ 8\ Update\ 92.pkg -target LocalSystem
99
else
1010
export DISPLAY=:99.0
1111
sh -e /etc/init.d/xvfb start
1212
pip install --user codecov
13-
fi
13+
fi

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ install:
2929
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ./gradlew :ui:assemble --stacktrace || ./gradlew --stacktrace '
3030

3131
script:
32-
- ./gradlew check --stacktrace -Pheadless=true
32+
- ./gradlew check --stacktrace -Pheadless=true -PlogTests
3333

3434
after_success:
3535
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then codecov ; fi

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build_script:
66

77
# to run your custom scripts instead of automatic tests
88
test_script:
9-
- gradlew.bat check --stacktrace -Pheadless=true
9+
- gradlew.bat check --stacktrace -Pheadless=true -PlogTests
1010

1111
platform:
1212
- x64
@@ -28,4 +28,4 @@ deploy:
2828
appveyor_repo_tag: true # deploy on tag push only
2929

3030
cache:
31-
- C:\Users\appveyor\.gradle
31+
- C:\Users\appveyor\.gradle

build.gradle

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ allprojects {
140140
// Turn on test results
141141
test {
142142
testLogging {
143-
events "failed"
143+
if (project.hasProperty('logTests')) {
144+
events "started", "passed", "skipped", "failed"
145+
} else {
146+
events "failed"
147+
}
144148
exceptionFormat "full"
145149
}
146150
doFirst {
@@ -168,12 +172,12 @@ project(":core") {
168172
repositories {
169173
flatDir {
170174
dirs 'libs'
171-
maven {
172-
url = "http://first.wpi.edu/FRC/roborio/maven/development"
173-
}
174-
maven {
175-
url = "https://github.com/WPIRoboticsProjects/rosjava_mvn_repo/raw/master"
176-
}
175+
}
176+
maven {
177+
url = "http://first.wpi.edu/FRC/roborio/maven/development"
178+
}
179+
maven {
180+
url = "https://github.com/WPIRoboticsProjects/rosjava_mvn_repo/raw/master"
177181
}
178182
}
179183

core/src/main/java/edu/wpi/grip/core/OperationMetaData.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package edu.wpi.grip.core;
22

3+
import com.google.common.base.MoreObjects;
4+
35
import javax.annotation.concurrent.Immutable;
46
import java.util.function.Supplier;
57

@@ -38,4 +40,12 @@ public OperationDescription getDescription() {
3840
public Supplier<Operation> getOperationSupplier() {
3941
return operationSupplier;
4042
}
43+
44+
@Override
45+
public String toString() {
46+
return MoreObjects.toStringHelper(OperationMetaData.class)
47+
.add("description", description)
48+
.add("operationSupplier", operationSupplier)
49+
.toString();
50+
}
4151
}

core/src/main/java/edu/wpi/grip/core/operations/CVOperations.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package edu.wpi.grip.core.operations;
22

33

4+
import com.google.common.annotations.VisibleForTesting;
45
import com.google.common.collect.ImmutableList;
56
import com.google.common.eventbus.EventBus;
67
import com.google.inject.Inject;
@@ -60,7 +61,7 @@ public class CVOperations {
6061
templateFactory.createAllMatTwoSource(opencv_core::bitwise_and)),
6162

6263
new OperationMetaData(CVOperation.defaults("CV bitwise_not", "Calculate per-element bit-wise inversion of an image."),
63-
templateFactory.createAllMatTwoSource(opencv_core::bitwise_not)),
64+
templateFactory.createAllMatOneSource(opencv_core::bitwise_not)),
6465

6566
new OperationMetaData(CVOperation.defaults("CV bitwise_or", "Calculate the per-element bit-wise disjunction of two images."),
6667
templateFactory.createAllMatTwoSource(opencv_core::bitwise_or)),
@@ -203,7 +204,7 @@ public class CVOperations {
203204
new SocketHint.Builder<>(Scalar.class).identifier("borderValue").initialValueSupplier(opencv_imgproc::morphologyDefaultBorderValue).build(),
204205
SocketHints.Outputs.createMatSocketHint("dst"),
205206
(src, kernel, anchor, iterations, borderType, borderValue, dst) -> {
206-
opencv_imgproc.dilate(src, kernel, dst, anchor, iterations.intValue(), borderType.value, borderValue);
207+
opencv_imgproc.dilate(src, dst, kernel, anchor, iterations.intValue(), borderType.value, borderValue);
207208
}
208209
)),
209210

@@ -217,7 +218,7 @@ public class CVOperations {
217218
new SocketHint.Builder<>(Scalar.class).identifier("borderValue").initialValueSupplier(opencv_imgproc::morphologyDefaultBorderValue).build(),
218219
SocketHints.Outputs.createMatSocketHint("dst"),
219220
(src, kernel, anchor, iterations, borderType, borderValue, dst) -> {
220-
opencv_imgproc.erode(src, kernel, dst, anchor, iterations.intValue(), borderType.value, borderValue);
221+
opencv_imgproc.erode(src, dst, kernel, anchor, iterations.intValue(), borderType.value, borderValue);
221222
}
222223
)),
223224

@@ -277,7 +278,7 @@ public class CVOperations {
277278
templateFactory.create(
278279
SocketHints.Inputs.createMatSocketHint("src", false),
279280
new SocketHint.Builder<>(Size.class).identifier("dsize").initialValueSupplier(() -> new Size(0, 0)).build(),
280-
SocketHints.Inputs.createNumberSpinnerSocketHint("fx", .25), SocketHints.Inputs.createNumberSpinnerSocketHint("fx", .25),
281+
SocketHints.Inputs.createNumberSpinnerSocketHint("fx", .25), SocketHints.Inputs.createNumberSpinnerSocketHint("fy", .25),
281282
SocketHints.createEnumSocketHint("interpolation", InterpolationFlagsEnum.INTER_LINEAR),
282283
SocketHints.Outputs.createMatSocketHint("dst"),
283284
(src, dsize, fx, fy, interpolation, dst) -> {
@@ -314,6 +315,14 @@ public class CVOperations {
314315
);
315316
}
316317

318+
/**
319+
* All of the operations that this list supplies
320+
*/
321+
@VisibleForTesting
322+
ImmutableList<OperationMetaData> operations() {
323+
return ImmutableList.<OperationMetaData>builder().addAll(coreOperations).addAll(imgprocOperation).build();
324+
}
325+
317326
public void addOperations() {
318327
coreOperations.stream()
319328
.map(OperationAddedEvent::new)

core/src/main/java/edu/wpi/grip/core/operations/Operations.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package edu.wpi.grip.core.operations;
22

3+
import com.google.common.annotations.VisibleForTesting;
34
import com.google.common.collect.ImmutableList;
45
import com.google.common.eventbus.EventBus;
56
import com.google.inject.Inject;
@@ -106,6 +107,11 @@ public class Operations {
106107
);
107108
}
108109

110+
@VisibleForTesting
111+
ImmutableList<OperationMetaData> operations() {
112+
return operations;
113+
}
114+
109115
public void addOperations() {
110116
operations.stream()
111117
.map(OperationAddedEvent::new)

core/src/main/java/edu/wpi/grip/core/operations/templated/FiveSourceOneDestinationOperation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public interface Performer<T1, T2, T3, T4, T5, R> {
3434
this.input4 = inputSocketFactory.create(t4SocketHint);
3535
this.input5 = inputSocketFactory.create(t5SocketHint);
3636
this.output = outputSocketFactory.create(rSocketHint);
37+
assert output.getValue().isPresent() : TemplateFactory.ASSERTION_MESSAGE;
3738
}
3839

3940
@Override

core/src/main/java/edu/wpi/grip/core/operations/templated/FourSourceOneDestinationOperation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public interface Performer<T1, T2, T3, T4, R> {
3232
this.input3 = inputSocketFactory.create(t3SocketHint);
3333
this.input4 = inputSocketFactory.create(t4SocketHint);
3434
this.output = outputSocketFactory.create(rSocketHint);
35+
assert output.getValue().isPresent() : TemplateFactory.ASSERTION_MESSAGE;
3536
}
3637

3738

core/src/main/java/edu/wpi/grip/core/operations/templated/OneSourceOneDestinationOperation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public interface Performer<T1, R> {
2626
SocketHint<R> rSocketHint) {
2727
this.input1 = inputSocketFactory.create(t1SocketHint);
2828
this.output = outputSocketFactory.create(rSocketHint);
29+
assert output.getValue().isPresent() : TemplateFactory.ASSERTION_MESSAGE;
2930
this.performer = performer;
3031
}
3132

0 commit comments

Comments
 (0)