-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NetworkTableSource #646
Add NetworkTableSource #646
Conversation
|
||
private void addListener() { | ||
entryListenerFunctionUid = NetworkTablesJNI.addEntryListener(path, (uid, key, value, flags) | ||
-> objectProperty.set(value), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguments should each be on their own line
Current coverage is 58.43% (diff: 70.63%)@@ master #646 diff @@
==========================================
Files 196 198 +2
Lines 6165 6282 +117
Methods 0 0
Messages 0 0
Branches 561 569 +8
==========================================
+ Hits 3578 3671 +93
- Misses 2422 2442 +20
- Partials 165 169 +4
|
Write tests for the network tables source |
|
* @param path The path of the object to get | ||
*/ | ||
public NetworkReceiver(String path) { | ||
checkArgument(!path.isEmpty(), "Name cannot be an empty string"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also add an explicit nullcheck with checkNotNull(path, ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha.... Thank you!
Tests randomly fail... |
@SamCarlberg Can you help out Austin? |
networkReceiver.close(); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline at EOF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
So maybe the error was a fluke? I reran the travis tests 3 times and the build did not fail. |
/** | ||
* Provides a way to get a {@link Types Type} from a NetworkTable that GRIP is connected to. | ||
*/ | ||
@XStreamAlias("grip:NetworkTableValue") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this to be "grip:NetworkTableEntry"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
I labeled this as ready for review because I have not seen the tests failing after merging master into this branch. |
So what I really don't want is Network Tables initialized in tests that don't need it. That's why, up until this point I've kept network tables out of tests. |
ummmm..... no promises but I will give it a shot |
# Conflicts: # ui/src/test/java/edu/wpi/grip/ui/pipeline/PipelineUITest.java
@JLLeitschuh I have no idea how to do this. If you could please lend a hand 😃 |
*/ | ||
public abstract class NetworkReceiver implements AutoCloseable { | ||
|
||
protected final String path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a protected field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in person
closes #363
closes #572
closes #635