Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
8e26f37f
Commit
8e26f37f
authored
Jun 11, 2024
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 ad2021.B2 1分钟位变化
parent
03821181
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
2 deletions
+37
-2
FlyAd2021B2.cs
Project.FLY.FlyADBase/FlyAd2021.B2/FlyAd2021B2.cs
+37
-2
No files found.
Project.FLY.FlyADBase/FlyAd2021.B2/FlyAd2021B2.cs
View file @
8e26f37f
...
...
@@ -22,7 +22,7 @@ namespace FlyADBase
public
partial
class
FlyAd2021B2
:
IFlyADClient
{
public
Logger
logger
=
NLog
.
LogManager
.
GetCurrentClassLogger
();
public
Logger
logger_adcnt
=
NLog
.
LogManager
.
GetLogger
(
"adcnt"
);
#
region
MARKNO
const
int
MARKNO_SET_SAVE
=
4
;
const
int
MARKNO_PARAM_APPLY
=
5
;
...
...
@@ -648,6 +648,40 @@ namespace FlyADBase
}
}
}
void
CountAD
(
int
ad
,
int
ad2
)
{
for
(
int
i
=
0
;
i
<
16
;
i
++)
{
if
(
Misc
.
MyBase
.
CHECKBIT
((
UInt16
)
ad
,
i
))
{
ad_bitCntAt1min
[
i
]++;
}
}
for
(
int
i
=
0
;
i
<
16
;
i
++)
{
if
(
Misc
.
MyBase
.
CHECKBIT
((
UInt16
)
ad2
,
i
))
{
ad2_bitCntAt1min
[
i
]++;
}
}
totalCntAt1min
++;
if
(
totalCntAt1min
>=
60000
)
{
AD_bitCntAt1min
=
ad_bitCntAt1min
;
AD2_bitCntAt1min
=
ad2_bitCntAt1min
;
//数了1min,导出数据
logger_adcnt
.
Debug
(
$"TOTAL =
{
totalCntAt1min
}
ADCNT =
{
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
ad_bitCntAt1min
)}
"
);
logger_adcnt
.
Debug
(
$"TOTAL =
{
totalCntAt1min
}
AD2CNT =
{
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
ad2_bitCntAt1min
)}
"
);
totalCntAt1min
=
0
;
ad_bitCntAt1min
=
new
int
[
16
];
ad2_bitCntAt1min
=
new
int
[
16
];
}
}
int
totalCntAt1min
=
0
;
int
[]
ad_bitCntAt1min
=
new
int
[
16
];
int
[]
ad2_bitCntAt1min
=
new
int
[
16
];
public
int
[]
AD_bitCntAt1min
{
get
;
private
set
;
}
public
int
[]
AD2_bitCntAt1min
{
get
;
private
set
;
}
Stopwatch
sw_reset
=
new
Stopwatch
();
...
...
@@ -657,7 +691,8 @@ namespace FlyADBase
Now
=
sysTickContext
.
ToDateTime
(
e
.
SysTick
);
AD
=
e
.
AD
;
AD2
=
e
.
AD2
;
//TODO 统计1分钟内,每个位出现1的次数
CountAD
(
AD
,
AD2
);
if
(
e
.
ENC1
!=
null
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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