Skip to content

Commit d2ead86

Browse files
committed
Merge branch 'development' of github.com:NeuronRobotics/java-bowler into development
2 parents 170bf68 + 52f6e53 commit d2ead86

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

javasdk/NRSDK/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<classpathentry kind="lib" path="lib_addons/usb4java-1.2.0.jar"/>
2828
<classpathentry kind="lib" path="lib_addons/usb4java-javax-1.2.0.jar"/>
2929
<classpathentry kind="lib" path="lib_addons/vecmath.jar"/>
30-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
3130
<classpathentry kind="lib" path="lib_addons/j3dcore.jar"/>
3231
<classpathentry kind="lib" path="lib_addons/j3dutils.jar"/>
32+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
3333
<classpathentry kind="output" path="bin"/>
3434
</classpath>

javasdk/NRSDK/addons/com/neuronrobotics/sdk/ui/ConnectionDialog.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,14 @@ public void windowGainedFocus(WindowEvent e) {
108108

109109
private void loadDefaultConnections() {
110110
try{
111-
if(!OsInfoUtil.isWindows() || OsInfoUtil.getOsName().contains("Windows 8") ){
112-
111+
try{
113112
addConnectionPanel(new UsbConnectionPanel());
114-
}else{
115-
System.out.println(OsInfoUtil.getOsName());
113+
addConnectionPanel(new BluetoothConnectionPanel());
116114
addConnectionPanel(new SerialConnectionPanel());
117-
}
118-
addConnectionPanel(new BluetoothConnectionPanel());
119-
//serial at the end if USB is enabled
120-
if(!OsInfoUtil.isWindows())
115+
}catch(Exception ex){
121116
addConnectionPanel(new SerialConnectionPanel());
122-
117+
addConnectionPanel(new BluetoothConnectionPanel());
118+
}
123119
}catch(Error e){
124120
e.printStackTrace();
125121
Log.error("This is not a java 8 compliant system, removing the serial, bluetooth and usb connections");

javasdk/NRSDK/addons/com/neuronrobotics/sdk/ui/UsbConnectionPanel.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,28 @@ public BowlerAbstractConnection getConnection() {
107107

108108

109109
public void refresh() {
110-
System.err.println("Refreshing USB");
110+
//System.err.println("Refreshing USB");
111111
connectionCbo.removeAllItems();
112112

113-
List<UsbDevice> prts;
114-
try {
115-
prts = UsbCDCSerialConnection.getAllUsbBowlerDevices();
113+
List<UsbDevice> prts=null;
114+
115+
try {
116+
prts = UsbCDCSerialConnection.getAllUsbBowlerDevices();
117+
} catch (UnsupportedEncodingException | UsbDisconnectedException
118+
| SecurityException | UsbException e1) {
119+
e1.printStackTrace();
120+
throw new RuntimeException(e1);
121+
}
116122
for(int i=0;i<prts.size();i++) {
117-
String s = UsbCDCSerialConnection.getUniqueID(prts.get(i));
118-
connectionCbo.addItem(s);
123+
try {
124+
String s = UsbCDCSerialConnection.getUniqueID(prts.get(i));
125+
connectionCbo.addItem(s);
126+
} catch (Exception e) {
127+
e.printStackTrace();
128+
throw new RuntimeException(e);
129+
}
119130
}
120-
} catch (Exception e) {
121-
e.printStackTrace();
122-
}
131+
123132

124133
}
125134

0 commit comments

Comments
 (0)