Addition for grayline to show LongPath

- Grayline map can now show great circle short- and Long path for qso.
	  User can select Short Path or long Path or both together.
	- Plotting steps can be fixed via Preferences/Program. How ever default
	  values seems to work for most of cases. But as there are 10^N different
	  plotting cases user can now play with steps.
	- Help files are fixed

Squashed commit of the following:

commit bd7ff20bec3ab90075dbe8932b37a6995dbf6e4a
Author: OH1KH <oh1kh@sral.fi>
Date:   Mon Feb 21 18:22:07 2022 +0200

    fixed prefernces help

commit 98793175b21fef6842796f68c39f556e82dbc7c2
Author: OH1KH <oh1kh@sral.fi>
Date:   Mon Feb 21 18:11:14 2022 +0200

    Fixed preferences

commit 04ef090f26a94a1fd3c482f04ecaefb905f1c024
Author: OH1KH <oh1kh@sral.fi>
Date:   Mon Feb 21 18:03:26 2022 +0200

    adjustable plot stepping

commit 65503ee718dec80cf75228b82d64ab0d50c157eb
Author: OH1KH <oh1kh@sral.fi>
Date:   Sun Feb 20 14:06:04 2022 +0200

    fixed help

commit c3ada778b769d5d6b7e5d81ddbbdc25a9b456622
Author: OH1KH <oh1kh@sral.fi>
Date:   Sat Feb 19 15:32:18 2022 +0200

    small fixes

commit bf7c2dbf42f24a24102f723e5e2cb4219a07add3
Author: OH1KH <oh1kh@sral.fi>
Date:   Sat Feb 19 15:21:15 2022 +0200

    Works now. TODO check code clean, fix help, test

commit be33d8fc81c7f2cfaae04ec1ad2dab3ce91822ff
Author: OH1KH <oh1kh@sral.fi>
Date:   Sat Feb 19 12:33:28 2022 +0200

    SP or LP plotting works and can be selected. TODO show both SP&LP together

commit dcd59150546daed974390f205980bc075c62adff
Author: OH1KH <oh1kh@sral.fi>
Date:   Sat Feb 19 09:38:52 2022 +0200

    Now can plot also LongPath
This commit is contained in:
OH1KH 2022-02-21 18:28:48 +02:00
parent 0e9dcdf767
commit 76c414e2f0
11 changed files with 554 additions and 207 deletions

View File

@ -101,6 +101,9 @@
<strong>Grayline offset</strong> - sometimes the gray line position is not accurate.
You can set your own correction.
<br><br>
<strong>Great circle </strong> Short and Long path line plotting may be adjusted here. Plotting step is decimal degrees &gt; 0.0 and &lt; 40.0. In polar areas where distance/degree is smaller this value is divided by integer divisor value &gt; 0 and &lt; 40.
<br>You may test different values if you like. If Columns are left empty the default values 1.5 and 10 are replaced.
<br><br>
<strong>Check for newer version of DXCC tables after program startup</strong></a> - if checked,
CQRLOG will check if any update of the country files is available. If a new version is found,
an update will be performed, however you are asked first if you want this update.<br><br>

View File

@ -37,17 +37,16 @@
<li> <b>Connect to RBN</b> If autoconnect is not seleceted, see: <a href="h1.html#ch6">RBN support</a>, the connect and disconnect to RBN can be done here.</li>
<li> <b>Link to RBNMonitor</b> This is alternative to RBN connection and will use same connection as RBN monitor window has (if connected).</li>
<li> <b>Show statusbar</b> Shows connection or linking state</li>
<li> <b>Show GreatCirclePath</b> By default Grayline map will show straight line from your station (from your locator defined) to station you enter to NewQSO/callsign.
With this selection you can switch the straight line to plotted great circle path. </li>
<li> <b>Show ShortPath</b> By default Grayline map will show straight line from your station (from your locator defined) to station you enter to NewQSO/callsign.
With this selection you can switch the straight line to plotted great circle short path. </li>
<li> <b>Show LongPath</b> As another option you can select great circle longpath. This can be selected with, or without short path.
<li> <b>Clear all spots</b> Clears all RBN spots from map.
<br><b> Note:</b> Dots also depend on the band, if you change band, dots will always be deleted. All data is band related.</li>
<li> <b>Watch for</b> Opens an edit window where you can change callsign or prefix watched without opening preferences. see: <a href="h1.html#ch6">RBN support</a></li>
</ul>
<img src="img/h1114b.png"><br><br>
<img src="img/h1114c.png"><br><br>
<img src="img/h1114d.png"><br><br>
<img src="img/h1114b.png"><br><br>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 453 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -196,9 +196,13 @@ object frmGrayline: TfrmGrayline
object pumShowStatusbar: TMenuItem
Action = acShowStatusBar
end
object pumShowGreatCircle: TMenuItem
Caption = 'Show GreatCirclePath'
OnClick = pumShowGreatCircleClick
object pumShowShortPath: TMenuItem
Caption = 'Show ShortPath'
OnClick = pumShowShortPathClick
end
object pumShowLongPath: TMenuItem
Caption = 'Show LongPath'
OnClick = pumShowLongPathClick
end
object pumMnuLine2: TMenuItem
Caption = '-'

View File

@ -32,7 +32,8 @@ type
acConnect : TAction;
acShowStatusBar : TAction;
acLinkToRbnMonitor: TAction;
pumShowGreatCircle: TMenuItem;
pumShowLongPath: TMenuItem;
pumShowShortPath: TMenuItem;
pumMnuLine2: TMenuItem;
pumClearAllSpots: TMenuItem;
pumWatchFor: TMenuItem;
@ -59,7 +60,8 @@ type
procedure FormShow(Sender: TObject);
procedure popGrayLinePopup(Sender: TObject);
procedure pumClearAllSpotsClick(Sender: TObject);
procedure pumShowGreatCircleClick(Sender: TObject);
procedure pumShowLongPathClick(Sender: TObject);
procedure pumShowShortPathClick(Sender: TObject);
procedure pumWatchForClick(Sender: TObject);
procedure sbtnGrayLineClick(Sender : TObject);
procedure tmrAutoConnectTimer(Sender : TObject);
@ -78,7 +80,7 @@ type
procedure lReceive(aSocket: TLSocket);
function ConnectToRBN : Boolean;
procedure CalculateBearing(lat0, long0, lat1, long1: extended; var bearing: extended);
public
RBNSpotList : array[1..MAX_ITEMS] of TRBNList;
band : String;
@ -87,7 +89,7 @@ type
pfx : String;
rbn_status : String;
procedure kresli;
procedure PlotGreatCircleArcLine(longitude1,latitude1,longitude2,latitude2:extended);
procedure PlotGreatCircleArcLine(longitude1,latitude1,longitude2,latitude2:extended; LongP:boolean);
procedure SavePosition;
procedure SynRBN;
function GetEmptyPos : Word;
@ -306,7 +308,8 @@ procedure TfrmGrayline.FormShow(Sender: TObject);
begin
dmUtils.LoadWindowPos(frmGrayline);
sbGrayLine.Visible := cqrini.ReadBool('Grayline','Statusbar',True);
pumShowGreatCircle.Checked:= cqrini.ReadBool('Grayline','GreatCircle',False);
pumShowShortPath.Checked := cqrini.ReadBool('Grayline','ShortPath',False);
pumShowLongPath.Checked := cqrini.ReadBool('Grayline','LongPath',False);
acShowStatusBar.Checked := sbGrayLine.Visible;
rbn_status :='Disconnected';
sbGrayLine.SimpleText := rbn_status;
@ -390,10 +393,16 @@ begin
tmrSpotDots.Enabled:=true;
end;
procedure TfrmGrayline.pumShowGreatCircleClick(Sender: TObject);
procedure TfrmGrayline.pumShowLongPathClick(Sender: TObject);
begin
pumShowGreatCircle.Checked:= not pumShowGreatCircle.Checked;
cqrini.WriteBool('Grayline','GreatCircle',pumShowGreatCircle.Checked);
pumShowLongPath.Checked:= not pumShowLongPath.Checked;
cqrini.WriteBool('Grayline','LongPath',pumShowLongPath.Checked);
end;
procedure TfrmGrayline.pumShowShortPathClick(Sender: TObject);
begin
pumShowShortPath.Checked:= not pumShowShortPath.Checked;
cqrini.WriteBool('Grayline','ShortPath',pumShowShortPath.Checked);
end;
procedure TfrmGrayline.pumWatchForClick(Sender: TObject);
@ -497,70 +506,73 @@ begin
s := '';
d := '';
dmUtils.CoordinateFromLocator(dmUtils.CompleteLoc(my_loc),lat,long);
if pumShowGreatCircle.Checked then
PlotGreatCircleArcLine(long,lat,long1,lat1)
if pumShowShortPath.Checked or pumShowLongPath.Checked then
Begin
if pumShowShortPath.Checked then
PlotGreatCircleArcLine(long,lat,long1,lat1,false);
if pumShowLongPath.Checked then
PlotGreatCircleArcLine(long,lat,long1,lat1,true);
end
else
ob^.jachcucaru(true,long,lat*-1,long1,lat1*-1);
Refresh
end;
procedure TfrmGrayline.PlotGreatCircleArcLine(longitude1,latitude1,longitude2,latitude2:extended);
{ Ref: http://www.movable-type.co.uk/scripts/latlong.html }
Const
Basestep = 0.0174532925; //1 degree in radians
PolarStep = 0.00174532925; // base/10
procedure TfrmGrayline.CalculateBearing(lat0, long0, lat1, long1: extended; var bearing: extended);
var
lat1,lat2,lon1,lon2,
latFrom,lonFrom,
step,
dist,
bearing : extended;
CountLimit : integer;
BearingIsPositive : boolean;
//-------------------------------------------------------------------
procedure LatLongToDistance(const lat0, long0, lat1, long1: extended;
var dist, bearing: extended);
var
R: double = 6371000; // earth radius in meters
dlat, dlong, slat, slong, a, c, x, y: double;
x, y: extended;
begin
// dist
dlat := lat1 - lat0;
dlong := long1 - long0;
slat := Sin(0.5 * dlat);
slong := Sin(0.5 * dlong);
a := slat * slat + Cos(lat0) * Cos(lat1) * slong * slong;
c := 2.0 * ArcTan2(Sqrt(a), Sqrt(1.0-a));
dist := R * c;
// bearing
y := Sin(long1 - long0) * Cos(lat1);
x := Cos(lat0) * Sin(lat1) - Sin(lat0) * Cos(lat1) * Cos(long1 - long0);
bearing := ArcTan2(y, x);
end;
//-------------------------------------------------------------------
procedure TfrmGrayline.PlotGreatCircleArcLine(longitude1,latitude1,longitude2,latitude2:extended; LongP:boolean);
{ Ref: http://www.movable-type.co.uk/scripts/latlong.html }
Const
MEC = 170 *pi/180; // Map image horizontal Edge Crossing "no print" limit in degrees (converted to radians)
var
lat1,lat2,lon1,lon2,
latFrom,lonFrom,
BaseStep,step, // degree steps (converted to radians) for path line
PolarStep, // steps in polar regions where distances/degrees are smaller
bearing, oldbearing : extended;
CountLimit,
LP : integer; //LongPath instead of ShortPath
Begin
BaseStep := cqrini.ReadFloat('Program', 'GraylineGCstep',15E-001) * pi/180;
PolarStep := Basestep/cqrini.ReadInteger('Program', 'GraylineGCstep',10);
ob^.GC_line_clear;
if LocalDbg then
begin
writeln ('-------------------------------------------------------------------');
writeln ('Start:',round(latitude1),' ',round(longitude1),' ',round(latitude2),' ',round(longitude2));
end;
step := BaseStep;
dist :=0;
bearing :=0;
step := BaseStep;
if LongP then
LP:=1
else
LP:=0;
ob^.GC_line_clear(LP);
longitude1 := degToRad(longitude1);
latitude1 := degToRad(latitude1);
longitude2 := degToRad(longitude2);
latitude2 := degToRad(latitude2);
LatLongToDistance(latitude1, longitude1, latitude2, longitude2, dist, bearing);
BearingIsPositive := (bearing > 0);
CalculateBearing(latitude1, longitude1, latitude2, longitude2, bearing);
bearing:=bearing+LP*pi;
oldbearing:=bearing;
CountLimit:=ob^.GC_Points_Max;
if LocalDbg then
writeln ('Bearing:',round(radTodeg(bearing)));
while (CountLimit > 0) do
Begin
latFrom:=latitude1;
@ -572,14 +584,40 @@ while (CountLimit > 0) do
else
step:=BaseStep;
LatLongToDistance(latFrom, lonFrom, latitude2, longitude2, dist, bearing);
if ((bearing > 0) <> BearingIsPositive) then CountLimit:=0;;
if LocalDbg then
writeln ('Dist:',round(dist * 0.001) ,' Bearing:',round(radTodeg(bearing)));
writeln (LineEnding,'FROM (',Round(RadToDeg(latFrom)),' ',Round(RadToDeg(lonFrom)),')',' To: ',Round(RadToDeg(latitude2)),' ',Round(RadToDeg(longitude2)));
CalculateBearing(latFrom, lonFrom, latitude2, longitude2,bearing);
bearing:=bearing+LP*pi; //makes LongPath if LP=1 counting plot points in "wrong direction"
if abs(oldbearing -bearing) > (pi/2) then
Begin
if LocalDbg then
Begin
writeln('Obe:',round(radtodeg(oldbearing)));
writeln('Nbe:',round(radtodeg(bearing)));
end;
if LP = 1 then
begin
if LocalDbg then
writeln ('Release LP value in count round ',CountLimit);
LP:=0; //we are on globe's opposite side of target. Release LP and now on calculate rest via ShortPath
CalculateBearing(latFrom, lonFrom, latitude2, longitude2, bearing);
end
else
begin
if LocalDbg then
writeln ('Stop counting in round ',CountLimit);
CountLimit:=0;
end;
end;
if LocalDbg then
writeln ('Bearing:',round(radTodeg(bearing)));
longitude1 := longitude1 + (sin(bearing) * step) / cos(latitude1);
latitude1 := latitude1 + (cos(bearing) * step);
//swap on horizontal or veritcal edges
if longitude1 < -Pi then longitude1 := 2*Pi+longitude1;
if longitude1 > Pi then longitude1 := -2*Pi+longitude1;
@ -587,13 +625,20 @@ while (CountLimit > 0) do
if latitude1 < -Pi/2 then latitude1:= -Pi/2 - (latitude1+Pi/2);
if LocalDbg then
writeln ('To: ',Round(RadToDeg(latitude1)),' ',Round(RadToDeg(longitude1)),' (',Round(RadToDeg(latFrom)),' ',Round(RadToDeg(lonFrom)),')');
writeln ('From (',Round(RadToDeg(latFrom)),' ',Round(RadToDeg(lonFrom)),')',' To: ',Round(RadToDeg(latitude1)),' ',Round(RadToDeg(longitude1)));
// 170 degrees = 2,96705972839 rad
if not (((lonFrom > 2.96705972839) and (longitude1 < -2.96705972839)) //right crossing
or ((lonFrom < -2.96705972839) and (longitude1 > 2.96705972839)) //left crossing
//map image horizontal edge crossing check. Allow plot if we are not in edge of image.
if not (((lonFrom > MEC) and (longitude1 < -MEC)) //right crossing
or ((lonFrom < -MEC) and (longitude1 > MEC)) //left crossing
) then
ob^.GC_line_part(RadToDeg(lonFrom),RadToDeg(latFrom)*-1,RadToDeg(longitude1),RadToDeg(latitude1)*-1);
begin
if not LongP then
ob^.GC_line_part(RadToDeg(lonFrom),RadToDeg(latFrom)*-1,RadToDeg(longitude1),RadToDeg(latitude1)*-1)
else
ob^.GC_Lline_part(RadToDeg(lonFrom),RadToDeg(latFrom)*-1,RadToDeg(longitude1),RadToDeg(latitude1)*-1)
end;
oldbearing:=bearing;
end;
end;

View File

@ -25,97 +25,144 @@ object frmPreferences: TfrmPreferences
Width = 697
ActivePage = tabProgram
Align = alClient
TabIndex = 4
TabIndex = 0
TabOrder = 0
OnChange = pgPreferencesChange
object tabProgram: TTabSheet
Caption = 'Program'
ClientHeight = 672
ClientWidth = 687
object Label60: TLabel
Left = 364
ClientHeight = 650
ClientWidth = 700
object lblWebBrowser: TLabel
AnchorSideLeft.Control = gbInternet
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = rgStatistics
AnchorSideTop.Side = asrBottom
Left = 350
Height = 17
Top = 91
Width = 248
Top = 78
Width = 249
BorderSpacing.Left = 3
BorderSpacing.Top = 3
Caption = 'Web browser for cqrlog (if not default)'
ParentColor = False
end
object GroupBox2: TGroupBox
Left = 14
Height = 137
object gbInternet: TGroupBox
AnchorSideLeft.Control = tabProgram
AnchorSideTop.Control = tabProgram
Left = 6
Height = 129
Top = 3
Width = 341
BorderSpacing.Left = 6
BorderSpacing.Top = 3
Caption = ' Internet connection '
ClientHeight = 111
ClientWidth = 335
ClientWidth = 339
TabOrder = 0
object Label12: TLabel
object lblintProxy: TLabel
AnchorSideTop.Control = edtProxy
AnchorSideTop.Side = asrCenter
Left = 7
Height = 17
Top = 24
Width = 43
Width = 40
Caption = 'Proxy:'
ParentColor = False
end
object Label13: TLabel
Left = 192
object lblIntPort: TLabel
AnchorSideLeft.Control = lblIntPasswd
AnchorSideTop.Control = edtPort
AnchorSideTop.Side = asrCenter
Left = 173
Height = 17
Top = 24
Width = 34
Width = 30
Caption = 'Port:'
ParentColor = False
end
object Label14: TLabel
object lblIntUser: TLabel
AnchorSideLeft.Control = lblintProxy
AnchorSideTop.Control = edtUser
AnchorSideTop.Side = asrCenter
Left = 7
Height = 17
Top = 69
Width = 35
Top = 67
Width = 34
Caption = 'User:'
ParentColor = False
end
object Label19: TLabel
Left = 160
object lblIntPasswd: TLabel
AnchorSideTop.Control = edtPasswd
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edtPasswd
Left = 173
Height = 17
Top = 69
Width = 69
Top = 67
Width = 66
Anchors = [akTop, akRight]
BorderSpacing.Right = 6
Caption = 'Password:'
ParentColor = False
end
object edtProxy: TEdit
Left = 52
Height = 25
Top = 20
AnchorSideLeft.Control = lblintProxy
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = gbInternet
Left = 53
Height = 34
Top = 15
Width = 100
BorderSpacing.Left = 6
BorderSpacing.Top = 15
TabOrder = 0
end
object edtPort: TEdit
Left = 240
Height = 25
Top = 20
AnchorSideTop.Control = edtProxy
AnchorSideRight.Control = gbInternet
AnchorSideRight.Side = asrBottom
Left = 245
Height = 34
Top = 15
Width = 88
Anchors = [akTop, akRight]
BorderSpacing.Right = 6
TabOrder = 1
end
object edtUser: TEdit
Left = 52
Height = 25
Top = 64
AnchorSideLeft.Control = edtProxy
AnchorSideTop.Control = edtProxy
AnchorSideTop.Side = asrBottom
Left = 53
Height = 34
Top = 58
Width = 100
BorderSpacing.Top = 9
TabOrder = 2
end
object edtPasswd: TEdit
Left = 240
Height = 25
Top = 64
AnchorSideTop.Control = edtPort
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = edtPort
AnchorSideRight.Side = asrBottom
Left = 245
Height = 34
Top = 58
Width = 88
Anchors = [akTop, akRight]
BorderSpacing.Top = 9
TabOrder = 3
end
end
object rgStatistics: TRadioGroup
Left = 359
AnchorSideLeft.Control = gbInternet
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = gbInternet
Left = 350
Height = 72
Top = 3
Width = 136
AutoFill = True
BorderSpacing.Left = 3
Caption = ' Show statistics in '
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
@ -125,8 +172,8 @@ object frmPreferences: TfrmPreferences
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 46
ClientWidth = 130
ClientHeight = 54
ClientWidth = 134
Items.Strings = (
'MHz'
'meters'
@ -134,195 +181,377 @@ object frmPreferences: TfrmPreferences
TabOrder = 1
end
object edtWebBrowser: TEdit
Left = 360
Height = 25
Top = 115
AnchorSideLeft.Control = lblWebBrowser
AnchorSideTop.Control = lblWebBrowser
AnchorSideTop.Side = asrBottom
Left = 350
Height = 34
Top = 98
Width = 176
BorderSpacing.Top = 3
OnClick = edtWebBrowserClick
OnExit = edtWebBrowserExit
TabOrder = 2
end
object chkNewDXCCTables: TCheckBox
Left = 14
AnchorSideLeft.Control = gbInternet
AnchorSideTop.Control = gbInternet
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 152
Width = 439
Top = 135
Width = 423
BorderSpacing.Top = 3
Caption = 'Check for newer version of dxcc tables after program startup'
TabOrder = 3
end
object chkShowDeleted: TCheckBox
Left = 14
AnchorSideLeft.Control = chkNewDXCCTables
AnchorSideTop.Control = chkNewDOKTables
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 224
Width = 265
Top = 204
Width = 257
Caption = 'Show deleted countries in statistics'
TabOrder = 4
end
object chkSunUTC: TCheckBox
Left = 14
AnchorSideLeft.Control = chkNewDXCCTables
AnchorSideTop.Control = chkShowDeleted
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 248
Width = 212
Top = 227
Width = 206
Caption = 'Show sunrise/sunset in UTC'
TabOrder = 5
end
object chkNewQSLTables: TCheckBox
Left = 14
AnchorSideLeft.Control = chkNewDXCCTables
AnchorSideTop.Control = chkNewDXCCTables
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 174
Width = 522
Top = 158
Width = 505
Caption = 'Check for newer version of qsl managers database after program startup'
TabOrder = 6
end
object GroupBox33: TGroupBox
Left = 14
Height = 147
Top = 379
object gbOffsets: TGroupBox
AnchorSideLeft.Control = gbInternet
AnchorSideTop.Control = lblQsoColorDate
AnchorSideTop.Side = asrBottom
Left = 6
Height = 195
Top = 327
Width = 626
BorderSpacing.Top = 3
Caption = ' Offsets '
ClientHeight = 121
ClientWidth = 620
ClientHeight = 177
ClientWidth = 624
TabOrder = 7
object Label15: TLabel
Left = 15
object lblUtc: TLabel
AnchorSideLeft.Control = edtOffset
AnchorSideLeft.Side = asrCenter
AnchorSideBottom.Control = edtOffset
Left = 469
Height = 17
Top = 50
Width = 28
Top = 3
Width = 27
Anchors = [akLeft, akBottom]
Caption = 'UTC'
ParentColor = False
end
object Label59: TLabel
Left = 352
object lblGrayline: TLabel
AnchorSideLeft.Control = LblTimes
AnchorSideTop.Control = chkSysUTC
AnchorSideTop.Side = asrBottom
Left = 6
Height = 17
Top = 10
Width = 56
Caption = 'Grayline'
Top = 64
Width = 59
BorderSpacing.Top = 15
Caption = 'Grayline:'
ParentColor = False
end
object Label94: TLabel
Left = 72
object lblSunRiseSet: TLabel
AnchorSideLeft.Control = edtSunOffset
AnchorSideLeft.Side = asrCenter
AnchorSideBottom.Control = edtSunOffset
Left = 533
Height = 17
Top = 50
Width = 81
Top = 3
Width = 76
Anchors = [akLeft, akBottom]
Caption = 'Sun rise/set'
ParentColor = False
end
object edtOffset: TEdit
Left = 7
Height = 25
Top = 74
Width = 52
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = chkSysUTC
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edtSunOffset
Left = 452
Height = 34
Top = 20
Width = 60
Anchors = [akTop, akRight]
BorderSpacing.Right = 30
TabOrder = 0
Text = '0'
end
object edtGrayLineOffset: TEdit
Left = 352
Height = 25
Top = 34
AnchorSideLeft.Control = lblGraylineHint
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = lblGrayline
AnchorSideTop.Side = asrBottom
Left = 128
Height = 34
Top = 81
Width = 50
TabOrder = 1
Text = '0'
end
object edtSunOffset: TEdit
Left = 74
Height = 25
Top = 74
Width = 50
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtOffset
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = gbOffsets
AnchorSideRight.Side = asrBottom
Left = 542
Height = 34
Top = 20
Width = 58
Anchors = [akTop, akRight]
BorderSpacing.Left = 6
BorderSpacing.Right = 24
TabOrder = 2
Text = '0'
end
object chkSysUTC: TCheckBox
Left = 7
AnchorSideLeft.Control = gbOffsets
AnchorSideTop.Control = LblTimes
AnchorSideTop.Side = asrBottom
Left = 3
Height = 23
Top = 10
Width = 255
Top = 26
Width = 247
BorderSpacing.Left = 3
BorderSpacing.Top = 6
Caption = 'get UTC time from computer time'
OnClick = chkSysUTCClick
TabOrder = 3
end
object Label197: TLabel
Left = 248
object lblGraylineHint: TLabel
AnchorSideLeft.Control = LblTimes
AnchorSideTop.Control = edtGrayLineOffset
AnchorSideTop.Side = asrBottom
Left = 6
Height = 34
Top = 66
Width = 303
Top = 115
Width = 294
Caption = 'Sometimes grayline is not accurate, you can '#10'enter the correction here (in hours, try -1.25)'
ParentColor = False
end
object LblTimes: TLabel
AnchorSideLeft.Control = gbOffsets
AnchorSideTop.Control = gbOffsets
Left = 6
Height = 17
Top = 3
Width = 36
BorderSpacing.Left = 6
BorderSpacing.Top = 3
Caption = 'Time:'
ParentColor = False
end
object edtGCStep: TEdit
AnchorSideTop.Control = edtGrayLineOffset
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = edtOffset
AnchorSideRight.Side = asrBottom
Left = 432
Height = 34
Top = 81
Width = 80
Anchors = [akTop, akRight]
OnExit = edtGCStepExit
TabOrder = 4
end
object edtGCPolarDivisor: TEdit
AnchorSideTop.Control = edtGrayLineOffset
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = lblSunRiseSet
AnchorSideRight.Side = asrBottom
Left = 529
Height = 34
Top = 81
Width = 80
Anchors = [akTop, akRight]
NumbersOnly = True
OnExit = edtGCPolarDivisorExit
TabOrder = 5
end
object lblGCStep: TLabel
AnchorSideLeft.Control = edtGCStep
AnchorSideLeft.Side = asrCenter
AnchorSideBottom.Control = edtGCStep
Left = 458
Height = 17
Top = 64
Width = 29
Anchors = [akLeft, akBottom]
Caption = 'Step'
ParentColor = False
end
object lblGCDivisor: TLabel
AnchorSideLeft.Control = edtGCPolarDivisor
AnchorSideLeft.Side = asrCenter
AnchorSideBottom.Control = edtGCPolarDivisor
Left = 546
Height = 17
Top = 64
Width = 46
Anchors = [akLeft, akBottom]
Caption = 'Divisor'
ParentColor = False
end
object lblGCHint: TLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtGCPolarDivisor
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = edtGCPolarDivisor
AnchorSideRight.Side = asrBottom
Left = 313
Height = 51
Top = 115
Width = 296
Anchors = [akTop, akRight]
Caption = 'Great circle plotting setps in desimal degrees'#10'Step divisor is used in polar areas N and S '#10'where distance/degree is smaller'
ParentColor = False
end
object lblGLOffset: TLabel
AnchorSideLeft.Control = edtGrayLineOffset
AnchorSideLeft.Side = asrCenter
AnchorSideBottom.Control = edtGrayLineOffset
Left = 133
Height = 17
Top = 64
Width = 40
Anchors = [akLeft, akBottom]
Caption = 'Offset'
ParentColor = False
end
end
object chkShowMiles: TCheckBox
Left = 14
AnchorSideLeft.Control = chkNewDXCCTables
AnchorSideTop.Control = chkSunUTC
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 273
Width = 178
Top = 250
Width = 176
Caption = 'Show distance in miles'
TabOrder = 8
end
object btnCfgStorage: TButton
Left = 14
Height = 27
Top = 539
Width = 222
AnchorSideLeft.Control = gbOffsets
AnchorSideTop.Control = gbOffsets
AnchorSideTop.Side = asrBottom
Left = 6
Height = 33
Top = 528
Width = 213
AutoSize = True
BorderSpacing.Top = 6
Caption = 'Configuration storage settings'
OnClick = btnCfgStorageClick
TabOrder = 9
end
object chkQSOColor: TCheckBox
Left = 14
AnchorSideLeft.Control = chkNewDXCCTables
AnchorSideTop.Control = chkShowMiles
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 307
Width = 130
Top = 273
Width = 124
Caption = 'QSO older than'
TabOrder = 10
end
object edtQSOColorDate: TEdit
Left = 160
Height = 25
Top = 307
AnchorSideLeft.Control = chkQSOColor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = chkQSOColor
Left = 133
Height = 34
Top = 273
Width = 104
BorderSpacing.Left = 3
TabOrder = 11
Text = '2017-04-18'
end
object Label46: TLabel
Left = 274
object lblDiffColor: TLabel
AnchorSideLeft.Control = edtQSOColorDate
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edtQSOColorDate
Left = 240
Height = 17
Top = 310
Width = 172
Top = 273
Width = 162
BorderSpacing.Left = 3
Caption = 'show with different color'
ParentColor = False
end
object pnlQSOColor: TPanel
Left = 472
AnchorSideLeft.Control = lblDiffColor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = lblDiffColor
Left = 405
Height = 42
Top = 298
Top = 273
Width = 106
BorderSpacing.Left = 3
BevelInner = bvRaised
TabOrder = 12
OnClick = pnlQSOColorClick
end
object btnSelectQSOColor: TButton
Left = 587
Height = 27
Top = 307
AnchorSideLeft.Control = pnlQSOColor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = pnlQSOColor
AnchorSideTop.Side = asrCenter
Left = 523
Height = 33
Top = 278
Width = 56
AutoSize = True
BorderSpacing.Left = 12
Caption = 'Select'
OnClick = btnSelectQSOColorClick
TabOrder = 13
end
object Label47: TLabel
Left = 160
object lblQsoColorDate: TLabel
AnchorSideLeft.Control = edtQSOColorDate
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = edtQSOColorDate
AnchorSideTop.Side = asrBottom
Left = 138
Height = 17
Top = 340
Width = 103
Top = 307
Width = 94
Caption = '(YYYY-MM-DD)'
ParentColor = False
end
object chkNewDOKTables: TCheckBox
Left = 14
AnchorSideLeft.Control = chkNewDXCCTables
AnchorSideTop.Control = chkNewQSLTables
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 197
Width = 464
Top = 181
Width = 446
Caption = 'Check for newer version of DOK database after program startup'
TabOrder = 14
end

View File

@ -513,6 +513,8 @@ type
DateEditCall: TDateEdit;
DateEditLoc: TDateEdit;
dlgColor : TColorDialog;
edtGCStep: TEdit;
edtGCPolarDivisor: TEdit;
edtUsrBtn: TEdit;
edtUsr1R1Name: TEdit;
edtR2Host: TEdit;
@ -679,7 +681,7 @@ type
GroupBox17: TGroupBox;
GroupBox18: TGroupBox;
GroupBox19: TGroupBox;
GroupBox2: TGroupBox;
gbInternet: TGroupBox;
GroupBox20: TGroupBox;
GroupBox21: TGroupBox;
GroupBox22: TGroupBox;
@ -696,7 +698,7 @@ type
grpUsrCmds: TGroupBox;
GroupBox31: TGroupBox;
GroupBox32: TGroupBox;
GroupBox33: TGroupBox;
gbOffsets: TGroupBox;
GroupBox34: TGroupBox;
GroupBox35: TGroupBox;
gbeQSL: TGroupBox;
@ -732,6 +734,11 @@ type
Label1: TLabel;
Label10: TLabel;
Label108: TLabel;
lblGLOffset: TLabel;
lblGCStep: TLabel;
lblGCDivisor: TLabel;
lblGCHint: TLabel;
LblTimes: TLabel;
Label17: TLabel;
lblUsrBtn: TLabel;
lblHost2: TLabel;
@ -777,7 +784,7 @@ type
Label117: TLabel;
Label118: TLabel;
Label119: TLabel;
Label12: TLabel;
lblintProxy: TLabel;
Label120: TLabel;
Label121: TLabel;
Label122: TLabel;
@ -789,7 +796,7 @@ type
lbleQSLBkg: TLabel;
lblRadio2: TLabel;
lblRotId1: TLabel;
Label13: TLabel;
lblIntPort: TLabel;
lblSerialR1Spd: TLabel;
lblserialR1DataBits: TLabel;
lblSerialR1Stop: TLabel;
@ -800,7 +807,7 @@ type
lblSerialR2Spd: TLabel;
lblSerialR2DataBits: TLabel;
lblSerialR2Stop: TLabel;
Label14: TLabel;
lblIntUser: TLabel;
lblSerialR2Hand: TLabel;
lblSerialR2Parity: TLabel;
lblSerialR2Dtr: TLabel;
@ -811,7 +818,7 @@ type
lblSpeed1: TLabel;
lblDataBits1: TLabel;
lblStopBits1: TLabel;
Label15: TLabel;
lblUtc: TLabel;
lblHandshake1: TLabel;
lblParity1: TLabel;
lblDTR1: TLabel;
@ -862,7 +869,7 @@ type
lblK3NGSpeed: TLabel;
lblK3NGWPM: TLabel;
lblK3NGSerSpeed: TLabel;
Label197: TLabel;
lblGraylineHint: TLabel;
Label198: TLabel;
lblHamLibSpeed: TLabel;
lblHamLibWPM: TLabel;
@ -876,14 +883,14 @@ type
lblDebug : TLabel;
Label207: TLabel;
lblwsjtaddr: TLabel;
Label46 : TLabel;
Label47 : TLabel;
lblDiffColor : TLabel;
lblQsoColorDate : TLabel;
Label48: TLabel;
Label49: TLabel;
Label50: TLabel;
Label51: TLabel;
lbl: TLabel;
Label19: TLabel;
lblIntPasswd: TLabel;
Label2: TLabel;
lblExtra: TLabel;
lblModelR1: TLabel;
@ -909,13 +916,13 @@ type
Label54: TLabel;
Label55: TLabel;
Label56: TLabel;
Label59: TLabel;
lblGrayline: TLabel;
Label61: TLabel;
Label63: TLabel;
Label91: TLabel;
Label92: TLabel;
Label93: TLabel;
Label94: TLabel;
lblSunRiseSet: TLabel;
Label95: TLabel;
lblPollR2: TLabel;
lbl1: TLabel;
@ -952,7 +959,7 @@ type
Label57: TLabel;
Label58: TLabel;
Label6: TLabel;
Label60: TLabel;
lblWebBrowser: TLabel;
lblBandMapFont: TLabel;
Label62: TLabel;
Label64: TLabel;
@ -1092,6 +1099,8 @@ type
procedure cmbModelRot1Change(Sender: TObject);
procedure cmbModelRot2Change(Sender: TObject);
procedure edtAlertCmdExit(Sender: TObject);
procedure edtGCPolarDivisorExit(Sender: TObject);
procedure edtGCStepExit(Sender: TObject);
procedure edtHtmlFilesClick(Sender: TObject);
procedure edtHtmlFilesExit(Sender: TObject);
procedure edtImgFilesExit(Sender: TObject);
@ -1226,6 +1235,8 @@ begin
cqrini.WriteInteger('Program', 'Options', pgPreferences.ActivePageIndex);
cqrini.WriteBool('Program', 'BandStatMHz', rgStatistics.ItemIndex = 0);
cqrini.WriteFloat('Program', 'GraylineOffset', StrToCurr(edtGrayLineOffset.Text));
cqrini.WriteFloat('Program', 'GraylineGCstep',StrToCurr(edtGCStep.Caption));
cqrini.WriteInteger('Program', 'GraylineGCPolarDivisor',StrToInt(edtGCPolarDivisor.Caption));
if edtWebBrowser.Text = '' then edtWebBrowser.Text:= dmUtils.MyDefaultBrowser; //may not be empty string
cqrini.WriteString('Program', 'WebBrowser', edtWebBrowser.Text);
@ -2559,6 +2570,30 @@ begin
// ~ in command causes DXCluster spot flow stop (!?)
end;
procedure TfrmPreferences.edtGCPolarDivisorExit(Sender: TObject);
var v:integer;
begin
if TryStrToInt(edtGCPolarDivisor.Caption,v) then
begin
if ((v<=0) or (v>40)) then
edtGCPolarDivisor.Caption:='10' //replace with default
end
else
edtGCPolarDivisor.Caption:='10' //replace with default
end;
procedure TfrmPreferences.edtGCStepExit(Sender: TObject);
var v:extended;
begin
if TryStrToFloat(edtGCStep.Caption,v) then
Begin
if ((v<=0) or (v>40)) then
edtGCStep.Caption:='1.5'; //error use default value;
end
else
edtGCStep.Caption:='1.5'; //on convert error use default value;
end;
procedure TfrmPreferences.edtHtmlFilesClick(Sender: TObject);
begin
if odFindBrowser.Execute then
@ -2635,6 +2670,7 @@ begin
if not (key in ['0'..'9']) then
key := #0;
end;
procedure TfrmPreferences.TRXParamsChange(Sender: TObject);
begin
TRXChanged := True
@ -2769,8 +2805,9 @@ begin
edtPasswd.Text := cqrini.ReadString('Program', 'Passwd', '');
edtOffset.Text := CurrToStr(cqrini.ReadFloat('Program', 'offset', 0));
pgPreferences.ActivePageIndex := cqrini.ReadInteger('Program', 'Options', 0);
edtGrayLineOffset.Text :=
CurrToStr(cqrini.ReadFloat('Program', 'GraylineOffset', 0));
edtGrayLineOffset.Text := CurrToStr(cqrini.ReadFloat('Program', 'GraylineOffset', 0));
edtGCStep.Caption := CurrToStr(cqrini.ReadFloat('Program', 'GraylineGCstep',15E-001));
edtGCPolarDivisor.Caption := IntToStr(cqrini.ReadInteger('Program', 'GraylineGCPolarDivisor',10));
edtWebBrowser.Text := cqrini.ReadString('Program', 'WebBrowser', dmUtils.MyDefaultBrowser);
chkNewDXCCTables.Checked := cqrini.ReadBool('Program', 'CheckDXCCTabs', True);
chkShowDeleted.Checked := cqrini.ReadBool('Program', 'ShowDeleted', False);

View File

@ -65,8 +65,9 @@ type
procedure body_add(typ:byte;x1,y1,x2,y2:extended;popis:string;barva:tcolor;vel_bodu:longint);
procedure body_smaz;
procedure GC_line_part(x1,y1,x2,y2:double);
procedure GC_line_clear;
procedure GC_line_part(x1,y1,x2,y2:double); //add ShortPath point
procedure GC_Lline_part(x1,y1,x2,y2:double); //add LongPath point
procedure GC_line_clear(what:integer=-1); //clear S&LPath points
private
nrd:boolean; //needs to redraw (a new calculation has been made)
@ -91,8 +92,11 @@ type
body:array[0..body_max] of Tcarobod;
body_poc:longint;
GC_point:array[0..GC_points_Max] of TGC_point;
GC_point:array[0..GC_points_Max] of TGC_point; //ShortPath array
GCpointer:longint;
GC_Lpoint:array[0..GC_points_Max] of TGC_point; //LongPath array
GCLpointer:longint;
LP : boolean; //set LongPath color;
function calc_horizontalx(var coord:t_coord; date:TDateTime; z:longint;latitude: extended):longint;
end;
@ -519,6 +523,7 @@ var e,z:longint;
body_poc:=0;
GCpointer:=0;
GCLpointer:=0;
poslednicas:=now-1000000;
nrd:=false;
@ -708,6 +713,9 @@ var
can.pen.Width:=5;
can.moveto(x1,y1);
can.lineto(x2,y2);
If LP then
can.pen.color:=clFuchsia
else
can.pen.color:=clyellow;
can.pen.Width:=2;
can.moveto(x1,y1);
@ -882,13 +890,15 @@ begin
// can.TextOut(10,30,' '+inttostr(round(carax2))+':'+inttostr(round(caray2))+' ');
end;
if GCpointer > 0 then
if GCpointer+GCLpointer > 0 then //same as OR
begin
LP:=True; //LongPath color plotting
for z:=0 to GCLpointer-1 do
cmarni(GC_Lpoint[z].La1, GC_Lpoint[z].Lo1, GC_Lpoint[z].La2, GC_Lpoint[z].Lo2, false);
LP:=False; //ShortPath color plotting
for z:=0 to GCpointer-1 do
begin
cmarni(GC_point[z].La1, GC_point[z].Lo1, GC_point[z].La2, GC_point[z].Lo2, false);
end;
end;
for z:=0 to body_poc-1 do
@ -973,11 +983,31 @@ Begin
inc(GCpointer);
end;
end;
procedure Tgrayline.GC_line_clear;
procedure Tgrayline.GC_Lline_part(x1,y1,x2,y2:double);
Begin
if chcipni then exit; //chcipni = "die"
if GCLpointer < GC_Points_max then
begin
GC_Lpoint[GCLpointer].La1:=x1;
GC_Lpoint[GCLpointer].Lo1:=y1;
GC_Lpoint[GCLpointer].La2:=x2;
GC_Lpoint[GCLpointer].Lo2:=y2;
inc(GCLpointer);
end;
end;
procedure Tgrayline.GC_line_clear(what:integer=-1);
begin
case what of
-1: Begin
GCpointer:=0;
GCLpointer:=0;
end;
0: GCpointer:=0;
1: GCLpointer:=0;
end;
end;
end.

View File

@ -20,7 +20,7 @@ const
cBUILD_DATE = '2022-02-15';
cBUILD_DATE = '2022-02-21';
implementation