Search in sources :

Example 6 with DeviceInfo

use of net.sourceforge.usbdm.deviceEditor.information.DeviceInfo in project usbdm-eclipse-plugins by podonoghue.

the class TestCreateCpp method main.

public static void main(String[] args) throws Exception {
    Path directory = Paths.get("BulkTesting");
    Path dataDirectory = Paths.get("data");
    // Locate header output directory
    Path headerDirectory = directory.resolve("Project_Headers");
    // Locate source output directory
    Path sourcesDirectory = directory.resolve("Sources");
    // Create output directories if needed
    if (!directory.toFile().exists()) {
        Files.createDirectory(directory);
    }
    if (!headerDirectory.toFile().exists()) {
        Files.createDirectory(headerDirectory);
    }
    if (!sourcesDirectory.toFile().exists()) {
        Files.createDirectory(sourcesDirectory);
    }
    DirectoryStream<Path> folderStream = Files.newDirectoryStream(dataDirectory.toAbsolutePath(), csvFilter);
    for (Path filePath : folderStream) {
        if (!Files.isRegularFile(filePath)) {
            continue;
        }
        /*
          * Process each input file
          */
        System.err.println("Processing " + filePath.getFileName() + " ======================== ");
        DeviceInfo deviceInfo = DeviceInfo.create(filePath);
        WriteFamilyCpp writer = new WriteFamilyCpp();
        writer.writeCppFiles(directory, deviceInfo);
    }
}
Also used : Path(java.nio.file.Path) WriteFamilyCpp(net.sourceforge.usbdm.deviceEditor.peripherals.WriteFamilyCpp) DeviceInfo(net.sourceforge.usbdm.deviceEditor.information.DeviceInfo)

Example 7 with DeviceInfo

use of net.sourceforge.usbdm.deviceEditor.information.DeviceInfo in project usbdm-eclipse-plugins by podonoghue.

the class DevicePackageModel method modelElementChanged.

@Override
public void modelElementChanged(ObservableModel model) {
    if (model instanceof DeviceInfo) {
        DeviceInfo deviceInfo = (DeviceInfo) model;
        String packageName = deviceInfo.getVariant().getPackage().getName();
        if (getValueAsString() != packageName) {
            setValue(deviceInfo.getVariant().getPackage().getName());
        }
    }
}
Also used : DeviceInfo(net.sourceforge.usbdm.deviceEditor.information.DeviceInfo)

Aggregations

DeviceInfo (net.sourceforge.usbdm.deviceEditor.information.DeviceInfo)7 Path (java.nio.file.Path)4 FamilyXmlWriter (net.sourceforge.usbdm.deviceEditor.peripherals.FamilyXmlWriter)2 Activator (net.sourceforge.usbdm.deviceEditor.Activator)1 WriteFamilyCpp (net.sourceforge.usbdm.deviceEditor.peripherals.WriteFamilyCpp)1 IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)1 FileDialog (org.eclipse.swt.widgets.FileDialog)1