/[projects]/dao/DelphiScanner/Main.pas
ViewVC logotype

Diff of /dao/DelphiScanner/Main.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2790 by torben, Tue Nov 24 15:35:17 2015 UTC revision 2791 by torben, Fri Dec 4 15:39:20 2015 UTC
# Line 25  uses Line 25  uses
25    ParentForm,    ParentForm,
26    LabelPrint,    LabelPrint,
27    Configuration,    Configuration,
28    Vcl.Imaging.pngimage    Vcl.Imaging.pngimage,
29      Generics.Collections
30    
31    ;    ;
32    
# Line 104  type Line 105  type
105      PanelManglendePakker5: TPanel;      PanelManglendePakker5: TPanel;
106      PanelManglendePakker6: TPanel;      PanelManglendePakker6: TPanel;
107      menuIndlevering: TMenuItem;      menuIndlevering: TMenuItem;
108        chkForstorTilDirekte: TCheckBox;
109    
110    
111    
# Line 3086  begin Line 3088  begin
3088        BtnEKLoverforsel.Enabled := true;        BtnEKLoverforsel.Enabled := true;
3089        InitLillePakke();        InitLillePakke();
3090        ListBox1.Items.Clear;        ListBox1.Items.Clear;
3091    
3092          chkForstorTilDirekte.Checked := false;
3093          chkForstorTilDirekte.Enabled := false;
3094    
3095        if BladhusSted = 0 then        if BladhusSted = 0 then
3096        begin        begin
3097          IndlesScanningLogFil();          IndlesScanningLogFil();
# Line 3117  begin Line 3123  begin
3123        ListBox1.Items.Clear;        ListBox1.Items.Clear;
3124        ListBox2.Items.Clear;        ListBox2.Items.Clear;
3125        BtnEKLoverforsel.Enabled := false;        BtnEKLoverforsel.Enabled := false;
3126    
3127          chkForstorTilDirekte.Checked := false;
3128          chkForstorTilDirekte.Enabled := false;
3129    
3130        InitLillePakke();        InitLillePakke();
3131  end;  end;
3132    
# Line 3143  begin Line 3153  begin
3153        ListBox1.Items.Clear;        ListBox1.Items.Clear;
3154        ListBox2.Items.Clear;        ListBox2.Items.Clear;
3155        BtnEKLoverforsel.Enabled := false;        BtnEKLoverforsel.Enabled := false;
3156    
3157          chkForstorTilDirekte.Checked := false;
3158          chkForstorTilDirekte.Enabled := false;
3159    
3160        InitLillePakke();        InitLillePakke();
3161  end;  end;
3162    
# Line 3174  begin Line 3188  begin
3188        BtnEKLoverforsel.Enabled := false;        BtnEKLoverforsel.Enabled := false;
3189        IdFTP1.Passive := true;        IdFTP1.Passive := true;
3190        IdFTP1.PassiveUseControlHost := true;        IdFTP1.PassiveUseControlHost := true;
3191    
3192          chkForstorTilDirekte.Checked := false;
3193          chkForstorTilDirekte.Enabled := true;
3194    
3195        if (BladhusSted = 0) or (BladhusSted = 2) or (BladhusSted = 3) then        if (BladhusSted = 0) or (BladhusSted = 2) or (BladhusSted = 3) then
3196        begin        begin
3197            IndlesScanningLogFil();            IndlesScanningLogFil();
# Line 3209  begin Line 3227  begin
3227    
3228        BtnEKLoverforsel.Enabled := true;        BtnEKLoverforsel.Enabled := true;
3229    
3230          chkForstorTilDirekte.Checked := false;
3231          chkForstorTilDirekte.Enabled := true;
3232    
3233        InitLillePakke();        InitLillePakke();
3234        IndlesScanningLogFil();        IndlesScanningLogFil();
3235        if BladhusSted = 0 then        if BladhusSted = 0 then
# Line 3244  begin Line 3265  begin
3265        BtnDownloadKontrolfil.Enabled := false;        BtnDownloadKontrolfil.Enabled := false;
3266        BtnOpdaterListen.Enabled := true;        BtnOpdaterListen.Enabled := true;
3267        BtnEKLoverforsel.Enabled := false;        BtnEKLoverforsel.Enabled := false;
3268    
3269          chkForstorTilDirekte.Checked := false;
3270          chkForstorTilDirekte.Enabled := false;
3271    
3272    
3273        InitLillePakke();        InitLillePakke();
3274        IndlesScanningLogFil();        IndlesScanningLogFil();
3275        if BladhusSted = 0 then        if BladhusSted = 0 then
# Line 3291  begin Line 3317  begin
3317        BtnDownloadKontrolfil.Enabled := false;        BtnDownloadKontrolfil.Enabled := false;
3318        BtnOpdaterListen.Enabled := true;        BtnOpdaterListen.Enabled := true;
3319        BtnEKLoverforsel.Enabled := false;        BtnEKLoverforsel.Enabled := false;
3320    
3321          chkForstorTilDirekte.Checked := false;
3322          chkForstorTilDirekte.Enabled := false;
3323    
3324    
3325        InitLillePakke();        InitLillePakke();
3326        IndlesScanningLogFil();        IndlesScanningLogFil();
3327        if BladhusSted = 0 then        if BladhusSted = 0 then
# Line 4034  var Line 4065  var
4065    stregkode, modtagernavn, modtageradresse, kommentar : string;    stregkode, modtagernavn, modtageradresse, kommentar : string;
4066    pakketype, tjekkodestatus : String;    pakketype, tjekkodestatus : String;
4067    pakketypeix, antalLiniefelter, antalFelterFundet, linienr : Integer;    pakketypeix, antalLiniefelter, antalFelterFundet, linienr : Integer;
4068    pakketyper : TStrings;    //pakketyper : TStrings;
4069      pakketyper : TDictionary<String, Integer>;
4070      tmpAntal : Integer;
4071    
4072    
4073    
4074    antlin : Integer;    antlin : Integer;
4075    
4076    antlinIdag, antlinSenere : Integer;    antlinIdag, antlinSenere : Integer;
# Line 4042  var Line 4078  var
4078    XmlFelter : TStrings;    XmlFelter : TStrings;
4079    
4080   begin   begin
4081    
4082    
4083      XmlFelter := TStringList.Create;      XmlFelter := TStringList.Create;
4084      pakketyper := TStringList.Create;      pakketyper := TDictionary<String, Integer>.Create;
4085      linienr := 0;      linienr := 0;
4086      ListBox2.Clear;      ListBox2.Clear;
4087      ListBox1.Items.Insert(0,TimeToStr(now) + ': ' + 'Henter oversigt over pakker der endnu ikke er modtaget');      ListBox1.Items.Insert(0,TimeToStr(now) + ': ' + 'Henter oversigt over pakker der endnu ikke er modtaget');
# Line 4058  var Line 4096  var
4096          StedKode := Sted;          StedKode := Sted;
4097        end;        end;
4098    
4099          Application.Processmessages; //Ugly Hack to improve User Experience when switching modes
4100    
4101    
4102    
4103      if (Scanningtype = '7') then      if (Scanningtype = '7') then
# Line 4144  var Line 4184  var
4184        SetLength(stregkoderMedTjekkodeArray, 0);    // reset fra tidligere brug        SetLength(stregkoderMedTjekkodeArray, 0);    // reset fra tidligere brug
4185        SetLength(stregkoderMedTjekkodeArray, antlin);  // sæt antal elementer i array        SetLength(stregkoderMedTjekkodeArray, antlin);  // sæt antal elementer i array
4186    
4187    
4188          Application.Processmessages; //Ugly Hack to improve User Experience when switching modes
4189    
4190        logTekst := 'Der er ' + IntToStr(antlin) + ' pakker, der endnu ikke er modtaget';        logTekst := 'Der er ' + IntToStr(antlin) + ' pakker, der endnu ikke er modtaget';
4191        if (antlinSenere > 0) then        if (antlinSenere > 0) then
4192        begin        begin
# Line 4179  var Line 4222  var
4222                if not VarIsNull(Node.NodeValue) then                if not VarIsNull(Node.NodeValue) then
4223                  pakketype := Node.NodeValue;                  pakketype := Node.NodeValue;
4224                  antalFelterFundet := antalFelterFundet + 1;                  antalFelterFundet := antalFelterFundet + 1;
4225                if (pakketyper.values[pakketype] <> '') then                if ( pakketyper.ContainsKey(pakketype) ) then
4226                  pakketyper.values[pakketype] := IntToStr(StrToInt(pakketyper.values[pakketype]) + 1)                begin
4227                    pakketyper.TryGetValue(pakketype, tmpAntal);
4228                    pakketyper.AddOrSetValue(pakketype, tmpAntal + 1);
4229                  end
4230                else                else
4231                  pakketyper.values[pakketype] := '1';                  pakketyper.Add(pakketype, 1);
4232              end;              end;
4233              if Node.NodeName = 'TjekkodeStatus' then begin              if Node.NodeName = 'TjekkodeStatus' then begin
4234                if not VarIsNull(Node.NodeValue) then                if not VarIsNull(Node.NodeValue) then
# Line 4217  var Line 4263  var
4263              end;              end;
4264            end;            end;
4265        end;        end;
       for pakketypeix := 0 to pakketyper.Count-1 do  
         begin  
           ListBox1.Items.Insert(0,TimeToStr(now) + ': ' + ' '+pakketyper[pakketypeix]+' pakke(r) ikke modtaget');  
         end;  
