Difference between revisions of "NESCDT"

From TinyOS Wiki
Jump to: navigation, search
 
(42 intermediate revisions by one other user not shown)
Line 1: Line 1:
==Using the ''nescdt'' TinyOS plugin for Eclipse==
+
#REDIRECT [[NESCDT- An editor for nesC in Eclipse]]
A basic [http://nescc.sourceforge.net/papers/nesc-ref.pdf '''nesC'''] editor plugin for TinyOS-2.x using Eclipse with syntax highlighting and ''.nc'' file content detection for the follow types:
 
* ''interface'' [[Image:Inter.gif]],
 
* ''module'' [[Image:Mod.gif]],
 
* ''generic module'' [[Image:Genmod.gif]],
 
* ''configuration'' [[Image:Conf.gif]],
 
* ''generic configuration'' [[Image:Genconf.gif]]
 
* ''safe'' [[Image:Safe.gif]](experimental).
 
The same symbols are used as in [[Getting_Started_with_TinyOS#Visualizing_a_Component_Graph| nesdoc]]. The source is included in the plugin jar file, and it is possible to refine it. To install the plugin:
 
* Download the ''nescdt_0.0.12.jar'' file [[http://nxtmote.sf.net/nescdt_0.0.12.jar here]]
 
* Save it in the root of Eclipse plugin directory (where the other (jar) plugins also reside), and delete the previous version of this plugin if you have it. The sources are included if you want to compile it yourself...
 
* Restart Eclipse (perhaps verify for yourself that it is installed: ''Help->About Eclipse SDK->Plug-in Details'')
 
* Associate the *.nc files with this editor: ''Windows->Preferences->General->Editors->File Associations''
 
[[Image:Nxtmote-fileassosi.png]]
 
* Create a new empty project [[Image:Nxtmote-newproject.jpg]] and name it what you want to (for example ''nescsampleproject'')
 
* Create a new folder in the project (right-click on the project) and name it what you want to
 
* Import and link to the part of the TinyOS tree or your own code(right-click on the ''nescsampleproject'' folder and press import)
 
[[Image:Nxtmote-folderlink.jpg]]
 
* Choose the ''Link to folder in the file system'' option and proceed (this will not change your TinyOS code at all and it will not copy any files on your computer)
 
* When you are done the Eclipse IDE could look something like this (note that the content of the files have been analyzed and that the icons reveal that we have some configurations, generic configurations, modules, and generic modules in the ''mica2'' folder):
 
[[Image:Nxtmote-editor.png]]
 
*When you open some ''.nc'' file it will be syntax colored (according some some predefined rules in the plugin):
 
[[Image:Nxtmote-editorsyntax2.png]]
 
*There is autocompletion for keywords and types. Press CTRL + SPACE to get the suggestions
 
 
 
[[Image:Nxtmote-keywordcompletion1a.png]]
 
 
 
Then select (if there is more than one choice) and press ENTER to insert the word
 
 
 
[[Image:Nxtmote-keywordcompletion2.png]]
 
 
 
* Side notes
 
**The ''nescdt'' plugin is < 50 kB
 
**(Experimental) If it detects ''safe'' code (looking for ''@safe'', ''*COUNT'', ''*SIZE'', or ''*SAFE'') a rhombus shape is added to the icon. A ''safe'' module could look like this [[Image:Nxtmote-safedemo.png]] in the file navigator (note that a little rhombus has been added to the module icon).
 
**If the CVS [http://www.eclipse.org/articles/Article-Decorators/decorators.html decorators] annoy you (if, for example, another CVS client than Eclipse is being used), then turn them off from ''Window->Preferences->General->Appearance->Label Decorations''.
 
**You can also consider downloading the CDT plugin for editing header files and perhaps ''C'' files in Eclipse. Enter the [http://download.eclipse.org/tools/cdt/releases/europa http://download.eclipse.org/tools/cdt/releases/europa] as a new ''Remote site'' in the Eclipse update manager and choose the CDT main plugin:
 
[[Image:Nxtmote-cdtdownload.png]]
 
 
 
==Developing/Debugging on the NESCDT Plugin==
 
[[Image:1-Dev-Blank-Eclipse.png]]
 
[[Image:2-Dev-Import.png]]
 
[[Image:3-Dev-pluginselect.png]]
 
[[Image:4-Dev-withsource.png]]
 
[[Image:5-Dev-select.png]]
 
[[Image:5a-Dev-coding-example.png]]
 
[[Image:5b-Dev-debug-start.png]]
 
[[Image:5c-Dev-debug-ok.png]]
 
[[Image:6-Dev-start-export.png]]
 
[[Image:7-Dev-export.png]]
 
[[Image:8-Dev-src-build.png]]
 
[[Image:9-Dev-plugin-eclipse-dir.png]]
 

Latest revision as of 02:04, 9 November 2009