提交 767ce4ff 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

添加一个发射水位标志,以便随时为发射逻辑准备足够的数据

上级 1c78ac19
......@@ -96,6 +96,7 @@ int do_iio(const cmdlineParser & args)
const quint32 instance = args.toUInt("instance",0);
const quint32 i_wav_rx[2] = {args.toUInt("wav_rx0",0),args.toUInt("wav_rx1",0)};
const quint32 i_wav_tx[2] = {args.toUInt("wav_tx0",0),args.toUInt("wav_tx1",0)};
const quint32 i_txWaterMark = args.toInt("tx_mark",0);
//设备句柄
uhd_usrp_handle usrp = nullptr;
uhd_rx_streamer_handle rx_streamer = nullptr;
......@@ -509,6 +510,22 @@ int do_iio(const cmdlineParser & args)
(const void **)tx_buff_ptr.data(),
tx_sps_buff, &tx_meta,0.1, &num_sps_sent));
tx_pos += num_sps_sent;
if (i_txWaterMark>0)
{
qint64 watM = stdin_pos[0] - tx_pos;
if (tx_channel_count>1)
{
qint64 wat2 = stdin_pos[1] - tx_pos;
if (wat2 < watM)
watM = wat2;
}
TASKBUS::push_subject(
i_txWaterMark,
instance,
sizeof(qint64),
(unsigned char *) &watM);
}
}
}
}
......
{
"uhd_usrp_continous": {
"name": "uhd_cio",
"parameters": {
"dev_args": {
"type": "string",
"tooltip": "Additional Device Start Args.",
"default": ""
},
"rx_rate": {
"type": "int",
"tooltip": "RX rate(MHz)",
"default": 1.0
},
"rx_on": {
"type": "int",
"tooltip": "RX is ON",
"default": "0,0"
},
"rx_frame": {
"type": "int",
"tooltip": "RX frame for stdout in sample points",
"default": 10000,
"range": "200-10000"
},
"rx_rf": {
"type": "double",
"tooltip": "RX Freq(MHz)",
"default": "1000.0,1100.0",
"range": "0-6000"
},
"rx_gain": {
"type": "double",
"tooltip": "RX Gain(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"rx_agc": {
"type": "int",
"tooltip": "RX AGC Switch",
"default": "0,0",
"range": "0=off,1=on"
},
"rx_bw": {
"type": "double",
"tooltip": "RX bandwidth(MHz)",
"default": "1.0,1.0"
},
"rx_atn": {
"type": "string",
"tooltip": "RX antenna",
"default": "RX2,RX2",
"range": "TX/RX,RX2"
},
"name": "uhd_cio",
"parameters": {
"dev_args": {
"type": "string",
"tooltip": "Additional Device Start Args.",
"default": ""
},
"rx_rate": {
"type": "int",
"tooltip": "RX rate(MHz)",
"default": 1.0
},
"rx_on": {
"type": "int",
"tooltip": "RX is ON",
"default": "0,0"
},
"rx_frame": {
"type": "int",
"tooltip": "RX frame for stdout in sample points",
"default": 10000,
"range": "200-10000"
},
"rx_rf": {
"type": "double",
"tooltip": "RX Freq(MHz)",
"default": "1000.0,1100.0",
"range": "0-6000"
},
"rx_gain": {
"type": "double",
"tooltip": "RX Gain(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"rx_agc": {
"type": "int",
"tooltip": "RX AGC Switch",
"default": "0,0",
"range": "0=off,1=on"
},
"rx_bw": {
"type": "double",
"tooltip": "RX bandwidth(MHz)",
"default": "1.0,1.0"
},
"rx_atn": {
"type": "string",
"tooltip": "RX antenna",
"default": "RX2,RX2",
"range": "TX/RX,RX2"
},
"rx_channels": {
"type": "int",
"tooltip": "RX channels",
"default": "0,1",
"range": "0,1"
},
"tx_on": {
"type": "int",
"tooltip": "TX is ON",
"default": "0"
},
"tx_rate": {
"type": "int",
"tooltip": "TX rate(MHz)",
"default": 1.0
},
"tx_frame": {
"type": "int",
"tooltip": "TX frame for stdout in sample points",
"default": "10000",
"range": "200-10000"
},
"tx_rf": {
"type": "double",
"tooltip": "TX freq(MHz)",
"default": "2000.0,2000.0"
},
"tx_gain": {
"type": "double",
"tooltip": "TX Gain(dB)",
"default": "0.0,0.0",
"range": "0-100"
},
"tx_bw": {
"type": "double",
"tooltip": "TX bandwidth(MHz)",
"default": "1.0,1.0"
},
"tx_atn": {
"type": "string",
"tooltip": "TX antenna",
"default": "TX/RX,TX/RX"
},
"tx_channels": {
"type": "int",
"tooltip": "TX channels",
"default": "0,1"
}
},
"input_subjects": {
"wav_tx0": {
"type": "short[2]",
"tooltip": "TX0IQ"
},
"wav_tx1": {
"type": "short[2]",
"tooltip": "TX1IQ"
}
},
"output_subjects": {
"wav_rx0": {
"type": "short[2]",
"tooltip": "RX0IQ"
},
"wav_rx1": {
"type": "short[2]",
"tooltip": "RX1IQ"
}
}
"rx_channels": {
"type": "int",
"tooltip": "RX channels",
"default": "0,1",
"range": "0,1"
},
"tx_on": {
"type": "int",
"tooltip": "TX is ON",
"default": "0"
},
"tx_rate": {
"type": "int",
"tooltip": "TX rate(MHz)",
"default": 1.0
},
"tx_frame": {
"type": "int",
"tooltip": "TX frame for stdout in sample points",
"default": "10000",
"range": "200-10000"
},
"tx_rf": {
"type": "double",
"tooltip": "TX freq(MHz)",
"default": "2000.0,2000.0"
},
"tx_gain": {
"type": "double",
"tooltip": "TX Gain(dB)",
"default": "0.0,0.0",
"range": "0-100"
},
"tx_bw": {
"type": "double",
"tooltip": "TX bandwidth(MHz)",
"default": "1.0,1.0"
},
"tx_atn": {
"type": "string",
"tooltip": "TX antenna",
"default": "TX/RX,TX/RX"
},
"tx_channels": {
"type": "int",
"tooltip": "TX channels",
"default": "0,1"
}
},
"input_subjects": {
"wav_tx0": {
"type": "short[2]",
"tooltip": "TX0IQ"
},
"wav_tx1": {
"type": "short[2]",
"tooltip": "TX1IQ"
}
},
"output_subjects": {
"wav_rx0": {
"type": "short[2]",
"tooltip": "RX0IQ"
},
"wav_rx1": {
"type": "short[2]",
"tooltip": "RX1IQ"
},
"tx_mark": {
"type": "int64",
"tooltip": "TXWaterMark"
}
}
}
}
{
"uhd_usrp_continous": {
"name": "UHD_连续收发",
"parameters": {
"dev_args": {
"type": "string",
"tooltip": "设备初始化参数.",
"default": ""
},
"rx_rate": {
"type": "int",
"tooltip": "RX采样率(MHz)",
"default": 1.0
},
"rx_on": {
"type": "int",
"tooltip": "接收开关",
"default": "0"
},
"rx_frame": {
"type": "int",
"tooltip": "接收接口单次样点数",
"default": "10000",
"range": "200-10000"
},
"rx_rf": {
"type": "double",
"tooltip": "接收频率(MHz)",
"default": "99.0,101.1",
"range": "0-6000"
},
"rx_gain": {
"type": "double",
"tooltip": "接收增益(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"rx_agc": {
"type": "int",
"tooltip": "接收AGC开关",
"default": "0,0",
"range": "0=off,1=on"
},
"rx_bw": {
"type": "double",
"tooltip": "接收滤波器带宽(MHz)",
"default": "1.0,1.0"
},
"rx_atn": {
"type": "string",
"tooltip": "接收天线名称",
"default": "RX2,RX2",
"range": "TX/RX,RX2"
},
"rx_channels": {
"type": "int",
"tooltip": "接收各个通道号",
"default": "0,1",
"range": "0,1"
},
"tx_rate": {
"type": "int",
"tooltip": "TX采样率(MHz)",
"default": 1.0
},
"tx_on": {
"type": "int",
"tooltip": "发射开关",
"default": 0
},
"tx_frame": {
"type": "int",
"tooltip": "发射接口单次样点数",
"default": "10000",
"range": "200-10000"
},
"tx_rf": {
"type": "double",
"tooltip": "发射频率(MHz)",
"default": "200.0,203.0",
"range": "0-6000"
},
"tx_gain": {
"type": "double",
"tooltip": "发射增益(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"tx_bw": {
"type": "double",
"tooltip": "发射滤波器带宽(MHz)",
"default": "1.0,1.0"
},
"tx_atn": {
"type": "string",
"tooltip": "发射天线名称",
"default": "TX/RX,TX/RX"
},
"name": "UHD_连续收发",
"parameters": {
"dev_args": {
"type": "string",
"tooltip": "设备初始化参数.",
"default": ""
},
"rx_rate": {
"type": "int",
"tooltip": "RX采样率(MHz)",
"default": 1.0
},
"rx_on": {
"type": "int",
"tooltip": "接收开关",
"default": "0"
},
"rx_frame": {
"type": "int",
"tooltip": "接收接口单次样点数",
"default": "10000",
"range": "200-10000"
},
"rx_rf": {
"type": "double",
"tooltip": "接收频率(MHz)",
"default": "99.0,101.1",
"range": "0-6000"
},
"rx_gain": {
"type": "double",
"tooltip": "接收增益(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"rx_agc": {
"type": "int",
"tooltip": "接收AGC开关",
"default": "0,0",
"range": "0=off,1=on"
},
"rx_bw": {
"type": "double",
"tooltip": "接收滤波器带宽(MHz)",
"default": "1.0,1.0"
},
"rx_atn": {
"type": "string",
"tooltip": "接收天线名称",
"default": "RX2,RX2",
"range": "TX/RX,RX2"
},
"rx_channels": {
"type": "int",
"tooltip": "接收各个通道号",
"default": "0,1",
"range": "0,1"
},
"tx_rate": {
"type": "int",
"tooltip": "TX采样率(MHz)",
"default": 1.0
},
"tx_on": {
"type": "int",
"tooltip": "发射开关",
"default": 0
},
"tx_frame": {
"type": "int",
"tooltip": "发射接口单次样点数",
"default": "10000",
"range": "200-10000"
},
"tx_rf": {
"type": "double",
"tooltip": "发射频率(MHz)",
"default": "200.0,203.0",
"range": "0-6000"
},
"tx_gain": {
"type": "double",
"tooltip": "发射增益(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"tx_bw": {
"type": "double",
"tooltip": "发射滤波器带宽(MHz)",
"default": "1.0,1.0"
},
"tx_atn": {
"type": "string",
"tooltip": "发射天线名称",
"default": "TX/RX,TX/RX"
},
"tx_channels": {
"type": "int",
"tooltip": "发射各个通道",
"default": "0,1"
}
},
"input_subjects": {
"wav_tx0": {
"type": "short[2]",
"tooltip": "TX0"
},
"wav_tx1": {
"type": "short[2]",
"tooltip": "TX1"
}
},
"output_subjects": {
"wav_rx0": {
"type": "short[2]",
"tooltip": "RX0"
},
"wav_rx1": {
"type": "short[2]",
"tooltip": "RX1"
}
}
"tx_channels": {
"type": "int",
"tooltip": "发射各个通道",
"default": "0,1"
}
},
"input_subjects": {
"wav_tx0": {
"type": "short[2]",
"tooltip": "TX0"
},
"wav_tx1": {
"type": "short[2]",
"tooltip": "TX1"
}
},
"output_subjects": {
"wav_rx0": {
"type": "short[2]",
"tooltip": "RX0"
},
"wav_rx1": {
"type": "short[2]",
"tooltip": "RX1"
},
"tx_mark": {
"type": "int64",
"tooltip": "TXWaterMark"
}
}
}
}
......@@ -137,6 +137,7 @@ int do_iio(const cmdlineParser & args)
const quint32 i_wav_tx[2] = {args.toUInt("wav_tx0",0),args.toUInt("wav_tx1",0)};
const quint32 i_rx_tm = args.toInt("rx_time",0);
const quint32 i_tx_tm = args.toInt("tx_time",0);
const quint32 i_txWaterMark = args.toInt("tx_mark",0);
//设备句柄
uhd_usrp_handle usrp = nullptr;
uhd_rx_streamer_handle rx_streamer = nullptr;
......@@ -632,6 +633,22 @@ int do_iio(const cmdlineParser & args)
//tx_meta->tx_metadata_ctmstmppp.start_of_burst = false;
for(int ch = 0;ch<tx_channel_count;++ch)
tx_pos[ch] += num_sps_sent;
if (i_txWaterMark>0)
{
qint64 watM = stdin_pos[0] - tx_pos[0];
if (tx_channel_count>1)
{
qint64 wat2 = stdin_pos[1] - tx_pos[1];
if (wat2 < watM)
watM = wat2;
}
TASKBUS::push_subject(
i_txWaterMark,
instance,
sizeof(qint64),
(unsigned char *) &watM);
}
}
//Burst
else
......
......@@ -3,120 +3,124 @@
"name": "uhd_usrp_io",
"parameters": {
"dev_args": {
"type": "string",
"tooltip": "Additional Device Start Args.",
"default": ""
"type": "string",
"tooltip": "Additional Device Start Args.",
"default": ""
},
"rx_rate": {
"type": "int",
"tooltip": "RX rate(MHz)",
"default": 1.0
"type": "int",
"tooltip": "RX rate(MHz)",
"default": 1.0
},
"rx_on": {
"type": "int",
"tooltip": "RX is ON",
"default": "0,0"
"type": "int",
"tooltip": "RX is ON",
"default": "0,0"
},
"rx_rf": {
"type": "double",
"tooltip": "RX Freq(MHz)",
"default": "1000.0,1100.0",
"range": "0-6000"
"type": "double",
"tooltip": "RX Freq(MHz)",
"default": "1000.0,1100.0",
"range": "0-6000"
},
"rx_gain": {
"type": "double",
"tooltip": "RX Gain(dB)",
"default": "30.0,30.0",
"range": "0-100"
"type": "double",
"tooltip": "RX Gain(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"rx_agc": {
"type": "int",
"tooltip": "RX AGC Switch",
"default": "0,0",
"range": "0=off,1=on"
"type": "int",
"tooltip": "RX AGC Switch",
"default": "0,0",
"range": "0=off,1=on"
},
"rx_bw": {
"type": "double",
"tooltip": "RX bandwidth(MHz)",
"default": "1.0,1.0"
"type": "double",
"tooltip": "RX bandwidth(MHz)",
"default": "1.0,1.0"
},
"rx_atn": {
"type": "string",
"tooltip": "RX antenna",
"default": "RX2,RX2",
"range": "TX/RX,RX2"
"type": "string",
"tooltip": "RX antenna",
"default": "RX2,RX2",
"range": "TX/RX,RX2"
},
"rx_channels": {
"type": "int",
"tooltip": "RX channels",
"default": "0,1",
"range": "0,1"
"type": "int",
"tooltip": "RX channels",
"default": "0,1",
"range": "0,1"
},
"tx_on": {
"type": "int",
"tooltip": "TX is ON",
"default": "0"
"type": "int",
"tooltip": "TX is ON",
"default": "0"
},
"tx_rate": {
"type": "int",
"tooltip": "TX rate(MHz)",
"default": 1.0
"type": "int",
"tooltip": "TX rate(MHz)",
"default": 1.0
},
"tx_rf": {
"type": "double",
"tooltip": "TX freq(MHz)",
"default": "2000.0,2000.0"
"type": "double",
"tooltip": "TX freq(MHz)",
"default": "2000.0,2000.0"
},
"tx_gain": {
"type": "double",
"tooltip": "TX Gain(dB)",
"default": "0.0,0.0",
"range": "0-100"
"type": "double",
"tooltip": "TX Gain(dB)",
"default": "0.0,0.0",
"range": "0-100"
},
"tx_bw": {
"type": "double",
"tooltip": "TX bandwidth(MHz)",
"default": "1.0,1.0"
"type": "double",
"tooltip": "TX bandwidth(MHz)",
"default": "1.0,1.0"
},
"tx_atn": {
"type": "string",
"tooltip": "TX antenna",
"default": "TX/RX,TX/RX"
"type": "string",
"tooltip": "TX antenna",
"default": "TX/RX,TX/RX"
},
"tx_channels": {
"type": "int",
"tooltip": "TX channels",
"default": "0,1"
"type": "int",
"tooltip": "TX channels",
"default": "0,1"
}
},
"input_subjects": {
"tx_time": {
"type": "uint64+double",
"type": "uint64+double",
"tooltip": "tx_time"
},
"wav_tx0": {
"type": "short[2]",
"tooltip": "TX0IQ"
"type": "short[2]",
"tooltip": "TX0IQ"
},
"wav_tx1": {
"type": "short[2]",
"tooltip": "TX1IQ"
"type": "short[2]",
"tooltip": "TX1IQ"
}
},
"output_subjects": {
"rx_time": {
"type": "uint64+double",
"type": "uint64+double",
"tooltip": "rx_time"
},
"wav_rx0": {
"type": "short[2]",
"tooltip": "RX0IQ"
"type": "short[2]",
"tooltip": "RX0IQ"
},
"wav_rx1": {
"type": "short[2]",
"tooltip": "RX1IQ"
"type": "short[2]",
"tooltip": "RX1IQ"
},
"tx_mark": {
"type": "int64",
"tooltip": "TXWaterMark"
}
}
}
......
{
"uhd_usrp_io": {
"name": "UHD收发",
"parameters": {
"dev_args": {
"type": "string",
"tooltip": "设备初始化参数.",
"default": ""
},
"rx_rate": {
"type": "int",
"tooltip": "RX采样率(MHz)",
"default": 1.0
},
"rx_on": {
"type": "int",
"tooltip": "接收开关",
"default": "0"
},
"rx_rf": {
"type": "double",
"tooltip": "接收频率(MHz)",
"default": "99.0,101.1",
"range": "0-6000"
},
"rx_gain": {
"type": "double",
"tooltip": "接收增益(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"rx_agc": {
"type": "int",
"tooltip": "接收AGC开关",
"default": "0,0",
"range": "0=off,1=on"
},
"rx_bw": {
"type": "double",
"tooltip": "接收滤波器带宽(MHz)",
"default": "1.0,1.0"
},
"rx_atn": {
"type": "string",
"tooltip": "接收天线名称",
"default": "RX2,RX2",
"range": "TX/RX,RX2"
},
"rx_channels": {
"type": "int",
"tooltip": "接收各个通道号",
"default": "0,1",
"range": "0,1"
},
"tx_rate": {
"type": "int",
"tooltip": "TX采样率(MHz)",
"default": 1.0
},
"tx_on": {
"type": "int",
"tooltip": "发射开关",
"default": 0
},
"tx_rf": {
"type": "double",
"tooltip": "发射频率(MHz)",
"default": "200.0,203.0",
"range": "0-6000"
},
"tx_gain": {
"type": "double",
"tooltip": "发射增益(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"tx_bw": {
"type": "double",
"tooltip": "发射滤波器带宽(MHz)",
"default": "1.0,1.0"
},
"tx_atn": {
"type": "string",
"tooltip": "发射天线名称",
"default": "TX/RX,TX/RX"
},
"name": "UHD收发",
"parameters": {
"dev_args": {
"type": "string",
"tooltip": "设备初始化参数.",
"default": ""
},
"rx_rate": {
"type": "int",
"tooltip": "RX采样率(MHz)",
"default": 1.0
},
"rx_on": {
"type": "int",
"tooltip": "接收开关",
"default": "0"
},
"rx_rf": {
"type": "double",
"tooltip": "接收频率(MHz)",
"default": "99.0,101.1",
"range": "0-6000"
},
"rx_gain": {
"type": "double",
"tooltip": "接收增益(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"rx_agc": {
"type": "int",
"tooltip": "接收AGC开关",
"default": "0,0",
"range": "0=off,1=on"
},
"rx_bw": {
"type": "double",
"tooltip": "接收滤波器带宽(MHz)",
"default": "1.0,1.0"
},
"rx_atn": {
"type": "string",
"tooltip": "接收天线名称",
"default": "RX2,RX2",
"range": "TX/RX,RX2"
},
"rx_channels": {
"type": "int",
"tooltip": "接收各个通道号",
"default": "0,1",
"range": "0,1"
},
"tx_rate": {
"type": "int",
"tooltip": "TX采样率(MHz)",
"default": 1.0
},
"tx_on": {
"type": "int",
"tooltip": "发射开关",
"default": 0
},
"tx_rf": {
"type": "double",
"tooltip": "发射频率(MHz)",
"default": "200.0,203.0",
"range": "0-6000"
},
"tx_gain": {
"type": "double",
"tooltip": "发射增益(dB)",
"default": "30.0,30.0",
"range": "0-100"
},
"tx_bw": {
"type": "double",
"tooltip": "发射滤波器带宽(MHz)",
"default": "1.0,1.0"
},
"tx_atn": {
"type": "string",
"tooltip": "发射天线名称",
"default": "TX/RX,TX/RX"
},
"tx_channels": {
"type": "int",
"tooltip": "发射各个通道",
"default": "0,1"
}
},
"input_subjects": {
"tx_time": {
"type": "uint64+double",
"tx_channels": {
"type": "int",
"tooltip": "发射各个通道",
"default": "0,1"
}
},
"input_subjects": {
"tx_time": {
"type": "uint64+double",
"tooltip": "tx_time"
},
"wav_tx0": {
"type": "short[2]",
"tooltip": "TX0"
},
"wav_tx1": {
"type": "short[2]",
"tooltip": "TX1"
}
},
"output_subjects": {
"rx_time": {
"type": "uint64+double",
},
"wav_tx0": {
"type": "short[2]",
"tooltip": "TX0"
},
"wav_tx1": {
"type": "short[2]",
"tooltip": "TX1"
}
},
"output_subjects": {
"rx_time": {
"type": "uint64+double",
"tooltip": "rx_time"
},
"wav_rx0": {
"type": "short[2]",
"tooltip": "RX0"
},
"wav_rx1": {
"type": "short[2]",
"tooltip": "RX1"
}
}
},
"wav_rx0": {
"type": "short[2]",
"tooltip": "RX0"
},
"wav_rx1": {
"type": "short[2]",
"tooltip": "RX1"
},
"tx_mark": {
"type": "int64",
"tooltip": "TXWaterMark"
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册