4266    
4267          // Free up the list object  
4268          for pakketype in pakketyper.Keys do
4269          begin
4270            pakketyper.TryGetValue(pakketype, tmpAntal);
4271            ListBox1.Items.Insert(0,TimeToStr(now) + ': ' + pakketype + ' ' + IntToStr(tmpAntal) + ' pakke(r) ikke modtaget');
4272          end;
4273    
4274            // Free up the dictionary object
4275        pakketyper.Free;        pakketyper.Free;
4276    
4277    
4278    
4279  //      ListBox1.Items.Insert(0,TimeToStr(now) + ': ' + 'Der er '+IntToStr(antlin)+' pakker, der endnu ikke er modtaget.');  //      ListBox1.Items.Insert(0,TimeToStr(now) + ': ' + 'Der er '+IntToStr(antlin)+' pakker, der endnu ikke er modtaget.');
4280        logTekst := 'Der er ' + IntToStr(antlin) + ' pakker, der endnu ikke er modtaget';        logTekst := 'Der er ' + IntToStr(antlin) + ' pakker, der endnu ikke er modtaget';
4281        if (antlinSenere > 0) then        if (antlinSenere > 0) then

Legend:
Removed from v.2790  
changed lines
  Added in v.2791

  ViewVC Help
Powered by ViewVC 1.1.20