use of org.openmuc.framework.driver.csv.CsvDriver in project OpenMUC by isc-konstanz.
the class CsvScanDeviceTest method testDeviceScan.
@Test
public void testDeviceScan() throws ArgumentSyntaxException, UnsupportedOperationException, ScanException, ScanInterruptedException {
CsvDriver csvDriver = new CsvDriver();
String settings = "path=" + dir + "/src/test/resources";
csvDriver.scanForDevices(settings, new DriverDeviceScanListener() {
@Override
public void scanProgressUpdate(int progress) {
System.out.println("Scan progress: " + progress + " %");
}
@Override
public void deviceFound(DeviceScanInfo scanInfo) {
System.out.println(scanInfo.toString());
}
});
}
use of org.openmuc.framework.driver.csv.CsvDriver in project OpenMUC by isc-konstanz.
the class CsvScanDeviceTest method testChannelScan.
@Test
public void testChannelScan() {
CsvDriver csvDriver = new CsvDriver();
String deviceAddress = dir + "/src/test/resources/test_data.csv";
try {
String settings = "SAMPLINGMODE=hhmmss";
CsvFile csvConnection = (CsvFile) csvDriver.connect(deviceAddress, settings);
List<ChannelScanInfo> channelsScanInfos = csvConnection.scanForChannels("");
for (ChannelScanInfo info : channelsScanInfos) {
System.out.println("Channel: " + info.getChannelAddress());
}
} catch (ArgumentSyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ConnectionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedOperationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ScanException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of org.openmuc.framework.driver.csv.CsvDriver in project OpenMUC by isc-konstanz.
the class DriverInfoTest method printDriverInfo.
@Test
public void printDriverInfo() {
CsvDriver driver = new CsvDriver();
DriverInfo info = driver.getInfo();
System.out.println("Id: " + info.getId());
System.out.println("Description: " + info.getDescription());
System.out.println("DeviceAddressSyntax: " + info.getDevice().getAddressSyntax());
System.out.println("DeviceSettingsSyntax: " + info.getDevice().getSettingsSyntax());
System.out.println("DeviceScanSettingsSyntax: " + info.getDevice().getScanSettingsSyntax());
System.out.println("ChannelAddressSyntax: " + info.getChannel().getAddressSyntax());
}
Aggregations