Skip to content

Commit

Permalink
ui_builder: migrate iq_tool
Browse files Browse the repository at this point in the history
  • Loading branch information
vladisslav2011 committed Apr 14, 2024
1 parent 412917c commit 6e477dd
Show file tree
Hide file tree
Showing 9 changed files with 644 additions and 610 deletions.
360 changes: 360 additions & 0 deletions src/applications/gqrx/dcontrols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <QDir>
#include "dcontrols.h"
#include "dsp/format_converter.h"

static const c_def::preset_list mode_map();

Expand Down Expand Up @@ -62,6 +63,365 @@ c_def()
,


c_def()
.idx(C_IQ_LOCATION)
.name("IQ Location")
.title("Location:")
.title_placement(c_def::grid_placement(0,0,1,1,ALIGN_LEFT))
.placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT,1,5,SIZE_EXPANDING))
.hint("Enter a different location or use the select button")
.g_type(G_TEXT)
.dock(D_IQTOOL)
.scope(S_GUI)
.v3_config_group("baseband")
.config_key("rec_dir")
.v_type(V_STRING)
.def("")
.min("")
.max("")
.step("")
,
c_def()
.idx(C_IQ_SELECT)
.name("Select")
.title("Location select")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT,1,1,ALIGN_RIGHT|SIZE_PREFERRED))
.hint("Select a different location")
.g_type(G_BUTTON)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(0)
.step(0)
.readable(0)
,
//leave a row for the file list
c_def()
.idx(C_IQ_REC)
.name("&Rec")
.title("IQ Rec")
.icon(":/icons/icons/record.svg")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(2,0,1,1,ALIGN_LEFT))
.hint("Record I/Q samples to new file")
.g_type(G_TOGGLEBUTTON)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(0)
.step(0)
.readable(0)
,
c_def()
.idx(C_IQ_PLAY)
.name("&Play")
.title("IQ Play")
.icon(":/icons/icons/play.svg")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT,1,1,ALIGN_LEFT))
.hint("Start playing selected file")
.g_type(G_TOGGLEBUTTON)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(0)
.step(0)
.readable(0)
,
c_def()
.idx(C_IQ_REPEAT)
.name("repeat")
.title("IQ repeat")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT,1,1,ALIGN_LEFT|SIZE_PREFERRED))
.hint("Repeat playing file")
.v3_config_group("baseband")
.config_key("repeat")
.g_type(G_CHECKBOX)
.dock(D_IQTOOL)
.scope(S_RX)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(1)
.step(1)
,
c_def()
.idx(C_IQ_TIME)
.name("IQ time label")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT,1,4,SIZE_EXPANDING|ALIGN_CENTER))
.hint("Time (total/remaining)")
.g_type(G_LABEL)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_STRING)
.def("")
.min("")
.max("")
.step("")
.writable(0)
// .event(1)
,
c_def()
.idx(C_IQ_POS)
.name("IQ seek")
.title("IQ seek")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_NEXT,0,1,7))
.hint("Seek forward and backward in I/Q file")
.g_type(G_SLIDER)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_INT)
.def(0)
.min(0)
.max(600)
.step(10)
,
c_def()
.idx(C_IQ_FORMAT)
.name("IQ format")
.title("Format:")
.title_placement(c_def::grid_placement(PLACE_NEXT,0,1,1,ALIGN_LEFT))
.placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT,1,4))
.hint("Set recording sample format")
.v3_config_group("baseband")
.config_key("rec_fmt")
.g_type(G_COMBO)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_INT)
.def(FILE_FORMAT_CF)
.min(FILE_FORMAT_CF)
.max(FILE_FORMAT_COUNT)
.step(1)
.presets([](){
c_def::preset_list ret{};
for(int k=FILE_FORMAT_CF;k<FILE_FORMAT_COUNT;k++)
ret.push_back({
any_to_any_base::fmt[k].suffix,
any_to_any_base::fmt[k].name,
k,
""
});
return ret;
}())
,
c_def()
.idx(C_IQ_BUFFERS)
.name("IQ buffers")
.title("Buffer:")
.title_placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT,1,1))
.placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT,1,1,ALIGN_RIGHT))
.hint("Set recording buffer size")
.v3_config_group("baseband")
.config_key("rec_buffers")
.g_type(G_SPINBOX)
.dock(D_IQTOOL)
.scope(S_RX)
.v_type(V_INT)
.suffix("s")
.def(1)
.min(1)
.max(99)
.step(1)
,
c_def()
.idx(C_IQ_SIZE_STAT)
.name("IQ size")
.title("")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_NEXT,0,1,5,ALIGN_CENTER))
.hint("Recording size/playback pos")
.g_type(G_LABEL)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_STRING)
.def("")
.min("")
.max("")
.step("")
.writable(0)
,
c_def()
.idx(C_IQ_BUF_STAT)
.name("IQ buffer")
.title("")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT,1,2))
.hint("IQ Tool buffer fill")
.g_type(G_LABEL)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_INT)
.prefix("Buffer: ")
.suffix("%")
.def(0)
.min(0)
.max(0)
.step(0)
.writable(0)
,
c_def()
.idx(C_IQ_FINE_STEP)
.base(C_IQ_POS)
.name("Fine step")
.title("Enable small step")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_NEXT,0,0))
.hint("Enable small step")
.shortcut(";")
.g_type(G_MENUCHECKBOX)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(1)
.step(1)
,
c_def()
.idx(C_IQ_SEL_A)
.base(C_IQ_POS)
.name("A")
.title("Set marker A (start)")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_NEXT,0,0))
.hint("Set marker A (start)")
.shortcut("[")
.g_type(G_MENUACTION)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(0)
.step(0)
.readable(0)
,
c_def()
.idx(C_IQ_SEL_B)
.base(C_IQ_POS)
.name("B")
.title("Set marker B (end)")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_NEXT,0,0))
.hint("Set marker A (start)")
.shortcut("]")
.g_type(G_MENUACTION)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(0)
.step(0)
.readable(0)
,
c_def()
.idx(C_IQ_RESET_SEL)
.base(C_IQ_POS)
.name("Reset")
.title("Reset selection")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_NEXT,0,0))
.hint("Reset selection")
.g_type(G_MENUACTION)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(0)
.step(0)
.readable(0)
,
c_def()
.idx(C_IQ_SAVE_SEL)
.base(C_IQ_POS)
.name("Save")
.title("Save selection")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_NEXT,0,0))
.hint("Save selection")
.shortcut("S")
.g_type(G_MENUACTION)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(0)
.step(0)
.readable(0)
,
c_def()
.idx(C_IQ_GOTO_A)
.base(C_IQ_POS)
.name("Go to A")
.title("Seek to marker A (start)")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_NEXT,0,0))
.hint("Seek to marker A (start)")
.shortcut("{")
.g_type(G_MENUACTION)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(0)
.step(0)
.readable(0)
,
c_def()
.idx(C_IQ_GOTO_B)
.base(C_IQ_POS)
.name("Go to B")
.title("Seek to marker B (start)")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_NEXT,0,0))
.hint("Seek to marker B (start)")
.shortcut("}")
.g_type(G_MENUACTION)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(0)
.step(0)
.readable(0)
,
c_def()
.idx(C_IQ_SAVE_LOC)
.base(C_IQ_POS)
.name("Save to")
.title("Set save location")
.title_placement(c_def::grid_placement(PLACE_NONE,0))
.placement(c_def::grid_placement(PLACE_NEXT,0,0))
.hint("Set save location")
.g_type(G_MENUACTION)
.dock(D_IQTOOL)
.scope(S_GUI)
.v_type(V_BOOLEAN)
.def(0)
.min(0)
.max(0)
.step(0)
.readable(0)
,



c_def()
.idx(C_DXC_ADDRESS)
.name("DXC address")
Expand Down
Loading

0 comments on commit 6e477dd

Please sign in to comment.