This is a brief overview with some directions for making an interface.
Interfaces An Interface is what’s commonly called a Window in Graphical User Interfaces upon which controls are placed for monitoring and control of a system – or the Human to Machine Interface. The Machine may either be simply your computer for using MakerPlot-J for some standalone tasks or the controller, such as an Arduino microcontroller system via serial data, which the computer is connected to.
When MakerPlot-J is opened, the initial interface window appears and may load with controls. This initial interface is referred to the Main Interface. Additional interfaces may be created through the software, or from code contained in MakerPlot-J Interface files (*.mpji). To add another Interface window called a Child Interface, Unlock the interface for editing, F9, and use CTRL-I to create a new Interface window.
Controls Controls are placed on the interfaces, either through a click-place method in the design of the interface using the Controls Palette, or through code contained in an MakerPlot-J Interface file (*.mpji) or from the controller sending text data to create the control.
To add a control:
· First Unlock the interface for editing by pressing F9, grid lines will appear on the interfaces.
· Press F2 to open the Control Palette, choose one of the 4 tabs.
· Click a control, answering questions about it, and ‘draw’ it on the interface or simply click the interface for default sizing.
There are a wide range of controls to develop interfaces with, including:
· Standard GUI controls, such as buttons and textboxes
· Analog and digital plots for charting data
· Timers for interval or timed events
· Data Logging
· Image Controls using the packages images or your own
· Indicators such as virtual LEDs, meters, and other developed indicators
· Drawing Canvas on which images and interactive drawings may be developed.
Controls placed have 3 main features:
· Properties and Values
· Update Value
· Event Code
Open the Interface Editor by clicking an interface, hover the mouse over an interface or a control, and press F3.
Properties define the appearance of a control as well as how its configuration settings, such as with a Timer whether it will run once or repeat, or the sound a button makes when clicked. The Interface Editor shows the properties which can be changed normally but not ‘values’ of the control - That will be shown in other pages. Properties can be changed by entering a new value, using the 0/1 checkbox for Boolean values (in aqua), or clicking the ellipses (…) to open a selection window.
The Update Value is what data will be used when new data arrives. Calculations are allowed using correct math formatting of Standard Math or Post-Fix Math. An example of an Update Value may be a TextBox, such as txtValue on the sample interface, that shows an incoming analog value, such as analog input 0 called ain0. To have the TextBox update when new data arrives, the value of [ain0] would be entered in the TextBox.
Incoming data can be simulated by opening the Debug/CLI window by pressing F4 and entering 20,30,40 as an example. The TextBox would show the value of 20. Text and Math can be added, for example if ain0 held voltage and ain1 held current. The update value may be used to show power in watts: { [ain0] * [ain1] }W Using the analog values of 20,30,40, the text would be: 600W
Event Code are MakerPlot-J instructions that will be processed when control is activated, such as a button click or a meter exceeding the high setpoint. Nearly all instruction in MakerPlot-J starts with an exclamation mark (!) and provide a means of performing operations, setting property values and variables and performing drawing on certain elements.
In the example shown, when the Reset button is clicked, the code of !plot.reset will be processed. This has the format of: !controlName.Instruction
MakerPlot has multiple ways of giving assistance in writing ‘code’. Using the DEBUG/CLI window or double-clicking the Event Code textbox to open the Code Editor will show contextual help based on what is typed. Entering information and pressing F1 will display help based on the text or a list item can be right-clicked to show the help information. Please see the DEBUG/CLI and Code Editor for more information on using them.
Serial Control
The Serial Control is used to communicate to a device, such as a microcontroller, and pass ASCII data, such analog data in the format of: value0, value1, value3…. <carriage return or new line> 10,20,30 or instructions, such as: !txtValue=50
Interactive control is possible allowing the computer and the serial device share data.
Using the File menu, interfaces may be saved and opened.
|