use of net.sourceforge.usbdm.constants.UsbdmSharedSettings in project usbdm-eclipse-plugins by podonoghue.
the class WorkbenchMainPreferencePage method saveSettings.
protected boolean saveSettings() {
// System.err.println("saveSetting() saving settings");
if (!validate()) {
return false;
}
if (!isControlCreated()) {
return true;
}
UsbdmSharedSettings settings = UsbdmSharedSettings.getSharedSettings();
savePaths(settings);
saveVariables(settings);
settings.flush();
return true;
}
use of net.sourceforge.usbdm.constants.UsbdmSharedSettings in project usbdm-eclipse-plugins by podonoghue.
the class WorkbenchMainPreferencePage method loadSettings.
protected void loadSettings() {
// System.err.println("loadSettings() loading settings");
UsbdmSharedSettings settings = UsbdmSharedSettings.getSharedSettings();
loadPaths(settings);
loadVariables(settings);
validate();
}
use of net.sourceforge.usbdm.constants.UsbdmSharedSettings in project usbdm-eclipse-plugins by podonoghue.
the class UsbdmDynamicVariableResolver method resolveValue.
@Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
if (variable.getName().equals(UsbdmSharedConstants.USBDM_APPLICATION_PATH_VAR)) {
// System.err.println("UsbdmDynamicVariableResolver.resolveValue(usbdm_application_path) => " + usbdmApplicationPath.toOSString());
return usbdmApplicationPath.toOSString();
}
if (variable.getName().equals(UsbdmSharedConstants.USBDM_RESOURCE_PATH_VAR)) {
// System.err.println("UsbdmDynamicVariableResolver.resolveValue(usbdm_application_path) => " + usbdmApplicationPath.toOSString());
return usbdmResourcePath.toOSString();
}
UsbdmSharedSettings usbdmSharedSettings = UsbdmSharedSettings.getSharedSettings();
String variableValue = usbdmSharedSettings.get(variable.getName());
if (variableValue == null) {
Hashtable<String, VariableInformationData> variableInformationTable = VariableInformationData.getVariableInformationTable();
VariableInformationData variableInfo = variableInformationTable.get(argument);
if (variableInfo == null) {
variableValue = "";
} else {
variableValue = variableInfo.getDefaultValue();
}
}
// System.err.println("UsbdmDynamicVariableResolver.resolveValue("+variable.getName()+") => " + variableValue);
return variableValue;
}
use of net.sourceforge.usbdm.constants.UsbdmSharedSettings in project usbdm-eclipse-plugins by podonoghue.
the class GdbServerParameters method saveSettingsAsDefault.
/**
* Save the GDB settings as the system default for the target type
*
* @return
* @throws Exception
*/
public boolean saveSettingsAsDefault() throws Exception {
if (interfaceType == null) {
throw new Exception("Interface type must be set before saving defaults");
}
UsbdmSharedSettings settings = UsbdmSharedSettings.getSharedSettings();
settings.put(getKey(deviceNameKey), getDeviceName());
settings.put(getKey(bdmSerialNumberKey), getBdmSerialNumber());
settings.put(getKey(bdmSerialNumberMatchRequiredKey), isBdmSerialNumberMatchRequired());
settings.put(getKey(SERVER_PORT_KEY), getGdbServerPortNumber());
settings.put(getKey(TTY_PORT_KEY), getGdbTtyPortNumber());
settings.put(getKey(USE_SEMI_HOSTING_KEY), isUseSemihosting());
settings.put(getKey(useDebugVersionKey), isUseDebugVersion());
settings.put(getKey(exitOnCloseKey), isExitOnClose());
settings.put(getKey(serverTypeKey), getServerType().name());
settings.put(getKey(interfaceFrequencyKey), getInterfaceFrequency());
settings.put(getKey(autoReconnectKey), getAutoReconnect().name());
settings.put(getKey(useResetKey), isUseReset());
settings.put(getKey(usePstSignalsKey), isUsePstSignals());
settings.put(getKey(eraseMethodKey), getEraseMethod().name());
settings.put(getKey(resetMethodKey), getResetMethod().name());
settings.put(getKey(securityOptionKey), getSecurityOption().name());
settings.put(getKey(targetVddKey), getTargetVdd().name());
settings.put(getKey(trimClockKey), isTrimClock());
settings.put(getKey(clockTrimFrequencyKey), getClockTrimFrequency());
settings.put(getKey(nvmClockTrimLocationKey), getNvmClockTrimLocation());
settings.put(getKey(connectionTimeoutKey), getConnectionTimeout());
settings.put(getKey(catchVLLSxEventsKey), isCatchVLLSxEvents());
settings.put(getKey(maskInterruptsKey), isMaskInterrupts());
settings.flush();
return true;
}
use of net.sourceforge.usbdm.constants.UsbdmSharedSettings in project usbdm-eclipse-plugins by podonoghue.
the class UsbdmGCCSpecsRunSIProvider method getToolPrefix.
/**
* @param project The project to look in for options
* @return The prefix for the build tools
*/
private String getToolPrefix(IProject project) {
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
if (info == null) {
return "";
}
IConfiguration cfg = info.getDefaultConfiguration();
// System.err.println("UsbdmGCCSpecsRunSIProvider.initialize() Found IConfiguration = " + cfg.getName());
IToolChain toolChain = cfg.getToolChain();
// System.err.println("UsbdmGCCSpecsRunSIProvider.initialize() Found toolChain = " + toolChain.getName());
// Find selected build tool (either ARM or Coldfire)
IOption buildToolOption = toolChain.getOptionBySuperClassId(UsbdmConstants.ARM_BUILDTOOLS_OPTIONS);
if (buildToolOption == null) {
buildToolOption = toolChain.getOptionBySuperClassId(UsbdmConstants.COLDFIRE_BUILDTOOLS_OPTIONS);
}
if (buildToolOption == null) {
return "";
}
// Get build path variable
ToolInformationData toolData = ToolInformationData.getToolInformationTable().get(buildToolOption.getValue().toString());
if (toolData == null) {
return "";
}
String toolPrefixVariableId = toolData.getPrefixVariableName();
if (toolPrefixVariableId == null) {
return "";
}
UsbdmSharedSettings settings = UsbdmSharedSettings.getSharedSettings();
String toolPrefix = null;
if (settings != null) {
toolPrefix = settings.get(toolPrefixVariableId);
}
if (toolPrefix == null) {
toolPrefix = "Tool Prefix not set";
return "";
}
// System.err.println("UsbdmGCCSpecsRunSIProvider.initialize() Found tool prefix = " + toolPrefix);
return toolPrefix;
}
Aggregations