Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Impressoras;
- interface
- uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
- System.Classes, Vcl.Graphics,Vcl.Controls, Vcl.Forms, Vcl.Dialogs, CurvyControls, Vcl.StdCtrls, Data.DB,
- Vcl.Grids, Vcl.DBGrids;
- type TComandos = (aCortapapel,aimprime);
- type TModelImpressora = ( aBematech,aEpson );
- type TEpson = class
- private
- {Private declaration}
- protected
- {Protected declaration}
- public
- {Public declaration declaration}
- constructor Create; (*Metodos do Constructor*)
- destructor Destroy; override;
- published
- {Protected declaration}
- end;
- type TBematech = class
- private
- {Private declaration}
- protected
- {Protected declaration}
- public
- {Public declaration declaration}
- constructor Create; (*Metodos do Constructor*)
- destructor Destroy; override;
- published
- {Protected declaration}
- end;
- type TDirectImp = Class
- private
- {Private declaration}
- FTComandos : TComandos;
- FBuffer: String;
- FCorte: string;
- FTModelImpressora: TModelImpressora;
- FTBematech: TBematech;
- FTEpson: TEpson;
- function getFcorte: String;
- function getFport: String;
- procedure setFCorte(const Value: String);
- procedure setFport(const Value: String);
- function getTModelImpressora: TModelImpressora;
- procedure setTModelImpressora(const Value: TModelImpressora);
- protected
- {Protected declaration}
- public
- {Public declaration declaration}
- property Porta: String read getFport write setFport;
- property Corte: String read getFcorte write setFCorte;
- property Modelo: TModelImpressora read getTModelImpressora write setTModelImpressora;
- procedure Imprime( aText: TStringList );
- procedure Comando( aComando: TComandos );
- procedure AfterConstruction; Override;
- procedure Beforedestruction; Override;
- constructor Create; (*Metodos do Constructor*)
- destructor Destroy; override;
- published
- {Protected declaration}
- end;
- type verificaCorte = class function VerCorte: string; end;
- implementation
- { TDirectImp }
- procedure TDirectImp.AfterConstruction;
- begin
- inherited;
- end;
- procedure TDirectImp.Beforedestruction;
- begin
- inherited;
- end;
- procedure TDirectImp.Comando(aComando: TComandos);
- begin
- case aComando of
- aCortapapel: FBuffer:= '#27+#119';
- aimprime: ;
- end;
- end;
- constructor TDirectImp.Create;
- begin
- end;
- destructor TDirectImp.Destroy;
- begin
- inherited;
- end;
- function TDirectImp.getFcorte: String;
- begin
- end;
- function TDirectImp.getFport: String;
- begin
- end;
- function TDirectImp.getTModelImpressora: TModelImpressora;
- begin
- Result:= FTModelImpressora;
- end;
- procedure TDirectImp.Imprime(aText: TStringList);
- begin
- end;
- procedure TDirectImp.setFCorte(const Value: String);
- begin
- end;
- procedure TDirectImp.setFport(const Value: String);
- begin
- end;
- procedure TDirectImp.setTModelImpressora(const Value: TModelImpressora);
- begin
- FTModelImpressora:= Value;
- case FTModelImpressora of
- aBematech: FTBematech.Create ;
- aEpson:FTEpson.Create ;
- end;
- end;
- { verificaCorte }
- function verificaCorte.VerCorte: string;
- begin
- end;
- { TEpson }
- constructor TEpson.Create;
- begin
- end;
- destructor TEpson.Destroy;
- begin
- inherited;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement