en:software:qpaint:qpaint51

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:software:qpaint:qpaint51 [2014/11/04 15:58] – created documentazioneen: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, which is the QEM software development environment for automation control.\\
 +The QPaint project can access all variables, parameters and other data structures declared in the Qview project. The "synchronisation" of the QPaint project with the Qview variables is represented in the figure below:
 +
 +{{:software:qpaint:qpaint5:symbols_file.png?nolink&400|}}
 +
 +The compilation of the QView project generates a file with the same project name and ".sym" extension. The QPaint project can use this file to access all the data.\\
 +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:
 +
 +{{:software:qpaint:qpaint5:selecttarget.png?nolink&400|}}
 +
 +==== - 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:
 +
 +{{:software:qpaint:qpaint5:qmovesymbolsfile.png?nolink&300|}}
 +
 +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 ".sym" extension.
 +
 +==== - 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:
 +
 +{{:software:qpaint:qpaint5:pagelist.png?nolink&600|}}
 +
 +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:
 +
 +{{:software:qpaint:qpaint5:objects.png?nolink&600|}}
 +
 +=== - 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 //actions//. Moreover 
 +
 +these //event-action// associations can be programmed so they are effective in all the pages or only in the page being viewed. For this there are 
 +
 +two FIXME contexts:
 +
 +  - Project - Global Events Editor
 +  - Page - Page Events Editor
 +
 +Both //Editors// have two areas as shown below
 +
 +{{:software:qpaint:qpaint5:globaleventseditor.png?nolink&600|}}
 +
 +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'ingresso della pagina;
 +  * **On Time**, evento che si attiva in un certo momento specificato da una data e un'ora;
 +  * **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 //actions//:
 +  * **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'hardware); 
 +  * **Restore**, invia un comando di Restore (verificare se questo comando è supportato dall'hardware).
 +
 +==== - 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^
 +|<code>$KEY</code> L  |  R  | FIXME Codice del tasto premuto. Ad ogni bit corrisponde un tasto della tastiera.|
 +|<code>$KEYF</code> L  |  R  |Codice del tasto funzione premuto. Ad ogni bit corrisponde un tasto della tastiera.|
 +|<code>$KEYF2</code> L  |  R  |Codice del tasto funzione premuto (Secondo gruppo). Ad ogni bit corrisponde un tasto della tastiera.|
 +|<code>$LEDS</code> L  |  RW  |Codice per attivare/disattivare i LED. Ad ogni bit corrisponde un LED.|
 +|<code>$LEDS2</code> L  |  RW  |Codice per attivare/disattivare i LED (Secondo gruppo). Ad ogni bit corrisponde un LED.|
 +|<code>$HOUR, $MIN, $SEC, $DAY, $MONTH, $YEAR</code> B, B, B, B, B, W  |  RW  |Ora e data.|
 +|<code>$DATAENTRYON</code> F  |  R  |Segnala che in questo momento è attivo l'inserimento di un valore|
 +|<code>$PAGE</code> L  |  R  |Valore della pagina visualizzata in questo momento.|
 +
 +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  <code>$KEY, $KEYF, $KEYF2.</code>\\ Each bit of these variables is assigned to a 
 +
 +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     ;This will be match to $KEYF
 +  KeyF2  L   ;This will be match to $KEYF2
 +</code>
 +
 +In the QPaint project select:
 +
 +  * Project - Global Events Editor
 +
 +{{:software:qpaint:qpaint5:globaleventseditor_2_.png?nolink&600|}}
 +
 +This will make the QPaint project continously copy (//OnAlways//) the values of its three variables FIXME in§ the Qview variables. The QView 
 +
 +project can declare the constants related to the §pressione of each button:
 +
 +<code QCL>
 +CONST
 +KEY_1 268435456 ;  "1"
 +KEY_2 1048576 ;  "2"
 +KEY_3 4096 ;  "3"
 +KEY_4 536870912 ;  "4"
 +KEY_5 2097152 ;  "5"
 +KEY_6 8192 ;  "6"
 +KEY_7 1073741824 ;  "7"
 +KEY_8 4194304 ;  "8"
 +KEY_9 16384 ;  "9"
 +KEY_0 8388608 ;  "0"
 +KEY_CLR -2147483648 ;  "CLR"
 +KEY_ENTER 128 ;  "ENTER"
 +KEY_HELP 64 ;  "HELP"
 +KEY_DECPT 32 ;  "."
 +KEY_SIGN 16 ;  "+/-"
 +KEY_ESC 33554432 ;  "ESC"
 +KEY_UP 131072 ;  "UP"
 +KEY_PGUP 512 ;  "PGUP"
 +KEY_LEFT 67108864 ;  "LEFT"
 +KEY_NEXT 262144 ;  "NEXT"
 +KEY_RIGHT 1024 ;  "RIGHT"
 +KEY_INS 134217728 ;  "INS"
 +KEY_DOWN 524288 ;  "DOWN"
 +KEY_PGDN 2048 ;  "PGDN"
 +
 +KEY_F1 33554432 ; "F1" 
 +KEY_F2 67108864 ; "F2" 
 +KEY_F3 134217728 ; "F3" 
 +KEY_F4 268435456 ; "F4" 
 +KEY_F5 536870912 ; "F5" 
 +KEY_F6 131072 ; "F6" 
 +KEY_F7 262144 ; "F7" 
 +KEY_F8 524288 ; "F8" 
 +KEY_F9 1048576 ; "F9" 
 +KEY_F10 2097152 ; "F10"
 +KEY_F11 1 ; "F11"
 +KEY_F12 2 ; "F12"
 +KEY_F13      4 ; "F13"
 +KEY_F14      8 ; "F14"
 +KEY_F15      16 ; "F15"
 +KEY_F16      32 ; "F16"
 +KEY_F17      64 ; "F17"
 +KEY_F18      128 ; "F18"
 +KEY_F19      256 ; "F19"
 +KEY_F20      512 ; "F20"
 +KEY_F21 1024 ; "F21"
 +KEY_F22 2048 ; "F22"
 +KEY_F23 4096 ; "F23"
 +KEY_F24 8192 ; "F24"
 +KEY_F25 16384 ; "F25"
 +KEY_F26 32768 ; "F26"
 +
 +</code>
 +
 +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 "1" key
 +ENDIF
 +</code>
 +
 +===== - 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 <code>$PAGE</code> variable 
 +
 +of the QPaint project. §Quindi dichiaro:
 +
 +<code QCL>
 +GLOBAL
 +  Page  L  ;This will be match§ to $PAGE
 +</code>
 +
 +e poi aggiungo an action associated to the //OnAlways// event:
 +
 +{{:software:qpaint:qpaint5:globaleventseditor_3_.png?nolink&600|}}
 +
 +§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 "1" key on the "MENU_PAGE" page
 +  ENDIF
 +ENDIF
 +</code>
 +
 +===== - 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  L  ;This will be used to request the page change
 +</code>
 +
 +then add a //OnChangeVar// event as shown in the figure:
 +
 +{{:software:qpaint:qpaint5:globaleventseditor_4_.png?nolink&600|}}
 +
 +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       ;Change page request: go to "PAGE_1" page
 +    WAIT(Page EQ PAGE_1)  ;Wait the change page has done
 +  ENDIF
 +ENDIF
 +</code>
 +
 +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
 +</code>
 +
 +add another action associated to the //OnAlways// event:
 +
 +{{:software:qpaint:qpaint5:globaleventseditor_5_.png?nolink&600|}}
 +
 +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       ;Change page request: go to "PAGE_1" page
 +    WAIT(Page EQ PAGE_1)  ;Wait the change page has done
 +  ENDIF
 +ENDIF
 +</code>
 +