| 1 | 
 < | 
 unit Helper_LevelDB; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 | 1 | 
 > | 
 unit LevelDB; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2 | 
   | 
 interface | 
 
 
 
 
 
 
 
 
 
 | 4 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 3 | 
   | 
 uses | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 4 | 
   | 
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 5 | 
   | 
   Dialogs, ComCtrls, StdCtrls, StrUtils; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 13 | 
   | 
     lbl_estimation: TLabel; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 14 | 
   | 
     procedure btn_abortokClick(Sender: TObject); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 15 | 
   | 
   private | 
 
 
 
 
 
 
 
 
 
 
 
 | 16 | 
 < | 
     procedure HandleFile(ext: String; fileid: Integer; dir_dat2db: Boolean); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 17 | 
 < | 
     procedure stop_convert; | 
 
 
 
 
 
 
 
 
 
 | 16 | 
 > | 
     procedure HandleFile(Ext: String; FileID: Integer); | 
 
 
 
 
 
 | 17 | 
 > | 
     procedure StopConvert; | 
 
 
 
 
 
 
 
 
 
 
 
 | 18 | 
   | 
   public | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 19 | 
   | 
     procedure CreateDatabase(Source, Target: String); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 20 | 
   | 
     procedure CreateLevel(Source, Target: String); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 25 | 
   | 
   Form_LevelDB: TForm_LevelDB; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 26 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 27 | 
   | 
 implementation | 
 
 
 
 
 
 
 
 
 
 | 30 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 28 | 
   | 
 {$R *.dfm} | 
 
 
 
 
 
 
 
 
 
 
 
 | 29 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 30 | 
 < | 
 uses ABSMain, ABSDecUtil, Main, Functions, Data, OniImgClass, DataStructures, ConnectionManager; | 
 
 
 
 
 
 
 
 
 
 | 29 | 
 > | 
 uses ABSMain, ABSDecUtil, Main, | 
 
 
 
 
 
 | 30 | 
 > | 
     ConnectionManager, TypeDefs, DataAccess, OniImgClass, Data; | 
 
 
 
 
 
 
 
 
 
 
 
 | 31 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 32 | 
   | 
 type | 
 
 
 
 
 
 
 
 
 
 
 
 | 33 | 
 < | 
   THandler = procedure(fileid: LongWord; dir_dat2db: Boolean); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 34 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 38 | 
 < | 
   TConvertHandlers = record | 
 
 
 
 
 
 
 
 
 
 | 33 | 
 > | 
   THandler = procedure(FileID: Integer); | 
 
 
 
 
 
 | 34 | 
 > | 
   TConvertHandler = record | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 35 | 
   | 
     Ext:     String[4]; | 
 
 
 
 
 
 
 
 
 
 | 40 | 
 – | 
     needed:  Boolean; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 36 | 
   | 
     Handler: THandler; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 37 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 38 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 39 | 
   | 
 var | 
 
 
 
 
 
 
 
 
 
 
 
 | 40 | 
 < | 
   ConvertHandlers: array of TConvertHandlers; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 41 | 
 < | 
   loaded_filename: String; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 42 | 
 < | 
   converting: Boolean = False; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 43 | 
 < | 
   abort:     Boolean = False; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 49 | 
 < | 
   DataBase:  TABSDatabase; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 50 | 
 < | 
   Query:     TABSQuery; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 51 | 
 < | 
   MimeCoder: TStringFormat_MIME64; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 52 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 53 | 
 < | 
 var | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 54 | 
 < | 
   DatHeader:   THeader; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 55 | 
 < | 
   FilesHeader: TFilesMap; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 56 | 
 < | 
   NamedFilesHeader: TNamedFilesMap; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 57 | 
 < | 
   ExtensionsHeader: TExtensionsMap; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 58 | 
 < | 
   Stream_Body, Stream_Names: TMemoryStream; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 59 | 
 < | 
   Stream_Dat, Stream_Raw, Stream_Sep: TFileStream; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 60 | 
 < | 
   OniDataConnection: TOniData; | 
 
 
 
 
 
 
 
 
 
 | 40 | 
 > | 
   ConvertHandlers: array of TConvertHandler; | 
 
 
 
 
 
 | 41 | 
 > | 
 //  loaded_filename: String; | 
 
 
 
 
 
 | 42 | 
 > | 
   Converting:  Boolean = False; | 
 
 
 
 
 
 | 43 | 
 > | 
   Abort:       Boolean = False; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 44 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 45 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 46 | 
 + | 
 function GetOpenMsg(msg: TStatusMessages): String; | 
 
 
 
 
 
 
 
 
 | 47 | 
 + | 
 begin | 
 
 
 
 
 
 
 
 
 | 48 | 
 + | 
   case msg of | 
 
 
 
 
 
 
 
 
 | 49 | 
 + | 
     SM_AlreadyOpened:    Result := 'File already opened.'; | 
 
 
 
 
 
 
 
 
 | 50 | 
 + | 
     SM_FileNotFound:     Result := 'File not found.'; | 
 
 
 
 
 
 
 
 
 | 51 | 
 + | 
     SM_UnknownExtension: Result := 'Unknown extension.'; | 
 
 
 
 
 
 
 
 
 | 52 | 
 + | 
     SM_IncompatibleFile: Result := 'Incompatible file format.'; | 
 
 
 
 
 
 
 
 
 | 53 | 
 + | 
     SM_UnknownError:     Result := 'Unknown error.'; | 
 
 
 
 
 
 
 
 
 | 54 | 
 + | 
   end; | 
 
 
 
 
 
 
 
 
 | 55 | 
 + | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 56 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 57 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 58 | 
 < | 
 procedure TForm_LevelDB.CreateLevel(Source, target: String); | 
 
 
 
 
 
 
 
 
 
 | 58 | 
 > | 
 procedure TForm_LevelDB.CreateLevel(Source, Target: String); | 
 
 
 
 
 
 
 
 
 
 
 
 | 59 | 
   | 
 var | 
 
 
 
 
 
 
 
 
 
 
 
 | 60 | 
 < | 
   files: LongWord; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 61 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 62 | 
 < | 
   i, j:     LongWord; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 63 | 
 < | 
   temps, temps2: String; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 71 | 
 < | 
   Data, rawdata: Tdata; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 72 | 
 < | 
   absolutebegintime, begintime: Double; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 73 | 
 < | 
   step:     Byte; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 74 | 
 < | 
   rawlist:  TRawList; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 75 | 
 < | 
   extlist:  TExtensionsMap; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 76 | 
 < | 
   fileinfo: TFileInfo; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 77 | 
 < | 
   datlinks: TDatLinks; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 78 | 
 < | 
   OniImage: TOniImage; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 79 | 
 < | 
   levelid:  LongWord; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 80 | 
 < | 
   timeformat: TFormatSettings; | 
 
 
 
 
 
 
 
 
 
 | 60 | 
 > | 
   DatHeader:        THeader; | 
 
 
 
 
 
 | 61 | 
 > | 
   FilesHeader:      TFilesMap; | 
 
 
 
 
 
 | 62 | 
 > | 
   NamedFilesHeader: TNamedFilesMap; | 
 
 
 
 
 
 | 63 | 
 > | 
   ExtensionsHeader: TExtensionsMap; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 64 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 65 | 
 < | 
   conIndex: Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 66 | 
 < | 
   connection: TOniData; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 84 | 
 < | 
 const | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 85 | 
 < | 
   steps: Byte = 3; | 
 
 
 
 
 
 
 
 
 
 | 65 | 
 > | 
   Stream_Body, Stream_Names:          TMemoryStream; | 
 
 
 
 
 
 | 66 | 
 > | 
   Stream_Dat, Stream_Raw, Stream_Sep: TFileStream; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 67 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 68 | 
 + | 
 //  Data, rawdata: Tdata; | 
 
 
 
 
 
 
 
 
 | 69 | 
 + | 
   BeginTime, FileTime: Double; | 
 
 
 
 
 
 
 
 
 | 70 | 
 + | 
   Step:     Integer; | 
 
 
 
 
 
 
 
 
 | 71 | 
 + | 
 //  rawlist:  TRawDataList; | 
 
 
 
 
 
 
 
 
 | 72 | 
 + | 
 //  datlinks: TDatLinks; | 
 
 
 
 
 
 
 
 
 | 73 | 
 + | 
   OniImage:   TOniImage; | 
 
 
 
 
 
 
 
 
 | 74 | 
 + | 
   LevelID:    Integer; | 
 
 
 
 
 
 
 
 
 | 75 | 
 + | 
   TimeFormat: TFormatSettings; | 
 
 
 
 
 
 
 
 
 | 76 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 77 | 
 + | 
   ConID:      Integer; | 
 
 
 
 
 
 
 
 
 | 78 | 
 + | 
   Connection: TDataAccess; | 
 
 
 
 
 
 
 
 
 | 79 | 
 + | 
   ConRepMsg:  TStatusMessages; | 
 
 
 
 
 
 
 
 
 | 80 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 81 | 
 + | 
   Strings:    TStrings; | 
 
 
 
 
 
 
 
 
 | 82 | 
 + | 
   i, j:       Integer; | 
 
 
 
 
 
 
 
 
 | 83 | 
 + | 
   temps:      String; | 
 
 
 
 
 
 
 
 
 | 84 | 
 + | 
   FileInfo:   TFileInfo; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 85 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 86 | 
 + | 
   DatFileStream, RawFileStream: TMemoryStream; | 
 
 
 
 
 
 
 
 
 | 87 | 
 + | 
 const | 
 
 
 
 
 
 
 
 
 | 88 | 
 + | 
   Steps: Byte = 3; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 89 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 90 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 91 | 
 < | 
   procedure DoStep(stepname: String); | 
 
 
 
 
 
 
 
 
 
 | 91 | 
 > | 
   procedure DoStep(StepName: String); | 
 
 
 
 
 
 
 
 
 
 
 
 | 92 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 93 | 
 < | 
     Inc(step); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 94 | 
 < | 
     if stepname <> 'FIN' then | 
 
 
 
 
 
 
 
 
 
 | 93 | 
 > | 
     Inc(Step); | 
 
 
 
 
 
 | 94 | 
 > | 
     if StepName <> 'FIN' then | 
 
 
 
 
 
 
 
 
 
 
 
 | 95 | 
   | 
       group_progress.Caption := | 
 
 
 
 
 
 
 
 
 
 
 
 | 96 | 
 < | 
         'Creating Dat (Step ' + IntToStr(step) + '/' + IntToStr(steps) + ': ' + stepname + ')' | 
 
 
 
 
 
 
 
 
 
 | 96 | 
 > | 
         'Creating Dat (Step ' + IntToStr(Step) + '/' + IntToStr(Steps) + ': ' + StepName + ')' | 
 
 
 
 
 
 
 
 
 
 
 
 | 97 | 
   | 
     else | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 98 | 
   | 
       group_progress.Caption := 'Creating Dat (FINISHED)'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 99 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 104 | 
   | 
   // FILE EXISTS CHECK FÜR DAT/RAW/SEP!!! | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 105 | 
   | 
   // | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 106 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 107 | 
 < | 
   timeformat.ShortTimeFormat := 'hh:nn:ss'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 108 | 
 < | 
   timeformat.LongTimeFormat := 'hh:nn:ss'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 109 | 
 < | 
   timeformat.TimeSeparator := ':'; | 
 
 
 
 
 
 
 
 
 
 | 107 | 
 > | 
   TimeFormat.ShortTimeFormat := 'hh:nn:ss'; | 
 
 
 
 
 
 | 108 | 
 > | 
   TimeFormat.LongTimeFormat  := 'hh:nn:ss'; | 
 
 
 
 
 
 | 109 | 
 > | 
   TimeFormat.TimeSeparator   := ':'; | 
 
 
 
 
 
 
 
 
 
 
 
 | 110 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 111 | 
 < | 
   connection := ConnectionExists(target); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 112 | 
 < | 
   if connection <> nil then | 
 
 
 
 
 
 
 
 
 
 | 111 | 
 > | 
   ConID := ConManager.OpenConnection(Source, ConRepMsg); | 
 
 
 
 
 
 | 112 | 
 > | 
   if not (ConRepMsg in [SM_OK, SM_AlreadyOpened]) then | 
 
 
 
 
 
 
 
 
 
 
 
 | 113 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 114 | 
 < | 
     ShowMessage('Destination-file is opened, close it in order to proceed conversion?'); | 
 
 
 
 
 
 
 
 
 
 | 114 | 
 > | 
     ShowMessage('Source-file couldn''t be opened! Aborting' + CrLf + GetOpenMsg(ConRepMsg)); | 
 
 
 
 
 
 
 
 
 
 
 
 | 115 | 
   | 
     Exit; | 
 
 
 
 
 
 
 
 
 
 
 
 | 116 | 
 < | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 116 | 
 > | 
   end else | 
 
 
 
 
 
 | 117 | 
 > | 
     Connection := ConManager.Connection[ConID]; | 
 
 
 
 
 
 
 
 
 
 
 
 | 118 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 119 | 
 < | 
   connection := ConnectionExists(source); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 120 | 
 < | 
   if connection <> nil then | 
 
 
 
 
 
 
 
 
 
 | 119 | 
 > | 
   ConID := ConManager.FileOpened(Target); | 
 
 
 
 
 
 | 120 | 
 > | 
   if ConID >= 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 | 121 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 122 | 
 < | 
     ShowMessage('Source-file is opened, close it in order to proceed conversion?'); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 123 | 
 < | 
     Exit; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 122 | 
 > | 
     if MessageBox(Self.Handle, PChar('Destination-file is opened, close it in ' + | 
 
 
 
 
 
 | 123 | 
 > | 
           'order to proceed conversion?'), PChar('Destination-file opened'), | 
 
 
 
 
 
 | 124 | 
 > | 
           MB_YESNO + MB_ICONQUESTION) = ID_YES then | 
 
 
 
 
 
 | 125 | 
 > | 
     begin | 
 
 
 
 
 
 | 126 | 
 > | 
       if Form_Main.CheckConnectionCloseable(ConID) then | 
 
 
 
 
 
 | 127 | 
 > | 
         if not ConManager.CloseConnection(ConID, ConRepMsg) then | 
 
 
 
 
 
 | 128 | 
 > | 
         begin | 
 
 
 
 
 
 | 129 | 
 > | 
           ShowMessage('Couldn''t close destination-file. Aborting'); | 
 
 
 
 
 
 | 130 | 
 > | 
           Exit; | 
 
 
 
 
 
 | 131 | 
 > | 
         end; | 
 
 
 
 
 
 | 132 | 
 > | 
     end else begin | 
 
 
 
 
 
 | 133 | 
 > | 
       ShowMessage('Aborting'); | 
 
 
 
 
 
 | 134 | 
 > | 
       Exit; | 
 
 
 
 
 
 | 135 | 
 > | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 | 136 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 137 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 138 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 125 | 
 < | 
   if CreateDataConnection(Source, ODB_ADB) = nil then | 
 
 
 
 
 
 
 
 
 
 | 138 | 
 > | 
   if FileExists(Target) then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 139 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 140 | 
 < | 
     ShowMessage('Could not connect to .oldb-file'); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 141 | 
 < | 
     Exit; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 140 | 
 > | 
     if MessageBox(Self.Handle, PChar('Destination-file exists. ' + | 
 
 
 
 
 
 | 141 | 
 > | 
           'Overwrite it?'), PChar('Destination-file exists'), | 
 
 
 
 
 
 | 142 | 
 > | 
           MB_YESNO + MB_ICONWARNING) = ID_YES then | 
 
 
 
 
 
 | 143 | 
 > | 
     begin | 
 
 
 
 
 
 | 144 | 
 > | 
       if not DeleteFile(Target) then | 
 
 
 
 
 
 | 145 | 
 > | 
       begin | 
 
 
 
 
 
 | 146 | 
 > | 
         ShowMessage('Couldn''t delete file. Aborting'); | 
 
 
 
 
 
 | 147 | 
 > | 
         Exit; | 
 
 
 
 
 
 | 148 | 
 > | 
       end else if not DeleteFile(AnsiReplaceStr(Target, '.dat', '.raw')) then | 
 
 
 
 
 
 | 149 | 
 > | 
       begin | 
 
 
 
 
 
 | 150 | 
 > | 
         ShowMessage('Couldn''t delete file. Aborting'); | 
 
 
 
 
 
 | 151 | 
 > | 
         Exit; | 
 
 
 
 
 
 | 152 | 
 > | 
       end else if not DeleteFile(AnsiReplaceStr(Target, '.dat', '.sep')) then | 
 
 
 
 
 
 | 153 | 
 > | 
       begin | 
 
 
 
 
 
 | 154 | 
 > | 
         ShowMessage('Couldn''t delete file. Aborting'); | 
 
 
 
 
 
 | 155 | 
 > | 
         Exit; | 
 
 
 
 
 
 | 156 | 
 > | 
       end; | 
 
 
 
 
 
 | 157 | 
 > | 
     end else begin | 
 
 
 
 
 
 | 158 | 
 > | 
       ShowMessage('Aborting'); | 
 
 
 
 
 
 | 159 | 
 > | 
       Exit; | 
 
 
 
 
 
 | 160 | 
 > | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 | 161 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 | 130 | 
 – | 
   levelid  := OniDataConnection.LevelInfo.LevelNumber; | 
 
 
 
 
 
 
 
 
 
 | 131 | 
 – | 
   levelid  := (levelid * 2) * 256 * 256 * 256 + $01; | 
 
 
 
 
 
 
 
 
 
 | 132 | 
 – | 
   OniImage := TOniImage.Create; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 162 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 163 | 
 < | 
   absolutebegintime := Time; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 163 | 
 > | 
   LevelID  := Connection.LevelNumber; | 
 
 
 
 
 
 | 164 | 
 > | 
   LevelID  := (LevelID * 2) * 256 * 256 * 256 + $01; | 
 
 
 
 
 
 | 165 | 
 > | 
   OniImage := TOniImage.Create; | 
 
 
 
 
 
 
 
 
 
 
 
 | 166 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 167 | 
   | 
   Self.Visible := True; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 168 | 
   | 
   Form_Main.Visible := False; | 
 
 
 
 
 
 
 
 
 
 
 
 | 169 | 
 < | 
   step  := 0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 170 | 
 < | 
   converting := True; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 171 | 
 < | 
   abort := False; | 
 
 
 
 
 
 
 
 
 
 | 169 | 
 > | 
   Step := 0; | 
 
 
 
 
 
 | 170 | 
 > | 
   Converting := True; | 
 
 
 
 
 
 | 171 | 
 > | 
   Abort := False; | 
 
 
 
 
 
 
 
 
 
 
 
 | 172 | 
   | 
   btn_abortok.Caption := '&Abort...'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 173 | 
   | 
   btn_abortok.Default := False; | 
 
 
 
 
 
 
 
 
 
 
 
 | 174 | 
 < | 
   absolutebegintime := Time; | 
 
 
 
 
 
 
 
 
 
 | 174 | 
 > | 
   BeginTime := Time; | 
 
 
 
 
 
 
 
 
 
 
 
 | 175 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 176 | 
   | 
   Stream_Body  := TMemoryStream.Create; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 177 | 
   | 
   Stream_Names := TMemoryStream.Create; | 
 
 
 
 
 
 
 
 
 
 
 
 | 178 | 
 < | 
   Stream_Dat   := TFileStream.Create(target, fmCreate); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 179 | 
 < | 
   Stream_Raw   := TFileStream.Create(AnsiReplaceStr(target, '.dat', '.raw'), fmCreate); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 180 | 
 < | 
   if OniDataConnection.OSisMac then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 181 | 
 < | 
     Stream_Sep := TFileStream.Create(AnsiReplaceStr(target, '.dat', '.sep'), fmCreate); | 
 
 
 
 
 
 
 
 
 
 | 178 | 
 > | 
   Stream_Dat   := TFileStream.Create(Target, fmCreate); | 
 
 
 
 
 
 | 179 | 
 > | 
   Stream_Raw   := TFileStream.Create(AnsiReplaceStr(Target, '.dat', '.raw'), fmCreate); | 
 
 
 
 
 
 | 180 | 
 > | 
   if Connection.DataOS in [DOS_WINDEMO, DOS_MAC, DOS_MACBETA] then | 
 
 
 
 
 
 | 181 | 
 > | 
     Stream_Sep := TFileStream.Create(AnsiReplaceStr(Target, '.dat', '.sep'), fmCreate); | 
 
 
 
 
 
 
 
 
 
 
 
 | 182 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 183 | 
   | 
   DoStep('Creating header'); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 184 | 
   | 
   progress.Position      := 0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 186 | 
   | 
   lbl_estimation.Caption := 'Estimated finishing time: unknown'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 187 | 
   | 
   Application.ProcessMessages; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 188 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 189 | 
 < | 
   NamedFilesHeader := TOniDataADB(OniDataConnection).GetNamedFilesMap; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 190 | 
 < | 
   extlist := OniDataConnection.GetExtendedExtensionsList; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 191 | 
 < | 
   for i := 0 to High(DatHeader.Ident) do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 192 | 
 < | 
     DatHeader.Ident[i] := OniDataConnection.LevelInfo.Ident[i]; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 193 | 
 < | 
   DatHeader.Files := OniDataConnection.GetFilesCount; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 189 | 
 > | 
   SetLength(NamedFilesHeader, 0); | 
 
 
 
 
 
 | 190 | 
 > | 
   Strings := TStringList.Create; | 
 
 
 
 
 
 | 191 | 
 > | 
   Strings := Connection.GetFilesList('', '', False, ST_ExtNameAsc); | 
 
 
 
 
 
 | 192 | 
 > | 
   for i := 0 to Strings.Count - 1 do | 
 
 
 
 
 
 | 193 | 
 > | 
   begin | 
 
 
 
 
 
 | 194 | 
 > | 
     if MidStr(Strings.Strings[i], | 
 
 
 
 
 
 | 195 | 
 > | 
           Pos('-', Strings.Strings[i]) + 1, | 
 
 
 
 
 
 | 196 | 
 > | 
           Length(Strings.Strings[i]) - | 
 
 
 
 
 
 | 197 | 
 > | 
             Pos('.', ReverseString(Strings.Strings[i])) - | 
 
 
 
 
 
 | 198 | 
 > | 
             Pos('-', Strings.Strings[i]) | 
 
 
 
 
 
 | 199 | 
 > | 
         ) <> '' then | 
 
 
 
 
 
 | 200 | 
 > | 
     begin | 
 
 
 
 
 
 | 201 | 
 > | 
       SetLength(NamedFilesHeader, Length(NamedFilesHeader) + 1); | 
 
 
 
 
 
 | 202 | 
 > | 
       NamedFilesHeader[High(NamedFilesHeader)].FileNumber := StrToInt(MidStr(Strings.Strings[i], 1, 5)); | 
 
 
 
 
 
 | 203 | 
 > | 
       NamedFilesHeader[High(NamedFilesHeader)].blubb := 0; | 
 
 
 
 
 
 | 204 | 
 > | 
     end; | 
 
 
 
 
 
 | 205 | 
 > | 
   end; | 
 
 
 
 
 
 | 206 | 
 > | 
  | 
 
 
 
 
 
 | 207 | 
 > | 
   for i := 0 to High(DatHeader.OSIdent) do | 
 
 
 
 
 
 | 208 | 
 > | 
     case Connection.DataOS of | 
 
 
 
 
 
 | 209 | 
 > | 
       DOS_WIN: DatHeader.OSIdent[i] := HeaderOSIdentWin[i]; | 
 
 
 
 
 
 | 210 | 
 > | 
       DOS_MAC: DatHeader.OSIdent[i] := HeaderOSIdentMac[i]; | 
 
 
 
 
 
 | 211 | 
 > | 
       DOS_MACBETA: DatHeader.OSIdent[i] := HeaderOSIdentMacBeta[i]; | 
 
 
 
 
 
 | 212 | 
 > | 
     end; | 
 
 
 
 
 
 | 213 | 
 > | 
   for i := 0 to High(DatHeader.GlobalIdent) do | 
 
 
 
 
 
 | 214 | 
 > | 
     DatHeader.GlobalIdent[i] := HeaderGlobalIdent[i]; | 
 
 
 
 
 
 | 215 | 
 > | 
   DatHeader.Files := Connection.GetFileCount; | 
 
 
 
 
 
 
 
 
 
 
 
 | 216 | 
   | 
   DatHeader.NamedFiles := Length(NamedFilesHeader); | 
 
 
 
 
 
 
 
 
 
 
 
 | 217 | 
 < | 
   DatHeader.Extensions := Length(extlist); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 217 | 
 > | 
  | 
 
 
 
 
 
 | 218 | 
 > | 
   Strings := Connection.GetExtensionsList(EF_ExtCount); | 
 
 
 
 
 
 | 219 | 
 > | 
  | 
 
 
 
 
 
 | 220 | 
 > | 
   DatHeader.Extensions := Strings.Count; | 
 
 
 
 
 
 
 
 
 
 
 
 | 221 | 
   | 
   DatHeader.DataAddr   := 0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 222 | 
   | 
   DatHeader.DataSize   := 0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 223 | 
   | 
   DatHeader.NamesAddr  := 0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 227 | 
   | 
   SetLength(FilesHeader, DatHeader.Files); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 228 | 
   | 
   SetLength(ExtensionsHeader, DatHeader.Extensions); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 229 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 230 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 231 | 
   | 
   DoStep('Writing extensions-header'); | 
 
 
 
 
 
 
 
 
 
 
 
 | 232 | 
 < | 
   progress.Max := Length(OniDataConnection.GetExtensionsList); | 
 
 
 
 
 
 
 
 
 
 | 232 | 
 > | 
   progress.Max := Strings.Count; | 
 
 
 
 
 
 
 
 
 
 
 
 | 233 | 
   | 
   Application.ProcessMessages; | 
 
 
 
 
 
 
 
 
 
 
 
 | 234 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 178 | 
 < | 
   for i := 0 to High(ExtensionsHeader) do | 
 
 
 
 
 
 
 
 
 
 | 234 | 
 > | 
   for i := 0 to Strings.Count - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 235 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 236 | 
 < | 
     ExtensionsHeader[i].Ident     := extlist[i].Ident; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 237 | 
 < | 
     ExtensionsHeader[i].Extension := extlist[i].Extension; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 238 | 
 < | 
     SetLength(temps, 4); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 236 | 
 > | 
     temps := Strings.Strings[i]; | 
 
 
 
 
 
 | 237 | 
 > | 
     ExtensionsHeader[i].ExtCount := StrToInt( MidStr( | 
 
 
 
 
 
 | 238 | 
 > | 
             temps, | 
 
 
 
 
 
 | 239 | 
 > | 
             Pos('(', temps) + 1, | 
 
 
 
 
 
 | 240 | 
 > | 
             Pos(')', temps) - Pos('(', temps) - 1 ) ); | 
 
 
 
 
 
 | 241 | 
 > | 
     temps := MidStr(temps, 1, 4); | 
 
 
 
 
 
 
 
 
 
 
 
 | 242 | 
   | 
     for j := 0 to 3 do | 
 
 
 
 
 
 
 
 
 
 
 
 | 243 | 
 < | 
       temps[j + 1] := ExtensionsHeader[i].Extension[3 - j]; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 244 | 
 < | 
     ExtensionsHeader[i].ExtCount := | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 245 | 
 < | 
       Length(OniDataConnection.GetFilesList(temps, '', False, stIDAsc)); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 243 | 
 > | 
       ExtensionsHeader[i].Extension[j] := temps[4-j]; | 
 
 
 
 
 
 | 244 | 
 > | 
     for j := 0 to High(FileTypes) do | 
 
 
 
 
 
 | 245 | 
 > | 
       if FileTypes[j].Extension = temps then | 
 
 
 
 
 
 | 246 | 
 > | 
         Break; | 
 
 
 
 
 
 | 247 | 
 > | 
     if j < Length(FileTypes) then | 
 
 
 
 
 
 | 248 | 
 > | 
     begin | 
 
 
 
 
 
 | 249 | 
 > | 
       case Connection.DataOS of | 
 
 
 
 
 
 | 250 | 
 > | 
         DOS_WIN:     ExtensionsHeader[i].Ident := FileTypes[j].IdentWin; | 
 
 
 
 
 
 | 251 | 
 > | 
         DOS_WINDEMO: ExtensionsHeader[i].Ident := FileTypes[j].IdentMac; | 
 
 
 
 
 
 | 252 | 
 > | 
         DOS_MAC:     ExtensionsHeader[i].Ident := FileTypes[j].IdentMac; | 
 
 
 
 
 
 | 253 | 
 > | 
         DOS_MACBETA: ExtensionsHeader[i].Ident := FileTypes[j].IdentMac; | 
 
 
 
 
 
 | 254 | 
 > | 
       end; | 
 
 
 
 
 
 | 255 | 
 > | 
     end else begin | 
 
 
 
 
 
 | 256 | 
 > | 
       ShowMessage('Unknown Extension: ' + Strings.Strings[i]); | 
 
 
 
 
 
 | 257 | 
 > | 
       Exit; | 
 
 
 
 
 
 | 258 | 
 > | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 | 259 | 
   | 
     progress.Position    := i + 1; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 260 | 
   | 
     lbl_progress.Caption := 'Extensions done: ' + IntToStr(i + 1) + '/' + | 
 
 
 
 
 
 
 
 
 
 
 
 | 261 | 
 < | 
       IntToStr(Length(extlist)); | 
 
 
 
 
 
 
 
 
 
 | 261 | 
 > | 
       IntToStr(Strings.Count); | 
 
 
 
 
 
 
 
 
 
 
 
 | 262 | 
   | 
     Application.ProcessMessages; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 263 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 264 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 269 | 
   | 
   lbl_estimation.Caption := 'Estimated finishing time: unknown'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 270 | 
   | 
   Application.ProcessMessages; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 271 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 272 | 
 < | 
   begintime := Time; | 
 
 
 
 
 
 
 
 
 
 | 272 | 
 > | 
   FileTime := Time; | 
 
 
 
 
 
 
 
 
 
 
 
 | 273 | 
   | 
   for i := 0 to DatHeader.Files - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 274 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 275 | 
 < | 
     fileinfo := OniDataConnection.GetFileInfo(i); | 
 
 
 
 
 
 
 
 
 
 | 275 | 
 > | 
     FileInfo := Connection.GetFileInfo(i); | 
 
 
 
 
 
 
 
 
 
 
 
 | 276 | 
   | 
     for j := 0 to 3 do | 
 
 
 
 
 
 
 
 
 
 
 
 | 277 | 
 < | 
       FilesHeader[i].Extension[j] := fileinfo.Extension[4 - j]; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 278 | 
 < | 
     if fileinfo.Size > 0 then | 
 
 
 
 
 
 
 
 
 
 | 277 | 
 > | 
       FilesHeader[i].Extension[j] := FileInfo.Extension[4 - j]; | 
 
 
 
 
 
 | 278 | 
 > | 
     if FileInfo.Size > 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 | 279 | 
   | 
     begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 280 | 
   | 
       //        DatLinks:=; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 281 | 
   | 
       FilesHeader[i].DataAddr := Stream_Body.Size + 8; | 
 
 
 
 
 
 
 
 
 
 
 
 | 282 | 
 < | 
       Data    := OniDataConnection.LoadDatFile(i); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 283 | 
 < | 
       Data[4] := (levelid) and $FF; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 284 | 
 < | 
       Data[5] := (levelid shr 8) and $FF; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 285 | 
 < | 
       Data[6] := (levelid shr 16) and $FF; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 214 | 
 < | 
       Data[7] := (levelid shr 24) and $FF; | 
 
 
 
 
 
 
 
 
 
 | 282 | 
 > | 
       DatFileStream := TMemoryStream.Create; | 
 
 
 
 
 
 | 283 | 
 > | 
       Connection.LoadDatFile(i, DatFileStream); | 
 
 
 
 
 
 | 284 | 
 > | 
       DatFileStream.Seek(4, soFromBeginning); | 
 
 
 
 
 
 | 285 | 
 > | 
       DatFileStream.Write(LevelID, 4); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 286 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 287 | 
   | 
       if (Pos(UpperCase(fileinfo.Extension), UpperCase(raws)) mod 4) = 1 then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 288 | 
   | 
       begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 352 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 353 | 
   | 
     if ((i mod 10) = 0) and (i >= 100) then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 354 | 
   | 
       lbl_estimation.Caption := 'Estimated time left: ' + TimeToStr( | 
 
 
 
 
 
 
 
 
 
 
 
 | 355 | 
 < | 
         (Time - begintime) / i * (progress.Max - i + 1) * 1.1, timeformat ); | 
 
 
 
 
 
 
 
 
 
 | 355 | 
 > | 
         (Time - FileTime) / i * (progress.Max - i + 1) * 1.1, TimeFormat ); | 
 
 
 
 
 
 
 
 
 
 
 
 | 356 | 
   | 
     progress.Position := i + 1; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 357 | 
   | 
     lbl_progress.Caption := 'Files done: ' + IntToStr(i + 1) + '/' + IntToStr(progress.Max); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 358 | 
   | 
     Application.ProcessMessages; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 388 | 
   | 
   progress.Position      := progress.Max; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 389 | 
   | 
   lbl_progress.Caption   := 'Files done: ' + IntToStr(progress.Max) + '/' + | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 390 | 
   | 
     IntToStr(progress.Max); | 
 
 
 
 
 
 
 
 
 
 
 
 | 391 | 
 < | 
   lbl_estimation.Caption := 'FINISHED (duration: ' + TimeToStr(Time - absolutebegintime, timeformat) + ')'; | 
 
 
 
 
 
 
 
 
 
 | 391 | 
 > | 
   lbl_estimation.Caption := 'FINISHED (duration: ' + TimeToStr(Time - Begintime, TimeFormat) + ')'; | 
 
 
 
 
 
 
 
 
 
 
 
 | 392 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 393 | 
   | 
   DoStep('FIN'); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 394 | 
   | 
   btn_abortok.Caption := '&OK'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 424 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 425 | 
   | 
 procedure TForm_LevelDB.CreateDatabase(Source, target: String); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 426 | 
   | 
 var | 
 
 
 
 
 
 
 
 
 | 427 | 
 + | 
   DataBase:    TABSDatabase; | 
 
 
 
 
 
 
 
 
 | 428 | 
 + | 
   Query:       TABSQuery; | 
 
 
 
 
 
 
 
 
 | 429 | 
 + | 
   MimeCoder:   TStringFormat_MIME64; | 
 
 
 
 
 
 
 
 
 | 430 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 431 | 
   | 
   i, j:     LongWord; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 432 | 
   | 
   temps, temps2: String; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 433 | 
   | 
   Data:     Tdata; |