Added preferences/TRXControl/Rig Power ON checkbox. If rig supports power cat commands and checked will send PowerON cmd to rig at initialize phase.

This commit is contained in:
OH1KH 2022-08-30 16:22:44 +03:00
parent 374624a03b
commit 89a8eee812
4 changed files with 36 additions and 12 deletions

View File

@ -5,8 +5,8 @@ object frmPreferences: TfrmPreferences
Width = 1131
HelpType = htKeyword
HelpKeyword = 'help/h1.html'
HorzScrollBar.Page = 794
VertScrollBar.Page = 432
HorzScrollBar.Page = 1094
VertScrollBar.Page = 703
ActiveControl = lbPreferences
AutoScroll = True
BorderIcons = [biSystemMenu]
@ -23,9 +23,9 @@ object frmPreferences: TfrmPreferences
Height = 713
Top = 0
Width = 883
ActivePage = tabModes
ActivePage = tabTRXcontrol
Align = alClient
TabIndex = 7
TabIndex = 5
TabOrder = 0
OnChange = pgPreferencesChange
object tabProgram: TTabSheet
@ -2140,7 +2140,7 @@ object frmPreferences: TfrmPreferences
BorderSpacing.Left = 6
BorderSpacing.Top = 4
Caption = ' rigctld '
ClientHeight = 86
ClientHeight = 70
ClientWidth = 655
TabOrder = 0
object lblRigctdPath: TLabel
@ -2374,7 +2374,7 @@ object frmPreferences: TfrmPreferences
Width = 511
BorderSpacing.Top = 3
Caption = 'Radio one serial parameters'
ClientHeight = 146
ClientHeight = 130
ClientWidth = 509
TabOrder = 11
object lblSerialRSpd: TLabel
@ -2800,10 +2800,11 @@ object frmPreferences: TfrmPreferences
end
end
object chkRVfo: TCheckBox
AnchorSideLeft.Control = edtRRigCtldPort
AnchorSideLeft.Control = grbSerialR
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = chkRSendCWR
AnchorSideTop.Side = asrCenter
Left = 549
Left = 517
Height = 23
Top = 94
Width = 103
@ -2851,6 +2852,19 @@ object frmPreferences: TfrmPreferences
Caption = 'Name'
ParentColor = False
end
object chkRPwrOn: TCheckBox
AnchorSideLeft.Control = chkRVfo
AnchorSideTop.Control = chkRVfo
AnchorSideTop.Side = asrBottom
Left = 517
Height = 23
Top = 117
Width = 131
Caption = 'Rig pwr ON cmd'
Checked = True
State = cbChecked
TabOrder = 13
end
end
end
object TabROTcontrol: TTabSheet

View File

@ -130,6 +130,7 @@ type
cb30cm: TCheckBox;
cgLimit: TCheckGroup;
cbNoKeyerReset: TCheckBox;
chkRPwrOn: TCheckBox;
chkOperator: TCheckBox;
chkDarcDok: TCheckBox;
chkNewDOKTables: TCheckBox;
@ -3299,6 +3300,7 @@ Begin
edtRRigCtldPort.Text := cqrini.ReadString('TRX'+nr, 'RigCtldPort', '4532');
edtRRigCtldArgs.Text := cqrini.ReadString('TRX'+nr, 'ExtraRigCtldArgs', '');
chkRRunRigCtld.Checked := cqrini.ReadBool('TRX'+nr, 'RunRigCtld', False);
chkRPwrON.Checked := cqrini.ReadBool('TRX'+nr, 'RigPwrON', True);
edtRHost.Text := cqrini.ReadString('TRX'+nr, 'host', 'localhost');
cmbSpeedR.ItemIndex := cqrini.ReadInteger('TRX'+nr, 'SerialSpeed', 0);
cmbDataBitsR.ItemIndex := cqrini.ReadInteger('TRX'+nr, 'DataBits', 0);
@ -3337,6 +3339,7 @@ Begin
cqrini.WriteString('TRX'+nr, 'RigCtldPort', edtRRigCtldPort.Text);
cqrini.WriteString('TRX'+nr, 'ExtraRigCtldArgs', edtRRigCtldArgs.Text);
cqrini.WriteBool('TRX'+nr, 'RunRigCtld', chkRRunRigCtld.Checked);
cqrini.WriteBool('TRX'+nr, 'RigPwrON', chkRPwrON.Checked);
cqrini.WriteString('TRX'+nr, 'host', edtRHost.Text);
cqrini.WriteInteger('TRX'+nr, 'SerialSpeed', cmbSpeedR.ItemIndex);
cqrini.WriteInteger('TRX'+nr, 'DataBits', cmbDataBitsR.ItemIndex);

View File

@ -1095,6 +1095,7 @@ begin
radio.RigPoll := poll;
radio.RigSendCWR := cqrini.ReadBool('TRX' + n, 'CWR', False);
radio.RigChkVfo := cqrini.ReadBool('TRX' + n, 'ChkVfo', True);
radio.PowerON:=cqrini.ReadBool('TRX'+ n, 'RigPwrON', True);
tmrRadio.Interval := radio.RigPoll;
tmrRadio.Enabled := True;
Result := True;

View File

@ -44,6 +44,7 @@ type TRigControl = class
fTXOffset : Double;
fMorse : boolean;
fPower : boolean;
fPowerON : boolean;
fGetVfo : boolean;
AllowCommand : integer; //things to do before start polling
@ -94,6 +95,8 @@ public
//can rig send CW
property Power : Boolean read fPower;
//can rig switch power
property PowerON : Boolean write fPowerON;
//may rig switch power on at start
property CanGetVfo : Boolean read fGetVfo;
//can rig show vfo (many Icoms can not)
property LastError : String read fLastError;
@ -620,10 +623,13 @@ begin
AllowCommand:=-1; //waiting for reply
end;
8: Begin
if fPowerON then
begin
cmd:= '+\set_powerstat 1'+LineEnding;
if DebugMode then
Writeln('Sending: '+cmd);
RigctldConnect.SendMessage(cmd);
end;
AllowCommand:=-1; //waiting for reply
end;