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
3afe9982
Commit
3afe9982
authored
Aug 21, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
waringsystem写错了
parent
9606ae0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
WarningSystem.cs
...t.FLY.OBJComponents/OBJComponents/Server/WarningSystem.cs
+25
-10
No files found.
Project.FLY.OBJComponents/OBJComponents/Server/WarningSystem.cs
View file @
3afe9982
...
...
@@ -41,24 +41,31 @@ namespace FLY.OBJComponents.Server
ReasonList
=
new
Buffer
<
FlyData_WarningHistory
>();
NewestList
=
new
BufferStorage
<
FlyData_WarningHistory
>(
"warning_newest.csv"
);
}
/// <summary>
/// 报警复位!!!!
/// </summary>
public
Action
ResetEvent
;
public
void
Reset
()
{
ReasonList
.
Reset
();
ResetEvent
?.
Invoke
();
}
/// <summary>
/// 正在报警!!!
/// </summary>
public
Action
RingEvent
;
#
region
IWarningServiceSimple
public
void
Add
(
byte
errcode
,
string
description
,
ERR_STATE
state
)
{
FlyData_WarningHistory
reason
=
new
FlyData_WarningHistory
{
Time
=
DateTime
.
Now
,
ErrCode
=
errcode
,
Description
=
description
,
State
=
state
};
FlyData_WarningHistory
reason
=
new
FlyData_WarningHistory
();
reason
.
Time
=
DateTime
.
Now
;
reason
.
ErrCode
=
errcode
;
reason
.
Description
=
description
;
reason
.
State
=
state
;
FlyData_WarningHistory
error
=
null
;
Buffer
<
FlyData_WarningHistory
>
reasonList
=
ReasonList
as
Buffer
<
FlyData_WarningHistory
>;
...
...
@@ -78,7 +85,7 @@ namespace FLY.OBJComponents.Server
case
ERR_STATE
.
ON
:
if
(
error
==
null
)
{
reasonList
.
Add
(
reason
.
Clone
());
((
Buffer
<
FlyData_WarningHistory
>)
ReasonList
)
.
Add
(
reason
.
Clone
());
}
else
...
...
@@ -96,12 +103,20 @@ namespace FLY.OBJComponents.Server
else
{
error
.
State
=
state
;
reasonList
.
Remove
(
error_id
);
((
Buffer
<
FlyData_WarningHistory
>)
ReasonList
)
.
Remove
(
error_id
);
}
break
;
}
((
Buffer
<
FlyData_WarningHistory
>)
NewestList
).
Add
(
reason
);
if
(
reasonList
.
Count
>
0
)
{
RingEvent
?.
Invoke
();
}
else
{
Reset
();
}
}
#
endregion
...
...
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