File tree Expand file tree Collapse file tree 3 files changed +24
-19
lines changed
addons/com/neuronrobotics/sdk/ui Expand file tree Collapse file tree 3 files changed +24
-19
lines changed Original file line number Diff line number Diff line change 27
27
<classpathentry kind =" lib" path =" lib_addons/usb4java-1.2.0.jar" />
28
28
<classpathentry kind =" lib" path =" lib_addons/usb4java-javax-1.2.0.jar" />
29
29
<classpathentry kind =" lib" path =" lib_addons/vecmath.jar" />
30
- <classpathentry kind =" con" path =" org.eclipse.jdt.launching.JRE_CONTAINER" />
31
30
<classpathentry kind =" lib" path =" lib_addons/j3dcore.jar" />
32
31
<classpathentry kind =" lib" path =" lib_addons/j3dutils.jar" />
32
+ <classpathentry kind =" con" path =" org.eclipse.jdt.launching.JRE_CONTAINER" />
33
33
<classpathentry kind =" output" path =" bin" />
34
34
</classpath >
Original file line number Diff line number Diff line change @@ -108,18 +108,14 @@ public void windowGainedFocus(WindowEvent e) {
108
108
109
109
private void loadDefaultConnections () {
110
110
try {
111
- if (!OsInfoUtil .isWindows () || OsInfoUtil .getOsName ().contains ("Windows 8" ) ){
112
-
111
+ try {
113
112
addConnectionPanel (new UsbConnectionPanel ());
114
- }else {
115
- System .out .println (OsInfoUtil .getOsName ());
113
+ addConnectionPanel (new BluetoothConnectionPanel ());
116
114
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 ){
121
116
addConnectionPanel (new SerialConnectionPanel ());
122
-
117
+ addConnectionPanel (new BluetoothConnectionPanel ());
118
+ }
123
119
}catch (Error e ){
124
120
e .printStackTrace ();
125
121
Log .error ("This is not a java 8 compliant system, removing the serial, bluetooth and usb connections" );
Original file line number Diff line number Diff line change @@ -107,19 +107,28 @@ public BowlerAbstractConnection getConnection() {
107
107
108
108
109
109
public void refresh () {
110
- System .err .println ("Refreshing USB" );
110
+ // System.err.println("Refreshing USB");
111
111
connectionCbo .removeAllItems ();
112
112
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
+ }
116
122
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
+ }
119
130
}
120
- } catch (Exception e ) {
121
- e .printStackTrace ();
122
- }
131
+
123
132
124
133
}
125
134
You can’t perform that action at this time.
0 commit comments