Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
en:software:qpaint:qpaint51 [2015/01/20 09:14] – qem202 | en:software:qpaint:qpaint51 [2019/08/29 17:01] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | PRELIMINARE/ | ||
+ | ====== QPAINT 5.1 ====== | ||
+ | FIXME | ||
+ | ===== - Introduction ===== | ||
+ | QPaint 5 is a graphics development environment for programming a QEM HMI terminal. This manual provides the main characteristics of a QPaint program. The description of the QPaint environment will often refer to concepts of the Qview development environment, | ||
+ | The QPaint project can access all variables, parameters and other data structures declared in the Qview project. The " | ||
+ | |||
+ | {{: | ||
+ | |||
+ | The compilation of the QView project generates a file with the same project name and " | ||
+ | QPaint is a development environment that creates an operator interface without a programming language, using intuitive tools that give an immediate preview of the graphics in the end result. | ||
+ | | ||
+ | |||
+ | ===== - Quick Start ===== | ||
+ | |||
+ | FIXME | ||
+ | |||
+ | This quickstart gives a basic outline of information needed for a rapid startup of a new QPaint project . | ||
+ | |||
+ | ==== - New Project ==== | ||
+ | Select: | ||
+ | |||
+ | * File - New Project... | ||
+ | |||
+ | QPaint asks the Qem hardware model for the Project: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== - Symbols file importing ==== | ||
+ | One first operation is to import the file that gives access to the symbols declared in the assiciated QView project. | ||
+ | Select: | ||
+ | |||
+ | * Project - QMove Syumbols File... | ||
+ | |||
+ | To open the window: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Click //Import// and specify the symbols file. | ||
+ | This file is generated by QView during the project compilation and has the same name as the QView project, with a " | ||
+ | |||
+ | ==== - FIXME Pages ==== | ||
+ | A QPaint project is made up of a series of //Pages// for viewing on the HMI display, where the operator interacts. The list of pages, given in the top | ||
+ | |||
+ | lefthand corner, can be identified by a number or name: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | The //Page// menu FIXME manages the project pages FIXME : | ||
+ | * inserire, FIXME | ||
+ | * aggiungere, | ||
+ | * togliere, | ||
+ | * copiare, | ||
+ | * incollare, | ||
+ | * importare, | ||
+ | * esportare, | ||
+ | * impostare il colore dello sfondo, | ||
+ | * programmare gli eventi e le azioni di una pagina. | ||
+ | |||
+ | ==== - FIXME Oggetti ==== | ||
+ | Graphic oggetti§ with various purposes can be added to the pages. To select what §oggetto to add to a §pagina use the vertical bar shown | ||
+ | |||
+ | below: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | === - Value Object === | ||
+ | The oggetto that views a variable or parameter value. | ||
+ | |||
+ | === - String Object === | ||
+ | The oggetto used to show§write fixed§ text in the page. | ||
+ | |||
+ | === - ValString Object === | ||
+ | The oggetto used to §apparire a dynamic message dependant on the value of a Qview variable. | ||
+ | |||
+ | === - UniString Object === | ||
+ | The same oggetto as //String Object// but using PC fonts and especially Unicode fonts that implement different characters: Cyrillic, Greek, Arabic, | ||
+ | |||
+ | Chinese, etc. | ||
+ | |||
+ | === - UniValString Object === | ||
+ | The same oggetto as //ValString Object// but with the same characteristics as //UniString Object//. | ||
+ | |||
+ | === - §Image Object === | ||
+ | This oggetto adds an image to the page. The image must be taken from the project image library, accessed by selecting: | ||
+ | |||
+ | * Graphics - Image Manager | ||
+ | |||
+ | //Image Manager// can load images into the library and modify their dimensions. | ||
+ | |||
+ | === - ValImage Object === | ||
+ | This oggetto adds a dynamic image to the page according to the value of a QView variable value. All images used in this type of oggetto must | ||
+ | |||
+ | have the same dimensions. The images must be taken from the image library in //Image Manager//. | ||
+ | |||
+ | === - Vector Image Object === | ||
+ | This oggetto creates an area in the page for drawing elementary shapes. This oggetto must always be associated to a Word array. There are | ||
+ | |||
+ | FIXME Qview functions that provide basic drawing §primitive (e.g. lines, rectangles, arcs, circles, etc.). | ||
+ | |||
+ | === - Box Object === | ||
+ | This oggetto creates rectangular frames FIXME boxes. | ||
+ | |||
+ | === - Touch Area === | ||
+ | This oggetto creates a touch area that activates events FIXME legati to the user touching the screen. This oggetto can only be used on displays | ||
+ | |||
+ | with touch screens. The events: | ||
+ | |||
+ | * **On Touch Press**, the moment a finger FIXME presses the display | ||
+ | * **On Touch Release**, the moment the finger FIXME leaves the display | ||
+ | * **On Touch Press Double**, a rapid double press. | ||
+ | |||
+ | actions can be associated to each of these events. The actions are §tipo generico and not tied to touch-screen §concetto, so they will be | ||
+ | |||
+ | described later. | ||
+ | |||
+ | ==== - Events and Actions ==== | ||
+ | §Oltre alla composizione della graphics, programming can also be implemented in the project. | ||
+ | §Il principio è quello di avere a disposizione a series of //events// da cui scegliere. Ad ogni event io can be associated with // | ||
+ | |||
+ | these // | ||
+ | |||
+ | two FIXME contexts: | ||
+ | |||
+ | - Project - Global Events Editor | ||
+ | - Page - Page Events Editor | ||
+ | |||
+ | Both //Editors// have two areas as shown below | ||
+ | |||
+ | {{: | ||
+ | |||
+ | The //events// are entered on the left and the //actions// associated to a selected event are entered on the right . | ||
+ | |||
+ | === - Events === | ||
+ | A list of the events: | ||
+ | * **On Key**, evento che si ripete continuamente finché è premuto il tasto specificato; | ||
+ | * **On Press**, evento che si attiva alla pressione del tasto specificato; | ||
+ | * **On Release**, evento che si attiva al rilascio del tasto specificato; | ||
+ | * **On Always**, evento che si ripete continuamente; | ||
+ | * **On Page In**, evento che si attiva all' | ||
+ | * **On Time**, evento che si attiva in un certo momento specificato da una data e un' | ||
+ | * **On Change Var**, evento che si attiva quando la variabile specificata cambia valore; | ||
+ | * **On Var**, evento che si attiva quando la variabile specificata assume il valore specificato. | ||
+ | |||
+ | === - Actions === | ||
+ | An //event// can be associated with to several of the following // | ||
+ | * **Goto Page** | ||
+ | * **Next Page** | ||
+ | * **Previus Page** | ||
+ | * **Begin Data Entry** | ||
+ | * **Send Command** FIXME ad un device dichiarato nel progetto QView; | ||
+ | * **Set Variable** assegna un valore ad una variabile del progetto QView; | ||
+ | * **Led On**, attiva il LED specificato (usually the LED's are associated to function keys); | ||
+ | * **Led Off**, disattiva il LED specificato; | ||
+ | * **Led Blink**, attiva il lampeggio del LED specificato; | ||
+ | * **Backup**, invia un comando di Backup (verificare se questo comando è supportato dall' | ||
+ | * **Restore**, | ||
+ | |||
+ | ==== - FIXME Terminal Variable ==== | ||
+ | Ogni progetto QPaint project contains variables sempre presenti che supply information related to the actual §terminale. | ||
+ | These variables have a pre-set name, some are only read and others are also write: | ||
+ | |||
+ | ^Name^Type^ Read/Write ^Description^ | ||
+ | |< | ||
+ | |< | ||
+ | |< | ||
+ | |< | ||
+ | |< | ||
+ | |< | ||
+ | |< | ||
+ | |< | ||
+ | |||
+ | There are many others, since these are only the most common when developing a project. (see FIXME ) | ||
+ | | ||
+ | |||
+ | ====== - Controls by QView ====== | ||
+ | FIXME | ||
+ | |||
+ | The management of the HMI (human-machine interface) can also be achieved by an exchange of information with a QView project. These are the | ||
+ | |||
+ | most important operations in managing an HMI: | ||
+ | |||
+ | * detect the pressure on a button FIXME | ||
+ | * understand what screen is being viewed | ||
+ | * command a screen change | ||
+ | * verify if the data entry is FIXME active (the page change is diabled). | ||
+ | |||
+ | Often it is best to manage the HMI basic operazioni directly from the QView project. Vediamo come questo sia possibile. | ||
+ | |||
+ | ===== - Detect the FIXME pressure on a button ===== | ||
+ | The variables to know if a button has been pressed are < | ||
+ | |||
+ | button FIXME della tastiera. The variables are only accessible by QPaint and are not FIXME visibili in the QView project. To be able to transfer | ||
+ | |||
+ | the variable values to the QView project, three variables have to be included in the QView project: | ||
+ | |||
+ | <code QCL> | ||
+ | GLOBAL | ||
+ | Key L ;This will be match to $KEY | ||
+ | KeyF | ||
+ | KeyF2 L ;This will be match to $KEYF2 | ||
+ | </ | ||
+ | |||
+ | In the QPaint project select: | ||
+ | |||
+ | * Project - Global Events Editor | ||
+ | |||
+ | {{: | ||
+ | |||
+ | This will make the QPaint project continously copy (// | ||
+ | |||
+ | project can declare the constants related to the §pressione of each button: | ||
+ | |||
+ | <code QCL> | ||
+ | CONST | ||
+ | KEY_1 268435456 ; | ||
+ | KEY_2 1048576 ; | ||
+ | KEY_3 4096 ; | ||
+ | KEY_4 536870912 ; | ||
+ | KEY_5 2097152 ; | ||
+ | KEY_6 8192 ; | ||
+ | KEY_7 1073741824 ; | ||
+ | KEY_8 4194304 ; | ||
+ | KEY_9 16384 ; | ||
+ | KEY_0 8388608 ; | ||
+ | KEY_CLR -2147483648 ; | ||
+ | KEY_ENTER 128 ; | ||
+ | KEY_HELP 64 ; | ||
+ | KEY_DECPT 32 ; | ||
+ | KEY_SIGN 16 ; | ||
+ | KEY_ESC 33554432 ; | ||
+ | KEY_UP 131072 ; | ||
+ | KEY_PGUP 512 ; | ||
+ | KEY_LEFT 67108864 ; | ||
+ | KEY_NEXT 262144 ; | ||
+ | KEY_RIGHT 1024 ; | ||
+ | KEY_INS 134217728 ; | ||
+ | KEY_DOWN 524288 ; | ||
+ | KEY_PGDN 2048 ; | ||
+ | |||
+ | KEY_F1 33554432 ; | ||
+ | KEY_F2 67108864 ; | ||
+ | KEY_F3 134217728 ; | ||
+ | KEY_F4 268435456 ; | ||
+ | KEY_F5 536870912 ; | ||
+ | KEY_F6 131072 ; | ||
+ | KEY_F7 262144 ; | ||
+ | KEY_F8 524288 ; | ||
+ | KEY_F9 1048576 ; | ||
+ | KEY_F10 2097152 ; | ||
+ | KEY_F11 1 ; | ||
+ | KEY_F12 2 ; | ||
+ | KEY_F13 | ||
+ | KEY_F14 | ||
+ | KEY_F15 | ||
+ | KEY_F16 | ||
+ | KEY_F17 | ||
+ | KEY_F18 | ||
+ | KEY_F19 | ||
+ | KEY_F20 | ||
+ | KEY_F21 1024 ; | ||
+ | KEY_F22 2048 ; | ||
+ | KEY_F23 4096 ; | ||
+ | KEY_F24 8192 ; | ||
+ | KEY_F25 16384 ; | ||
+ | KEY_F26 32768 ; | ||
+ | |||
+ | </ | ||
+ | |||
+ | The code to execute a given action if a tasto FIXME is pressed: | ||
+ | |||
+ | <code QCL> | ||
+ | IF Key EQ KEY_1 | ||
+ | ;Put here the code to do when the operator press " | ||
+ | ENDIF | ||
+ | </ | ||
+ | |||
+ | ===== - Knowing the page §visualizzata ===== | ||
+ | As in the previous chapter, a variable has to be included in the Qview project to be able to FIXME accogliere the < | ||
+ | |||
+ | of the QPaint project. §Quindi dichiaro: | ||
+ | |||
+ | <code QCL> | ||
+ | GLOBAL | ||
+ | Page L ;This will be match§ to $PAGE | ||
+ | </ | ||
+ | |||
+ | e poi aggiungo an action associated to the // | ||
+ | |||
+ | {{: | ||
+ | |||
+ | §In questo modo posso eseguire different operations depending on the page being viewed: | ||
+ | |||
+ | <code QCL> | ||
+ | IF Page EQ MENU_PAGE | ||
+ | IF Key EQ KEY_1 | ||
+ | ;Put here the code to do when the operator press " | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | </ | ||
+ | |||
+ | ===== - Commanding change page ===== | ||
+ | To command a page change on the HMI by a single code line in the QView project, first declare a Qview variable: | ||
+ | |||
+ | <code QCL> | ||
+ | GLOBAL | ||
+ | PageIn | ||
+ | </ | ||
+ | |||
+ | then add a // | ||
+ | |||
+ | {{: | ||
+ | |||
+ | So when the value of //PagIn// variable is changed in a code line of the Qview project, the //Goto Page// action is activated and changes the page, | ||
+ | |||
+ | viewing the page FIXME con indice il new value of the //PageIn// variable. | ||
+ | |||
+ | The new QCL code: | ||
+ | |||
+ | <code QCL> | ||
+ | IF Page EQ MENU_PAGE | ||
+ | IF Key EQ KEY_1 | ||
+ | PageIn = PAGE_1 | ||
+ | WAIT(Page EQ PAGE_1) | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | </ | ||
+ | |||
+ | It can be seen that a //WAIT// instruction is added to wait until the requested page change is effectively made before continuing with the | ||
+ | |||
+ | remaining code lines. | ||
+ | ===== - Dataentry active ===== | ||
+ | To know the status of a data entry another variable must be included in the QVIEW project: | ||
+ | |||
+ | <code QCL> | ||
+ | GLOBAL | ||
+ | DEOn F ;This will match FIXME to $DATAENTRYON | ||
+ | </ | ||
+ | |||
+ | add another action associated to the // | ||
+ | |||
+ | {{: | ||
+ | |||
+ | then if the page change is not possible during the data entry, the code must be changed: | ||
+ | |||
+ | <code QCL> | ||
+ | IF Page EQ MENU_PAGE | ||
+ | IF (Key EQ KEY_1) AND (DEOn EQ 0) | ||
+ | PageIn = PAGE_1 | ||
+ | WAIT(Page EQ PAGE_1) | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | </ | ||
+ | |