Advertisement
filhotecmail

IMpressoras

Nov 16th, 2017
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 3.28 KB | None | 0 0
  1. unit Impressoras;
  2.  
  3. interface
  4.  
  5. uses  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  6.   System.Classes, Vcl.Graphics,Vcl.Controls, Vcl.Forms, Vcl.Dialogs, CurvyControls, Vcl.StdCtrls, Data.DB,
  7.   Vcl.Grids, Vcl.DBGrids;
  8.  
  9.  type TComandos = (aCortapapel,aimprime);
  10.  type TModelImpressora = ( aBematech,aEpson );
  11.  
  12. type TEpson = class
  13.  
  14.   private
  15.   {Private declaration}
  16.   protected
  17.   {Protected declaration}
  18.   public
  19.   {Public declaration declaration}
  20.     constructor Create; (*Metodos do Constructor*)
  21.     destructor Destroy; override;
  22.  
  23.   published
  24.   {Protected declaration}
  25.   end;
  26.  
  27.  
  28.  
  29. type TBematech = class
  30.  
  31.      private
  32.      {Private declaration}
  33.      protected
  34.      {Protected declaration}
  35.      public
  36.      {Public declaration declaration}
  37.        constructor Create; (*Metodos do Constructor*)
  38.        destructor Destroy; override;
  39.  
  40.      published
  41.      {Protected declaration}
  42.  
  43. end;
  44.  
  45. type TDirectImp = Class
  46. private
  47. {Private declaration}
  48.  FTComandos : TComandos;
  49.  FBuffer: String;
  50.  FCorte: string;
  51.  FTModelImpressora: TModelImpressora;
  52.  FTBematech: TBematech;
  53.  FTEpson: TEpson;
  54.     function getFcorte: String;
  55.     function getFport: String;
  56.     procedure setFCorte(const Value: String);
  57.     procedure setFport(const Value: String);
  58.     function getTModelImpressora: TModelImpressora;
  59.     procedure setTModelImpressora(const Value: TModelImpressora);
  60. protected
  61. {Protected declaration}
  62. public
  63. {Public declaration declaration}
  64.   property Porta: String read getFport write setFport;
  65.   property Corte: String read getFcorte write setFCorte;
  66.   property Modelo: TModelImpressora read getTModelImpressora write setTModelImpressora;
  67.   procedure Imprime( aText: TStringList );
  68.   procedure Comando( aComando: TComandos );
  69.   procedure AfterConstruction; Override;
  70.   procedure Beforedestruction; Override;
  71.   constructor Create; (*Metodos do Constructor*)
  72.   destructor Destroy; override;
  73.  
  74. published
  75. {Protected declaration}
  76. end;
  77.  
  78.   type verificaCorte = class function VerCorte: string; end;
  79.  
  80.  implementation
  81.  
  82. { TDirectImp }
  83.  
  84. procedure TDirectImp.AfterConstruction;
  85. begin
  86.   inherited;
  87.  
  88. end;
  89.  
  90. procedure TDirectImp.Beforedestruction;
  91. begin
  92.   inherited;
  93.  
  94. end;
  95.  
  96. procedure TDirectImp.Comando(aComando: TComandos);
  97. begin
  98.  case aComando of
  99.    aCortapapel: FBuffer:= '#27+#119';
  100.    aimprime: ;
  101.  end;
  102. end;
  103.  
  104. constructor TDirectImp.Create;
  105. begin
  106.  
  107. end;
  108.  
  109. destructor TDirectImp.Destroy;
  110. begin
  111.  
  112.   inherited;
  113. end;
  114.  
  115. function TDirectImp.getFcorte: String;
  116. begin
  117.  
  118. end;
  119.  
  120. function TDirectImp.getFport: String;
  121. begin
  122.  
  123. end;
  124.  
  125. function TDirectImp.getTModelImpressora: TModelImpressora;
  126. begin
  127.  Result:= FTModelImpressora;
  128. end;
  129.  
  130. procedure TDirectImp.Imprime(aText: TStringList);
  131. begin
  132.  
  133. end;
  134.  
  135. procedure TDirectImp.setFCorte(const Value: String);
  136. begin
  137.  
  138. end;
  139.  
  140. procedure TDirectImp.setFport(const Value: String);
  141. begin
  142.  
  143. end;
  144.  
  145. procedure TDirectImp.setTModelImpressora(const Value: TModelImpressora);
  146. begin
  147.  FTModelImpressora:= Value;
  148.   case FTModelImpressora of
  149.     aBematech: FTBematech.Create ;
  150.     aEpson:FTEpson.Create ;
  151.   end;
  152. end;
  153.  
  154. { verificaCorte }
  155.  
  156. function verificaCorte.VerCorte: string;
  157. begin
  158.  
  159. end;
  160.  
  161. { TEpson }
  162.  
  163. constructor TEpson.Create;
  164. begin
  165.  
  166. end;
  167.  
  168. destructor TEpson.Destroy;
  169. begin
  170.  
  171.   inherited;
  172. end;
  173.  
  174. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement