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
6aeafc95
Commit
6aeafc95
authored
Nov 11, 2024
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/dev8.0-jinjiu' into dev8.0-blowing
parents
218b32ef
b8520ac4
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
80 additions
and
82 deletions
+80
-82
FlyAD7.cs
Project.FLY.FlyADBase/FlyADBase/FlyAD7.cs
+47
-39
IFlyADClient.cs
Project.FLY.FlyADBase/FlyADBase/IFlyADClient.cs
+0
-5
OnInitError.cs
...ct.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitError.cs
+0
-10
PgFlyAd.xaml.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgFlyAd.xaml.cs
+1
-4
ERRNOs.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Common/ERRNOs.cs
+11
-9
FLY.Thick.Base.csproj
Project.FLY.Thick.Base/FLY.Thick.Base/FLY.Thick.Base.csproj
+1
-1
IFlyADService.cs
...t.FLY.Thick.Base/FLY.Thick.Base/IService/IFlyADService.cs
+6
-1
FlyAdService.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Server/FlyAdService.cs
+10
-13
StringResource.ERRNO.xaml
....Base/Themes/StringResources/en/StringResource.ERRNO.xaml
+2
-0
StringResource.ERRNO.xaml
....Base/Themes/StringResources/zh/StringResource.ERRNO.xaml
+2
-0
No files found.
Project.FLY.FlyADBase/FlyADBase/FlyAD7.cs
View file @
6aeafc95
...
...
@@ -47,13 +47,6 @@ namespace FlyADBase
/// </summary>
public
int
ConnectCnt
{
get
;
private
set
;
}
/// <summary>
/// CRC
/// </summary>
public
bool
HasCRC
{
get
;
set
;
}
/// <summary>
/// 已经从AD盒获取全部当前数据
/// </summary>
...
...
@@ -504,11 +497,6 @@ namespace FlyADBase
void
FlyAD7_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
if
(
e
.
PropertyName
==
nameof
(
HasCRC
))
{
if
(
conn
!=
null
)
conn
.
HasCRC
=
HasCRC
;
}
if
(
bShieldSetValueEx
)
return
;
...
...
@@ -1334,7 +1322,7 @@ namespace FlyADBase
}
conn
=
CurrObjSys
.
Connect_to_Another_OBJSys
(
LocalEP
,
ID
);
conn
.
HasCRC
=
HasCRC
;
conn
.
HasCRC
=
false
;
}
/// <summary>
...
...
@@ -1349,7 +1337,7 @@ namespace FlyADBase
}
conn
=
CurrObjSys
.
Connect_to_Another_OBJSys
(
LocalEP
,
ID
);
conn
.
HasCRC
=
HasCRC
;
conn
.
HasCRC
=
false
;
}
#
endregion
...
...
@@ -1761,19 +1749,34 @@ namespace FlyADBase
class
FlyAD7JsonDb
{
static
Mapper
Mapper
{
get
;
}
=
new
AutoMapper
.
Mapper
(
new
MapperConfiguration
(
c
=>
{
c
.
CreateMap
<
FlyAD7
,
FlyAD7JsonDb
>().
ReverseMap
();
}));
public
static
void
Save
(
string
jsonDbPath
,
FlyAD7
src
)
{
if
(
string
.
IsNullOrEmpty
(
jsonDbPath
))
return
;
var
p
=
FlyAD7JsonDb
.
Mapper
.
Map
<
FlyAD7JsonDb
>(
src
);
FlyAD7JsonDb
jsonDb
=
new
FlyAD7JsonDb
()
{
Addr
=
src
.
Addr
,
GridSmooth
=
src
.
GridSmooth
,
ADLag
=
src
.
ADLag
,
PosMin
=
src
.
PosMin
,
PosMax
=
src
.
PosMax
,
HasPosMaxMin
=
src
.
HasPosMaxMin
,
HardwareVersion
=
src
.
HardwareVersion
,
IsDevParamValid
=
src
.
IsDevParamValid
,
MotorType
=
src
.
MotorType
,
PosOfGrid
=
src
.
PosOfGrid
,
Ratio01
=
src
.
Ratio01
,
Ratio02
=
src
.
Ratio02
,
PosOffset
=
src
.
PosOffset
,
JogVelocity
=
src
.
JogVelocity
};
try
{
File
.
WriteAllText
(
jsonDbPath
,
JsonConvert
.
SerializeObject
(
p
,
Formatting
.
Indented
));
File
.
WriteAllText
(
jsonDbPath
,
JsonConvert
.
SerializeObject
(
jsonDb
,
Formatting
.
Indented
));
}
catch
{
...
...
@@ -1790,8 +1793,24 @@ namespace FlyADBase
if
(
File
.
Exists
(
jsonDbPath
))
{
string
json
=
File
.
ReadAllText
(
jsonDbPath
);
var
p
=
JsonConvert
.
DeserializeObject
<
FlyAD7JsonDb
>(
json
);
Mapper
.
Map
(
p
,
src
);
FlyAD7JsonDb
jsonDb
=
JsonConvert
.
DeserializeObject
<
FlyAD7JsonDb
>(
json
);
src
.
Addr
=
jsonDb
.
Addr
;
src
.
GridSmooth
=
jsonDb
.
GridSmooth
;
src
.
ADLag
=
jsonDb
.
ADLag
;
src
.
PosMin
=
jsonDb
.
PosMin
;
src
.
PosMax
=
jsonDb
.
PosMax
;
src
.
HasPosMaxMin
=
jsonDb
.
HasPosMaxMin
;
src
.
HardwareVersion
=
jsonDb
.
HardwareVersion
;
src
.
IsDevParamValid
=
jsonDb
.
IsDevParamValid
;
src
.
MotorType
=
jsonDb
.
MotorType
;
src
.
PosOfGrid
=
jsonDb
.
PosOfGrid
;
src
.
Ratio01
=
jsonDb
.
Ratio01
;
src
.
Ratio02
=
jsonDb
.
Ratio02
;
src
.
PosOffset
=
jsonDb
.
PosOffset
;
src
.
JogVelocity
=
jsonDb
.
JogVelocity
;
return
true
;
}
}
...
...
@@ -1802,7 +1821,6 @@ namespace FlyADBase
return
false
;
}
public
string
Addr
=
"192.168.251.10:20006"
;
public
bool
HasCRC
=
false
;
public
int
GridSmooth
=
0
;
public
int
ADLag
=
0
;
public
int
PosMin
=
0
;
...
...
@@ -1846,7 +1864,7 @@ namespace FlyADBase
/// </summary>
class
SysTickContext
{
Int32
systick_1st
=
0
;
int
systick_1st
=
0
;
DateTime
dt_1st
=
DateTime
.
MinValue
;
public
event
Action
BeReseted
;
public
void
Reset
()
...
...
@@ -1872,30 +1890,20 @@ namespace FlyADBase
}
int
ms
=
systick
-
systick_1st
;
if
((
ms
<
-
1000
)
||
//时间被提前
(
ms
>
1000
*
60
*
3
))
//记录与新的timemark 相差3分钟,太大了,重新生成 timemark 与 dt 的关系
if
(
Math
.
Abs
(
ms
)
>
2000
)
{
//时间偏差太大,重新生成 timemark 与 dt 的关系
//被复位了
BeReseted
?.
Invoke
();
dt_1st
=
DateTime
.
Now
;
//毫秒级别取整
long
tick
=
dt_1st
.
Ticks
%
TimeSpan
.
TicksPerMillisecond
;
dt_1st
-=
TimeSpan
.
FromTicks
(
tick
);
systick_1st
=
systick
;
return
dt_1st
;
Reset
();
return
ToDateTime
(
systick
);
}
DateTime
dt
=
dt_1st
.
AddMilliseconds
(
ms
);
systick_1st
=
systick
;
dt_1st
=
dt
;
//if (Math.Abs((DateTime.Now-dt).TotalSeconds) > 5000)//滞后5s,异常
//{
// //修正
// dt = DateTime.Now;
// dt_1st = dt;
//}
return
dt
;
}
}
...
...
Project.FLY.FlyADBase/FlyADBase/IFlyADClient.cs
View file @
6aeafc95
...
...
@@ -22,11 +22,6 @@ namespace FlyADBase
/// </summary>
int
ConnectCnt
{
get
;
}
/// <summary>
/// CRC 校正
/// </summary>
bool
HasCRC
{
get
;
set
;
}
/// <summary>
/// 连接
/// </summary>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitError.cs
View file @
6aeafc95
...
...
@@ -99,16 +99,6 @@ namespace FLY.Thick.Base.UI.OnInit
int
errcode
=
rs
.
First
().
ErrCode
;
string
description
=
rs
.
First
().
Description
;
ResourceDictionary
rd_errnos
=
(
ResourceDictionary
)
Application
.
Current
.
TryFindResource
(
"dict.StringResource.ERRNO"
);
if
(
rd_errnos
!=
null
&&
!
string
.
IsNullOrEmpty
(
description
))
{
string
resourceName
=
$"str.ERRNO.
{
description
}
"
;
if
(
rd_errnos
.
Contains
(
resourceName
))
{
description
=
(
string
)
rd_errnos
[
resourceName
];
}
}
string
path
=
paramDictionary
.
GetValue
<
string
>(
ParamDistItemKeys
.
WarningTipPath
);
string
msg
=
description
;
//报警!!!!!!!!
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgFlyAd.xaml.cs
View file @
6aeafc95
...
...
@@ -56,7 +56,6 @@ namespace FLY.Thick.Base.UI
{
public
event
PropertyChangedEventHandler
PropertyChanged
;
#
region
参数
public
bool
HasCRC
{
get
;
set
;
}
public
IPEndPoint
EP
{
get
;
set
;
}
public
UInt16
PosOfGrid
{
get
;
set
;
}
public
MOTORTYPE
MotorType
{
set
;
get
;
}
...
...
@@ -168,7 +167,6 @@ namespace FLY.Thick.Base.UI
//下面全部event保存在bindingConexts
Misc
.
BindingOperations
.
StartMarkdownEvents
(
bindingConexts
);
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
HasCRC
),
this
,
nameof
(
HasCRC
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
flyAdService
,
nameof
(
this
.
flyAdService
.
Addr
),
this
,
()
=>
{
EP
=
Misc
.
StringConverter
.
ToIPEndPoint
(
this
.
flyAdService
.
Addr
);
...
...
@@ -228,7 +226,6 @@ namespace FLY.Thick.Base.UI
if
(!
WdPassword
.
Authorize
(
"FlyAd"
))
return
;
flyAdService
.
HasCRC
=
this
.
HasCRC
;
flyAdService
.
Addr
=
this
.
EP
.
ToString
();
flyAdService
.
PosOfGrid
=
this
.
PosOfGrid
;
flyAdService
.
MotorType
=
this
.
MotorType
;
...
...
@@ -244,7 +241,7 @@ namespace FLY.Thick.Base.UI
flyAdService
.
PosMax
=
this
.
PosMax
;
flyAdService
.
HardwareVersion
=
HardwareVersion
;
flyAdService
.
Apply
();
{
string
tit
=
(
string
)
Application
.
Current
.
TryFindResource
(
"str.PgFlyAd.ApplySuccessfully"
);
FLY
.
ControlLibrary
.
Window_Tip
.
Show
(
tit
,
null
,
TimeSpan
.
FromSeconds
(
2
));
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Common/ERRNO.cs
→
Project.FLY.Thick.Base/FLY.Thick.Base/Common/ERRNO
s
.cs
View file @
6aeafc95
...
...
@@ -40,7 +40,7 @@ namespace FLY.Thick.Base.Common
return
(
string
)
rd_errnos
[
resourceName
];
//异常直接让它出错
}
public
List
<
ERRNO
>
GetAll
()
public
virtual
List
<
ERRNO
>
GetAll
()
{
List
<
ERRNO
>
list
=
new
List
<
ERRNO
>();
Type
t
=
this
.
GetType
();
...
...
@@ -61,7 +61,9 @@ namespace FLY.Thick.Base.Common
return
list
;
}
public
ERRNO
ERRNO_ALARM_TEST
=
new
ERRNO
()
{
Code
=
1
,
Description
=
"ALARM_TEST"
};
//"报警测试" };
public
ERRNO
ERRNO_AUTH_EXP
=
new
ERRNO
()
{
Code
=
0
,
Description
=
"AUTH_EXP"
};
//"授权过期" };
public
ERRNO
ERRNO_FLYAD7_DC
=
new
ERRNO
()
{
Code
=
1
,
Description
=
"FLYAD7_DC"
};
//"AD盒连接断开" };
public
ERRNO
ERRNO_AD_MIN
=
new
ERRNO
()
{
Code
=
2
,
Description
=
"AD_MIN"
};
//"AD值太小" };
...
...
@@ -71,20 +73,20 @@ namespace FLY.Thick.Base.Common
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_
OVERTOL
=
new
ERRNO
()
{
Code
=
6
,
Description
=
"OVERTOL"
};
//"扫描超规格报警
" };
public
ERRNO
ERRNO_
WILL_EXP
=
new
ERRNO
()
{
Code
=
7
,
Description
=
"WILL_EXP"
};
//"授权将要过期
" };
public
ERRNO
ERRNO_
SCAN_FATAL
=
new
ERRNO
()
{
Code
=
7
,
Description
=
"SCAN_FATAL"
};
//"扫描动作异常
" };
public
ERRNO
ERRNO_
AUTH_EXP
=
new
ERRNO
()
{
Code
=
8
,
Description
=
"AUTH_EXP"
};
//"授权过期
" };
public
ERRNO
ERRNO_
SAMPLE_FATAL
=
new
ERRNO
()
{
Code
=
8
,
Description
=
"SAMPLE_FATAL"
};
//"采样异常
" };
public
ERRNO
ERRNO_
DB_BACKUP
=
new
ERRNO
()
{
Code
=
9
,
Description
=
"DB_BACKUP"
};
//"已经连续开机1个月,数据库需要备份归档,请尽快重启服务器
" };
public
ERRNO
ERRNO_
ALARM_TEST
=
new
ERRNO
()
{
Code
=
9
,
Description
=
"ALARM_TEST"
};
//"报警测试
" };
public
ERRNO
ERRNO_WILL_EXP
=
new
ERRNO
()
{
Code
=
10
,
Description
=
"WILL_EXP"
};
//"授权将要过期" };
public
ERRNO
ERRNO_OVERCTRL
=
new
ERRNO
()
{
Code
=
11
,
Description
=
"OVERCTRL"
};
//"扫描超控制报警" };
public
ERRNO
ERRNO_OVERTOL
=
new
ERRNO
()
{
Code
=
12
,
Description
=
"OVERTOL"
};
//"扫描超规格报警" };
public
ERRNO
ERRNO_DB_BACKUP
=
new
ERRNO
()
{
Code
=
12
,
Description
=
"DB_BACKUP"
};
//"已经连续开机1个月,数据库需要备份归档,请尽快重启服务器" };
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"
};
//"采样出错:没有采集数据" };
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/FLY.Thick.Base.csproj
View file @
6aeafc95
...
...
@@ -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/IService/IFlyADService.cs
View file @
6aeafc95
...
...
@@ -14,7 +14,6 @@ namespace FLY.Thick.Base.IService
public
interface
IFlyADService
:
INotifyPropertyChanged
{
#
region
参数
bool
HasCRC
{
get
;
set
;
}
string
Addr
{
get
;
set
;
}
UInt16
PosOfGrid
{
get
;
set
;
}
int
PosLen
{
get
;
}
...
...
@@ -32,6 +31,12 @@ namespace FLY.Thick.Base.IService
int
Verson
{
get
;
}
int
HardwareVersion
{
get
;
set
;
}
/// <summary>
/// 参数保存
/// </summary>
void
Apply
();
/// <summary>
/// 获取序列码
/// </summary>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Server/FlyAdService.cs
View file @
6aeafc95
...
...
@@ -21,15 +21,6 @@ namespace FLY.Thick.Base.Server
const
int
MARKNO_PUSH_ACCESS
=
2
;
#
endregion
public
bool
HasCRC
{
get
{
return
flyad
.
HasCRC
;
}
set
{
flyad
.
HasCRC
=
value
;
}
}
public
string
Addr
{
get
...
...
@@ -132,7 +123,7 @@ namespace FLY.Thick.Base.Server
}
}
public
int
ADLag
public
int
ADLag
{
get
{
return
flyad
.
ADLag
;
}
set
{
...
...
@@ -164,7 +155,7 @@ namespace FLY.Thick.Base.Server
}
}
public
int
Verson
public
int
Verson
{
get
{
return
flyad
.
Version
;
}
}
...
...
@@ -180,7 +171,7 @@ namespace FLY.Thick.Base.Server
{
}
public
void
Init
(
IFlyADClientAdv
flyad
,
AD2ThkHandler
func_Ad2Thk
)
public
void
Init
(
IFlyADClientAdv
flyad
,
AD2ThkHandler
func_Ad2Thk
)
{
ad2thk
=
func_Ad2Thk
;
...
...
@@ -195,7 +186,13 @@ namespace FLY.Thick.Base.Server
PropertyChanged
?.
Invoke
(
this
,
new
PropertyChangedEventArgs
(
e
.
PropertyName
));
}
}
/// <summary>
/// 保存参数
/// </summary>
public
void
Apply
()
{
flyad
.
Save
();
}
/// <summary>
/// 获取序列码
/// </summary>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Themes/StringResources/en/StringResource.ERRNO.xaml
View file @
6aeafc95
...
...
@@ -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>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Themes/StringResources/zh/StringResource.ERRNO.xaml
View file @
6aeafc95
...
...
@@ -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>
...
...
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