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
d924bc7c
Commit
d924bc7c
authored
Jun 21, 2024
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改报警码
parent
781e7c3c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
99 deletions
+5
-99
ERRNO.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Common/ERRNO.cs
+0
-98
FLY.Thick.Base.csproj
Project.FLY.Thick.Base/FLY.Thick.Base/FLY.Thick.Base.csproj
+1
-1
StringResource.ERRNO.xaml
...ick.Base/Themes/StringResources/StringResource.ERRNO.xaml
+2
-0
StringResource.ERRNO.xaml
....Base/Themes/StringResources/en/StringResource.ERRNO.xaml
+2
-0
No files found.
Project.FLY.Thick.Base/FLY.Thick.Base/Common/ERRNO.cs
deleted
100644 → 0
View file @
781e7c3c
using
FLY.OBJComponents.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Linq
;
using
System.Text
;
using
System.Windows
;
namespace
FLY.Thick.Base.Common
{
/// <summary>
/// 异常常量
/// </summary>
public
class
ERRNOs
{
public
static
ERRNOs
Instance
{
get
;
}
=
new
ERRNOs
();
public
ERRNOs
()
{
string
resourceName
=
$"dict.StringResource.ERRNO"
;
var
rd_errnos
=
(
ResourceDictionary
)
Application
.
Current
.
FindResource
(
resourceName
);
//异常直接让它出错
Type
t
=
this
.
GetType
();
var
fields
=
t
.
GetFields
();
foreach
(
var
field
in
fields
)
{
if
(
field
.
Name
.
StartsWith
(
"ERRNO_"
))
{
var
errno
=
(
ERRNO
)
field
.
GetValue
(
this
);
errno
.
Description
=
ToDescription
(
rd_errnos
,
field
.
Name
);
field
.
SetValue
(
this
,
errno
);
}
}
}
string
ToDescription
(
ResourceDictionary
rd_errnos
,
string
errNoKey
)
{
string
resourceName
=
$"str.ERRNO.
{
errNoKey
}
"
;
return
(
string
)
rd_errnos
[
resourceName
];
//异常直接让它出错
}
public
List
<
ERRNO
>
GetAll
()
{
List
<
ERRNO
>
list
=
new
List
<
ERRNO
>();
Type
t
=
this
.
GetType
();
var
fields
=
t
.
GetFields
();
foreach
(
var
field
in
fields
)
{
if
(
field
.
Name
.
StartsWith
(
"ERRNO_"
))
{
var
errno
=
(
ERRNO
)
field
.
GetValue
(
this
);
list
.
Add
(
errno
);
}
}
list
.
Sort
((
e0
,
e1
)
=>
{
return
e0
.
Code
.
CompareTo
(
e1
.
Code
);
});
return
list
;
}
public
ERRNO
ERRNO_ALARM_TEST
=
new
ERRNO
()
{
Code
=
1
,
Description
=
"ALARM_TEST"
};
//"报警测试" };
public
ERRNO
ERRNO_AD_MIN
=
new
ERRNO
()
{
Code
=
2
,
Description
=
"AD_MIN"
};
//"AD值太小" };
public
ERRNO
ERRNO_AD_MAX
=
new
ERRNO
()
{
Code
=
3
,
Description
=
"AD_MAX"
};
//"AD值太大" };
public
ERRNO
ERRNO_SCRAM
=
new
ERRNO
()
{
Code
=
4
,
Description
=
"SCRAM"
};
//"急停" };
public
ERRNO
ERRNO_LIMIT
=
new
ERRNO
()
{
Code
=
5
,
Description
=
"LIMIT"
};
//"限位" };
public
ERRNO
ERRNO_FLYAD7_DC
=
new
ERRNO
()
{
Code
=
6
,
Description
=
"FLYAD7_DC"
};
//"AD盒连接断开" };
public
ERRNO
ERRNO_WILL_EXP
=
new
ERRNO
()
{
Code
=
7
,
Description
=
"WILL_EXP"
};
//"授权将要过期" };
public
ERRNO
ERRNO_AUTH_EXP
=
new
ERRNO
()
{
Code
=
8
,
Description
=
"AUTH_EXP"
};
//"授权过期" };
public
ERRNO
ERRNO_DB_BACKUP
=
new
ERRNO
()
{
Code
=
9
,
Description
=
"DB_BACKUP"
};
//"已经连续开机1个月,数据库需要备份归档,请尽快重启服务器" };
public
ERRNO
ERRNO_OVERCTRL
=
new
ERRNO
()
{
Code
=
11
,
Description
=
"OVERCTRL"
};
//"扫描超控制报警" };
public
ERRNO
ERRNO_OVERTOL
=
new
ERRNO
()
{
Code
=
12
,
Description
=
"OVERTOL"
};
//"扫描超规格报警" };
public
ERRNO
ERRNO_SAMPLE_ParamErr
=
new
ERRNO
()
{
Code
=
20
,
Description
=
"SAMPLE_ParamErr"
};
//"采样出错:参数异常" };
public
ERRNO
ERRNO_SAMPLE_ADZero
=
new
ERRNO
()
{
Code
=
21
,
Description
=
"SAMPLE_ADZero"
};
//"采样出错:AD值为0" };
public
ERRNO
ERRNO_SAMPLE_NoData
=
new
ERRNO
()
{
Code
=
22
,
Description
=
"SAMPLE_NoData"
};
//"采样出错:没有采集数据" };
public
ERRNO
ERRNO_SAMPLE_FilterErr
=
new
ERRNO
()
{
Code
=
23
,
Description
=
"SAMPLE_FilterErr"
};
//"采样出错:滤波数据与原始数据差异大" };
public
ERRNO
ERRNO_SAMPLE_PercentErr
=
new
ERRNO
()
{
Code
=
24
,
Description
=
"SAMPLE_PercentErr"
};
//"采样出错:样品AD与上次差异大" };
public
ERRNO
ERRNO_SAMPLE_CrossErr
=
new
ERRNO
()
{
Code
=
25
,
Description
=
"SAMPLE_CrossErr"
};
//"采样出错:样品比值与上次差异大" };
}
}
Project.FLY.Thick.Base/FLY.Thick.Base/FLY.Thick.Base.csproj
View file @
d924bc7c
...
...
@@ -72,7 +72,7 @@
<Compile
Include=
"Common\CurveCore.cs"
/>
<Compile
Include=
"Common\DATAVALIDSRC.cs"
/>
<Compile
Include=
"Common\DynArea.cs"
/>
<Compile
Include=
"Common\ERRNO.cs"
/>
<Compile
Include=
"Common\ERRNO
s
.cs"
/>
<Compile
Include=
"Common\FlyADIODefine.cs"
/>
<Compile
Include=
"Common\FlyAD_Common.cs"
/>
<Compile
Include=
"Common\FlyData_WarningHistory.cs"
/>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Themes/StringResources/StringResource.ERRNO.xaml
View file @
d924bc7c
...
...
@@ -16,6 +16,8 @@
<system:String x:Key="str.ERRNO.ERRNO_DB_BACKUP">已经连续开机1个月,数据库需要备份归档,请尽快重启服务器</system:String>
<system:String x:Key="str.ERRNO.ERRNO_OVERCTRL">超控制线报警</system:String>
<system:String x:Key="str.ERRNO.ERRNO_OVERTOL">超规格线报警</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SCAN_FATAL">扫描异常停止</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_FATAL">采样出错</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_ParamErr">采样出错:参数异常</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_ADZero">采样出错:AD值为0</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_NoData">采样出错:没有采集数据</system:String>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Themes/StringResources/en/StringResource.ERRNO.xaml
View file @
d924bc7c
...
...
@@ -16,6 +16,8 @@
<system:String x:Key="str.ERRNO.ERRNO_DB_BACKUP">The database needs to be backed up,Restart the server</system:String>
<system:String x:Key="str.ERRNO.ERRNO_OVERCTRL">Over control line</system:String>
<system:String x:Key="str.ERRNO.ERRNO_OVERTOL">Over tolerance line</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SCAN_FATAL">Scan action exception</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_FATAL">Sampling error</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_ParamErr">Sampling error: Param</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_ADZero">Sampling error: AD=0</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_NoData">Sampling error: No Data</system:String>
...
...
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