Finished config up/down load impl and Finished startup action implementation

This commit is contained in:
BWS Systems
2019-06-12 16:05:29 -05:00
parent 69b510ae18
commit 2dbf4c96c4
8 changed files with 335 additions and 25 deletions

View File

@@ -202,15 +202,33 @@ public class DeviceRepository extends BackupHandler {
List<DeviceDescriptor> list = new ArrayList<DeviceDescriptor>(devices.values());
Iterator<DeviceDescriptor> deviceIterator = list.iterator();
Map<String, DeviceDescriptor> newdevices = new HashMap<String, DeviceDescriptor>();
nextId = seedId;
List<String> lockedIds = new ArrayList<String>();
String hexValue;
Integer newValue;
DeviceDescriptor theDevice;
log.debug("Renumber devices with seed: {}", seedId);
boolean findNext = true;
nextId = seedId;
while(deviceIterator.hasNext()) {
theDevice = deviceIterator.next();
if(theDevice.isLockDeviceId()) {
lockedIds.add(theDevice.getId());
}
}
log.debug("Renumber devices starting with: {}", nextId);
deviceIterator = list.iterator();
while (deviceIterator.hasNext()) {
theDevice = deviceIterator.next();
if (!theDevice.isLockDeviceId()) {
findNext = true;
while(findNext) {
if(lockedIds.contains(String.valueOf(nextId))) {
nextId++;
} else {
findNext = false;
}
}
theDevice.setId(String.valueOf(nextId));
newValue = nextId % 256;
if (newValue <= 0)