Edi export fix

- Added 'req stx/srx' checkbox. Not all ocntests require serial number
	  (For example NAC contest).
	- Added 'open exported file' button that appears after export is done
	- Fixed result count of rejected qsos. Progress bar MAX can not be used
	  as store of qso count.
	- Fixed help files

Squashed commit of the following:

commit 01276e0d096b8c36b9ba57edbc85c9a6726c3ff5
Author: OH1KH <oh1kh@sral.fi>
Date:   Sun Feb 13 10:34:01 2022 +0200

    Help fix

commit 3e556dbdca1bd88a9259f375cf0f1dfe050d6987
Author: OH1KH <oh1kh@sral.fi>
Date:   Fri Feb 11 15:14:00 2022 +0200

    Added 'req stx/srx' checkbox. Fixed result count. Added 'open exported file' button to chec adi export file
This commit is contained in:
OH1KH 2022-02-14 12:33:48 +02:00
parent e2f399ca5c
commit 9243a96644
7 changed files with 244 additions and 101 deletions

View File

@ -113,7 +113,13 @@
<br><br>
<img src=img/h45f.png><br><br>
You can set the filename to export to as well as some meta data describing the equipment you
used for this contest.
used for this contest.</p>
<p><img src=img/h45ff.png>
<br><br>After export is done you can see the summary of exported qsos. Also <b>Open exported file</b> button appears.
<br>If you have set <b>preferences/External viewers/text files</b> exported file will be opened when button is pressed.
<br><br><img src=img/h45fff.png>
<br><br>If your contest did not use serial numbers you can uncheck <b>Export requires serial nr</b> that may clear out export error qsos.
</p>
<p align=center><img src=img/line.png></p>
<p><a name=ah28><strong>Cabrillo export</strong></a><br><br>
This dialog can be used to export contest logs in Carbillo format. Cabrillo is very compilcated to export as

