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
36899304
Commit
36899304
authored
May 04, 2024
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 报警内容多国语言,在服务器中实现
parent
d162d8d4
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
210 additions
and
125 deletions
+210
-125
FlyData_WarningHistory.cs
...Components/OBJComponents/Common/FlyData_WarningHistory.cs
+7
-3
ErrorConf.cs
Project.FLY.OBJComponents/OBJComponents/Server/ErrorConf.cs
+1
-1
WarningSystem2.cs
....FLY.OBJComponents/OBJComponents/Server/WarningSystem2.cs
+1
-1
FLY.Thick.Base.UI.csproj
...FLY.Thick.Base/FLY.Thick.Base.UI/FLY.Thick.Base.UI.csproj
+1
-8
IErrNoTranslator.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/IErrNoTranslator.cs
+51
-0
StringResource.ERRNO.xaml
....Base.UI/Themes/StringResources/StringResource.ERRNO.xaml
+0
-25
StringResource.ERRNO.xaml
...se.UI/Themes/StringResources/en/StringResource.ERRNO.xaml
+0
-25
DynAreaFilmWidth.xaml
...ick.Base/FLY.Thick.Base.UI/UiModule/DynAreaFilmWidth.xaml
+1
-1
DynAreaIO.xaml.cs
...Y.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaIO.xaml.cs
+14
-36
ERRNO.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Common/ERRNO.cs
+60
-19
FLY.Thick.Base.csproj
Project.FLY.Thick.Base/FLY.Thick.Base/FLY.Thick.Base.csproj
+12
-0
GetSample.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Server/GetSample.cs
+12
-6
StringResource.ERRNO.xaml
...ick.Base/Themes/StringResources/StringResource.ERRNO.xaml
+25
-0
StringResource.ERRNO.xaml
....Base/Themes/StringResources/en/StringResource.ERRNO.xaml
+25
-0
No files found.
Project.FLY.OBJComponents/OBJComponents/Common/FlyData_WarningHistory.cs
View file @
36899304
...
@@ -115,8 +115,12 @@ namespace FLY.OBJComponents.Common
...
@@ -115,8 +115,12 @@ namespace FLY.OBJComponents.Common
/// </summary>
/// </summary>
public
struct
ERRNO
public
struct
ERRNO
{
{
public
UInt16
Code
;
public
int
Code
;
public
string
Descrption
;
public
string
Description
;
public
override
string
ToString
()
{
return
$"[
{
Code
}
]
{
Description
}
"
;
}
}
}
public
class
PlcErrNos
public
class
PlcErrNos
...
@@ -126,6 +130,6 @@ namespace FLY.OBJComponents.Common
...
@@ -126,6 +130,6 @@ namespace FLY.OBJComponents.Common
/// <summary>
/// <summary>
/// PLC连接断开
/// PLC连接断开
/// </summary>
/// </summary>
public
ERRNO
ERRNO_PLC_DISCONNECTED
=
new
ERRNO
()
{
Code
=
65535
,
Descrption
=
"PLC连接断开"
};
public
ERRNO
ERRNO_PLC_DISCONNECTED
=
new
ERRNO
()
{
Code
=
65535
,
Descr
i
ption
=
"PLC连接断开"
};
}
}
}
}
Project.FLY.OBJComponents/OBJComponents/Server/ErrorConf.cs
View file @
36899304
...
@@ -59,7 +59,7 @@ namespace FLY.OBJComponents.Server
...
@@ -59,7 +59,7 @@ namespace FLY.OBJComponents.Server
//初始化 PLC连接断开的描述列表
//初始化 PLC连接断开的描述列表
int
plcCnt
=
PLCos
.
PLCs
.
Count
();
int
plcCnt
=
PLCos
.
PLCs
.
Count
();
int
errCode
=
plcErrCodeBegin
;
int
errCode
=
plcErrCodeBegin
;
string
descrption
=
PlcErrNos
.
Instance
.
ERRNO_PLC_DISCONNECTED
.
Descrption
;
string
descrption
=
PlcErrNos
.
Instance
.
ERRNO_PLC_DISCONNECTED
.
Descr
i
ption
;
for
(
int
i
=
0
;
i
<
plcCnt
;
i
++)
for
(
int
i
=
0
;
i
<
plcCnt
;
i
++)
{
{
plcDisconnectedErrMsgs
.
Add
(
new
PlcDisconnectedErrMsg
()
plcDisconnectedErrMsgs
.
Add
(
new
PlcDisconnectedErrMsg
()
...
...
Project.FLY.OBJComponents/OBJComponents/Server/WarningSystem2.cs
View file @
36899304
...
@@ -86,7 +86,7 @@ namespace FLY.OBJComponents.Server
...
@@ -86,7 +86,7 @@ namespace FLY.OBJComponents.Server
public
void
Add
(
ERRNO
errno
,
bool
canReset
=
true
)
public
void
Add
(
ERRNO
errno
,
bool
canReset
=
true
)
{
{
Add
(
errno
.
Code
,
errno
.
Descrption
,
canReset
:
canReset
);
Add
(
errno
.
Code
,
errno
.
Descr
i
ption
,
canReset
:
canReset
);
}
}
public
void
Remove
(
ERRNO
errno
)
public
void
Remove
(
ERRNO
errno
)
{
{
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/FLY.Thick.Base.UI.csproj
View file @
36899304
...
@@ -117,6 +117,7 @@
...
@@ -117,6 +117,7 @@
<DependentUpon>
UcSingleStateTab.xaml
</DependentUpon>
<DependentUpon>
UcSingleStateTab.xaml
</DependentUpon>
</Compile>
</Compile>
<Compile
Include=
"DependOn\WarningSystem2ServiceClientWithName.cs"
/>
<Compile
Include=
"DependOn\WarningSystem2ServiceClientWithName.cs"
/>
<Compile
Include=
"IErrNoTranslator.cs"
/>
<Compile
Include=
"OnInit\OnInitAutoScan.cs"
/>
<Compile
Include=
"OnInit\OnInitAutoScan.cs"
/>
<Compile
Include=
"OnInit\OnInitControllerState.cs"
/>
<Compile
Include=
"OnInit\OnInitControllerState.cs"
/>
<Compile
Include=
"OnInit\OnInitWarnings.cs"
/>
<Compile
Include=
"OnInit\OnInitWarnings.cs"
/>
...
@@ -340,10 +341,6 @@
...
@@ -340,10 +341,6 @@
<Generator>
MSBuild:Compile
</Generator>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
<SubType>
Designer
</SubType>
</Page>
</Page>
<Page
Include=
"Themes\StringResources\en\StringResource.ERRNO.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"Themes\StringResources\en\StringResource.OnInit.xaml"
>
<Page
Include=
"Themes\StringResources\en\StringResource.OnInit.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
<SubType>
Designer
</SubType>
...
@@ -352,10 +349,6 @@
...
@@ -352,10 +349,6 @@
<Generator>
MSBuild:Compile
</Generator>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
<SubType>
Designer
</SubType>
</Page>
</Page>
<Page
Include=
"Themes\StringResources\StringResource.ERRNO.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"Themes\StringResources\en\StringResource.FlyADIODefine.xaml"
>
<Page
Include=
"Themes\StringResources\en\StringResource.FlyADIODefine.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
<SubType>
Designer
</SubType>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/IErrNoTranslator.cs
0 → 100644
View file @
36899304
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
namespace
FLY.Thick.Base.UI
{
public
interface
IErrNoTranslator
{
/// <summary>
/// errNoKey 查表 获取 文字
/// </summary>
/// <param name="errNoKey"></param>
/// <returns></returns>
string
ToDescription
(
string
errNoKey
);
}
public
class
ErrNoTranslator
:
IErrNoTranslator
{
ResourceDictionary
rd_errnos
=
null
;
public
virtual
string
DictKey
=>
""
;
public
ErrNoTranslator
()
{
//提前全部
string
resourceName
=
$"dict
{
DictKey
}
.StringResource.ERRNO"
;
rd_errnos
=
(
ResourceDictionary
)
Application
.
Current
.
TryFindResource
(
resourceName
);
if
(
rd_errnos
==
null
)
{
throw
new
Exception
(
$"can't find out ResourceDictionary x:Key = \"
{
resourceName
}
\""
);
}
}
public
virtual
string
ToDescription
(
string
errNoKey
)
{
if
(
rd_errnos
!=
null
&&
!
string
.
IsNullOrEmpty
(
errNoKey
))
{
string
resourceName
=
$"str
{
DictKey
}
.ERRNO.
{
errNoKey
}
"
;
if
(
rd_errnos
.
Contains
(
resourceName
))
{
return
(
string
)
rd_errnos
[
resourceName
];
}
}
return
null
;
}
}
}
Project.FLY.Thick.Base/FLY.Thick.Base.UI/Themes/StringResources/StringResource.ERRNO.xaml
deleted
100644 → 0
View file @
d162d8d4
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xml:space="preserve">
<!--字符串换行 必须添加 xml:space="preserve" -->
<!--字符串换行 换行符 -->
<system:String x:Key="str.ERRNO.ALARM_TEST">报警测试</system:String>
<system:String x:Key="str.ERRNO.AD_MIN">AD值超下限</system:String>
<system:String x:Key="str.ERRNO.AD_MAX">AD值超上限</system:String>
<system:String x:Key="str.ERRNO.SCRAM">急停</system:String>
<system:String x:Key="str.ERRNO.LIMIT">限位</system:String>
<system:String x:Key="str.ERRNO.FLYAD7_DC">AD盒连接断开</system:String>
<system:String x:Key="str.ERRNO.WILL_EXP">授权将要过期</system:String>
<system:String x:Key="str.ERRNO.AUTH_EXP">授权过期</system:String>
<system:String x:Key="str.ERRNO.DB_BACKUP">已经连续开机1个月,数据库需要备份归档,请尽快重启服务器</system:String>
<system:String x:Key="str.ERRNO.OVERCTRL">超控制线报警</system:String>
<system:String x:Key="str.ERRNO.OVERTOL">超规格线报警</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_ParamErr">采样出错:参数异常</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_ADZero">采样出错:AD值为0</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_NoData">采样出错:没有采集数据</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_FilterErr">采样出错:滤波数据与原始数据差异大</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_PercentErr">采样出错:样品AD与上次差异大</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_CrossErr">采样出错:样品比值与上次差异大</system:String>
</ResourceDictionary>
\ No newline at end of file
Project.FLY.Thick.Base/FLY.Thick.Base.UI/Themes/StringResources/en/StringResource.ERRNO.xaml
deleted
100644 → 0
View file @
d162d8d4
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xml:space="preserve">
<!--字符串换行 必须添加 xml:space="preserve" -->
<!--字符串换行 换行符 -->
<system:String x:Key="str.ERRNO.ALARM_TEST">Alarm Test</system:String>
<system:String x:Key="str.ERRNO.AD_MIN">AD exceeded the lower limit</system:String>
<system:String x:Key="str.ERRNO.AD_MAX">AD exceeded the upper limit</system:String>
<system:String x:Key="str.ERRNO.SCRAM">Scram</system:String>
<system:String x:Key="str.ERRNO.LIMIT">Limit</system:String>
<system:String x:Key="str.ERRNO.FLYAD7_DC">FLYAD7 disconnected</system:String>
<system:String x:Key="str.ERRNO.WILL_EXP">Authorization will expire</system:String>
<system:String x:Key="str.ERRNO.AUTH_EXP">Authorization expired</system:String>
<system:String x:Key="str.ERRNO.DB_BACKUP">The database needs to be backed up,Restart the server</system:String>
<system:String x:Key="str.ERRNO.OVERCTRL">Over control line</system:String>
<system:String x:Key="str.ERRNO.OVERTOL">Over tolerance line</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_ParamErr">Sampling error:Param</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_ADZero">Sampling error:AD=0</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_NoData">Sampling error::No Data</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_FilterErr">Sampling error:Filtering Error</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_PercentErr">Sampling error:Large Deviation</system:String>
<system:String x:Key="str.ERRNO.SAMPLE_CrossErr">Sampling error:Proportional Error</system:String>
</ResourceDictionary>
\ No newline at end of file
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaFilmWidth.xaml
View file @
36899304
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<UserControl.Resources>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/
Themes/Styles.xaml"
/>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/
Converter/Converters.xaml"
/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ResourceDictionary>
</UserControl.Resources>
</UserControl.Resources>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaIO.xaml.cs
View file @
36899304
...
@@ -41,9 +41,7 @@ namespace FLY.Thick.Base.UI.UiModule
...
@@ -41,9 +41,7 @@ namespace FLY.Thick.Base.UI.UiModule
errorVm
=
new
DynAreaErrorVm2
();
errorVm
=
new
DynAreaErrorVm2
();
string
serverName
=
(
string
)
Application
.
Current
.
TryFindResource
(
"str.DynArea.TGauge"
);
errorVm
.
Init
(
container
,
warningSystem
);
errorVm
.
Init
(
container
,
warningSystem
,
serverName
,
null
);
this
.
DataContext
=
ioVm
;
this
.
DataContext
=
ioVm
;
grid_error
.
DataContext
=
errorVm
;
grid_error
.
DataContext
=
errorVm
;
...
@@ -165,38 +163,32 @@ namespace FLY.Thick.Base.UI.UiModule
...
@@ -165,38 +163,32 @@ namespace FLY.Thick.Base.UI.UiModule
/// </summary>
/// </summary>
string
serverName
;
string
serverName
;
/// <summary>
/// StringResource.ERRNO 中的 str.XXX.ERRNO.YYYY, XXX标识
/// </summary>
string
errnoKey
;
DispatcherTimer
timer_error
;
DispatcherTimer
timer_error
;
private
int
reason_list_index
=
-
1
;
private
int
reason_list_index
=
-
1
;
ResourceDictionary
rd_errnos
=
null
;
bool
isTGauge
;
public
DynAreaErrorVm2
()
public
DynAreaErrorVm2
()
{
{
OpenWarningCmd
=
new
RelayCommand
(
OpenWarning
);
OpenWarningCmd
=
new
RelayCommand
(
OpenWarning
);
}
}
public
void
Init
(
IUnityContainer
container
,
IWarningSystem2Service
warningSystem
)
{
isTGauge
=
true
;
var
serverName
=
(
string
)
Application
.
Current
.
TryFindResource
(
"str.DynArea.TGauge"
);
Init
(
container
,
warningSystem
,
serverName
);
}
public
void
Init
(
public
void
Init
(
IUnityContainer
container
,
IUnityContainer
container
,
IWarningSystem2Service
warningSystem
,
IWarningSystem2Service
warningSystem
,
string
serverName
,
string
serverName
)
string
errnoKey
)
{
{
this
.
container
=
container
;
this
.
container
=
container
;
this
.
warningSystem
=
warningSystem
;
this
.
warningSystem
=
warningSystem
;
this
.
serverName
=
serverName
;
this
.
serverName
=
serverName
;
this
.
errnoKey
=
errnoKey
;
string
resourceName
;
if
(
errnoKey
!=
null
)
resourceName
=
$"dict.
{
this
.
errnoKey
}
.StringResource.ERRNO"
;
else
resourceName
=
$"dict.StringResource.ERRNO"
;
rd_errnos
=
(
ResourceDictionary
)
Application
.
Current
.
TryFindResource
(
resourceName
);
//报警原因轮流显示
//报警原因轮流显示
timer_error
=
new
DispatcherTimer
();
timer_error
=
new
DispatcherTimer
();
...
@@ -258,21 +250,6 @@ namespace FLY.Thick.Base.UI.UiModule
...
@@ -258,21 +250,6 @@ namespace FLY.Thick.Base.UI.UiModule
//通过资源翻译报警信息
//通过资源翻译报警信息
var
description
=
warningSystem
.
ReasonList
[
reason_list_index
].
Description
;
var
description
=
warningSystem
.
ReasonList
[
reason_list_index
].
Description
;
if
(
rd_errnos
!=
null
&&
!
string
.
IsNullOrEmpty
(
description
))
{
string
resourceName
;
if
(
errnoKey
!=
null
)
resourceName
=
$"str.
{
errnoKey
}
.ERRNO.
{
description
}
"
;
else
resourceName
=
$"str.ERRNO.
{
description
}
"
;
if
(
rd_errnos
.
Contains
(
resourceName
))
{
description
=
(
string
)
rd_errnos
[
resourceName
];
}
}
ErrMsg
=
description
;
ErrMsg
=
description
;
IsError
=
true
;
IsError
=
true
;
timer_error
.
Start
();
timer_error
.
Start
();
...
@@ -290,7 +267,8 @@ namespace FLY.Thick.Base.UI.UiModule
...
@@ -290,7 +267,8 @@ namespace FLY.Thick.Base.UI.UiModule
{
{
if
(!
WdPassword
.
Authorize
(
"Warning"
))
if
(!
WdPassword
.
Authorize
(
"Warning"
))
return
;
return
;
if
(
errnoKey
==
null
)
if
(
isTGauge
)
{
{
var
p
=
new
PgErrorTable
();
var
p
=
new
PgErrorTable
();
p
.
Init
(
container
,
warningSystem
);
p
.
Init
(
container
,
warningSystem
);
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Common/ERRNO.cs
View file @
36899304
...
@@ -4,6 +4,7 @@ using System.Collections.Generic;
...
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using
System.ComponentModel
;
using
System.ComponentModel
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Windows
;
namespace
FLY.Thick.Base.Common
namespace
FLY.Thick.Base.Common
{
{
...
@@ -14,39 +15,79 @@ namespace FLY.Thick.Base.Common
...
@@ -14,39 +15,79 @@ namespace FLY.Thick.Base.Common
{
{
public
static
ERRNOs
Instance
{
get
;
}
=
new
ERRNOs
();
public
static
ERRNOs
Instance
{
get
;
}
=
new
ERRNOs
();
public
ERRNO
ERRNO_ALARM_TEST
=
new
ERRNO
()
{
Code
=
1
,
Descrption
=
"ALARM_TEST"
};
//"报警测试" };
public
ERRNOs
()
{
string
resourceName
=
$"dict.StringResource.ERRNO"
;
public
ERRNO
ERRNO_AD_MIN
=
new
ERRNO
()
{
Code
=
2
,
Descrption
=
"AD_MIN"
};
//"AD值太小" };
var
rd_errnos
=
(
ResourceDictionary
)
Application
.
Current
.
FindResource
(
resourceName
);
//异常直接让它出错
public
ERRNO
ERRNO_AD_MAX
=
new
ERRNO
()
{
Code
=
3
,
Descrption
=
"AD_MAX"
};
//"AD值太大" };
Type
t
=
this
.
GetType
();
var
fields
=
t
.
GetFields
();
public
ERRNO
ERRNO_SCRAM
=
new
ERRNO
()
{
Code
=
4
,
Descrption
=
"SCRAM"
};
//"急停" };
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
ERRNO
ERRNO_LIMIT
=
new
ERRNO
()
{
Code
=
5
,
Descrption
=
"LIMIT"
};
//"限位" };
public
List
<
ERRNO
>
GetAll
()
{
List
<
ERRNO
>
list
=
new
List
<
ERRNO
>();
Type
t
=
this
.
GetType
();
var
fields
=
t
.
GetFields
();
public
ERRNO
ERRNO_FLYAD7_DC
=
new
ERRNO
()
{
Code
=
6
,
Descrption
=
"FLYAD7_DC"
};
//"AD盒连接断开" };
foreach
(
var
field
in
fields
)
{
if
(
field
.
Name
.
StartsWith
(
"ERRNO_"
))
{
var
errno
=
(
ERRNO
)
field
.
GetValue
(
this
);
list
.
Add
(
errno
);
}
}
return
list
;
}
public
ERRNO
ERRNO_ALARM_TEST
=
new
ERRNO
()
{
Code
=
1
,
Description
=
"ALARM_TEST"
};
//"报警测试" };
public
ERRNO
ERRNO_
WILL_EXP
=
new
ERRNO
()
{
Code
=
7
,
Descrption
=
"WILL_EXP"
};
//"授权将要过期
" };
public
ERRNO
ERRNO_
AD_MIN
=
new
ERRNO
()
{
Code
=
2
,
Description
=
"AD_MIN"
};
//"AD值太小
" };
public
ERRNO
ERRNO_A
UTH_EXP
=
new
ERRNO
()
{
Code
=
8
,
Descrption
=
"AUTH_EXP"
};
//"授权过期
" };
public
ERRNO
ERRNO_A
D_MAX
=
new
ERRNO
()
{
Code
=
3
,
Description
=
"AD_MAX"
};
//"AD值太大
" };
public
ERRNO
ERRNO_
DB_BACKUP
=
new
ERRNO
()
{
Code
=
9
,
Descrption
=
"DB_BACKUP"
};
//"已经连续开机1个月,数据库需要备份归档,请尽快重启服务器
" };
public
ERRNO
ERRNO_
SCRAM
=
new
ERRNO
()
{
Code
=
4
,
Description
=
"SCRAM"
};
//"急停
" };
public
ERRNO
ERRNO_LIMIT
=
new
ERRNO
()
{
Code
=
5
,
Description
=
"LIMIT"
};
//"限位" };
public
ERRNO
ERRNO_
OVERCTRL
=
new
ERRNO
()
{
Code
=
11
,
Descrption
=
"OVERCTRL"
};
//"扫描超控制报警
" };
public
ERRNO
ERRNO_
FLYAD7_DC
=
new
ERRNO
()
{
Code
=
6
,
Description
=
"FLYAD7_DC"
};
//"AD盒连接断开
" };
public
ERRNO
ERRNO_OVERTOL
=
new
ERRNO
()
{
Code
=
12
,
Descrption
=
"OVERTOL"
};
//"扫描超规格报警" };
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
=
new
ERRNO
()
{
Code
=
20
,
Descrption
=
"SAMPLE"
};
//"采样出错" };
public
ERRNO
ERRNO_SAMPLE_ParamErr
=
new
ERRNO
()
{
Code
=
20
,
Description
=
"SAMPLE_ParamErr"
};
//"采样出错:参数异常" };
public
ERRNO
ERRNO_SAMPLE_ParamErr
=
new
ERRNO
()
{
Code
=
20
,
Descrption
=
"SAMPLE_ParamErr"
};
//"采样出错:参数异常" };
public
ERRNO
ERRNO_SAMPLE_ADZero
=
new
ERRNO
()
{
Code
=
21
,
Description
=
"SAMPLE_ADZero"
};
//"采样出错:AD值为0" };
public
ERRNO
ERRNO_SAMPLE_ADZero
=
new
ERRNO
()
{
Code
=
21
,
Descrption
=
"SAMPLE_ADZero"
};
//"采样出错:AD值为0" };
public
ERRNO
ERRNO_SAMPLE_NoData
=
new
ERRNO
()
{
Code
=
22
,
Description
=
"SAMPLE_NoData"
};
//"采样出错:没有采集数据" };
public
ERRNO
ERRNO_SAMPLE_NoData
=
new
ERRNO
()
{
Code
=
22
,
Descrption
=
"SAMPLE_NoData"
};
//"采样出错:没有采集数据" };
public
ERRNO
ERRNO_SAMPLE_FilterErr
=
new
ERRNO
()
{
Code
=
23
,
Description
=
"SAMPLE_FilterErr"
};
//"采样出错:滤波数据与原始数据差异大" };
public
ERRNO
ERRNO_SAMPLE_FilterErr
=
new
ERRNO
()
{
Code
=
23
,
Descrption
=
"SAMPLE_FilterErr"
};
//"采样出错:滤波数据与原始数据差异大" };
public
ERRNO
ERRNO_SAMPLE_PercentErr
=
new
ERRNO
()
{
Code
=
24
,
Description
=
"SAMPLE_PercentErr"
};
//"采样出错:样品AD与上次差异大" };
public
ERRNO
ERRNO_SAMPLE_PercentErr
=
new
ERRNO
()
{
Code
=
24
,
Descrption
=
"SAMPLE_PercentErr"
};
//"采样出错:样品AD与上次差异大" };
public
ERRNO
ERRNO_SAMPLE_CrossErr
=
new
ERRNO
()
{
Code
=
25
,
Description
=
"SAMPLE_CrossErr"
};
//"采样出错:样品比值与上次差异大" };
public
ERRNO
ERRNO_SAMPLE_CrossErr
=
new
ERRNO
()
{
Code
=
25
,
Descrption
=
"SAMPLE_CrossErr"
};
//"采样出错:样品比值与上次差异大" };
}
}
}
}
Project.FLY.Thick.Base/FLY.Thick.Base/FLY.Thick.Base.csproj
View file @
36899304
...
@@ -42,6 +42,8 @@
...
@@ -42,6 +42,8 @@
</ApplicationIcon>
</ApplicationIcon>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference
Include=
"PresentationCore"
/>
<Reference
Include=
"PresentationFramework"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Xml.Linq"
/>
<Reference
Include=
"System.Xml.Linq"
/>
...
@@ -162,6 +164,16 @@
...
@@ -162,6 +164,16 @@
<Folder
Include=
"OBJ_INTERFACE\"
/>
<Folder
Include=
"OBJ_INTERFACE\"
/>
<Folder
Include=
"Server.OBJProxy\"
/>
<Folder
Include=
"Server.OBJProxy\"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<Page
Include=
"Themes\StringResources\en\StringResource.ERRNO.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
<Page
Include=
"Themes\StringResources\StringResource.ERRNO.xaml"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
</Page>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Other similar extension points exist, see Microsoft.Common.targets.
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Server/GetSample.cs
View file @
36899304
...
@@ -556,9 +556,8 @@ namespace FLY.Thick.Base.Server
...
@@ -556,9 +556,8 @@ namespace FLY.Thick.Base.Server
void
UpdateSampleErrNo
(
ERRNO
sampleErrNo
)
void
UpdateSampleErrNo
(
ERRNO
sampleErrNo
)
{
{
this
.
warningSystem
.
Update
(
this
.
warningSystem
.
Update
(
ERRNOs
.
Instance
.
ERRNO_SAMPLE
.
Code
,
sampleErrNo
.
Code
,
sampleErrNo
.
Descrption
,
sampleErrNo
.
Description
accessory
:
sampleErrNo
.
Code
.
ToString
()
);
);
}
}
/// <summary>
/// <summary>
...
@@ -608,8 +607,7 @@ namespace FLY.Thick.Base.Server
...
@@ -608,8 +607,7 @@ namespace FLY.Thick.Base.Server
//全部都采集完成
//全部都采集完成
if
(!
IsErr
())
//没有异常
if
(!
IsErr
())
//没有异常
{
{
this
.
warningSystem
.
Remove
(
Remove_ERRNO_SAMPLE
();
ERRNOs
.
Instance
.
ERRNO_SAMPLE
);
//备份
//备份
last_sampleData
=
new
SampleData
();
last_sampleData
=
new
SampleData
();
...
@@ -624,7 +622,15 @@ namespace FLY.Thick.Base.Server
...
@@ -624,7 +622,15 @@ namespace FLY.Thick.Base.Server
_end
:
_end
:
SampleChangedEvent
?.
Invoke
(
this
);
SampleChangedEvent
?.
Invoke
(
this
);
}
}
void
Remove_ERRNO_SAMPLE
()
{
this
.
warningSystem
.
Remove
(
ERRNOs
.
Instance
.
ERRNO_SAMPLE_ParamErr
);
this
.
warningSystem
.
Remove
(
ERRNOs
.
Instance
.
ERRNO_SAMPLE_ADZero
);
this
.
warningSystem
.
Remove
(
ERRNOs
.
Instance
.
ERRNO_SAMPLE_NoData
);
this
.
warningSystem
.
Remove
(
ERRNOs
.
Instance
.
ERRNO_SAMPLE_FilterErr
);
this
.
warningSystem
.
Remove
(
ERRNOs
.
Instance
.
ERRNO_SAMPLE_PercentErr
);
this
.
warningSystem
.
Remove
(
ERRNOs
.
Instance
.
ERRNO_SAMPLE_CrossErr
);
}
bool
IsErr
()
bool
IsErr
()
{
{
if
(
last_sampleData
==
null
)
if
(
last_sampleData
==
null
)
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Themes/StringResources/StringResource.ERRNO.xaml
0 → 100644
View file @
36899304
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xml:space="preserve">
<!--字符串换行 必须添加 xml:space="preserve" -->
<!--字符串换行 换行符 -->
<system:String x:Key="str.ERRNO.ERRNO_ALARM_TEST">报警测试</system:String>
<system:String x:Key="str.ERRNO.ERRNO_AD_MIN">AD值超下限</system:String>
<system:String x:Key="str.ERRNO.ERRNO_AD_MAX">AD值超上限</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SCRAM">急停</system:String>
<system:String x:Key="str.ERRNO.ERRNO_LIMIT">限位</system:String>
<system:String x:Key="str.ERRNO.ERRNO_FLYAD7_DC">AD盒连接断开</system:String>
<system:String x:Key="str.ERRNO.ERRNO_WILL_EXP">授权将要过期</system:String>
<system:String x:Key="str.ERRNO.ERRNO_AUTH_EXP">授权过期</system:String>
<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_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>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_FilterErr">采样出错:滤波数据与原始数据差异大</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_PercentErr">采样出错:样品AD与上次差异大</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_CrossErr">采样出错:样品比值与上次差异大</system:String>
</ResourceDictionary>
\ No newline at end of file
Project.FLY.Thick.Base/FLY.Thick.Base/Themes/StringResources/en/StringResource.ERRNO.xaml
0 → 100644
View file @
36899304
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xml:space="preserve">
<!--字符串换行 必须添加 xml:space="preserve" -->
<!--字符串换行 换行符 -->
<system:String x:Key="str.ERRNO.ERRNO_ALARM_TEST">Alarm Test</system:String>
<system:String x:Key="str.ERRNO.ERRNO_AD_MIN">AD exceeded the lower limit</system:String>
<system:String x:Key="str.ERRNO.ERRNO_AD_MAX">AD exceeded the upper limit</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SCRAM">Scram</system:String>
<system:String x:Key="str.ERRNO.ERRNO_LIMIT">Limit</system:String>
<system:String x:Key="str.ERRNO.ERRNO_FLYAD7_DC">FLYAD7 disconnected</system:String>
<system:String x:Key="str.ERRNO.ERRNO_WILL_EXP">Authorization will expire</system:String>
<system:String x:Key="str.ERRNO.ERRNO_AUTH_EXP">Authorization expired</system:String>
<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_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>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_FilterErr">Sampling error: Filtering Error</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_PercentErr">Sampling error: Large Deviation</system:String>
<system:String x:Key="str.ERRNO.ERRNO_SAMPLE_CrossErr">Sampling error: Proportional Error</system:String>
</ResourceDictionary>
\ No newline at end of file
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