Skip to content

EclipseDevEnvironment

Jereme Haack edited this page Sep 12, 2014 · 2 revisions

The Eclipse IDE has a Python plugin which is already installed in the VOLTTRON VM. In order to setup Eclipse outside the VM, download the IDE from: http://www.eclipse.org/ or through the Software Manager in Linux.

The VOLTTRON code is stored in a git repository. There is a plugin available for Eclipse that makes development more convenient (note: you must have Mercurial already installed on the system and have built the project):

  • Help -> Install New Software
  • Click on the "Add" button
  • For name use: EGit
  • For location: <http://download.eclipse.org/egit/updates >
  • After hitting OK, check the box for: Check Select All
  • Click through Next, Agree to Terms, then Finish
  • Allow Eclipse to restart

After installing Eclipse, you must add the PyDev plugin to the environment. In Eclipse:

  • Help -> Install New Software
  • Click on the "Add" button
  • For name use: PyDev
  • For location: <http://pydev.org/updates>
  • Check the box for PyDev
  • Click through Next, Agree to Terms, Finish
  • Allow Eclipse to restart

The project can now be checked out from the repository into Eclipse.

  • The project must now be built outside Eclipse. Please follow the directions here and skip the git clone portion.
  • After changing the filesystem outside Eclipse, right-click on the project name and select Refresh
  • PyDev must now be pointed at the correct version of Python.
    • Window-> Preferences
    • Expand PyDev
    • Select Interpreter-Python
    • Hit New
    • Hit Browse and browse to the Python in the bin directory of the volttron project. Then hit Ok
    • Select All, then Hit Ok
    • You may need to redo this after a platform update and buildout
  • In the Project/PackageExplorer view on the left, right-click on the project, PyDev-> Set as PyDev Project
  • Switch to the PyDev perspective (if it has not already switched), Window -> Open Perspective -> PyDev

Eclipse should now be configured to use the project's environment.

To test the installation:

  • Setup a run configuration for the platform
    • In the Package Explorer view, open the bin folder
    • Right-click on volttron-lite and select Run As -> Python Run (this will create a run configuration but fail)
    • On the menu bar, pick Run -> Run Configurations...
    • Under Python Run pick "volttron volttron-lite"
    • Click on the Argument tab
    • Change Working Directory to Default
    • In the Program arguments box, add: "-c dev-config.ini" This sets up running the platform in a development mode
    • Click Run, this launches the platform. If the run does not succeed, click the all stop icon (two red boxes overlaid) on the console and then retry.
  • Setup a run configuration for the ListenerAgent
    • In the Package Explorer view, open Agents -> ListenerAgent --> listener
    • Righ-click on listeneragent.py and select Run As -> Python Run (this will create a run configuration but fail)
    • On the menu bar, pick Run -> Run Configurations...
    • Under Python Run pick "rtunetwork listeneragent.py"
    • Click on the Argument tab
    • Change Working Directory to Default
    • In the Program arguments box, add: "--config Agents/ListenerAgent/listeneragent.launch.json --pub ipc:///tmp/volttron-lite-agent-publish --sub ipc:///tmp/volttron-lite-agent-subscribe" This launches the agent with the dev settings the platform is using
    • Click Run, this launches the agent
    • You should see the agent start to publish and receive its own heartbeat message
Clone this wiki locally