Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
zoompipeline
提交
a7081fbb
zoompipeline
项目概览
colorEagleStdio
/
zoompipeline
通知
181
Star
12
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
zoompipeline
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a7081fbb
编写于
1月 28, 2014
作者:
丁劲犇
😸
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add threshold for heart-beating .
Add national-ts files.
上级
53fcb696
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
756 addition
and
5 deletion
+756
-5
ZoomPipeline_FuncSvr/ZoomPipeline_FuncSvr.pro
ZoomPipeline_FuncSvr/ZoomPipeline_FuncSvr.pro
+3
-0
ZoomPipeline_FuncSvr/ZoomPipeline_FuncSvr_zh_cn.ts
ZoomPipeline_FuncSvr/ZoomPipeline_FuncSvr_zh_cn.ts
+535
-0
ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp
ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp
+1
-0
ZoomPipeline_FuncSvr/smartlink/st_client_table.h
ZoomPipeline_FuncSvr/smartlink/st_client_table.h
+27
-0
ZoomPipeline_FuncSvr/smartlink/st_clientnode.cpp
ZoomPipeline_FuncSvr/smartlink/st_clientnode.cpp
+1
-1
ZoomPipeline_FuncSvr/zpmainframe.cpp
ZoomPipeline_FuncSvr/zpmainframe.cpp
+52
-2
ZoomPipeline_FuncSvr/zpmainframe.ui
ZoomPipeline_FuncSvr/zpmainframe.ui
+137
-2
未找到文件。
ZoomPipeline_FuncSvr/ZoomPipeline_FuncSvr.pro
浏览文件 @
a7081fbb
...
...
@@ -42,3 +42,6 @@ FORMS += zpmainframe.ui
RESOURCES
+=
\
resource
.
qrc
OTHER_FILES
+=
\
ZoomPipeline_FuncSvr_zh_cn
.
ts
ZoomPipeline_FuncSvr/ZoomPipeline_FuncSvr_zh_cn.ts
0 → 100644
浏览文件 @
a7081fbb
此差异已折叠。
点击以展开。
ZoomPipeline_FuncSvr/smartlink/st_client_table.cpp
浏览文件 @
a7081fbb
...
...
@@ -8,6 +8,7 @@ st_client_table::st_client_table(ZPNetwork::zp_net_ThreadPool * pool, ZPTaskEngi
,
m_pThreadPool
(
pool
)
,
m_pTaskEngine
(
taskeng
)
{
m_nHeartBeatingDeadThrd
=
180
;
connect
(
m_pThreadPool
,
&
ZPNetwork
::
zp_net_ThreadPool
::
evt_NewClientConnected
,
this
,
&
st_client_table
::
on_evt_NewClientConnected
,
Qt
::
QueuedConnection
);
connect
(
m_pThreadPool
,
&
ZPNetwork
::
zp_net_ThreadPool
::
evt_ClientDisconnected
,
this
,
&
st_client_table
::
on_evt_ClientDisconnected
,
Qt
::
QueuedConnection
);
connect
(
m_pThreadPool
,
&
ZPNetwork
::
zp_net_ThreadPool
::
evt_Data_recieved
,
this
,
&
st_client_table
::
on_evt_Data_recieved
,
Qt
::
QueuedConnection
);
...
...
ZoomPipeline_FuncSvr/smartlink/st_client_table.h
浏览文件 @
a7081fbb
...
...
@@ -20,14 +20,41 @@ public:
bool
regisitClientUUID
(
st_clientNode
*
);
st_clientNode
*
clientNodeFromUUID
(
quint32
);
st_clientNode
*
clientNodeFromSocket
(
QObject
*
);
//Heart beating and healthy
void
KickDealClients
();
int
heartBeatingThrd
(){
return
m_nHeartBeatingDeadThrd
;}
void
setHeartBeatingThrd
(
int
h
)
{
m_nHeartBeatingDeadThrd
=
h
;}
//Database and disk resources
QString
Database_UserAcct
(){
return
m_strDBName_useraccount
;}
void
setDatabase_UserAcct
(
const
QString
&
s
){
m_strDBName_useraccount
=
s
;}
QString
Database_Event
(){
return
m_strDBName_event
;}
void
setDatabase_Event
(
const
QString
&
s
){
m_strDBName_event
=
s
;}
QString
largeFileFolder
(){
return
m_largeFileFolder
;}
void
setLargeFileFolder
(
const
QString
&
s
){
m_largeFileFolder
=
s
;}
protected:
//This list hold dead nodes that still in task queue,avoiding crash
QList
<
st_clientNode
*>
m_nodeToBeDel
;
//Very important hashes. will be improved for cross-server transfer
QMutex
m_hash_mutex
;
QMap
<
quint32
,
st_clientNode
*>
m_hash_uuid2node
;
QMap
<
QObject
*
,
st_clientNode
*>
m_hash_sock2node
;
//Concurrent Network frame work
ZPNetwork
::
zp_net_ThreadPool
*
m_pThreadPool
;
//The piple-line
ZPTaskEngine
::
zp_pipeline
*
m_pTaskEngine
;
//The max seconds before dead client be kicked out
int
m_nHeartBeatingDeadThrd
;
//Database Resource Names used by nodes
QString
m_strDBName_useraccount
;
QString
m_strDBName_event
;
QString
m_largeFileFolder
;
signals:
void
evt_Message
(
const
QString
&
);
...
...
ZoomPipeline_FuncSvr/smartlink/st_clientnode.cpp
浏览文件 @
a7081fbb
...
...
@@ -270,7 +270,7 @@ void st_clientNode::CheckHeartBeating()
{
QDateTime
dtm
=
QDateTime
::
currentDateTime
();
qint64
usc
=
this
->
m_last_Report
.
secsTo
(
dtm
);
if
(
usc
>=
60
)
if
(
usc
>=
m_pClientTable
->
heartBeatingThrd
()
)
{
emit
evt_Message
(
tr
(
"Client "
)
+
QString
(
"%1"
).
arg
((
unsigned
int
)((
quint64
)
this
))
+
tr
(
" is dead, kick out."
));
emit
evt_close_client
(
this
->
sock
());
...
...
ZoomPipeline_FuncSvr/zpmainframe.cpp
浏览文件 @
a7081fbb
...
...
@@ -30,7 +30,7 @@ ZPMainFrame::ZPMainFrame(QWidget *parent) :
connect
(
m_pDatabases
,
&
ZPDatabase
::
DatabaseResource
::
evt_Message
,
this
,
&
ZPMainFrame
::
on_evt_Message
);
m_pDatabases
->
start
();
m_nTimerId
=
startTimer
(
5
00
);
m_nTimerId
=
startTimer
(
20
00
);
m_nTimerCheck
=
startTimer
(
10000
);
initUI
();
LoadSettings
(
m_currentConffile
);
...
...
@@ -159,13 +159,20 @@ void ZPMainFrame::timerEvent(QTimerEvent * e)
str_msg
+=
", Msg="
+
para
.
lastError
;
str_msg
+=
"
\n
"
;
}
str_msg
+=
tr
(
"Smartlink Function Server Paras:
\n
"
);
str_msg
+=
tr
(
"
\t
User Account Database is : %1
\n
"
).
arg
(
m_clientTable
->
Database_UserAcct
());
str_msg
+=
tr
(
"
\t
Event Database is : %1
\n
"
).
arg
(
m_clientTable
->
Database_Event
());
str_msg
+=
tr
(
"
\t
Local folder for large file is : %1
\n
"
).
arg
(
m_clientTable
->
largeFileFolder
());
str_msg
+=
tr
(
"
\t
Heart beating Threadhold is : %1
\n
"
).
arg
(
m_clientTable
->
heartBeatingThrd
());
ui
->
plainTextEdit_status_net
->
setPlainText
(
str_msg
);
}
else
if
(
e
->
timerId
()
==
m_nTimerCheck
)
{
killTimer
(
m_nTimerCheck
);
m_nTimerCheck
=
-
1
;
m_clientTable
->
KickDealClients
();
m_nTimerCheck
=
startTimer
(
10000
);
}
}
...
...
@@ -274,6 +281,21 @@ void ZPMainFrame::forkServer(const QString & config_file)
);
}
//Smartlink settings
int
nHeartbeatingThreadhold
=
settings
.
value
(
"Smartlink/HeartbeatingThreadhold"
,
180
).
toInt
();
if
(
nHeartbeatingThreadhold
>=
60
&&
nHeartbeatingThreadhold
<=
300
)
m_clientTable
->
setHeartBeatingThrd
(
nHeartbeatingThreadhold
);
QString
strSLDB_useracc
=
settings
.
value
(
"Smartlink/SLDB_useracc"
,
"EMPTY"
).
toString
();
m_clientTable
->
setDatabase_UserAcct
(
strSLDB_useracc
);
QString
strSLDB_mainEvent
=
settings
.
value
(
"Smartlink/SLDB_mainEvt"
,
"EMPTY"
).
toString
();
m_clientTable
->
setDatabase_Event
(
strSLDB_mainEvent
);
QString
strSL_LargetFolder
=
settings
.
value
(
"Smartlink/SL_LargetFolder"
,
"NUL"
).
toString
();
m_clientTable
->
setLargeFileFolder
(
strSL_LargetFolder
);
}
void
ZPMainFrame
::
on_action_About_triggered
()
...
...
@@ -360,6 +382,24 @@ void ZPMainFrame::LoadSettings(const QString & config_file)
m_pDbResModel
->
setData
(
m_pDbResModel
->
index
(
nInserted
,
7
),
db_testSQL
);
nInserted
++
;
}
//Smartlink settings
int
nHeartbeatingThreadhold
=
settings
.
value
(
"Smartlink/HeartbeatingThreadhold"
,
180
).
toInt
();
if
(
nHeartbeatingThreadhold
>=
60
&&
nHeartbeatingThreadhold
<=
300
)
ui
->
horizontalSlider_heartbeating
->
setValue
(
nHeartbeatingThreadhold
);
else
ui
->
horizontalSlider_heartbeating
->
setValue
(
180
);
ui
->
lcdNumber_heartbeating
->
display
(
ui
->
horizontalSlider_heartbeating
->
value
());
QString
strSLDB_useracc
=
settings
.
value
(
"Smartlink/SLDB_useracc"
,
"EMPTY"
).
toString
();
ui
->
lineEdit_SL_DB_Account
->
setText
(
strSLDB_useracc
);
QString
strSLDB_mainEvent
=
settings
.
value
(
"Smartlink/SLDB_mainEvt"
,
"EMPTY"
).
toString
();
ui
->
lineEdit_SL_DB_ME
->
setText
(
strSLDB_mainEvent
);
QString
strSL_LargetFolder
=
settings
.
value
(
"Smartlink/SL_LargetFolder"
,
"NUL"
).
toString
();
ui
->
lineEdit_SL_LargetFolder
->
setText
(
strSL_LargetFolder
);
}
...
...
@@ -421,6 +461,16 @@ void ZPMainFrame::SaveSettings(const QString & config_file)
QString
db_testSQL
=
m_pDbResModel
->
data
(
m_pDbResModel
->
index
(
i
,
7
)).
toString
()
;
settings
.
setValue
(
keyPrefix
+
"testSql"
,
db_testSQL
);
}
//Smartlink settings
int
nHeartbeatingThreadhold
=
ui
->
horizontalSlider_heartbeating
->
value
();
settings
.
setValue
(
"Smartlink/HeartbeatingThreadhold"
,
nHeartbeatingThreadhold
);
QString
strSLDB_useracc
=
ui
->
lineEdit_SL_DB_Account
->
text
();
settings
.
setValue
(
"Smartlink/SLDB_useracc"
,
strSLDB_useracc
);
QString
strSLDB_mainEvent
=
ui
->
lineEdit_SL_DB_ME
->
text
();
settings
.
setValue
(
"Smartlink/SLDB_mainEvt"
,
strSLDB_mainEvent
);
QString
strSL_LargetFolder
=
ui
->
lineEdit_SL_LargetFolder
->
text
();
settings
.
setValue
(
"Smartlink/SL_LargetFolder"
,
strSL_LargetFolder
);
}
void
ZPMainFrame
::
on_pushButton_addListener_clicked
()
{
...
...
ZoomPipeline_FuncSvr/zpmainframe.ui
浏览文件 @
a7081fbb
...
...
@@ -44,7 +44,7 @@
</attribute>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_2"
>
<item>
<widget
class=
"QTabWidget"
name=
"tabWidget_S
ettings
"
>
<widget
class=
"QTabWidget"
name=
"tabWidget_S
martlink
"
>
<property
name=
"tabPosition"
>
<enum>
QTabWidget::South
</enum>
</property>
...
...
@@ -492,6 +492,125 @@
</item>
</layout>
</widget>
<widget
class=
"QWidget"
name=
"tab"
>
<attribute
name=
"icon"
>
<iconset
resource=
"resource.qrc"
>
<normaloff>
:/icons/Resources/Alienware (27).png
</normaloff>
:/icons/Resources/Alienware (27).png
</iconset>
</attribute>
<attribute
name=
"title"
>
<string>
Smartlink
</string>
</attribute>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_5"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_9"
>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Heart-beating
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QSlider"
name=
"horizontalSlider_heartbeating"
>
<property
name=
"minimum"
>
<number>
60
</number>
</property>
<property
name=
"maximum"
>
<number>
300
</number>
</property>
<property
name=
"value"
>
<number>
180
</number>
</property>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"tickPosition"
>
<enum>
QSlider::TicksBelow
</enum>
</property>
</widget>
</item>
<item>
<widget
class=
"QLCDNumber"
name=
"lcdNumber_heartbeating"
>
<property
name=
"frameShape"
>
<enum>
QFrame::Panel
</enum>
</property>
<property
name=
"frameShadow"
>
<enum>
QFrame::Plain
</enum>
</property>
<property
name=
"segmentStyle"
>
<enum>
QLCDNumber::Flat
</enum>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_8"
>
<property
name=
"text"
>
<string>
seconds
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_10"
>
<item>
<widget
class=
"QLabel"
name=
"label_16"
>
<property
name=
"text"
>
<string>
User Account Database Name
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_SL_DB_Account"
/>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_17"
>
<property
name=
"text"
>
<string>
Main event db name
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_SL_DB_ME"
/>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_11"
>
<item>
<widget
class=
"QLabel"
name=
"label_18"
>
<property
name=
"text"
>
<string>
Large data root folder
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit_SL_LargetFolder"
/>
</item>
<item>
<widget
class=
"QToolButton"
name=
"toolButton_SL_BR_LargeFolder"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer
name=
"verticalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
121
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
...
...
@@ -520,7 +639,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
556
</width>
<height>
2
3
</height>
<height>
2
1
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menu_Control"
>
...
...
@@ -666,5 +785,21 @@
</hint>
</hints>
</connection>
<connection>
<sender>
horizontalSlider_heartbeating
</sender>
<signal>
valueChanged(int)
</signal>
<receiver>
lcdNumber_heartbeating
</receiver>
<slot>
display(int)
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
260
</x>
<y>
128
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
436
</x>
<y>
129
</y>
</hint>
</hints>
</connection>
</connections>
</ui>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录