use of com.neuronrobotics.sdk.util.IFileChangeListener in project bowler-script-kernel by CommonWealthRobotics.
the class MobileBaseCadManager method getConfigurationDisplay.
private static ICadGenerator getConfigurationDisplay() {
if (cadEngineConfiguration == null) {
try {
File confFile = ScriptingEngine.fileFromGit("https://github.com/CommonWealthRobotics/DHParametersCadDisplay.git", "dhcad.groovy");
cadEngineConfiguration = (ICadGenerator) ScriptingEngine.inlineFileScriptRun(confFile, null);
FileChangeWatcher watcher = FileChangeWatcher.watch(confFile);
watcher.addIFileChangeListener(new IFileChangeListener() {
@Override
public void onFileChange(File fileThatChanged, WatchEvent event) {
// TODO Auto-generated method stub
try {
cadEngineConfiguration = (ICadGenerator) ScriptingEngine.gitScriptRun("https://github.com/CommonWealthRobotics/DHParametersCadDisplay.git", "dhcad.groovy", null);
for (MobileBase manager : cadmap.keySet()) {
MobileBaseCadManager mobileBaseCadManager = cadmap.get(manager);
if (mobileBaseCadManager.autoRegen)
if (mobileBaseCadManager.configMode)
mobileBaseCadManager.generateCad();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return cadEngineConfiguration;
}
Aggregations