mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 17:27:32 +00:00
fix UpdateRptAutoState
This commit is contained in:
@@ -40,6 +40,8 @@ type
|
||||
CTCSSToneIdx: Integer; // 0..37
|
||||
FMStepOn: Boolean;
|
||||
FMStepIdx: Integer; // 0..3 (6.25/12.5/20/25 kHz)
|
||||
FMRptDir: Integer; // RPT_NONE/RPT_MINUS/RPT_PLUS
|
||||
FMRptOffsetHz: Double; // Hz, 0 = use band default
|
||||
end;
|
||||
|
||||
// TX-настройки per-device. Хранятся в JSON-секции "tx" под MAC,
|
||||
@@ -150,6 +152,8 @@ type
|
||||
LastCTun: Boolean;
|
||||
LastAGCMode: Integer;
|
||||
LastAGCTop: Integer;
|
||||
LastFMRptDir: Integer;
|
||||
LastFMRptOffsetHz: Double;
|
||||
end;
|
||||
|
||||
TXvtrSettings = record
|
||||
@@ -356,6 +360,8 @@ begin
|
||||
B.CTCSSToneIdx := 0;
|
||||
B.FMStepOn := True;
|
||||
B.FMStepIdx := 3; // 25 kHz
|
||||
B.FMRptDir := 0;
|
||||
B.FMRptOffsetHz := 0.0;
|
||||
end;
|
||||
|
||||
class procedure TSettingsManager.DefaultGlobal(out G: TGlobalSettings);
|
||||
@@ -737,6 +743,7 @@ begin
|
||||
JW(O,'fmsq_on',B.FMSQOn); JW(O,'fmsq_level',B.FMSQLevel);
|
||||
JW(O,'ctcss_on',B.CTCSSOn); JW(O,'ctcss_idx',B.CTCSSToneIdx);
|
||||
JW(O,'fmstep_on',B.FMStepOn); JW(O,'fmstep_idx',B.FMStepIdx);
|
||||
JW(O,'fmrpt_dir',B.FMRptDir); JW(O,'fmrpt_offset',B.FMRptOffsetHz);
|
||||
end;
|
||||
|
||||
function TSettingsManager.LoadBand(const MAC: array of Byte; BandIdx: Integer;
|
||||
@@ -763,6 +770,8 @@ begin
|
||||
B.CTCSSToneIdx := EnsureRange(JI(O,'ctcss_idx', B.CTCSSToneIdx), 0, 37);
|
||||
B.FMStepOn := JB(O,'fmstep_on', B.FMStepOn);
|
||||
B.FMStepIdx := EnsureRange(JI(O,'fmstep_idx', B.FMStepIdx), 0, 3);
|
||||
B.FMRptDir := EnsureRange(JI(O,'fmrpt_dir', B.FMRptDir), 0, 2);
|
||||
B.FMRptOffsetHz := JD(O,'fmrpt_offset', B.FMRptOffsetHz);
|
||||
end;
|
||||
|
||||
procedure TSettingsManager.SaveWindowBounds(L, T, W, H, DPI: Integer; Maximized: Boolean);
|
||||
@@ -1173,6 +1182,8 @@ begin
|
||||
X.Entries[i].LastCTun := False;
|
||||
X.Entries[i].LastAGCMode := 1;
|
||||
X.Entries[i].LastAGCTop := 90;
|
||||
X.Entries[i].LastFMRptDir := 0;
|
||||
X.Entries[i].LastFMRptOffsetHz := 0.0;
|
||||
end;
|
||||
// Шаблоны (пользователь должен сам Enable, чтобы трансверторы появились)
|
||||
X.Entries[0].ButtonText := '2m';
|
||||
@@ -1229,6 +1240,8 @@ begin
|
||||
X.Entries[i].LastCTun := JB(EObj, 'last_ctun', X.Entries[i].LastCTun);
|
||||
X.Entries[i].LastAGCMode := EnsureRange(JI(EObj, 'last_agc_mode', X.Entries[i].LastAGCMode), 0, 4);
|
||||
X.Entries[i].LastAGCTop := EnsureRange(JI(EObj, 'last_agc_top', X.Entries[i].LastAGCTop), 0, 120);
|
||||
X.Entries[i].LastFMRptDir := EnsureRange(JI(EObj, 'last_fmrpt_dir', X.Entries[i].LastFMRptDir), 0, 2);
|
||||
X.Entries[i].LastFMRptOffsetHz := JD(EObj, 'last_fmrpt_offset', X.Entries[i].LastFMRptOffsetHz);
|
||||
// Валидация: LastFreq должен быть в [FreqBegin..FreqEnd]
|
||||
if (X.Entries[i].LastFreq < X.Entries[i].FreqBegin) or
|
||||
(X.Entries[i].LastFreq > X.Entries[i].FreqEnd) then
|
||||
@@ -1270,6 +1283,8 @@ begin
|
||||
JW(EObj, 'last_ctun', X.Entries[i].LastCTun);
|
||||
JW(EObj, 'last_agc_mode', X.Entries[i].LastAGCMode);
|
||||
JW(EObj, 'last_agc_top', X.Entries[i].LastAGCTop);
|
||||
JW(EObj, 'last_fmrpt_dir', X.Entries[i].LastFMRptDir);
|
||||
JW(EObj, 'last_fmrpt_offset', X.Entries[i].LastFMRptOffsetHz);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user