Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
taskbus
提交
64d5d10c
taskbus
项目概览
colorEagleStdio
/
taskbus
通知
162
Star
11
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
taskbus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
64d5d10c
编写于
4月 25, 2022
作者:
M
manjaro-xfce
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
准备实现以模块实例ID为标记的消息系统。消息系统可以用于全局配置的交互,比如模块之间的互相控制。
上级
e5554b65
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
22 addition
and
21 deletion
+22
-21
modules/network/network_p2p/dialognetp2p.cpp
modules/network/network_p2p/dialognetp2p.cpp
+4
-4
modules/sources/source_files/main.cpp
modules/sources/source_files/main.cpp
+4
-4
modules/sources/source_plutosdr/iio.cpp
modules/sources/source_plutosdr/iio.cpp
+2
-2
modules/sources/source_soundcard/dialogsoundcard.cpp
modules/sources/source_soundcard/dialogsoundcard.cpp
+2
-2
taskbusplatform/core/tasknode.cpp
taskbusplatform/core/tasknode.cpp
+3
-3
taskbusplatform/core/taskproject.cpp
taskbusplatform/core/taskproject.cpp
+3
-3
tb_interface/tb_interface.h
tb_interface/tb_interface.h
+4
-3
未找到文件。
modules/network/network_p2p/dialognetp2p.cpp
浏览文件 @
64d5d10c
...
...
@@ -60,9 +60,9 @@ void DialogNetP2P::timerEvent(QTimerEvent * e)
{
fprintf
(
stderr
,
"Listening on port %d
\n
"
,
m_n_port
);
fflush
(
stderr
);
TASKBUS
::
push_subject
(
0xffffffff
,
0
,
TASKBUS
::
push_subject
(
TB_SUBJECT_CMD
,
0
,
QString
(
"source=%1;"
"destin=
all
;"
"destin=
0
;"
"function=listening;"
"hostaddr=%2;"
"port=%3;"
...
...
@@ -82,9 +82,9 @@ void DialogNetP2P::timerEvent(QTimerEvent * e)
}
static
int
cc
=
0
;
if
((
++
cc
)
%
10
==
0
)
TASKBUS
::
push_subject
(
0xffffffff
,
0
,
TASKBUS
::
push_subject
(
TB_SUBJECT_CMD
,
0
,
QString
(
"source=%1;"
"destin=
all
;"
"destin=
0
;"
"function=aloha;"
"class=network_p2p.taskbus;"
)
...
...
modules/sources/source_files/main.cpp
浏览文件 @
64d5d10c
...
...
@@ -200,9 +200,9 @@ int do_source(const cmdlineParser & args)
//保留最新的文件
const
int
keep_last
=
args
.
toInt
(
"keep_last"
,
1
);
//Broadcast sample rates
TASKBUS
::
push_subject
(
0xffffffff
,
0
,
TASKBUS
::
push_subject
(
TB_SUBJECT_CMD
,
0
,
QString
(
"source=%1;"
"destin=
all
;"
"destin=
0
;"
"function=sample_rate;"
"sample_rate=%2;"
"unit=1.0;"
...
...
@@ -327,9 +327,9 @@ int do_source(const cmdlineParser & args)
start
=
clock
();
finish
=
clock
();
total_frames
=
0
;
TASKBUS
::
push_subject
(
0xffffffff
,
0
,
TASKBUS
::
push_subject
(
TB_SUBJECT_CMD
,
0
,
QString
(
"source=%1;"
"destin=
all
;"
"destin=
0
;"
"function=aloha;"
"class=source_files.taskbus;"
)
...
...
modules/sources/source_plutosdr/iio.cpp
浏览文件 @
64d5d10c
...
...
@@ -168,9 +168,9 @@ int do_iio(const cmdlineParser & args)
const
double
sample_rate
=
args
.
toDouble
(
"sample_rate"
,
2.5
);
const
double
bw
=
args
.
toDouble
(
"bw"
,
2.5
);
const
double
rf
=
args
.
toDouble
(
"rf"
,
1800
);
TASKBUS
::
push_subject
(
0xffffffff
,
0
,
TASKBUS
::
push_subject
(
TB_SUBJECT_CMD
,
0
,
QString
(
"source=%1;"
"destin=
all
;"
"destin=
0
;"
"function=sample_rate;"
"unit=1000000;"
"sample_rate=%2;"
...
...
modules/sources/source_soundcard/dialogsoundcard.cpp
浏览文件 @
64d5d10c
...
...
@@ -136,9 +136,9 @@ void DialogSoundCard::CreateAudioInput()
QAudioDevice
inputDevice
(
infoIn
);
mpAudioInputSound
=
new
QAudioSource
(
inputDevice
,
mFormatSound
,
this
);
//Broadcast sample rates
TASKBUS
::
push_subject
(
0xffffffff
,
0
,
TASKBUS
::
push_subject
(
TB_SUBJECT_CMD
,
0
,
QString
(
"source=%1;"
"destin=
all
;"
"destin=
0
;"
"function=sample_rate;"
"sample_rate=%2;"
"unit=1;"
...
...
taskbusplatform/core/tasknode.cpp
浏览文件 @
64d5d10c
...
...
@@ -88,7 +88,7 @@ bool taskNode::cmd_stop(QObject * node)
if
(
m_process
->
state
()
!=
QProcess
::
Running
)
return
false
;
//发送信令,终止
char
cmd
[]
=
"function=quit;ret=0;source=
taskbus;destin=all
;class=taskbus;"
;
char
cmd
[]
=
"function=quit;ret=0;source=
0;destin=0
;class=taskbus;"
;
subject_package_header
header
;
header
.
prefix
[
0
]
=
0x3C
;
header
.
prefix
[
1
]
=
0x5A
;
...
...
@@ -203,7 +203,7 @@ void taskNode::slot_readyReadStandardOutput()
const
TASKBUS
::
subject_package_header
*
header_package
=
reinterpret_cast
<
const
TASKBUS
::
subject_package_header
*>
(
arr
.
constData
());
//Command
if
(
header_package
->
subject_id
==
0xffffffff
)
if
(
header_package
->
subject_id
==
TB_SUBJECT_CMD
)
{
//Command must endwith \0
const
char
*
pCmd
=
arr
.
constData
()
+
sizeof
(
TASKBUS
::
subject_package_header
);
...
...
@@ -398,7 +398,7 @@ bool taskNode::cmd_write(QObject * node,QByteArray arr)
bool
taskNode
::
cmd_sendcmd
(
QMap
<
QString
,
QVariant
>
cmd
,
QSet
<
QString
>
destins
)
{
if
(
destins
.
contains
(
m_uuid
)
==
false
&&
destins
.
contains
(
"
all
"
)
==
false
)
&&
destins
.
contains
(
"
0
"
)
==
false
)
return
false
;
if
(
cmd
.
contains
(
"source"
))
if
(
cmd
[
"source"
]
==
m_uuid
)
...
...
taskbusplatform/core/taskproject.cpp
浏览文件 @
64d5d10c
...
...
@@ -559,7 +559,7 @@ void taskProject::slot_new_package(QByteArrayList pkgs)
if
(
srcfuns
.
size
()
==
0
)
throw
"srcfuns.size() is 0"
;
//看看是否合法 See if it's legal.
if
(
header
->
subject_id
!=
0xffffffff
)
if
(
header
->
subject_id
!=
TB_SUBJECT_CMD
)
{
quint32
src_inst
=
mod
->
function_instance
(
srcfuns
.
first
());
//专题是否被登记为内部专题
...
...
@@ -661,7 +661,7 @@ void taskProject::slot_new_package(QByteArrayList pkgs)
* There are 3 reserved keywords:
* 1.source: ID of source module. ID is given by each module designer, UUID or
* full domain name is strongly recommanded.
* 2.destin: ID of destin modules. "
all
" means all modules. module names are seperated by ","
* 2.destin: ID of destin modules. "
0
" means all modules. module names are seperated by ","
* 3.function: function name.
*
* eg:
...
...
@@ -904,7 +904,7 @@ void taskProject::slot_outside_recieved(QByteArray pkg)
if
(
header
->
data_length
+
sizeof
(
TASKBUS
::
subject_package_header
)
!=
static_cast
<
size_t
>
(
pkg
.
size
()))
return
;
try
{
if
(
header
->
subject_id
!=
0xffffffff
)
if
(
header
->
subject_id
!=
TB_SUBJECT_CMD
)
{
//进行解析、转发 To parse, forward
if
(
m_iface_outside2inside_in
.
contains
(
header
->
subject_id
)
==
false
)
...
...
tb_interface/tb_interface.h
浏览文件 @
64d5d10c
...
...
@@ -18,6 +18,7 @@
//Comments:
//Next feature: Multithread-push protect.
namespace
TASKBUS
{
#define TB_SUBJECT_CMD 0xffffffffu
//数据专题包头结构体,1字节序对齐
//Datahead structure with pack = 1
#pragma pack(push,1)
...
...
@@ -37,7 +38,7 @@ namespace TASKBUS{
//是否为控制指令 Whether to be a control instruction or a normal subject
inline
bool
is_control_subject
(
const
subject_package_header
&
header
);
inline
bool
is_valid_header
(
const
subject_package_header
&
header
);
//返回控制信令专题
0xffffffff
//返回控制信令专题
TB_SUBJECT_CMD
inline
unsigned
int
control_subect_id
();
//用于方便连线模式的函数, line connect mod(subject) functions
inline
void
push_subject
(
...
...
@@ -210,7 +211,7 @@ namespace TASKBUS{
inline
bool
is_control_subject
(
const
subject_package_header
&
header
)
{
if
(
header
.
prefix
[
0
]
==
0x3C
&&
header
.
prefix
[
1
]
==
0x5A
&&
header
.
prefix
[
2
]
==
0x7E
&&
header
.
prefix
[
3
]
==
0x69
)
return
(
header
.
subject_id
==
0xffffffff
)
?
true
:
false
;
return
(
header
.
subject_id
==
TB_SUBJECT_CMD
)
?
true
:
false
;
return
false
;
}
//提取控制命令
...
...
@@ -239,7 +240,7 @@ namespace TASKBUS{
//返回控制信令专题
inline
unsigned
int
control_subect_id
()
{
return
0xffffffff
;
return
TB_SUBJECT_CMD
;
}
/** Debug the modile.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录