Let's begin with the traditional Hello World tutorial.
First of all, you need to create a new Orcc project in Eclipse (File > New > Other then select Orcc > Orcc Project).
The new project is created with a default source folder src.
Orcc uses the same package system than java projects. To create a new package, select HelloOrcc project and click on File > New > Package. Type org.tutorial.hellorcc then validate by pressing Finish.
To create an actor, select the package you just created and click on File > New > File. Type Hello.cal as file name and click on Finish.
Copy and paste the folowing source to your new actor:
package org.tutorial.hellorcc; actor Hello () ==> : action ==> do println("Hello Orcc!"); end end
Now, you have to create a new Network. Select the package and click on File > New > Other then select Orcc > XDF Network:
An empty XDF file will open. Click first on (Objects > Instance) in the palette, and then click on XDF file area to add an Instance in your network.
Name your instance "HelloInstance" to obtain this result:
Now, you have to link this instance to the actor you have created before. To do so, right-click on the instance and select Set/Update Refinement. Then, select the "Hello" actor in the newly opended box:
After your validation, "HelloInstance" should be displayed in blue (meaning that your instance is assigned to an actor). This very simple instance does not contain any input or ouput port. Don't worry, this is normal: the Hello actor doesn't defines any port. The next tutorial will show you how to define a more realistic network.
You are now ready to run your network! The easiest way is to run it as a simulation. Right-click on the XDF file and (Run As > Orcc simulation).
In the "Select simulator" window, click OK.
In the "Select input stimulus" window, select a random file and click VALIDATE (anyway it will not be used by our example).
In the Run configuration wizard just click on RUN!
You should see that in Eclipse's console:
Orcc is usually used to generate native code so you may also want to run this "Hello World" as a native program. Please follow steps described in this page to generate code (The C backend is the easiest way to begin), build it and run it!
And magic will happen!
Install Orcc from the update site http://orcc.sf.net/eclipse/
Whether you need (or want to offer) help or advice, or if you just want to discuss/chat about Orcc, feel free to contact us!
Most of the team is based in Europe, so you might expect people to be connected and answer mail during the day (GMT+1).