Difference between revisions of "Exercise - Exporting the Traffic Cone Component"

From Flowcode Help
Jump to navigationJump to search
(Created page with "==Preliminaries== 280px|right * Create a traffic cone component as shown in the Exercise - Create a LED component. =...")
 
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
<sidebar>Sidebar: Flowcode Exercises:Ex3</sidebar>
 +
Now that we have created the traffic cone component in the previous [[Exercise - Building a Complex Component]] article we can now export the component (which also contains the 'newLED' component we created earlier) for use elsewhere.
 +
 +
__NOTOC__
 
==Preliminaries==
 
==Preliminaries==
[[File:gen_exerciseLEDexport_compmansetup_01.png|280px|right]]
+
[[File:gen_exerciseconeexport_compmansetup_01.png|280px|right]]
* Create a traffic cone component as shown in the [[Exercise - Create a LED component]].
+
* Create a traffic cone component as shown in the [[Exercise - Building a Complex Component|Exercise - Building a Complex Component - the Traffic Cone]] article.
  
  
Line 8: Line 12:
 
==Declaring the interface==
 
==Declaring the interface==
  
Before you export a component, you need to 'declare the interface'. The interface is the collection of macros and files publically available to the user. Declaring the interface means deciding which of the component routines to make available to the user, and to decide whether these are suitable for simulation or for download.
+
Before you export a component, you need to 'declare the interface'.  
 
 
 
 
 
* Move the mouse cursor over the [[System Panel]], and right-click.
 
* Move the mouse cursor over the [[System Panel]], and right-click.
  
* Select the option 'Export component'. The [[Component Management]] dialogue box opens. This replicates the settings, [[Settings Manager]], [[Interface Manager]] and [[Resources Manager]] available on the [[Panel Properties]].
+
* Select the option 'Export component' to open the 'Component Management' window.
[[File:gen_exerciseLEDexport_componentman01.png|280px|right]]
+
[[File:gen_exerciseconeexport_copmanint_01.png|280px|right]]
* Configure this for the LED component as follow:
+
* Configure this for the traffic cone component as follows:
 
:* Click on the 'Setup' tab.
 
:* Click on the 'Setup' tab.
::* Assign the component to a category, by clicking on the down-arrow next to the label 'Category'. In this case, the component will go into the 'Outputs' toolbox.
+
::* Don't assign a category. As a result, the traffic cone will appear in the 'Misc' toolbox.  
 +
::* Give the component a 'Cosmetic name' of "traffic cone", which then becomes the name given to it in the 'Misc' toolbox.
 
::* Click on the check-box next to the 'Use an image of the panel' label.
 
::* Click on the check-box next to the 'Use an image of the panel' label.
 
:* Click on the 'Interface' tab.  
 
:* Click on the 'Interface' tab.  
::* Set the 'LEDoff' and 'LEDon' macros as 'Component' macros, by selecting each in turn, and clicking on 'Component macro' in the 'Type of macro' drop-down menu.
+
::* Set the 'flash' macro as a simulation macro, by clicking on 'Simulation macro' in the 'Type of macro' drop-down menu.  
::* Set the 'PinChange' macro as a 'Hidden' macro, in the same way.
+
:* In this case, there are no additional files to save with the component, and so you don't need to use the 'Resources' tab.
:* In this case, there is no need to use the 'Resources' tab, as there are no additional files to save with the component.
 
  
 
* Click on 'OK'.
 
* Click on 'OK'.
Line 30: Line 32:
  
 
==Saving the component==
 
==Saving the component==
* You may be asked if you want to save the current flowchart. Do so if you wish.
+
* You may be asked to save the current flowchart. There is no need to do so.
  
* The 'Save As' dialogue box opens. This will automatically point to a destination Flowcode will search for components. Select a suitable name for the component.  
+
* For the component, the 'Save As' dialogue box opens. This will automatically point to a destination used by Flowcode for components. Select a suitable name for the component.  
  
 
* Click 'Save'. The component file is saved with a '*.fcpx' extension.
 
* Click 'Save'. The component file is saved with a '*.fcpx' extension.
Line 39: Line 41:
  
  
==Testing the component==
+
==What next?==
Select to create a new flowchart from the main menu.
+
Create a Flowcode flowchart to test the component, such as the one given in the next exercise [[Exercise - Importing and Testing the Traffic Cone|Importing and Testing the Traffic Cone]]
 
 
Go to the category your component was assigned to be in, ('Outputs' in this case). If you did not select a category you will find the component in'''Misc'''.
 
 
 
Click on the down arrow next to the component, and select 'Add to system panel, or double click on the name of the component.
 
 
 
Create a Flowcode flowchart to test the component, such as the one given in the [[Exercise - Testing an imported LED component]]
 

Latest revision as of 14:46, 13 March 2014

<sidebar>Sidebar: Flowcode Exercises:Ex3</sidebar> Now that we have created the traffic cone component in the previous Exercise - Building a Complex Component article we can now export the component (which also contains the 'newLED' component we created earlier) for use elsewhere.


Preliminaries

Gen exerciseconeexport compmansetup 01.png



Declaring the interface

Before you export a component, you need to 'declare the interface'.

  • Move the mouse cursor over the System Panel, and right-click.
  • Select the option 'Export component' to open the 'Component Management' window.
Gen exerciseconeexport copmanint 01.png
  • Configure this for the traffic cone component as follows:
  • Click on the 'Setup' tab.
  • Don't assign a category. As a result, the traffic cone will appear in the 'Misc' toolbox.
  • Give the component a 'Cosmetic name' of "traffic cone", which then becomes the name given to it in the 'Misc' toolbox.
  • Click on the check-box next to the 'Use an image of the panel' label.
  • Click on the 'Interface' tab.
  • Set the 'flash' macro as a simulation macro, by clicking on 'Simulation macro' in the 'Type of macro' drop-down menu.
  • In this case, there are no additional files to save with the component, and so you don't need to use the 'Resources' tab.
  • Click on 'OK'.



Saving the component

  • You may be asked to save the current flowchart. There is no need to do so.
  • For the component, the 'Save As' dialogue box opens. This will automatically point to a destination used by Flowcode for components. Select a suitable name for the component.
  • Click 'Save'. The component file is saved with a '*.fcpx' extension.



What next?

Create a Flowcode flowchart to test the component, such as the one given in the next exercise Importing and Testing the Traffic Cone