提交 413a2447 编写于 作者: M manjaro-xfce

加入接收时钟回显功能

上级 84ae4029
......@@ -48,7 +48,7 @@ void DialogPannel::deal_message(QString message)
const QString source = QString::fromStdString(cmd["source"]).trimmed();
if (!m_handles.contains(source))
return;
if (!m_handles.contains(handle))
if (!m_handles[source].contains(handle))
return;
if (m_handles[source][handle])
m_handles[source][handle](value);
......
......@@ -223,6 +223,14 @@ int do_iio(const cmdlineParser & args)
fprintf(stderr, "Actual RX Bandwidth: %lf MHz...\n", rx_bw[ch] / 1e6);
fflush(stderr);
}//end for (int ch = 0; ch < rx_channel_count;++ch)
annouce_handle(
args.toString("instance","0"),
"0",
"rx_time",
"",
"rx_time",
"string"
);
}//end if (rx_on)
if (tx_on)
{
......@@ -436,6 +444,7 @@ int do_iio(const cmdlineParser & args)
std::function<void()> thread_stdout = [&]()->void
{
try{
unsigned int ct_br = 0;
//Read, RX
while (!stop_signal_called)
{
......@@ -444,6 +453,13 @@ int do_iio(const cmdlineParser & args)
QThread::msleep(1);
continue;
}
if (++ct_br % 1000==0)
set_handle(args.toString("instance","0"),
"0",
"rx_time",
QString("%1.%2")
.arg(buf_rx_list[stdout_pos % sz_buffer_rx].tmstmp.sec)
.arg(buf_rx_list[stdout_pos % sz_buffer_rx].tmstmp.frag).toStdString());
if (i_rx_tm)
{
TASKBUS::push_subject(
......
......@@ -429,6 +429,23 @@ namespace TASKBUS{
std::vector<unsigned char> v = map_to_ctrlpackage(mp);
push_subject(TB_SUBJECT_CMD,0,v.size(),v.data());
}
//播告功能
inline void set_handle(
const std::string & source,
const std::string & destin,
const std::string & handle,
const std::string & value
)
{
std::map<std::string, std::string> mp;
mp["source"] = source;
mp["function"] = "handle_set";
mp["destin"] = destin;
mp["handle"] = handle;
mp["value"] = value;
std::vector<unsigned char> v = map_to_ctrlpackage(mp);
push_subject(TB_SUBJECT_CMD,0,v.size(),v.data());
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册