BIN
help/img/h45ff.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
help/img/h45fff.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -819,7 +819,7 @@ object frmCabrilloExport: TfrmCabrilloExport
Width = 156
Anchors = [akRight, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Open resulted file'
Caption = 'Open exported file'
OnClick = btnResultFileClick
TabOrder = 17
end

View File

@ -1,253 +1,363 @@
object frmEDIExport: TfrmEDIExport
Left = 819
Height = 414
Left = 760
Height = 457
Top = 254
Width = 516
Caption = 'Export for contests'
ClientHeight = 414
ClientHeight = 457
ClientWidth = 516
OnClose = FormClose
OnShow = FormShow
LCLVersion = '1.8.2.0'
object Label1: TLabel
Left = 8
LCLVersion = '2.0.12.0'
object lblFilename: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 6
Height = 17
Top = 8
Width = 66
Top = 7
Width = 63
BorderSpacing.Left = 6
BorderSpacing.Top = 7
Caption = 'Filename:'
ParentColor = False
end
object edtFileName: TEdit
Left = 8
Height = 25
Top = 32
AnchorSideLeft.Control = lblFilename
AnchorSideTop.Control = lblFilename
AnchorSideTop.Side = asrBottom
Left = 6
Height = 34
Top = 27
Width = 421
BorderSpacing.Top = 3
TabOrder = 0
end
object Button1: TButton
Left = 433
object btnBrowse: TButton
AnchorSideLeft.Control = edtFileName
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtFileName
AnchorSideTop.Side = asrCenter
Left = 430
Height = 25
Top = 34
Top = 32
Width = 75
BorderSpacing.Left = 3
Caption = 'Browse'
OnClick = Button1Click
OnClick = btnBrowseClick
TabOrder = 1
end
object btnClose: TButton
Left = 434
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 435
Height = 25
Top = 368
Top = 420
Width = 75
Anchors = [akRight, akBottom]
BorderSpacing.Right = 6
BorderSpacing.Bottom = 12
Cancel = True
Caption = 'Close'
ModalResult = 2
TabOrder = 10
end
object btnExport: TButton
AnchorSideTop.Control = btnClose
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = btnClose
Left = 345
Height = 25
Top = 368
Width = 75
Top = 420
Width = 79
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Right = 11
Caption = 'Export'
OnClick = btnExportClick
TabOrder = 9
end
object pbExport: TProgressBar
Left = 8
AnchorSideLeft.Control = lblFilename
AnchorSideTop.Control = btnClose
AnchorSideTop.Side = asrCenter
Left = 6
Height = 20
Top = 370
Top = 422
Width = 264
Step = 1
TabOrder = 11
end
object lblDone: TLabel
Left = 289
AnchorSideLeft.Control = pbExport
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnClose
AnchorSideTop.Side = asrCenter
Left = 282
Height = 17
Top = 372
Width = 37
Top = 424
Width = 34
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 12
Caption = 'Done'
ParentColor = False
Visible = False
end
object lblContestName: TLabel
Left = 8
AnchorSideLeft.Control = lblFilename
AnchorSideTop.Control = edtContestName
AnchorSideTop.Side = asrCenter
Left = 6
Height = 17
Top = 72
Width = 99
Top = 74
Width = 95
Caption = 'Contest name:'
ParentColor = False
end
object lblTxEquipment: TLabel
Left = 8
AnchorSideLeft.Control = lblFilename
AnchorSideTop.Control = edtTxEquipment
AnchorSideTop.Side = asrCenter
Left = 6
Height = 17
Top = 104
Width = 100
Top = 111
Width = 95
Caption = 'TX Equipment:'
ParentColor = False
end
object edtContestName: TEdit
AnchorSideLeft.Control = lblContestName
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = lblContestName
AnchorSideTop.Side = asrCenter
Left = 122
Height = 25
Top = 68
AnchorSideTop.Control = edtFileName
AnchorSideTop.Side = asrBottom
Left = 116
Height = 34
Top = 65
Width = 307
BorderSpacing.Left = 15
BorderSpacing.Top = 4
TabOrder = 2
end
object edtTxEquipment: TEdit
AnchorSideLeft.Control = lblContestName
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtContestName
AnchorSideTop.Side = asrBottom
Left = 122
Height = 25
Top = 100
Left = 116
Height = 34
Top = 102
Width = 307
BorderSpacing.Left = 15
BorderSpacing.Top = 3
TabOrder = 3
end
object lblRxEquipment: TLabel
Left = 8
AnchorSideLeft.Control = lblFilename
AnchorSideTop.Control = edtRxEquipment
AnchorSideTop.Side = asrCenter
Left = 6
Height = 17
Top = 168
Width = 101
Top = 185
Width = 96
Caption = 'RX Equipment:'
ParentColor = False
end
object edtRxEquipment: TEdit
AnchorSideLeft.Control = lblContestName
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtTxPower
AnchorSideTop.Side = asrBottom
Left = 122
Height = 25
Top = 164
Left = 116
Height = 34
Top = 176
Width = 307
BorderSpacing.Left = 15
BorderSpacing.Top = 3
TabOrder = 5
end
object lblAntenna: TLabel
Left = 8
AnchorSideLeft.Control = lblFilename
AnchorSideTop.Control = edtAntenna
Left = 6
Height = 17
Top = 200
Width = 62
Top = 213
Width = 58
Caption = 'Antenna:'
ParentColor = False
end
object edtAntenna: TEdit
AnchorSideLeft.Control = lblContestName
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtRxEquipment
AnchorSideTop.Side = asrBottom
Left = 122
Height = 25
Top = 196
Left = 116
Height = 34
Top = 213
Width = 307
BorderSpacing.Left = 15
TabOrder = 6
BorderSpacing.Top = 3
TabOrder = 12
end
object lblAntennaHeight: TLabel
Left = 8
AnchorSideLeft.Control = lblFilename
AnchorSideTop.Control = edtAntennaHeightGroundLevel
AnchorSideTop.Side = asrCenter
Left = 6
Height = 17
Top = 232
Width = 137
Top = 259
Width = 132
Caption = 'Antenna Height (m):'
ParentColor = False
end
object edtAntennaHeightGroundLevel: TEdit
AnchorSideLeft.Control = lblContestName
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtAntenna
AnchorSideTop.Side = asrBottom
Left = 152
Height = 25
Top = 228
Height = 34
Top = 250
Width = 48
Anchors = [akTop]
BorderSpacing.Left = 15
BorderSpacing.Top = 3
NumbersOnly = True
TabOrder = 7
end
object lblAntennaHeightSeaLevel: TLabel
Left = 208
AnchorSideLeft.Control = edtAntennaHeightGroundLevel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtAntennaHeightGroundLevel
AnchorSideTop.Side = asrCenter
Left = 213
Height = 17
Top = 232
Width = 94
Top = 259
Width = 89
BorderSpacing.Left = 13
Caption = 'above ground'
ParentColor = False
end
object edtAntennaHeightSeaLevel: TEdit
AnchorSideLeft.Control = lblContestName
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtAntennaHeightGroundLevel
AnchorSideTop.Side = asrBottom
Left = 152
Height = 25
Top = 260
Height = 34
Top = 287
Width = 48
Anchors = [akTop]
BorderSpacing.Left = 15
BorderSpacing.Top = 3
NumbersOnly = True
TabOrder = 8
end
object lblAntennaHeightGroundLevel: TLabel
AnchorSideTop.Control = edtAntennaHeightSeaLevel
AnchorSideTop.Side = asrCenter
Left = 208
Height = 17
Top = 264
Width = 104
Top = 296
Width = 103
Caption = 'above sea level'
ParentColor = False
end
object lblTxPower: TLabel
Left = 7
AnchorSideLeft.Control = lblFilename
AnchorSideTop.Control = edtTxPower
AnchorSideTop.Side = asrCenter
Left = 6
Height = 17
Top = 136
Width = 96
Top = 148
Width = 92
Caption = 'TX Power (W):'
ParentColor = False
end
object edtTxPower: TEdit
AnchorSideLeft.Control = lblContestName
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtTxEquipment
AnchorSideTop.Side = asrBottom
Left = 122
Height = 25
Top = 132
Left = 116
Height = 34
Top = 139
Width = 78
BorderSpacing.Left = 15
BorderSpacing.Top = 3
NumbersOnly = True
TabOrder = 4
end
object lblDigitalModes: TLabel
Left = 8
AnchorSideLeft.Control = lblFilename
AnchorSideTop.Control = edtDigitalModes
AnchorSideTop.Side = asrCenter
Left = 6
Height = 17
Top = 296
Width = 137
Top = 333
Width = 94
Caption = 'Digital Modes:'
ParentColor = False
end
object edtDigitalModes: TEdit
AnchorSideLeft.Control = lblContestName
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtAntennaHeightSeaLevel
AnchorSideTop.Side = asrBottom
Left = 122
Height = 25
Top = 292
Left = 116
Height = 34
Top = 324
Width = 307
BorderSpacing.Left = 15
BorderSpacing.Top = 3
TabOrder = 6
end
object lblError: TLabel
Left = 8
AnchorSideLeft.Control = lblFilename
AnchorSideTop.Control = chcSerialNr
AnchorSideTop.Side = asrBottom
Left = 6
Height = 17
Top = 344
Width = 98
Top = 387
Width = 94
BorderSpacing.Top = 6
Caption = 'Error message'
ParentColor = False
Visible = False
end
object btnResultFile: TButton
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = btnClose
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = btnClose
Left = 347
Height = 25
Top = 389
Width = 163
Anchors = [akRight, akBottom]
BorderSpacing.Bottom = 6
Caption = 'Open exported file'
OnClick = btnResultFileClick
TabOrder = 13
Visible = False
end
object chcSerialNr: TCheckBox
AnchorSideLeft.Control = edtDigitalModes
AnchorSideTop.Control = edtDigitalModes
AnchorSideTop.Side = asrBottom
Left = 116
Height = 23
Top = 358
Width = 240
Caption = 'Export requires serial nr (stx/srx)'
Checked = True
State = cbChecked
TabOrder = 14
end
object dlgSave: TSaveDialog
DefaultExt = '.edi'
Filter = 'EDI file|*.edi'
left = 477
top = 236
Left = 477
Top = 236
end
end

View File

@ -15,7 +15,9 @@ type
TfrmEDIExport = class(TForm)
btnClose: TButton;
btnExport: TButton;
Button1: TButton;
btnBrowse: TButton;
btnResultFile: TButton;
chcSerialNr: TCheckBox;
dlgSave: TSaveDialog;
edtAntennaHeightSeaLevel: TEdit;
edtContestName: TEdit;
@ -26,7 +28,7 @@ type
edtAntennaHeightGroundLevel: TEdit;
edtTxPower: TEdit;
edtDigitalModes: TEdit;
Label1: TLabel;
lblFilename: TLabel;
lblError: TLabel;
lblAntennaHeight: TLabel;
lblAntennaHeightSeaLevel: TLabel;
@ -40,9 +42,11 @@ type
lblDigitalModes: TLabel;
pbExport: TProgressBar;
procedure btnExportClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure btnBrowseClick(Sender: TObject);
procedure btnResultFileClick(Sender: TObject);
procedure FormClose(Sender : TObject; var CloseAction : TCloseAction);
procedure FormShow(Sender : TObject);
private
procedure SaveSettings;
@ -64,6 +68,7 @@ uses dData,dUtils,dDXCC,fWorkedGrids, uMyIni;
procedure TfrmEDIExport.FormShow(Sender : TObject);
begin
btnResultFile.Visible:=false;
dmUtils.LoadWindowPos(self);
lblError.Visible := False;
edtFileName.Text := cqrini.ReadString('EdiExport','FileName','');
@ -82,6 +87,7 @@ begin
end;
procedure TfrmEDIExport.SaveSettings;
begin
cqrini.WriteString('EdiExport','FileName',edtFileName.Text);
@ -138,12 +144,26 @@ begin
dmUtils.SaveWindowPos(self)
end;
procedure TfrmEDIExport.Button1Click(Sender : TObject);
procedure TfrmEDIExport.btnBrowseClick(Sender : TObject);
begin
if dlgSave.Execute then
edtFileName.Text := dlgSave.FileName
end;
procedure TfrmEDIExport.btnResultFileClick(Sender: TObject);
var
prg: string;
begin
try
prg := cqrini.ReadString('ExtView', 'txt', '');
if prg<>'' then
dmUtils.RunOnBackground(prg + ' ' + edtFileName.Text)
else ShowMessage('No external text viewer defined!'+#10+'See: prefrences/External viewers');
finally
//done
end;
end;
procedure TfrmEDIExport.btnExportClick(Sender: TObject);
var
AllQSO : Boolean=False;
@ -159,6 +179,7 @@ var
qrb, qrc : String;
odx : Integer = 0;
odx_call, odx_wwl : String;
QsoMax : Integer = 0;
i : Integer = 0;
j : Integer = 0;
startdate, enddate: String;
@ -249,6 +270,7 @@ begin
pbExport.Max := dmData.Q.RecordCount;
while not dmData.Q.Eof do
begin
inc(QsoMax);
// Check for missing mandatory fields
if (dmData.Q.FieldByName('rst_s').AsString = '') then
begin
@ -262,17 +284,20 @@ begin
dmData.Q.Next;
Continue;
end;
if (dmData.Q.FieldByName('stx').AsString = '') then
begin
pbExport.StepIt;
dmData.Q.Next;
Continue;
end;
if (dmData.Q.FieldByName('srx').AsString = '') then
begin
pbExport.StepIt;
dmData.Q.Next;
Continue;
if chcSerialNr.Checked then
begin;
if (dmData.Q.FieldByName('stx').AsString = '') then
begin
pbExport.StepIt;
dmData.Q.Next;
Continue;
end;
if (dmData.Q.FieldByName('srx').AsString = '') then
begin
pbExport.StepIt;
dmData.Q.Next;
Continue;
end;
end;
loc := UpperCase(dmData.Q.FieldByName('srx_string').AsString);
if (loc = '') then //or not frmWorkedGrids.GridOK(loc) then
@ -418,17 +443,19 @@ begin
mb_OK+mb_IconError)
end
end;
if ((pbExport.Max - i) > 0) then
if ((QsoMax - i) > 0) then
begin
lblError.Caption := IntToStr(pbExport.Max - i)+' of '+IntToStr(pbExport.Max)+' entries were ignored! Please check log entries.';
lblError.Caption := IntToStr(QsoMax - i)+' of '+IntToStr(QsoMax)+' entries were ignored! Please check log entries.';
lblError.Font.Color := clRed;
lblError.Visible := True;
end
else
begin
lblError.Caption := IntToStr(pbExport.Max)+' entries were exported.';
lblError.Caption := IntToStr(QsoMax)+' entries were exported.';
lblError.Font.Color := clGreen;
lblError.Visible := True;
end;
btnResultFile.Visible:=True;
end;
end.

View File

@ -19,7 +19,7 @@ const
cBUILD = 1;
cBUILD_DATE = '2022-01-27';
cBUILD_DATE = '2022-02-14';
implementation