added cw setup in pref. Whole setup is still broken...AHhhhhhh

This commit is contained in:
OH1KH 2022-09-09 13:33:02 +03:00
parent 1553f48abb
commit 934694ea63
4 changed files with 58 additions and 46 deletions

View File

@ -168,7 +168,7 @@ begin
if cmbStoreLoTW.ItemIndex>0 then
Sections := Sections + 'LoTW,';
if cmbStoreCWInterface.ItemIndex>0 then
Sections := Sections + 'CW,';
Sections := Sections + 'CW,CW1,CW2,CW3,CW4,CW5,CW6';
if cmbStoreFldigiInterface.ItemIndex>0 then
Sections := Sections + 'fldigi,wsjt,n1mm';
if cmbStoreAutoBackup.ItemIndex>0 then

View File

@ -136,6 +136,7 @@ end;
procedure TfrmKeyTexts.btnOKClick(Sender: TObject);
begin
cqrini.SectionErase(C_INI_FILE_SECTION); //this cleans section to keep only memory keys, other settings in CWnr sections
cqrini.WriteString(C_INI_FILE_SECTION,'F1',edtF1.Text);
cqrini.WriteString(C_INI_FILE_SECTION,'F2',edtF2.Text);
cqrini.WriteString(C_INI_FILE_SECTION,'F3',edtF3.Text);

View File

@ -23,9 +23,9 @@ object frmPreferences: TfrmPreferences
Height = 712
Top = 0
Width = 883
ActivePage = tabCWInterface
ActivePage = tabTRXcontrol
Align = alClient
TabIndex = 19
TabIndex = 5
TabOrder = 0
OnChange = pgPreferencesChange
object tabProgram: TTabSheet
@ -2903,7 +2903,7 @@ object frmPreferences: TfrmPreferences
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = ' rotctld '
ClientHeight = 86
ClientHeight = 70
ClientWidth = 655
TabOrder = 0
object Label124: TLabel
@ -2951,7 +2951,7 @@ object frmPreferences: TfrmPreferences
AnchorSideBottom.Control = pgROTControl
AnchorSideBottom.Side = asrBottom
Caption = 'Rotor one'
ClientHeight = 388
ClientHeight = 361
ClientWidth = 647
object gbRot1: TGroupBox
AnchorSideLeft.Control = tabRot1
@ -2963,7 +2963,7 @@ object frmPreferences: TfrmPreferences
BorderSpacing.Left = 6
BorderSpacing.Top = 12
Caption = ' Rotor one, desc.:'
ClientHeight = 339
ClientHeight = 323
ClientWidth = 622
TabOrder = 0
object lblDevice1: TLabel
@ -3090,14 +3090,14 @@ object frmPreferences: TfrmPreferences
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 161
Top = 172
Top = 156
Width = 610
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 6
BorderSpacing.Right = 6
BorderSpacing.Bottom = 6
Caption = 'Rotor one serial parameters'
ClientHeight = 159
ClientHeight = 143
ClientWidth = 608
TabOrder = 5
object lblSpeed1: TLabel
@ -3409,7 +3409,7 @@ object frmPreferences: TfrmPreferences
AnchorSideBottom.Control = tabRot1
AnchorSideBottom.Side = asrBottom
Caption = 'Rotor two'
ClientHeight = 388
ClientHeight = 361
ClientWidth = 647
object gbRot2: TGroupBox
AnchorSideLeft.Control = tabRot2
@ -7123,7 +7123,6 @@ object frmPreferences: TfrmPreferences
Width = 71
Caption = 'Min speed:'
ParentColor = False
Visible = False
end
object lblWinMaxSpeed: TLabel
AnchorSideLeft.Side = asrBottom
@ -7138,7 +7137,6 @@ object frmPreferences: TfrmPreferences
Anchors = [akTop, akRight]
Caption = 'Max speed:'
ParentColor = False
Visible = False
end
object edtWinPort1: TEdit
AnchorSideLeft.Control = lblWinPort
@ -7180,7 +7178,6 @@ object frmPreferences: TfrmPreferences
Caption = 'Use potentiometer''s CW speed'
OnChange = chkPotSpeedChange
TabOrder = 1
Visible = False
end
object edtWinMinSpeed: TSpinEdit
AnchorSideLeft.Control = lblWinMinSpeed
@ -7197,7 +7194,6 @@ object frmPreferences: TfrmPreferences
OnChange = edtWinMinSpeedChange
TabOrder = 3
Value = 5
Visible = False
end
object edtWinMaxSpeed: TSpinEdit
AnchorSideLeft.Control = lblWinMaxSpeed
@ -7212,7 +7208,6 @@ object frmPreferences: TfrmPreferences
OnChange = edtWinMaxSpeedChange
TabOrder = 4
Value = 60
Visible = False
end
end
object gbCwkeyer: TGroupBox

