if (convert()) {
logger.info("Emit convertSuccessful");
logger.info("Number of observers: " + this.countObservers());
this.setChanged();
this.notifyObservers(new ObserverNotification(NotificationType.convertSuccessful));
} else {
logger.info("Emit convertFailed");
this.setChanged();
this.notifyObservers(new ObserverNotification(NotificationType.convertFailed, getLastError()));
return false;
}
// check if the user has pressed cancel
if (checkForAbortAndSendSignal())
return false;
this.setChanged();
if (this.doNetconvert) {
if (generateNetFile(netconvertDest, netconvertArguments))
this.notifyObservers(new ObserverNotification(NotificationType.netFileSuccessful));
else {
this.notifyObservers(new ObserverNotification(NotificationType.netFileFailed, getLastError()));
return false;
}
}
// check if the user has pressed cancel
if (checkForAbortAndSendSignal())
return false;
this.setChanged();
if (this.doDuarouter) {
if (generateRouFile(duarouterDest, duarouterArguments))
this.notifyObservers(new ObserverNotification(NotificationType.rouFileSuccessful));
else {
this.notifyObservers(new ObserverNotification(NotificationType.rouFileFailed, getLastError()));
return false;
}
}
if (this.doEwdRouFile) {
generateRouFileFromEwd();
}
// check if the user has pressed cancel
if (checkForAbortAndSendSignal())
return false;
this.setChanged();
if (this.doTlsfile) {
if (generateTlsFile())
this.notifyObservers(new ObserverNotification(NotificationType.tlsFileSuccessful));
else {
this.notifyObservers(new ObserverNotification(NotificationType.tlsFileFailed, getLastError()));
return false;
}
}
// check if the user has pressed cancel
if (checkForAbortAndSendSignal())
return false;
// check if local SUMO version is 0.10.0 or greater, because
// then creation of edge/lane dumps requires different
// commands and an additional file
int[] minVersion = { 0, 10, 0 };
boolean addFileCreated = false;
this.setChanged();
if (sumoVersionGreaterOrEqual(minVersion)) {
if (generateAddFile(statisticsIntervals)) {
this.notifyObservers(new ObserverNotification(NotificationType.addFileSuccessful));
addFileCreated = true;
} else {
this.notifyObservers(new ObserverNotification(NotificationType.addFileFailed, getLastError()));
return false;
}
}
// check if the user has pressed cancel
if (checkForAbortAndSendSignal())
return false;
this.setChanged();
if (generateCfgFile(this.doTlsfile, this.doNetconvert, this.doDuarouter, addFileCreated))
this.notifyObservers(new ObserverNotification(NotificationType.cfgFileSuccessful));
else {
this.notifyObservers(new ObserverNotification(NotificationType.cfgFileFailed, getLastError()));
return false;
}
return true;
}