When starting SciCraft the user will be presented with something similar to the window seen in Figure 2.1. The items seen in the Figure are the following:
It is also possible to create links between nodes when using the pointingtool. By clicking on the right mousebutton on a node a small menu will appear, as illustrated in Figure 2.3. 'Create link' enables you to make a connection between the chosen node and any node in the workspace. I addition to this, it is possible to choose from the menu to remove and view the current node.
When connecting nodes you start at the FROM node, left click on this node and then left click on the TO node. A line will now be drawn between these two nodes and they are linked together, as illustrated in Figure 2.4. If you look closer on the nodes you will notice that most node images has one or more slots on the edge of the node icons. When you left click on the nodes, the line will start (or end) at the slot closest to where you just clicked.
After connecting two nodes in the GUI you are now ready to set the input and output to and from the nodes. This means that you have to switch to pointing tool. A node is capable of having several input and output ports. These ports have a name and often a type and description. When connecting two node ports you have to know which port in the FROM node that should be connected to a specific port in the TO node. If you double click on the link you just created you will see a window similar to Figure 2.5. Specify which ports you want to connect by clicking one output and one input port and then click on Connect. A similar operation is repeated when disconnecting ports, select ports and click Disconnect.
So just using a link to connect two nodes does not specify any flow of data between the nodes, you have to double click on a newly created link and specify the port connections in order to define the flow of data between the nodes. An exception to this rule occurs when you connect two nodes with only one output and one input port. In these cases, the ports are automatically connected when the node link is created.
The difference between node connections (links) and port connections is illustrated in Figure 2.6. The node connections are specified by drawing links between nodes as described above. Port connections are defined by double clicking on links and connecting ports as in Figure 2.5.
As you change the comment attributes a preview field below the heading Comment preview will be updated for convenience. However, changes are not applied to the actual comment until the Ok-button is clicked. The Cancel-button may also be clicked if it is desired to cancel all changes done to the comment's attributes.
Also comments may be selected and moved around by using the pointing tool. Selected comments may also be removed by using the delete-key on the keyboard.
First of all, to be able to mark a collection of nodes, or even one node, you have to choose the pointing tool, as illustrated in Figure 2.2. Nodes placed in the workspace, linked or not, can be moved, one by one or as a collection of several nodes. Begin by setting the mousepointer on the desired starting point and hold down the left mousebutton. Now a dotted rectangle will appear on the workspace. You are now free to drag the dotted rectagle over the nodes you want to move. When the nodes you want to mark are covered by the rectangle, release the left mousebutton, see Figure 2.10 for illustration. The colour of the selected nodes labels will change, as an indication of the selection. Set the mousepointer on one of the selected nodes, hold down the left mousebutton, and move the selected nodes wherever you want in the workspace.
Running a diagram is done by clicking the Play button on the toolbar, or by clicking Run via the Actions menu.
When running a diagram, SciCraft will first validate the diagram. If the diagram fails the validation, a pop-up with information about errors will appear. The most common error when validating is missing connections on an input port.
Running a single node is accomplished by right-clicking the node and selecting Collect & Run. As opposed to regular diagram running, where nodes send data to next connected node, this collects data from all nodes providing data and then runs the node.
The Collect & Run functionality depends on all nodes providing data keep the output from their last run. This setting must be enabled manually on all nodes providing data to the single node. To enable this setting, select Keep output after right-clicking the node.
Using Keep Output and Collect & Run it is possible to build a single node, enable Keep output, then run it with Collect & Run, then create a second node, connect it to the first, enable Keep output and then run it with Collect & Run. By creating a series of nodes, and running them as you go along, you can inspect return values along links, change parameters, and interactively create an entire diagram without having to run all nodes several times.
This is particularely useful when dealing with nodes that use an extended amount of time for calculations.
The reason that the Keep Output setting of each node is not enabled by default is that keeping output data of all nodes readily available might require alot of memory or disk on a system, depending on your data sets. Keeping all data might deplete your systems resources.
After you have started a diagram by clicking the Play button on the toolbar, or by clicking Run via the Actions menu, you may stop the diagram while it is running. This is for example quite useful if you by a mistake started a diagram that takes a long time to run, with, say, the wrong parameters set in a node. Stopping the diagram may be done either by pressing the Stop button on the toolbar, or by clicking Stop via the Actions menu. The Play and Stop buttons are shown in Figure 2.12.
When the Stop button has been pushed the dialog box in Figure 2.13 appears on the screen. At the same time the text in the progress bar at the bottom of the SciCraft window turns red and shows the text Interrupted and the Stop button is disabled. This is when the running nodes are stopping themselves. Some nodes may use longer time than others to stop. As the running nodes finish running, they change their State in the dialog box from Running to Interrupted. When all the running nodes have finished running, the text in the progress bar changes to Done and the text inside the dialog box says that it is done interrupting the nodes. Now the Play button is enabled again.
What happens when you press the stop button during a diagram run, is that the nodes that are not yet started at the time when the button was pressed are not started at all. Those nodes that are possible to stop are stopped in a nice way, those that are not are allowed to finish. The nodes that were finished before the button was pressed are finished and will contain valid data.
During a diagram run, it is possible to switch to another window within SciCraft and work on another diagram, or even run it, whatever state the first diagram is in. One could also press the OK button in the dialog at any time, but it will not be possible to run the diagram again until all running nodes are safely stopped.
After the module diagram has been run it is possible to inspect the data flowing through the different links. This option is located in the links context menu (see figure 2.14). This menu is reached by right clicking on links.
The View data sub-menu lists the variables that flows through the higlighted link. Each item in the list is on the format variable-name - info where info can be one of, or a combination of, the following (see figure 2.14 for an example):
By clicking on one of the variables in the View data sub-menu, you will find a dialog box with a spreadsheet popping up. The data in the spreadsheet is the data that flows through the link, in the variable you clicked on. An example of such a dialog box is shown in figure 2.15.
SciCraft enables you to save the data that is in a spreadsheet, such as the one shown in figure 2.15. By selecting the File menu's Save data... option, you may save the data in the spreadsheet, using all the formats that SciCraft supports for output (see table 3.1 for a list of the formats that SciCraft supports).
If there are data available in the node, a menu with the items 'Input ports' and 'Output ports' is displayed when you activate the 'Inspect data' item. If one of them is disabled, there are no ports of the specified type with data on them. By activating one of the items, a list of ports will be displayed. Beside the port name, the type and/or size of the data is shown. By clicking on a port item, a spreadsheet displaying the port data will be opened. It is possible to save the data in the spreadsheet to file, refer to section 2.2.9 for more info on saving data.
The output shown in the dialog box in figure 2.16, was generated by inserting the following into a R script (in this case the HCA.R file):
print(summary(an_object))
The Python Pyx package must be installed for this option to work. On a Windows platform this may be bundeled with SciCraft, depending on which SciCraft package is chosen for download. Choose File in the main menu bar and then Export diagram to EPS from the file menu. From the save file dialog, you can choose to save it as an image in black and white or with colours. The current diagram will then be saved in the Encapsualted PostScript (*.eps) format.