Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
taskbus
提交
c4292c28
taskbus
项目概览
colorEagleStdio
/
taskbus
通知
159
Star
11
Fork
3
代码
文件
提交
分支
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 搜索 >>
提交
c4292c28
编写于
2月 09, 2021
作者:
丁劲犇
😸
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Qt 6 兼容性修改(win)
上级
67aa313a
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
110 addition
and
77 deletion
+110
-77
modules/modules.pro
modules/modules.pro
+5
-2
modules/sinks/sink_plutosdr/main.cpp
modules/sinks/sink_plutosdr/main.cpp
+1
-0
modules/sources/source_plutosdr/main.cpp
modules/sources/source_plutosdr/main.cpp
+1
-0
modules/uhd/uhd_usrp_continous/uhd_continous.cpp
modules/uhd/uhd_usrp_continous/uhd_continous.cpp
+39
-38
taskbusplatform/core/process_prctl.cpp
taskbusplatform/core/process_prctl.cpp
+51
-24
taskbusplatform/core/taskcell.cpp
taskbusplatform/core/taskcell.cpp
+4
-4
taskbusplatform/gui/pdesignerview.cpp
taskbusplatform/gui/pdesignerview.cpp
+2
-2
taskbusplatform/gui/taskbusplatformfrm.cpp
taskbusplatform/gui/taskbusplatformfrm.cpp
+1
-1
taskbusplatform/gui/taskmodule.cpp
taskbusplatform/gui/taskmodule.cpp
+3
-3
taskbusplatform/watchdog/tbwatchdog.cpp
taskbusplatform/watchdog/tbwatchdog.cpp
+1
-1
taskbusplatform/watchdog/watchmemmodule.cpp
taskbusplatform/watchdog/watchmemmodule.cpp
+2
-2
未找到文件。
modules/modules.pro
浏览文件 @
c4292c28
...
...
@@ -2,12 +2,10 @@ TEMPLATE = subdirs
#
main
framework
project
SUBDIRS
+=
sources
/
source_plutosdr
\
sources
/
source_soundcard
\
transforms
/
transform_fft
\
transforms
/
mod_fm
\
sources
/
source_files
\
sinks
/
sink_file
\
sinks
/
sink_soundcard
\
sinks
/
sink_plutosdr
\
network
/
network_p2p
\
sinks
/
sink_SQL
\
...
...
@@ -19,3 +17,8 @@ qtHaveModule(charts){
SUBDIRS
+=
\
sinks
/
sink_plots
}
qtHaveModule
(
multimedia
){
SUBDIRS
+=
\
sinks
/
sink_soundcard
\
sources
/
source_soundcard
}
modules/sinks/sink_plutosdr/main.cpp
浏览文件 @
c4292c28
...
...
@@ -2,6 +2,7 @@
#include <QThread>
#include <QFile>
#include <QTextStream>
#include <QLocale>
#include "listen_thread.h"
#include "cmdlineparser.h"
#include "tb_interface.h"
...
...
modules/sources/source_plutosdr/main.cpp
浏览文件 @
c4292c28
...
...
@@ -2,6 +2,7 @@
#include <QThread>
#include <QFile>
#include <QTextStream>
#include <QLocale>
#include "listen_thread.h"
#include "cmdlineparser.h"
#include "tb_interface.h"
...
...
modules/uhd/uhd_usrp_continous/uhd_continous.cpp
浏览文件 @
c4292c28
/*
/*
* Copyright 2015 Ettus Research LLC
* Copyright 2018 Ettus Research, a National Instruments Company
*
...
...
@@ -13,6 +13,7 @@
#include "cmdlineparser.h"
#include "tb_interface.h"
#include <QFile>
#include <QLocale>
#ifdef Q_OS_LINUX
#include <unistd.h>
#endif
...
...
@@ -23,48 +24,48 @@ int do_iio(const cmdlineParser & args);
int
main
(
int
argc
,
char
*
argv
[])
{
QCoreApplication
a
(
argc
,
argv
);
init_client
();
QCoreApplication
a
(
argc
,
argv
);
init_client
();
#ifdef OFFLINEDEBUG
FILE
*
old_stdin
,
*
old_stdout
;
auto
ars
=
debug
(
"D:
\\
pid1008"
,
&
old_stdin
,
&
old_stdout
);
const
cmdlineParser
args
(
ars
);
FILE
*
old_stdin
,
*
old_stdout
;
auto
ars
=
debug
(
"D:
\\
pid1008"
,
&
old_stdin
,
&
old_stdout
);
const
cmdlineParser
args
(
ars
);
#else
const
cmdlineParser
args
(
argc
,
argv
);
const
cmdlineParser
args
(
argc
,
argv
);
#endif
int
ret
=
0
;
QTextStream
stmerr
(
stderr
);
//每个模块要响应 --information参数,打印自己的功能定义字符串。或者提供一个json文件。
if
(
args
.
contains
(
"information"
))
{
QFile
fp
(
":/uhd_usrp_continous."
+
QLocale
::
system
().
name
()
+
".json"
);
if
(
!
fp
.
open
(
QIODevice
::
ReadOnly
))
{
fp
.
setFileName
(
":/uhd_usrp_continous.json"
);
fp
.
open
(
QIODevice
::
ReadOnly
);
}
if
(
fp
.
isOpen
())
{
QByteArray
arr
=
fp
.
readAll
();
arr
.
push_back
(
'\0'
);
puts
(
arr
.
constData
());
fflush
(
stdout
);
}
ret
=
-
1
;
}
else
if
(
args
.
contains
(
"function"
))
//正常运行模式
{
int
ret
=
0
;
QTextStream
stmerr
(
stderr
);
//每个模块要响应 --information参数,打印自己的功能定义字符串。或者提供一个json文件。
if
(
args
.
contains
(
"information"
))
{
QFile
fp
(
":/uhd_usrp_continous."
+
QLocale
::
system
().
name
()
+
".json"
);
if
(
!
fp
.
open
(
QIODevice
::
ReadOnly
))
{
fp
.
setFileName
(
":/uhd_usrp_continous.json"
);
fp
.
open
(
QIODevice
::
ReadOnly
);
}
if
(
fp
.
isOpen
())
{
QByteArray
arr
=
fp
.
readAll
();
arr
.
push_back
(
'\0'
);
puts
(
arr
.
constData
());
fflush
(
stdout
);
}
ret
=
-
1
;
}
else
if
(
args
.
contains
(
"function"
))
//正常运行模式
{
fprintf
(
stderr
,
"Entering Loop...
\n
"
);
//用于接收消息的线程
ret
=
do_iio
(
args
);
}
else
{
stmerr
<<
"Error:Function does not exits.
\n
"
;
ret
=
-
1
;
}
return
ret
;
//用于接收消息的线程
ret
=
do_iio
(
args
);
}
else
{
stmerr
<<
"Error:Function does not exits.
\n
"
;
ret
=
-
1
;
}
return
ret
;
...
...
taskbusplatform/core/process_prctl.cpp
浏览文件 @
c4292c28
/*!
/*!
@author goldenhawking@163.com
@date 2017-02-11
*/
...
...
@@ -32,20 +32,27 @@ namespace TASKBUS {
void
set_proc_nice
(
QProcess
*
p
,
int
nice
)
{
#ifdef WIN32
Q_PID
id
=
p
->
pid
();
const
DWORD
dw_pn
[]
=
{
IDLE_PRIORITY_CLASS
,
BELOW_NORMAL_PRIORITY_CLASS
,
NORMAL_PRIORITY_CLASS
,
ABOVE_NORMAL_PRIORITY_CLASS
,
HIGH_PRIORITY_CLASS
,
REALTIME_PRIORITY_CLASS
};
if
(
nice
<
0
)
nice
=
0
;
if
(
nice
>
5
)
nice
=
5
;
SetPriorityClass
(
id
->
hProcess
,
dw_pn
[
nice
]);
#endif
#ifdef WIN32
qint64
id
=
p
->
processId
();
HANDLE
hProcess
=
OpenProcess
(
PROCESS_ALL_ACCESS
,
FALSE
,
id
);
if
(
hProcess
)
{
const
DWORD
dw_pn
[]
=
{
IDLE_PRIORITY_CLASS
,
BELOW_NORMAL_PRIORITY_CLASS
,
NORMAL_PRIORITY_CLASS
,
ABOVE_NORMAL_PRIORITY_CLASS
,
HIGH_PRIORITY_CLASS
,
REALTIME_PRIORITY_CLASS
};
if
(
nice
<
0
)
nice
=
0
;
if
(
nice
>
5
)
nice
=
5
;
SetPriorityClass
(
hProcess
,
dw_pn
[
nice
]);
CloseHandle
(
hProcess
);
}
#endif
#ifdef linux
Q_PID
id
=
p
->
pid
();
...
...
@@ -59,7 +66,7 @@ namespace TASKBUS {
void
set_proc_nice
(
int
nice
)
{
#ifdef WIN32
#ifdef WIN32
const
DWORD
dw_pn
[]
=
{
IDLE_PRIORITY_CLASS
,
BELOW_NORMAL_PRIORITY_CLASS
,
...
...
@@ -71,7 +78,7 @@ namespace TASKBUS {
if
(
nice
<
0
)
nice
=
0
;
if
(
nice
>
5
)
nice
=
5
;
SetPriorityClass
(
GetCurrentProcess
(),
dw_pn
[
nice
]);
#endif
#endif
#ifdef linux
Q_PID
id
=
getpid
();
...
...
@@ -96,7 +103,7 @@ namespace TASKBUS {
QString
l
=
s
.
readLine
();
while
(
l
.
size
()
&&
hit
<
2
)
{
QStringList
lst
=
l
.
split
(
":"
,
Q
String
::
SkipEmptyParts
);
QStringList
lst
=
l
.
split
(
":"
,
Q
t
::
SkipEmptyParts
);
if
(
lst
.
size
()
>=
2
)
{
QString
keystr
=
lst
.
first
().
trimmed
();
...
...
@@ -158,14 +165,34 @@ namespace TASKBUS {
}
else
if
(
p
)
{
GetModuleFileNameExA
((
HMODULE
)
p
,
0
,
ch_module
,
MAX_PATH
);
info
->
pid
=
GetProcessId
((
HMODULE
)
p
);
HANDLE
hProcess
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
|
PROCESS_VM_READ
,
FALSE
,
p
);
info
->
pid
=
0
;
if
(
hProcess
)
{
HMODULE
hMod
;
DWORD
cbNeeded
;
if
(
EnumProcessModules
(
hProcess
,
&
hMod
,
sizeof
(
hMod
),
&
cbNeeded
)
)
{
GetModuleFileNameExA
(
hProcess
,
hMod
,
ch_module
,
MAX_PATH
);
PROCESS_MEMORY_COUNTERS
pmc
;
GetProcessMemoryInfo
(
hProcess
,
&
pmc
,
sizeof
(
pmc
));
info
->
m_memsize
=
pmc
.
WorkingSetSize
;
}
info
->
pid
=
p
;
}
//printf( "%s (Process ID: %u)\n", szProcessName, processID );
CloseHandle
(
hProcess
);
if
(
info
->
pid
==
0
)
return
false
;
info
->
phandle
=
(
qint64
)
p
;
PROCESS_MEMORY_COUNTERS
pmc
;
GetProcessMemoryInfo
((
HMODULE
)
p
,
&
pmc
,
sizeof
(
pmc
));
info
->
m_memsize
=
pmc
.
WorkingSetSize
;
}
char
*
pt
=
ch_module
+
strlen
(
ch_module
)
-
1
;
while
(
pt
>
ch_module
)
...
...
@@ -192,7 +219,7 @@ namespace TASKBUS {
#endif
#ifdef WIN32
if
(
p
)
return
(
qint64
)
p
->
p
id
()
->
hProcess
;
return
(
qint64
)
p
->
p
rocessId
()
;
else
return
(
qint64
)
GetCurrentProcess
();
#endif
...
...
taskbusplatform/core/taskcell.cpp
浏览文件 @
c4292c28
...
...
@@ -312,7 +312,7 @@ QString taskCell::set_function_exec(const QString & func , const QString & execs
}
const
QString
taskCell
::
function_class
(
const
QString
&
func
)
const
{
QStringList
strV
=
func
.
split
(
QReg
Exp
(
"[:_]"
),
QString
::
SkipEmptyParts
);
QStringList
strV
=
func
.
split
(
QReg
ularExpression
(
"[:_]"
),
Qt
::
SkipEmptyParts
);
if
(
strV
.
size
()
>
1
)
{
strV
.
pop_back
();
...
...
@@ -713,7 +713,7 @@ QVariant taskCell::view_to_internal(const QVariant & vtdef
else
if
(
targetType
==
QVariant
::
List
)
{
QString
strVal
=
vtdef
.
toString
();
QStringList
lstv
=
strVal
.
split
(
","
,
Q
String
::
SkipEmptyParts
);
QStringList
lstv
=
strVal
.
split
(
","
,
Q
t
::
SkipEmptyParts
);
QVariantList
lsttag
;
foreach
(
QString
vii
,
lstv
)
{
...
...
@@ -739,7 +739,7 @@ QVariant taskCell::view_to_internal(const QVariant & vtdef
QString
taskCell
::
pureName
(
const
QVariant
&
v
)
{
QString
sv
=
v
.
toString
();
QStringList
ls
=
sv
.
split
(
QReg
Exp
(
"[:_]"
),
QString
::
SkipEmptyParts
);
QStringList
ls
=
sv
.
split
(
QReg
ularExpression
(
"[:_]"
),
Qt
::
SkipEmptyParts
);
if
(
ls
.
size
())
return
ls
.
last
();
return
QString
(
""
);
...
...
@@ -758,7 +758,7 @@ QString taskCell::pureName(const QVariant & v)
QString
taskCell
::
className
(
const
QVariant
&
v
)
{
QString
sv
=
v
.
toString
();
QStringList
ls
=
sv
.
split
(
QReg
Exp
(
"[:_]"
),
QString
::
SkipEmptyParts
);
QStringList
ls
=
sv
.
split
(
QReg
ularExpression
(
"[:_]"
),
Qt
::
SkipEmptyParts
);
QString
res
;
while
(
ls
.
size
()
>
1
)
{
...
...
taskbusplatform/gui/pdesignerview.cpp
浏览文件 @
c4292c28
...
...
@@ -369,8 +369,8 @@ void PDesignerView::update_paths()
const
QList
<
unsigned
int
>
srcs
=
m_project
->
idx_in2instances
().
keys
();
const
QList
<
unsigned
int
>
dsts
=
m_project
->
idx_out2instances
().
keys
();
const
QSet
<
unsigned
int
>
setin
=
QSet
<
unsigned
int
>
::
fromList
(
srcs
);
const
QSet
<
unsigned
int
>
setout
=
QSet
<
unsigned
int
>
::
fromList
(
dsts
);
const
QSet
<
unsigned
int
>
setin
=
QSet
<
unsigned
int
>
(
srcs
.
begin
(),
srcs
.
end
()
);
const
QSet
<
unsigned
int
>
setout
=
QSet
<
unsigned
int
>
(
dsts
.
begin
(),
dsts
.
end
()
);
QEasingCurve
cuve
(
QEasingCurve
::
InOutCubic
);
...
...
taskbusplatform/gui/taskbusplatformfrm.cpp
浏览文件 @
c4292c28
...
...
@@ -91,7 +91,7 @@ void taskBusPlatformFrm::timerEvent(QTimerEvent *event)
if
(
m_nTmid
==
event
->
timerId
())
{
extern
QAtomicInt
g_totalrev
,
g_totalsent
;
QString
s
=
QString
().
sprintf
(
"down %.2lf Mbps, up %.2lf Mbps"
,
QString
s
=
QString
().
a
sprintf
(
"down %.2lf Mbps, up %.2lf Mbps"
,
g_totalrev
*
8.0
/
1024
/
1024
,
g_totalsent
*
8.0
/
1024
/
1024
);
...
...
taskbusplatform/gui/taskmodule.cpp
浏览文件 @
c4292c28
...
...
@@ -5,7 +5,7 @@
#include <QMimeData>
#include <QBrush>
#include <QDataStream>
#include <QIODevice>
QSet
<
int
>
taskModule
::
m_pinInsValues
;
taskModule
::
taskModule
(
QObject
*
parent
)
...
...
@@ -449,7 +449,7 @@ int taskModule::draw_direction(const QString & func, bool bInput, int n) const
strMasks
=
mp
[
"IND"
].
toString
();
else
strMasks
=
mp
[
"OUTD"
].
toString
();
QStringList
lstMasks
=
strMasks
.
split
(
","
,
Q
String
::
SkipEmptyParts
);
QStringList
lstMasks
=
strMasks
.
split
(
","
,
Q
t
::
SkipEmptyParts
);
if
(
lstMasks
.
size
()
<=
n
)
return
bInput
==
true
?-
(
n
+
1
)
:
(
n
+
1
);
QString
nn
=
lstMasks
.
at
(
n
);
...
...
@@ -488,7 +488,7 @@ void taskModule::set_draw_direction(const QString & func, bool bInput, int n, in
strMasks
=
mp
[
"IND"
].
toString
();
else
strMasks
=
mp
[
"OUTD"
].
toString
();
QStringList
lstMasks
=
strMasks
.
split
(
","
,
Q
String
::
SkipEmptyParts
);
QStringList
lstMasks
=
strMasks
.
split
(
","
,
Q
t
::
SkipEmptyParts
);
QString
strVal
;
const
int
sz
=
lstMasks
.
size
();
QString
nstr
=
QString
(
"%1"
).
arg
(
direction
);
...
...
taskbusplatform/watchdog/tbwatchdog.cpp
浏览文件 @
c4292c28
#include "tbwatchdog.h"
#
include
"tbwatchdog.h"
#include <QDebug>
#include <QTimerEvent>
#include <QVector>
...
...
taskbusplatform/watchdog/watchmemmodule.cpp
浏览文件 @
c4292c28
#include "watchmemmodule.h"
#
include
"watchmemmodule.h"
#include <QDebug>
WatchMemModule
::
WatchMemModule
(
QObject
*
parent
)
:
QAbstractTableModel
(
parent
)
{
...
...
@@ -35,7 +35,7 @@ QVariant WatchMemModule::headerData(int section, Qt::Orientation orientation, in
else
if
(
orientation
==
Qt
::
Vertical
)
{
QString
strV
;
strV
.
sprintf
(
"%d"
,
section
);
strV
.
a
sprintf
(
"%d"
,
section
);
return
strV
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录