Skip to content

Commit c2d59db

Browse files
Merge pull request #35 from NeuronRobotics/kh/TimeKeeper-Update
Kh/time keeper update
2 parents 03aa4c2 + 23f2928 commit c2d59db

File tree

286 files changed

+3937
-980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+3937
-980
lines changed

build.gradle

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
apply plugin: 'java'
22
apply plugin: 'eclipse'
3-
apply plugin: 'maven'
3+
if (project == rootProject) {
4+
apply plugin: 'maven'
5+
}
6+
apply plugin: 'java-library'
47
apply plugin: 'signing'
58

69
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
@@ -9,14 +12,14 @@ File buildDir = file(".");
912

1013
Properties props = new Properties()
1114
props.load(new FileInputStream(buildDir.getAbsolutePath()+"/src/main/resources/com/neuronrobotics/sdk/config/build.properties"))
12-
//sourceSets {
13-
//
14-
// test {
15-
// java {
16-
// srcDirs = ["test/java/src" ] // Note @Peter's comment below
17-
// }
18-
// }
19-
//}
15+
sourceSets {
16+
17+
test {
18+
java {
19+
srcDirs = ["test/java/src" ]
20+
}
21+
}
22+
}
2023

2124
manifest {
2225
attributes(
@@ -31,7 +34,7 @@ manifest {
3134

3235
)
3336
}
34-
37+
if (project == rootProject)
3538
jar.archiveName = "nrsdk-"+props."app.version"+"-jar-with-dependencies.jar"
3639

3740
//apply from: 'http://gradle-plugins.mihosoft.eu/latest/vlicenseheader.gradle'
@@ -40,27 +43,36 @@ jar.archiveName = "nrsdk-"+props."app.version"+"-jar-with-dependencies.jar"
4043

4144
repositories {
4245
mavenCentral()
46+
// maven {
47+
// url "https://repository.ow2.org/nexus/content/repositories/public/"
48+
// }
4349
}
4450

4551
dependencies {
4652
//TODO change as many of these as possible to Maven repositories
47-
compile fileTree (dir: 'libs', includes: ['*.jar'])
48-
testCompile 'junit:junit:4.12'
49-
compile 'gov.nist.math:jama:1.0.2'
50-
compile 'com.miglayout:miglayout-swing:4.1'
51-
compile 'org.igniterealtime.smack:smack:3.2.1'
53+
api fileTree (dir: 'libs', includes: ['*.jar'])
54+
testImplementation 'junit:junit:4.12'
55+
implementation 'com.google.code.gson:gson:2.5'
56+
57+
api 'gov.nist.math:jama:1.0.2'
58+
implementation 'com.miglayout:miglayout-swing:4.1'
59+
implementation 'org.igniterealtime.smack:smack:3.2.1'
5260

53-
compile 'org.igniterealtime.smack:smackx:3.2.1'
54-
compile 'org.apache.commons:commons-lang3:3.2.1'
55-
compile 'org.usb4java:usb4java:1.2.0'
56-
compile 'org.usb4java:usb4java-javax:1.2.0'
61+
implementation 'org.igniterealtime.smack:smackx:3.2.1'
62+
implementation 'org.apache.commons:commons-lang3:3.2.1'
63+
api 'org.usb4java:usb4java:1.2.0'
64+
api 'org.usb4java:usb4java-javax:1.2.0'
5765

5866
//compile fileTree (dir: '../doychinNRJAVASERISL/nrjavaserial/build/libs', includes: ['*.jar'])
59-
compile "com.neuronrobotics:nrjavaserial:5.1.1"
67+
api "com.neuronrobotics:nrjavaserial:5.1.1"
6068
// https://mvnrepository.com/artifact/org.apache.commons/commons-math3
61-
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
62-
63-
69+
api group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
70+
// https://mvnrepository.com/artifact/net.sf.bluecove/bluecove-gpl
71+
api group: 'net.sf.bluecove', name: 'bluecove-gpl', version: '2.1.0'
72+
api group: 'io.ultreia', name: 'bluecove', version: '2.1.1'
73+
// https://mvnrepository.com/artifact/motej/motej
74+
//api group: 'motej', name: 'motej', version: '0.9-2008.02.05-patched', ext: 'pom'
75+
6476

6577
}
6678

@@ -73,11 +85,13 @@ archivesBaseName = "java-bowler"
7385
version = props."app.version"
7486

7587
task javadocJar(type: Jar) {
88+
if (project == rootProject)
7689
classifier = 'javadoc'
7790
from javadoc
7891
}
7992

8093
task sourcesJar(type: Jar) {
94+
if (project == rootProject)
8195
classifier = 'sources'
8296
from sourceSets.main.allSource
8397
}

examples/java/src/com/neuronrobotics/test/nrdk/BluetoothConector.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import com.neuronrobotics.sdk.wireless.bluetooth.BlueCoveManager;
55
import com.neuronrobotics.sdk.wireless.bluetooth.BluetoothSerialConnection;
66

7-
// TODO: Auto-generated Javadoc
7+
// Auto-generated Javadoc
88
/**
99
* The Class BluetoothConector.
1010
*/
@@ -19,16 +19,16 @@ public static void main(String[] args) {
1919
DyIO dyio;
2020
BlueCoveManager manager = new BlueCoveManager();
2121
String devices[] = manager.getAvailableSerialDevices(true);
22-
System.out.println("Devices: ");
22+
com.neuronrobotics.sdk.common.Log.error("Devices: ");
2323
for (String d: devices) {
24-
System.out.println(d);
24+
com.neuronrobotics.sdk.common.Log.error(d);
2525
}
2626
if (devices.length > 0) {
27-
System.out.println("Connecting to : "+devices[0]);
27+
com.neuronrobotics.sdk.common.Log.error("Connecting to : "+devices[0]);
2828
dyio = new DyIO(new BluetoothSerialConnection(manager, devices[0]));
2929
dyio.connect();
3030
if(dyio.ping() )
31-
System.out.println("All OK!");
31+
com.neuronrobotics.sdk.common.Log.error("All OK!");
3232

3333
}
3434
System.exit(0);

examples/java/src/com/neuronrobotics/test/nrdk/ByteListTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.neuronrobotics.sdk.common.ByteList;
44

5-
// TODO: Auto-generated Javadoc
5+
// Auto-generated Javadoc
66
/**
77
* The Class ByteListTest.
88
*/
@@ -15,9 +15,9 @@ public class ByteListTest {
1515
*/
1616
public static void main(String [] args) {
1717
byte [] b = ByteList.convertTo16(526);
18-
System.out.println(b[0] + " - " + b[1]);
18+
com.neuronrobotics.sdk.common.Log.error(b[0] + " - " + b[1]);
1919

2020
int i = ByteList.convertToInt(b);
21-
System.out.println(i);
21+
com.neuronrobotics.sdk.common.Log.error(i);
2222
}
2323
}

examples/java/src/com/neuronrobotics/test/nrdk/ConnectionDialogTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import com.neuronrobotics.sdk.dyio.DyIO;
55
import com.neuronrobotics.sdk.ui.ConnectionDialog;
66

7-
// TODO: Auto-generated Javadoc
7+
// Auto-generated Javadoc
88
/**
99
* The Class ConnectionDialogTest.
1010
*/
@@ -16,16 +16,16 @@ public class ConnectionDialogTest {
1616
* @param args the arguments
1717
*/
1818
public static void main(String[] args) {
19-
System.out.println("Starting");
19+
com.neuronrobotics.sdk.common.Log.error("Starting");
2020
DyIO dyio=new DyIO();
2121
if (!ConnectionDialog.getBowlerDevice(dyio)){
22-
System.err.println("Dialog failed");
22+
com.neuronrobotics.sdk.common.Log.error("Dialog failed");
2323
System.exit(1);
2424
}
2525
Log.enableDebugPrint();
2626
dyio.ping();
2727
dyio.disconnect();
28-
System.out.println("Connection OK!");
28+
com.neuronrobotics.sdk.common.Log.error("Connection OK!");
2929
System.exit(0);
3030
//while(true);
3131
}

examples/java/src/com/neuronrobotics/test/nrdk/ExtendGenericPID.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import com.neuronrobotics.sdk.pid.GenericPIDDevice;
99
import com.neuronrobotics.sdk.ui.ConnectionDialog;
1010

11-
// TODO: Auto-generated Javadoc
11+
// Auto-generated Javadoc
1212
/**
1313
* The Class ExtendGenericPID.
1414
*/
@@ -24,14 +24,14 @@ private ExtendGenericPID(){
2424
System.exit(1);
2525
}
2626
try {
27-
System.out.println("Extended get position: "+pid.getExtendedValue(0));
27+
com.neuronrobotics.sdk.common.Log.error("Extended get position: "+pid.getExtendedValue(0));
2828
pid.GetAllPIDPosition();
2929
pid.GetPIDPosition(2);
3030
pid.disconnect();
31-
System.out.println("All OK!");
31+
com.neuronrobotics.sdk.common.Log.error("All OK!");
3232
System.exit(0);
3333
} catch (Exception e) {
34-
// TODO Auto-generated catch block
34+
// Auto-generated catch block
3535
e.printStackTrace();
3636
pid.disconnect();
3737
System.exit(1);

examples/java/src/com/neuronrobotics/test/nrdk/GenericPIDTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import com.neuronrobotics.sdk.network.BowlerTCPClient;
55
import com.neuronrobotics.sdk.pid.GenericPIDDevice;
66

7-
// TODO: Auto-generated Javadoc
7+
// Auto-generated Javadoc
88
/**
99
* The Class GenericPIDTest.
1010
*/
@@ -25,17 +25,17 @@ public static void main(String[] args) {
2525
try {
2626
pid.setConnection(new BowlerTCPClient("cortex.wpi.edu", 1965));
2727
} catch (Exception e) {
28-
// TODO Auto-generated catch block
28+
// Auto-generated catch block
2929
e.printStackTrace();
3030
}
3131
//pid.setConnection(new BowlerTCPClient("192.168.0.134", 1965));
3232
pid.GetAllPIDPosition();
3333
pid.GetPIDPosition(2);
3434
pid.disconnect();
35-
System.out.println("All OK!");
35+
com.neuronrobotics.sdk.common.Log.error("All OK!");
3636
System.exit(0);
3737
} catch (Exception e) {
38-
// TODO Auto-generated catch block
38+
// Auto-generated catch block
3939
e.printStackTrace();
4040
pid.disconnect();
4141
System.exit(1);

examples/java/src/com/neuronrobotics/test/nrdk/PingSpeedTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import com.neuronrobotics.sdk.serial.SerialConnection;
1010
import com.neuronrobotics.sdk.ui.ConnectionDialog;
1111

12-
// TODO: Auto-generated Javadoc
12+
// Auto-generated Javadoc
1313
/**
1414
* The Class PingSpeedTest.
1515
*/
@@ -30,13 +30,13 @@ public static void main(String[] args) {
3030
// //c = new BowlerTCPClient("192.168.1.10", 1866);
3131
// c = new UDPBowlerConnection(InetAddress.getByName("130.215.49.37"), 1865);
3232
// } catch (Exception e) {
33-
// // TODO Auto-generated catch block
33+
// // Auto-generated catch block
3434
// e.printStackTrace();
3535
// System.exit(1);
3636
// }
3737
if(c==null)
3838
System.exit(1);
39-
System.out.println("Starting test");
39+
com.neuronrobotics.sdk.common.Log.error("Starting test");
4040
Log.enableInfoPrint();
4141
GenericDevice dev = new GenericDevice(c);
4242
dev.connect();
@@ -51,10 +51,10 @@ public static void main(String[] args) {
5151

5252
double ms=System.currentTimeMillis()-start;
5353
avg +=ms;
54-
System.out.println("Average cycle time: "+(int)(avg/i)+"ms\t\t\t this loop was: "+ms);
54+
com.neuronrobotics.sdk.common.Log.error("Average cycle time: "+(int)(avg/i)+"ms\t\t\t this loop was: "+ms);
5555
dev.getNamespaces();
5656
}
57-
System.out.println("Average cycle time for ping: "+(avg/i)+" ms");
57+
com.neuronrobotics.sdk.common.Log.error("Average cycle time for ping: "+(avg/i)+" ms");
5858
dev.disconnect();
5959
System.exit(0);
6060
}

examples/java/src/com/neuronrobotics/test/nrdk/SimpleConnection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.neuronrobotics.sdk.genericdevice.GenericDevice;
44
import com.neuronrobotics.sdk.serial.SerialConnection;
55

6-
// TODO: Auto-generated Javadoc
6+
// Auto-generated Javadoc
77
/**
88
* The Class SimpleConnection.
99
*/
@@ -16,7 +16,7 @@ public class SimpleConnection {
1616
*/
1717
public static void main(String[] args) {
1818
SerialConnection s = null;
19-
System.out.println("Connecting and disconnecting");
19+
com.neuronrobotics.sdk.common.Log.error("Connecting and disconnecting");
2020

2121
//Windows
2222
//s=new SerialConnection("COM5");
@@ -41,7 +41,7 @@ public static void main(String[] args) {
4141
avg +=ms;
4242
start = System.currentTimeMillis();
4343
}
44-
System.out.println("Average cycle time for ping: "+(avg/i)+" ms");
44+
com.neuronrobotics.sdk.common.Log.error("Average cycle time for ping: "+(avg/i)+" ms");
4545
dyio.disconnect();
4646
System.exit(0);
4747
//while(true);

examples/java/src/com/neuronrobotics/test/nrdk/network/NetworkServerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import com.neuronrobotics.sdk.network.BowlerUDPServer;
99
import com.neuronrobotics.sdk.util.ThreadUtil;
1010

11-
// TODO: Auto-generated Javadoc
11+
// Auto-generated Javadoc
1212
/**
1313
* The Class NetworkServerTest.
1414
*/
@@ -43,7 +43,7 @@ public static void main(String [] args){
4343
new NetworkServerTest();
4444
}catch (Exception e){
4545
e.printStackTrace();
46-
System.err.println("###SERVER Failed out!");
46+
com.neuronrobotics.sdk.common.Log.error("###SERVER Failed out!");
4747
System.exit(1);
4848
}
4949
}

0 commit comments

Comments
 (0)