@@ -27,12 +27,13 @@ public enum NetworkProtocol {
2727 @ Setting (label = "FRC Team Number" , description = "The team number, if used for FRC" )
2828 private int teamNumber = 0 ;
2929
30- @ Setting (label = "NetworkTables Server Address" , description = "The host that runs the Network Protocol server. If not " +
31- "specified and Network Tables is specified as the protocol, the hostname is derived from the team number." )
32- private String networkProtocolServerAddress = "" ;
30+ @ Setting (label = "NetworkTables Server Address" , description = "The host that runs the Network Protocol server. " +
31+ "If not specified and NetworkTables is specified as the protocol, the hostname is derived from the team " +
32+ "number." )
33+ private String publishAddress = "" ;
3334
34- @ Setting (label = "Deploy Address" , description = "The remote host that grip should be remotely deployed to. If not " +
35- "specified and Network Tables is specified as the protocol , the hostname is derived from the team number." )
35+ @ Setting (label = "Deploy Address" , description = "The remote host that grip should be remotely deployed to. If " +
36+ "not specified, the hostname is derived from the team number." )
3637 private String deployAddress = "" ;
3738
3839 public void setNetworkProtocol (NetworkProtocol networkProtocol ) {
@@ -52,13 +53,13 @@ public int getTeamNumber() {
5253 return teamNumber ;
5354 }
5455
55- public void setNetworkProtocolServerAddress (String networkProtocolServerAddress ) {
56- this .networkProtocolServerAddress =
57- checkNotNull (networkProtocolServerAddress , "Network Protocol Server Address cannot be null" );
56+ public void setPublishAddress (String publishAddress ) {
57+ this .publishAddress =
58+ checkNotNull (publishAddress , "Network Protocol Server Address cannot be null" );
5859 }
5960
60- public String getNetworkProtocolServerAddress () {
61- return networkProtocolServerAddress ;
61+ public String getPublishAddress () {
62+ return publishAddress ;
6263 }
6364
6465 public void setDeployAddress (String deployAddress ) {
@@ -71,29 +72,31 @@ public String getDeployAddress() {
7172
7273 /**
7374 * @return The address of the machine that the NetworkTables server is running on. If
74- * {@link #setNetworkProtocolServerAddress} is specified, that is returned, otherwise this is based on the team number.
75+ * {@link #setPublishAddress} is specified, that is returned, otherwise this is based on the team
76+ * number.
7577 */
76- public String computeNetworkProtocolServerAddress () {
77- if (networkProtocolServerAddress .isEmpty ()) {
78- return "roboio -" + teamNumber + "-frc.local" ;
78+ public String computePublishAddress () {
79+ if (publishAddress == null || publishAddress .isEmpty ()) {
80+ return "roborio -" + teamNumber + "-frc.local" ;
7981 } else {
80- return networkProtocolServerAddress ;
82+ return publishAddress ;
8183 }
8284 }
8385
84- public String computeDeployAddresss () {
85- if (networkProtocolServerAddress .isEmpty ()) {
86- return "roboio -" + teamNumber + "-frc.local" ;
86+ public String computeDeployAddress () {
87+ if (deployAddress == null || deployAddress .isEmpty ()) {
88+ return "roborio -" + teamNumber + "-frc.local" ;
8789 } else {
88- return networkProtocolServerAddress ;
90+ return publishAddress ;
8991 }
9092 }
9193
9294 @ Override
9395 public String toString () {
9496 return MoreObjects .toStringHelper (this )
9597 .add ("networkProtocol" , networkProtocol )
96- .add ("networkProtocolServerAddress" , networkProtocolServerAddress )
98+ .add ("publishAddress" , publishAddress )
99+ .add ("deployAddress" , deployAddress )
97100 .add ("teamNumber" , teamNumber )
98101 .toString ();
99102 }
0 commit comments