/* autodetect_pilot.bsh With this script we will test the possiblity of auto-detecting hardware. Three core calls are made to attempt to connect to all possible devices: getAvailableDevices, loadDevice, initializeDevice. If any of these methods throws an exception, then the device is deemed to be not detected. After we correct device adapters' source code (so there are no crashes, no pop-ups, no false positives, and proper handling of serial ports) then this auto-detect scheme could be implemented in the core. */ // Libraries in forbiddenLibs cause problems in this auto-detect scheme and // therefore we currently don't attempt to auto-detect them: forbiddenLibs = new ArrayList(); //forbiddenLibs.add("PCO_Camera"); forbiddenLibs.add("DemoCamera"); // Demos don't need to be autodetected! :) forbiddenLibs.add("DemoRGBCamera"); forbiddenLibs.add("DemoStreamingCamera"); forbiddenLibs.add("Utilities"); // Utilities shouldn't be detected either. // Device discovery routine: detectedDevices = new ArrayList(); notDetectedDevices = new ArrayList(); mmc.unloadAllDevices(); libs = mmc.getDeviceLibraries("."); print(libs.size() + " libraries found."); public void discover(String libraryName) { try { print("\tattempting to load library..."); devs = mmc.getAvailableDevices(libraryName); print("\tsucceeded!"); // Loop through devices in library: for (j=0;j