This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package ch.psi.mxsc;
|
||||
|
||||
import ch.psi.pshell.core.DevicePoolListener;
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.device.DeviceAdapter;
|
||||
import ch.psi.pshell.device.GenericDevice;
|
||||
@@ -27,7 +28,7 @@ public class DevicesPanel extends javax.swing.JPanel {
|
||||
* Creates new form DevicesPanel
|
||||
*/
|
||||
public DevicesPanel() {
|
||||
initComponents();
|
||||
initComponents();
|
||||
}
|
||||
|
||||
GenericDevice[] getDevices(){
|
||||
@@ -41,8 +42,21 @@ public class DevicesPanel extends javax.swing.JPanel {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void initialize(){
|
||||
Controller.getInstance().getDevicePool().addListener(new DevicePoolListener() {
|
||||
@Override
|
||||
public void onDeviceAdded(GenericDevice dev) {
|
||||
updateDevices();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeviceRemoved(GenericDevice dev) {
|
||||
}
|
||||
});
|
||||
updateDevices();
|
||||
}
|
||||
|
||||
void updateDevices(){
|
||||
for (GenericDevice dev : getDevices()){
|
||||
if (dev!=null){
|
||||
dev.removeListener(deviceListener);
|
||||
|
||||
Reference in New Issue
Block a user