(*
*******************************************************************************
*         Copyright (C) SofCon 2002 All Rights Reserved                       *
*******************************************************************************
*
*    project:     priklad generatoru online parametru
*
*    title:       uCrExam2.pas
*
*******************************************************************************
*
*    description: vytvoreni CSV souboru popisujici online parametry
*
*    version:     1.01
*    language:    Borland Pascal
*
*    author:      Hvozdovic
*    history:     date      sign   remark
*                 9.02      bi     zacatek vyvoje
*                11.02      hv     prvni release
*****************************************************************************
*)
{$I SETS.INC }

unit uCrExam2;
interface

uses
 {$IFDEF VER7}
  NumToStr
 {$ENDIF}
 {$IFDEF WIN32}
  Cf_StrNu
 {$ENDIF}
 ,XTKing_1 { Spolecny systemovy soubor s programem TKingCon.exe }
 ,XTheKing { Interface na creator Cr_TheKing.exe }
 ,CrBPFile { prostredky pro definici OnLine parametru do souboru CSV }
 {--------------------------------------------------------------}
 ,xCrExam2; { Definice parametru konkretni aplikace TheKing   }

const
  cName = 'uCrExam2';           { jmeno jednotky }
  cVer  = 'v1.01, 8.11.2002';   { verze jednotky }

procedure CrAppOpen(const ADestFN:string);
procedure CrAppExecute;
procedure CrAppClose;

{#######################################################################################}
implementation


const  et_Boolean         ='Boolean.et';
       et_OnOff           ='OnOff.et';
       et_DemoEnum1       ='DemoEnum1.et';
       et_DemoEnum2       ='DemoEnum2.et';



procedure CrAppOpen(const ADestFN:string);
begin
  writeln(output,'CrAppOpen');
  WrOnLineFileOpen(ADestFN);
end;

function fRCP(ALev:byte):word;
begin
  if ALev=LeReadOnly
  then fRCP:=rcp_PeriodicWatch
  else fRCP:=rcp_PeriodicWatch or rcp_Store or rcp_Load or rcp_Transmit;
end;

procedure CrAppExecute;
var ACreator,ADEArr:byte;
begin
  { Definice konkretnich parametru aplikace TheKing, parametry z XD6King.pas }
  writeln(output,'CrAppExecute');
  ACreator:=0;
  ADEArr  :=0;

  InsRealpPar(ACreator,ADEArr, LA_VersionGlb_Ver,NA_VersionGlb_Ver,'[u]'{AUNI},
                Le_VersionGlb_Ver,10{ARfsPer},fRCP(Le_VersionGlb_Ver),dscr_None,
                Dm_VersionGlb_Ver{Adec},Im_VersionGlb_Ver{AImp_Val},
                Lo_VersionGlb_Ver,Hi_VersionGlb_Ver);

  { byte zobrazeny dekadicky }
  InsBytePar(ACreator,ADEArr,LA_Byte1,NA_Byte1,'[u1]'{AUNI},
                Le_Byte1,5{ARfsPer},fRCP(Le_Byte1),dscr_None,
                Im_Byte1,Lo_Byte1,Hi_Byte1);

  { byte zobrazeny hexadecimalne }
  InsBytePar(ACreator,ADEArr,LA_Byte2,NA_Byte2,'[u2]'{AUNI},
                Le_Byte2,5{ARfsPer},fRCP(Le_Byte2),dscr_ShwHex,
                Im_Byte2,Lo_Byte2,Hi_Byte2);

  { byte zobrazeny dekadicky }
  InsBytePar(ACreator,ADEArr,LA_Byte3,NA_Byte3,'[u1]'{AUNI},
                Le_Byte3,5{ARfsPer},fRCP(Le_Byte3),dscr_None,
                Im_Byte3,Lo_Byte3,Hi_Byte3);


end;

procedure CrAppClose;
begin
  writeln(output,'CrAppClose');
  WrOnLineFileClose;
end;

end.