VI10CheckBufferReady
Sostituisce VI10WaitBufferReadyUsingEND
V = Vector
I = Image
Funzione utilizzata per la gestione della funzionalità Vector Image (oggetto presente su alcune versioni di Qpaint).
La funzione VI10CheckBufferReady viene utilizzata per poter ottenere lo stato di READY
del buffer senza essere bloccante.
Si usa all'interno di una macchina a stati per poter sapere quando procedere con lo stato successivo.
IMPLEMENTAZIONE
VI10CheckBufferReady (awBuffer, gfState)
Parametri:
IN/OUT | TIPO VARIABILE | NOME DI ESEMPIO | DIM | |
---|---|---|---|---|
IN | ARRSYS / ARRGBL | awBuffer | W | Array che funge da buffer per istruzioni/dati |
OUT | GLOBAL | gfState | F | Stato del buffer: 0 = occupato, 1 = pronto |
Esempio
T_TIME00
;dichiarazione costanti CONST BUFFPLOT_SIZE 500 ;dimensione del buffer ;dichiarazione variabili GLOBAL gfState F ;stato del buffer phase B ;numero dello stato (macchina a stati) ;dichiarazione array ARRGBL agwBuffPlotDemo11 W BUFFPLOT_SIZE ;buffer per VectorImage SUB DRAW SWITCH (phase) CASE 0 NOP CASE 1 VI10CheckBufferReady(agwBuffPlotDemo11, gfState) VI10SetLayer (agwBuffPlotDemo11, 0) VI10SetBackground (agwBuffPlotDemo11, COLOR.BLUE) VI10AddCls(agwBuffPlotDemo11) VI10SetLayer(agwBuffPlotDemo11, 0) ;- LAYER 0 (zero), background gwFill = 1 gwCoordX1 = 340 gwCoordY1 = 50 gwCoordX2 = gwCoordX1 + SIDE_SIZE gwCoordY2 = gwCoordY1 + SIDE_SIZE gwPenColor = COLOR.RED VI10AddPen(agwBuffPlotDemo11, gwPenColor) VI10AddSet(agwBuffPlotDemo11, gwCoordX1, gwCoordY1) VI10AddRect(agwBuffPlotDemo11, gwCoordX2, gwCoordY2, gwFill) VI10DrawBuffer(agwBuffPlotDemo11) phase = 2 CASE 2 VI10CheckBufferReady(agwBuffPlotDemo11, gfState) IF NOT gfState VI10SetLayer(agwBuffPlotDemo11, 1) ;- LAYER 1 (one) gwCoordX1 = gwCoordX1 + OFFSET gwCoordY1 = gwCoordY1 + OFFSET gwCoordX2 = gwCoordX1 + SIDE_SIZE gwCoordY2 = gwCoordY1 + SIDE_SIZE gwPenColor = COLOR.GRAY VI10AddPen(agwBuffPlotDemo11, gwPenColor) VI10AddSet(agwBuffPlotDemo11, gwCoordX1, gwCoordY1) VI10AddRect(agwBuffPlotDemo11, gwCoordX2, gwCoordY2, gwFill) VI10DrawBuffer(agwBuffPlotDemo11) phase = 3 ENDIF CASE 3 VI10CheckBufferReady(agwBuffPlotDemo11, gfState) IF NOT gfState phase = 4 ENDIF CASE 4 phase = 0 ENDSWITCH ENDSUB