use of io.sloeber.core.api.BoardDescription in project arduino-eclipse-plugin by Sloeber.
the class RegressionTest method rename_Configuration.
/**
* Does Sloeber still compile after a configuration renamen
*
* @throws Exception
*/
@Test
public void rename_Configuration() throws Exception {
BoardDescription unoBoardid = Arduino.uno().getBoardDescriptor();
IProject theTestProject = null;
String projectName = "rename_Configuration";
CodeDescription codeDescriptor = CodeDescription.createDefaultIno();
NullProgressMonitor monitor = new NullProgressMonitor();
theTestProject = SloeberProject.createArduinoProject(projectName, null, unoBoardid, codeDescriptor, new CompileDescription(), new NullProgressMonitor());
// for the indexer
Shared.waitForAllJobsToFinish();
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
if (Shared.hasBuildErrors(theTestProject)) {
fail("Failed to compile the project before config rename");
}
CCorePlugin cCorePlugin = CCorePlugin.getDefault();
ICProjectDescription prjCDesc = cCorePlugin.getProjectDescription(theTestProject);
ICConfigurationDescription activeConfig = prjCDesc.getActiveConfiguration();
activeConfig.setName("renamedConfig");
cCorePlugin.setProjectDescription(theTestProject, prjCDesc);
// for the indexer
Shared.waitForAllJobsToFinish();
theTestProject.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
if (Shared.hasBuildErrors(theTestProject)) {
fail("Failed to compile the project after config rename");
}
}
use of io.sloeber.core.api.BoardDescription in project arduino-eclipse-plugin by Sloeber.
the class RegressionTestFailingOnTravis method redirectedJson.
/**
* Test wether a platform json redirect is handled properly
* https://github.com/jantje/arduino-eclipse-plugin/issues/393
*/
@SuppressWarnings("static-method")
@Test
public void redirectedJson() {
// this board references to arduino avr so install that one to
Arduino.installLatestAVRBoards();
BoardsManager.installLatestPlatform("package_talk2.wisen.com_index.json", "Talk2", "avr");
Map<String, String> options = new HashMap<>();
options.put("mhz", "16MHz");
BoardDescription boardid = BoardsManager.getBoardDescription("package_talk2.wisen.com_index.json", "Talk2", "avr", "whispernode", options);
if (boardid == null) {
fail("redirect Json ");
return;
}
if (!Shared.BuildAndVerify("redirect_json", boardid, CodeDescription.createDefaultIno(), new CompileDescription())) {
fail(Shared.getLastFailMessage());
}
}
use of io.sloeber.core.api.BoardDescription in project arduino-eclipse-plugin by Sloeber.
the class OpenSerialMonitorHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(// $NON-NLS-1$
"io.sloeber.ui.monitor.views.SerialMonitor");
// find all projects
IProject[] SelectedProjects = ProjectExplorerListener.getSelectedProjects();
// on
if ((SelectedProjects.length > 0) && (MyPreferences.getOpenSerialWithMonitor() == true)) {
for (IProject curproject : SelectedProjects) {
int baud = Sketch.getCodeBaudRate(curproject);
if (baud > 0) {
SloeberProject sProject = SloeberProject.getSloeberProject(curproject);
if (sProject != null) {
ICConfigurationDescription activeConf = CoreModel.getDefault().getProjectDescription(curproject).getActiveConfiguration();
BoardDescription boardDescription = sProject.getBoardDescription(activeConf.getName(), false);
String comPort = boardDescription.getUploadPort();
if (!comPort.isEmpty()) {
io.sloeber.ui.monitor.SerialConnection.add(comPort, baud);
}
}
}
}
}
} catch (PartInitException e) {
e.printStackTrace();
}
return null;
}
use of io.sloeber.core.api.BoardDescription in project arduino-eclipse-plugin by Sloeber.
the class BoardSelectionPage method updateSloeber.
@Override
protected void updateSloeber(ICConfigurationDescription confDesc) {
BoardDescription theObjectToStore = (BoardDescription) getDescription(confDesc);
mySloeberProject.setBoardDescription(confDesc.getName(), theObjectToStore, true);
}
use of io.sloeber.core.api.BoardDescription in project arduino-eclipse-plugin by Sloeber.
the class BoardSelectionPage method getBoardFromScreen.
public BoardDescription getBoardFromScreen() {
BoardDescription boardDesc = (BoardDescription) getDescription(getConfdesc());
String selectedText = myControlBoardsTxtFile.getText().trim();
boardDesc.setreferencingBoardsFile(myAllBoardsFiles.get(selectedText));
boardDesc.setUploadPort(myControlUploadPort.getText());
boardDesc.setProgrammer(myControlUploadProtocol.getText());
boardDesc.setBoardName(mycontrolBoardName.getText());
boardDesc.setOptions(getOptions(boardDesc));
return boardDesc;
}
Aggregations