Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zhongyang219
TrafficMonitor
Commits
ac96ff1f
Commit
ac96ff1f
authored
7 years ago
by
Zhong Yang
Browse files
Options
Download
Plain Diff
merge
parents
7f8032b7
08b5c2fb
master
github/fork/BombaxCeiba/fix_end_draw_not_invoke
github/fork/holylong/master
github/fork/rayfalling/master
V1.84.1
V1.84
V1.83
V1.82
V1.81
V1.80.3
V1.80.2
V1.80.1
V1.80
V1.79.1
V1.79
V1.78
V1.77
V1.76
V1.75
V1.74
V1.73
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
TrafficMonitor/HistoryTrafficListDlg.cpp
+0
-0
TrafficMonitor/HistoryTrafficListDlg.cpp
TrafficMonitor/ListCtrlEx.cpp
+1
-1
TrafficMonitor/ListCtrlEx.cpp
TrafficMonitor/NetworkInfoDlg.cpp
+1
-1
TrafficMonitor/NetworkInfoDlg.cpp
TrafficMonitor/TrafficMonitor.vcxproj
+1
-0
TrafficMonitor/TrafficMonitor.vcxproj
TrafficMonitor/TrafficMonitorDlg.cpp
+12
-5
TrafficMonitor/TrafficMonitorDlg.cpp
with
15 additions
and
7 deletions
+15
-7
TrafficMonitor/HistoryTrafficListDlg.cpp
+6 bytes (+0%)
View file @
ac96ff1f
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
This diff is collapsed.
Click to expand it.
TrafficMonitor/ListCtrlEx.cpp
+
1
-
1
View file @
ac96ff1f
...
...
@@ -14,7 +14,7 @@ CListCtrlEx::~CListCtrlEx()
void
CListCtrlEx
::
SetDrawItemRangeData
(
int
item
,
double
range
,
COLORREF
color
)
{
if
(
item
<
0
)
return
;
if
(
item
>=
m_item_rage_data
.
size
())
if
(
item
>=
static_cast
<
int
>
(
m_item_rage_data
.
size
())
)
m_item_rage_data
.
resize
(
item
+
1
);
m_item_rage_data
[
item
].
data_value
=
range
;
m_item_rage_data
[
item
].
color
=
color
;
...
...
This diff is collapsed.
Click to expand it.
TrafficMonitor/NetworkInfoDlg.cpp
+
1
-
1
View file @
ac96ff1f
...
...
@@ -103,7 +103,7 @@ void CNetworkInfoDlg::ShowInfo()
m_info_list
.
InsertItem
(
4
,
CCommon
::
LoadText
(
IDS_ADAPTER_PHYSICAL_ADDRESS
));
temp
=
_T
(
""
);
char
buff
[
3
];
for
(
in
t
i
{};
i
<
m_network_info
.
dwPhysAddrLen
;
i
++
)
for
(
size_
t
i
{};
i
<
m_network_info
.
dwPhysAddrLen
;
i
++
)
{
//_itoa_s(m_network_info.bPhysAddr[i], buff, 16);
sprintf_s
(
buff
,
"%.2x"
,
m_network_info
.
bPhysAddr
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
TrafficMonitor/TrafficMonitor.vcxproj
+
1
-
0
View file @
ac96ff1f
...
...
@@ -92,6 +92,7 @@
<Optimization>
Disabled
</Optimization>
<PreprocessorDefinitions>
WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<SDLCheck>
true
</SDLCheck>
<TreatWarningAsError>
false
</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>
Windows
</SubSystem>
...
...
This diff is collapsed.
Click to expand it.
TrafficMonitor/TrafficMonitorDlg.cpp
+
12
-
5
View file @
ac96ff1f
...
...
@@ -588,7 +588,7 @@ void CTrafficMonitorDlg::AutoSelect()
//m_connection_selected = m_connections[0].index;
m_connection_selected
=
0
;
//自动选择连接时,查找已发送和已接收字节数之和最多的那个连接,并将其设置为当前查看的连接
for
(
in
t
i
{};
i
<
m_connections
.
size
();
i
++
)
for
(
size_
t
i
{};
i
<
m_connections
.
size
();
i
++
)
{
if
(
m_pIfTable
->
table
[
m_connections
[
i
].
index
].
dwOperStatus
==
IF_OPER_STATUS_OPERATIONAL
)
//只选择网络状态为正常的连接
{
...
...
@@ -660,7 +660,7 @@ void CTrafficMonitorDlg::IniConnection()
m_menu
.
LoadMenu
(
IDR_MENU1
);
//装载右键菜单
m_select_connection_menu
=
m_menu
.
GetSubMenu
(
0
)
->
GetSubMenu
(
0
);
//设置“选择网卡”子菜单项
CString
connection_descr
;
for
(
in
t
i
{};
i
<
m_connections
.
size
();
i
++
)
for
(
size_
t
i
{};
i
<
m_connections
.
size
();
i
++
)
{
connection_descr
=
CCommon
::
StrToUnicode
(
m_connections
[
i
].
description
.
c_str
()).
c_str
();
m_select_connection_menu
->
AppendMenu
(
MF_STRING
|
MF_ENABLED
,
ID_SELETE_CONNECTION
+
i
+
1
,
connection_descr
);
...
...
@@ -777,7 +777,7 @@ void CTrafficMonitorDlg::LoadHistoryTraffic()
std
::
sort
(
m_history_traffics
.
begin
(),
m_history_traffics
.
end
(),
HistoryTraffic
::
DateGreater
);
//如果列表中有相同日期的项目,则将它合并
for
(
int
i
{};
i
<
m_history_traffics
.
size
()
-
1
;
i
++
)
for
(
int
i
{};
i
<
static_cast
<
int
>
(
m_history_traffics
.
size
()
-
1
)
;
i
++
)
{
if
(
HistoryTraffic
::
DateEqual
(
m_history_traffics
[
i
],
m_history_traffics
[
i
+
1
]))
{
...
...
@@ -1205,7 +1205,14 @@ void CTrafficMonitorDlg::OnTimer(UINT_PTR nIDEvent)
m_history_traffics
[
0
].
kBytes
=
static_cast
<
unsigned
int
>
(
theApp
.
m_today_traffic
/
1024
);
//每隔30秒保存一次流量历史记录
if
(
m_timer_cnt
%
30
==
10
)
SaveHistoryTraffic
();
{
static
unsigned
int
last_today_kbytes
;
if
(
m_history_traffics
[
0
].
kBytes
-
last_today_kbytes
>=
100
)
//只有当流量变化超过100KB时才保存历史流量记录,防止磁盘写入过于频繁
{
SaveHistoryTraffic
();
last_today_kbytes
=
m_history_traffics
[
0
].
kBytes
;
}
}
if
(
rtn
==
ERROR_INSUFFICIENT_BUFFER
)
{
...
...
@@ -1326,7 +1333,7 @@ void CTrafficMonitorDlg::OnTimer(UINT_PTR nIDEvent)
{
static
int
last_memory_usage
;
static
int
notify_time
{
-
theApp
.
m_notify_interval
};
//记录上次弹出提示时的时间
if
(
last_memory_usage
<
theApp
.
m_general_data
.
memory_tip_value
&&
theApp
.
m_memory_usage
>=
theApp
.
m_general_data
.
memory_tip_value
&&
(
m_timer_cnt
-
notify_time
>
theApp
.
m_notify_interval
))
if
(
last_memory_usage
<
theApp
.
m_general_data
.
memory_tip_value
&&
theApp
.
m_memory_usage
>=
theApp
.
m_general_data
.
memory_tip_value
&&
(
m_timer_cnt
-
notify_time
>
static_cast
<
unsigned
int
>
(
theApp
.
m_notify_interval
))
)
{
CString
info
;
info
.
Format
(
CCommon
::
LoadText
(
IDS_MEMORY_UDAGE_EXCEED
,
_T
(
" %d%%!"
)),
theApp
.
m_general_data
.
memory_tip_value
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets