PARAM lcd_text, radek, all
private m.aa
m.lcdpamet=m.lcd_text
IF !EMPTY(m.gcLcdPrnName)
 *m.lcd_text = CHRTRAN(m.lcd_text,"áéíóúýùìžšøèÁÉÍÓÚÝUEZŠRC-","aeiouyuezsrcAEIOUYUEZSRC-")
 m.lcd_text = td(m.lcd_text)		&& Pripadne odcesteni
  do case
    case m.gcLcdTyp=upper("DUHA")
      pdrvpuv = _pdriver
      _pdriver = ""
      m.pvl = "SET PRINTER TO NAME "+ m.gcLcdPrnName
      &pvl 
      ??? CHR(27)+"["+"J"+m.lcd_text+CHR(13)
      set printer to
      _pdriver = pdrvpuv
    case m.gcLcdTyp=upper("NCR")
      =oncrdisp.disp(m.lcd_text+SPACE(1),.f.)
    case m.gcLcdTyp=upper("FLOUR")
      *pdrvpuv = _pdriver
      *_pdriver = ""
      oo_prn = SET("PRINT", 1)
      m.pvl = "SET PRINTER TO NAME "+ m.gcLcdPrnName
      &pvl 
      printjob
      if ! m.all
        m.radek = iif(param()>1 .and. between(m.radek,1,2),20*(m.radek-1),0)
        =send( chr(4)+chr(1)+'C';
          +chr(asc('1')+m.radek)+chr(asc('1')+m.radek+19)+;
          chr(23)),.f.
        =send( chr(4)+chr(1)+'P'+chr(asc('1')+m.radek)+chr(23)),.t.
        if ! empty(m.lcd_text)
          =send( left(m.lcd_text,20)),.t.
        endif
      else
        =send( chr(4)+chr(1)+'C1X'+chr(23)),.f.
        =send( chr(4)+chr(1)+'P1'+chr(23)),.t.
        if ! empty(m.lcd_text)
          =send( left(m.lcd_text,40)),.t.
        endif
     endif
     endprintjob
     SET PRINT TO &oo_prn
     *_pdriver = pdrvpuv
    case m.gcLcdTyp=upper("SURE_ONE")
      oo_prn = SET("PRINT", 1)
      m.pvl = "SET PRINTER TO NAME "+ m.gcLcdPrnName
      &pvl 
      printjob
      if ! empty(m.lcd_text)
        =send(chr(31)+rtrim(m.lcd_text)),.t.
      else
        =send(chr(31))
      endif
     endprintjob
     SET PRINT TO &oo_prn
    case m.gcLcdTyp=upper("BULL")
      pdrvpuv = _pdriver
      _pdriver = ""
      m.pvl = "SET PRINTER TO NAME "+ m.gcLcdPrnName
      &pvl 
      if ! empty(m.lcd_text)
        =send(chr(27)+"[2J"+left(rtrim(m.lcd_text),20)+chr(10)+chr(13)),.t.
        =send(substr(rtrim(m.lcd_text),21,20)+chr(13)),.t.
      else
        =send(chr(27)+"[2J")
      endif
     set printer to
     _pdriver = pdrvpuv
    case m.gcLcdTyp=upper("POSIFLEX")
      oo_prn = SET("PRINT", 1)
      m.pvl = "SET PRINTER TO NAME "+ m.gcLcdPrnName
      &pvl 
      printjob
      if ! empty(m.lcd_text)
        m.pomtxt = CHR(27)+CHR(17)+CHR(12)
        =send(m.pomtxt,.T.)
        m.pomtxt = m.lcd_text
        =send(LEFT(m.pomtxt,20)+PADR(SUBSTR(m.pomtxt,21),20),.T.)
      ELSE
        =send(SPACE(40),.T.)
      endif
      endprintjob
      SET PRINT TO &oo_prn
      *_pdriver = pdrvpuv
    CASE UPPER(m.gcLcdTyp) = "VIRTUOS"
      pdrvpuv = _pdriver
      _pdriver = ""
      m.pvl = "SET PRINTER TO NAME "+ m.gcLcdPrnName
      &pvl 
      if ! empty(m.lcd_text)
        =send(CHR(12))		&& Smazat
        =send(chr(27)+"QA"+left(rtrim(m.lcd_text),20)+chr(13)),.t.
        =send(chr(27)+"QB"+substr(rtrim(m.lcd_text),21,20)+chr(13)),.t.
      else
        =send(chr(12))
      endif
     set printer to
     _pdriver = pdrvpuv
  endcase
ENDIF

function send
parameter m.qwe,m.cti
private m.aa
??? m.qwe
return


procedure black_alto
privat m.aa
IF !EMPTY(m.gcLcdPrnName)
  do case
  case upper(m.gcLcdTyp)="FLOUR"
    do lcd_disp with padc('Alto Praha s.r.o.',20),1,.f.
    do lcd_disp with padc('Food500',20),2,.f.
*    pdrvpuv = _pdriver
*    _pdriver = ""
    oo_prn = SET("PRINT", 1)
    m.pvl = "SET PRINTER TO NAME "+ m.gcLcdPrnName
    &pvl 
    =send(chr(4)+chr(1)+'S1'+chr(23),.t.) in (m.pgm_path+lcd_disp.prg)
    wait '*' window time 4
    =send(chr(4)+chr(1)+'D11'+chr(23),.t.) in (m.pgm_path+lcd_disp.prg)
    set printer to
    SET PRINT TO &oo_prn
    *_pdriver = pdrvpuv
  case upper(m.gcLcdTyp)="SURE_ONE"
    do lcd_disp with padc('Alto Praha s.r.o.',20)+padc('Food500',20) ,1,.f.
    pdrvpuv = _pdriver
    _pdriver = ""
    m.pvl = "SET PRINTER TO NAME "+ m.gcLcdPrnName
    &pvl 
    set printer to
    _pdriver = pdrvpuv
  case upper(m.gcLcdTyp)="BULL"
    do lcd_disp with padc('Alto Praha s.r.o.',20)+padc('Food500',20) ,1,.f.
    do lcd_disp with padc('Alto Praha s.r.o.',20)+padc('Food500',20) ,1,.f.
    pdrvpuv = _pdriver
    _pdriver = ""
    m.pvl = "SET PRINTER TO NAME "+ m.gcLcdPrnName
    &pvl 
    set printer to
    _pdriver = pdrvpuv
  endcase
endif
return

PROCEDURE send_cmd
PARAMETERS p_port, p_outstr
PRIVATE c_vys
  ***********  Posilani zpravy   **********************
  = c_rxflush(p_port, 0)
  = c_txflush(p_port, 0)
  for i=1 to len(m.p_outstr)
    =c_putc(m.p_port, substr(m.p_outstr,m.i,1))
  endfor
RETURN