View File

@ -1316,6 +1316,12 @@ begin
cqrini.WriteBool('TRX','MemModeRelated',chkModeRelatedOnly.Checked);
cqrini.WriteInteger('TRX', 'RigCount', edtRigCount.Value);
For int:=1 to edtRigCount.Value do //these should be saved while editing them, but we do it here just for sure
Begin
SaveTRX(int);
SaveBandW(int);
SaveCWif(int);
end;
ClearUnUsedRigs;
frmTRXControl.cmbRigGetItems(nil);
@ -1674,7 +1680,6 @@ begin
if frmPropagation.Showing then
frmPropagation.RefreshPropagation;
frmTRXControl.cmbRigGetItems(nil);
frmTRXControl.SetDebugMode(chkTrxControlDebug.Checked or (dmData.DebugLevel>0));
if ((frmNewQSO.sbNewQSO.Panels[0].Text = '') or (frmNewQSO.sbNewQSO.Panels[0].Text = cMyLoc)) then
@ -2408,7 +2413,7 @@ begin
if cmbCWRadio.ItemIndex<1 then cmbCWRadio.ItemIndex:=1;
SaveCWif(CWifLoaded);
LoadCWif(cmbCWRadio.ItemIndex);
if cqrini.ReadString('TRX'+IntToStr(cmbRadioModes.ItemIndex), 'model', '')='' then
if cqrini.ReadString('TRX'+IntToStr(cmbCWRadio.ItemIndex), 'model', '')='' then
lblNoRigForCW.Visible:=True
else
lblNoRigForCW.Visible:=False;
@ -2658,6 +2663,7 @@ begin
InitRigCmb; //load selectors
frmTRXControl.cmbRigGetItems(nil); //update rig names
cmbRadioModes.Items:=frmTRXControl.cmbRig.Items; //names to modes tab
cmbCWRadio.Items:=cmbRadioModes.Items; //names to CW tab
end;
procedure TfrmPreferences.TRXParamsChange(Sender: TObject);
@ -2939,8 +2945,12 @@ begin
chkModeRelatedOnly.Checked := cqrini.ReadBool('TRX','MemModeRelated',False);
edtRigCount.Value:=cqrini.ReadInteger('TRX', 'RigCount', 2);
InitRigCmb;
frmTRXControl.cmbRigGetItems(nil); //this populates cmb radio names and sets used rig to cmbRig.itemindex
cmbRadioNr.ItemIndex:=frmTRXControl.cmbRig.ItemIndex;
LoadTRX(cmbRadioNr.ItemIndex);
cmbRadioNrCloseUp(nil);//this populates radio names to modes and cw
LoadBandW(cmbRadioNr.ItemIndex);
LoadCWif(cmbRadioNr.ItemIndex);
edtRotCtldPath.Text := cqrini.ReadString('ROT', 'RotCtldPath', '/usr/bin/rotctld');
if (FileExistsUTF8(edtRotCtldPath.Text)) then
@ -3454,20 +3464,20 @@ var
nr :string;
Begin
nr:=IntToStr(RigNr);
cmbIfaceType.ItemIndex := cqrini.ReadInteger('CW', 'Type'+nr, 0);
cbNoKeyerReset.Checked := cqrini.ReadBool('CW', 'NoReset', false);
edtWinPort1.Text := cqrini.ReadString('CW', 'wk_port'+nr, '');
chkPotSpeed.Checked := cqrini.ReadBool('CW', 'PotSpeed', False);
edtWinSpeed.Value := cqrini.ReadInteger('CW', 'wk_speed', 30);
edtCWAddress.Text := cqrini.ReadString('CW', 'cw_address', 'localhost');
edtCWPort1.Text := cqrini.ReadString('CW', 'cw_port'+nr, '6789');
edtCWSpeed.Value := cqrini.ReadInteger('CW', 'cw_speed', 30);
edtWinMinSpeed.Value := cqrini.ReadInteger('CW', 'wk_min', 5);
edtWinMaxSpeed.Value := cqrini.ReadInteger('CW', 'wk_max', 60);
edtK3NGPort1.Text := cqrini.ReadString('CW','K3NGPort'+nr,'');
edtK3NGSerSpeed.Text := IntToStr(cqrini.ReadInteger('CW','K3NGSerSpeed',115200));
edtK3NGSpeed.Text := IntToStr(cqrini.ReadInteger('CW','K3NGSpeed',30));
edtHamLibSpeed.Text := IntToStr(cqrini.ReadInteger('CW','HamLibSpeed',30));
cmbIfaceType.ItemIndex := cqrini.ReadInteger('CW'+nr, 'Type'+nr, 0);
cbNoKeyerReset.Checked := cqrini.ReadBool('CW'+nr, 'NoReset', false);
edtWinPort1.Text := cqrini.ReadString('CW'+nr, 'wk_port'+nr, '');
chkPotSpeed.Checked := cqrini.ReadBool('CW'+nr, 'PotSpeed', False);
edtWinSpeed.Value := cqrini.ReadInteger('CW'+nr, 'wk_speed', 30);
edtCWAddress.Text := cqrini.ReadString('CW'+nr, 'cw_address', 'localhost');
edtCWPort1.Text := cqrini.ReadString('CW'+nr, 'cw_port'+nr, '6789');
edtCWSpeed.Value := cqrini.ReadInteger('CW'+nr, 'cw_speed', 30);
edtWinMinSpeed.Value := cqrini.ReadInteger('CW'+nr, 'wk_min', 5);
edtWinMaxSpeed.Value := cqrini.ReadInteger('CW'+nr, 'wk_max', 60);
edtK3NGPort1.Text := cqrini.ReadString('CW'+nr,'K3NGPort'+nr,'');
edtK3NGSerSpeed.Text := IntToStr(cqrini.ReadInteger('CW'+nr,'K3NGSerSpeed',115200));
edtK3NGSpeed.Text := IntToStr(cqrini.ReadInteger('CW'+nr,'K3NGSpeed',30));
edtHamLibSpeed.Text := IntToStr(cqrini.ReadInteger('CW'+nr,'HamLibSpeed',30));
CWifLoaded := RigNr;
end;
procedure TfrmPreferences.SaveCWif(RigNr:integer);
@ -3476,23 +3486,23 @@ var
Begin
if lblNoRigForCW.Visible then exit; //No rig, no save
nr:=IntToStr(RigNr);
cqrini.WriteInteger('CW', 'Type'+nr, cmbIfaceType.ItemIndex);
cqrini.WriteBool('CW', 'NoReset', cbNoKeyerReset.Checked);
cqrini.WriteString('CW', 'wk_port'+nr, edtWinPort1.Text);
cqrini.WriteBool('CW', 'PotSpeed', chkPotSpeed.Checked);
cqrini.WriteInteger('CW', 'wk_speed', edtWinSpeed.Value);
cqrini.WriteString('CW', 'cw_address', edtCWAddress.Text);
cqrini.WriteString('CW', 'cw_port'+nr, edtCWPort1.Text);
cqrini.WriteInteger('CW', 'cw_speed', edtCWSpeed.Value);
cqrini.WriteInteger('CW', 'wk_min', edtWinMinSpeed.Value);
cqrini.WriteInteger('CW', 'wk_max', edtWinMaxSpeed.Value);
cqrini.WriteString('CW','K3NGPort'+nr,edtK3NGPort1.Text);
cqrini.WriteInteger('CW','K3NGSerSpeed',StrToInt(edtK3NGSerSpeed.Text));
cqrini.WriteInteger('CW','K3NGSpeed',StrToInt(edtK3NGSpeed.Text));
cqrini.WriteInteger('CW','HamLibSpeed',StrToInt(edtHamLibSpeed.Text));
cqrini.WriteInteger('CW'+nr, 'Type', cmbIfaceType.ItemIndex);
cqrini.WriteBool('CW'+nr, 'NoReset', cbNoKeyerReset.Checked);
cqrini.WriteString('CW'+nr, 'wk_port', edtWinPort1.Text);
cqrini.WriteBool('CW'+nr, 'PotSpeed', chkPotSpeed.Checked);
cqrini.WriteInteger('CW'+nr, 'wk_speed', edtWinSpeed.Value);
cqrini.WriteString('CW'+nr, 'cw_address', edtCWAddress.Text);
cqrini.WriteString('CW'+nr, 'cw_port', edtCWPort1.Text);
cqrini.WriteInteger('CW'+nr, 'cw_speed', edtCWSpeed.Value);
cqrini.WriteInteger('CW'+nr, 'wk_min', edtWinMinSpeed.Value);
cqrini.WriteInteger('CW'+nr, 'wk_max', edtWinMaxSpeed.Value);
cqrini.WriteString('CW'+nr,'K3NGPort',edtK3NGPort1.Text);
cqrini.WriteInteger('CW'+nr,'K3NGSerSpeed',StrToInt(edtK3NGSerSpeed.Text));
cqrini.WriteInteger('CW'+nr,'K3NGSpeed',StrToInt(edtK3NGSpeed.Text));
cqrini.WriteInteger('CW'+nr,'HamLibSpeed',StrToInt(edtHamLibSpeed.Text));
end;
procedure TfrmPreferences.InitRigCmb; //initialize radio selectors (without names) in TRXControl and Modes
procedure TfrmPreferences.InitRigCmb; //initialize radio selectors (without names) in TRXControl, CW and Modes
var //set itemindexes to used rig
f : integer;
s : string;
@ -3501,13 +3511,17 @@ Begin
cmbRadioNr.Items.Add('');
cmbRadioModes.Clear;
cmbRadioModes.Items.Add('');
cmbCWRadio.Clear;
cmbCWRadio.Items.Add('');
for f:=1 to edtRigCount.Value do
Begin
cmbRadioNr.Items.Add(IntToStr(f));
cmbRadioModes.Items.Add(IntToStr(f));
cmbCWRadio.Items.Add(IntToStr(f));
end;
cmbRadioNr.ItemIndex:=cqrini.ReadInteger('TRX', 'RigInUse', 1);
cmbRadioModes.ItemIndex:=cmbRadioNr.ItemIndex;
cmbCWRadio.ItemIndex:=cmbRadioNr.ItemIndex;
end;
procedure TfrmPreferences.ClearUnUsedRigs;
var
@ -3518,6 +3532,7 @@ Begin
begin
cqrini.SectionErase('TRX'+IntToStr(f));
cqrini.SectionErase('Band'+IntToStr(f));
cqrini.SectionErase('CW'+IntToStr(f));
end;
//remove unused rigs and modes from configuration
if edtRigCount.Value< edtRigCount.MaxValue then
@ -3527,13 +3542,14 @@ Begin
Begin
cqrini.SectionErase('TRX'+IntToStr(f));
cqrini.SectionErase('Band'+IntToStr(f));
cqrini.SectionErase('CW'+IntToStr(f));
dec(f);
end;
until (f=edtRigCount.Value);
end;
//6 is max rig count set by edtRigCount:Tspinedit
//if you change it you must change also fConfigStorage.pas
//TRX and Band lists
//TRX, CW and Band lists
end;