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
7ff61276
Commit
7ff61276
authored
Aug 04, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/dev7.0' into dev7.0-filmCasting
parents
c6265fea
6924763a
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
104 additions
and
12 deletions
+104
-12
Enumerable.cs
Project.FLY.Misc/MISC/Enumerable.cs
+45
-0
LCUS1_dependOn.cs
...Y.Thick.Base/FLY.Thick.Base.UI/DependOn/LCUS1_dependOn.cs
+3
-0
WarningSystem2ServiceClientWithName.cs
...k.Base.UI/DependOn/WarningSystem2ServiceClientWithName.cs
+4
-0
OnInitAutoScan.cs
...FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitAutoScan.cs
+3
-0
OnInitError.cs
...ct.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitError.cs
+6
-0
OnInitGageCommand.cs
....Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitGageCommand.cs
+3
-0
OnInitLanguage.cs
...FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitLanguage.cs
+3
-0
OnInitLcus1_Multi.cs
....Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitLcus1_Multi.cs
+3
-0
OnInitLcus1_One.cs
...LY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitLcus1_One.cs
+3
-0
OnInitOSK.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitOSK.cs
+3
-0
OnInitWarnings.cs
...FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitWarnings.cs
+7
-0
DynAreaIO.xaml.cs
...Y.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaIO.xaml.cs
+3
-5
FilmPositionDetect.cs
...LY.Thick.Base/FLY.Thick.Base/Server/FilmPositionDetect.cs
+4
-2
SQLiteDbContext.cs
Project.SQLiteHelper/SQLiteHelper/SQLiteDbContext.cs
+9
-3
SQLiteHelper.cs
Project.SQLiteHelper/SQLiteHelper/SQLiteHelper.cs
+5
-2
No files found.
Project.FLY.Misc/MISC/Enumerable.cs
View file @
7ff61276
...
...
@@ -212,6 +212,51 @@ namespace Misc
}
return
System
.
Linq
.
Enumerable
.
SequenceEqual
(
first
,
second
,
comparer
);
}
/// <summary>
/// 对数列平滑;
/// 数列的两端,平滑量只有 radius;中间数据平滑量 = radius*2+1
/// </summary>
/// <param name="data">数列</param>
/// <param name="radius">平滑半径</param>
/// <returns></returns>
public
static
double
[]
Smooth
(
this
IEnumerable
<
double
>
frame
,
int
radius
)
{
if
(
radius
>
0
)
{
double
[]
frame2
=
new
double
[
frame
.
Count
()];
for
(
int
i
=
0
;
i
<
frame
.
Count
();
i
++)
{
double
sum
=
0
;
int
cnt
=
0
;
int
index_b
=
i
-
radius
;
int
index_e
=
i
+
radius
;
for
(
int
j
=
index_b
;
j
<=
index_e
;
j
++)
{
if
((
j
>=
0
)
&&
(
j
<
frame
.
Count
()))
{
double
v
=
frame
.
ElementAt
(
j
);
if
(!
double
.
IsNaN
(
v
))
{
sum
+=
v
;
cnt
++;
}
}
}
if
(
cnt
>
0
)
frame2
[
i
]
=
sum
/
cnt
;
else
frame2
[
i
]
=
double
.
NaN
;
}
return
frame2
;
}
else
{
return
frame
.
ToArray
();
}
}
}
/// <summary>
/// X Y 组合
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/DependOn/LCUS1_dependOn.cs
View file @
7ff61276
...
...
@@ -7,6 +7,9 @@ using System.Threading.Tasks;
namespace
FLY.Thick.Base.UI
{
/// <summary>
/// LCUS1 绑定 全局参数字典ParamDictionary 的配置
/// </summary>
public
class
LCUS1_dependOn
:
LCUS1
{
ParamDictionary
paramDictionary
;
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/DependOn/WarningSystem2ServiceClientWithName.cs
View file @
7ff61276
...
...
@@ -7,6 +7,10 @@ using System.Threading.Tasks;
namespace
FLY.Thick.Base.UI
{
/// <summary>
/// 报警服务 的带设备名称 版本
/// </summary>
public
class
WarningSystem2ServiceClientWithName
:
WarningSystem2ServiceClient
{
public
string
DevName
{
get
;
private
set
;
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitAutoScan.cs
View file @
7ff61276
...
...
@@ -9,6 +9,9 @@ using System.Threading.Tasks;
namespace
FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 显示 自动扫描 提示, 只是负责显示而已
/// </summary>
public
class
OnInitAutoScan
:
IOnInit
{
FLY
.
OBJComponents
.
IService
.
IWarningSystem2Service
warningService
;
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitError.cs
View file @
7ff61276
...
...
@@ -14,6 +14,12 @@ using FLY.Thick.Base.Common;
namespace
FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// ERRNOs.Instance.SCAN_ERRNO_OVERCTRL
/// ERRNOs.Instance.SCAN_ERRNO_OVERTOL
/// 扫描报警时,全屏显示
/// </summary>
public
class
OnInitError
:
IOnInit
{
#
region
延时推送
MARKNO
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitGageCommand.cs
View file @
7ff61276
...
...
@@ -13,6 +13,9 @@ using FLY.Thick.Base.UI;
namespace
FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// F1~F5 动作
/// </summary>
public
class
OnInitGageCommand
:
IOnInit
{
Window
window
;
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitLanguage.cs
View file @
7ff61276
...
...
@@ -11,6 +11,9 @@ using System.Windows;
namespace
FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 语言切换,现在没法用 UI没做英语翻译
/// </summary>
public
class
OnInitLanguage
:
IOnInit
{
ParamDictionary
paramDictionary
;
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitLcus1_Multi.cs
View file @
7ff61276
...
...
@@ -9,6 +9,9 @@ using Unity;
namespace
FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// LCUS1 USB继电器模块, 监听 WarningSystemManager
/// </summary>
public
class
OnInitLcus1_Multi
:
IOnInit
{
public
int
Level
{
get
;
private
set
;
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitLcus1_One.cs
View file @
7ff61276
...
...
@@ -9,6 +9,9 @@ using Unity;
namespace
FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// LCUS1 USB继电器模块, 监听 单个报警服务 IWarningSystem2Service
/// </summary>
public
class
OnInitLcus1_One
:
IOnInit
{
public
int
Level
{
get
;
private
set
;
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitOSK.cs
View file @
7ff61276
...
...
@@ -11,6 +11,9 @@ using Unity;
namespace
FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 虚拟键盘
/// </summary>
public
class
OnInitOSK
:
IOnInit
{
ParamDictionary
paramDictionary
;
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitWarnings.cs
View file @
7ff61276
...
...
@@ -18,6 +18,9 @@ using System.Collections.ObjectModel;
namespace
FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 监听 WarningSystemManager 的报警。 周期一个个显示 报警列表的内容
/// </summary>
public
class
OnInitWarnings
:
IOnInit
{
public
int
Level
{
get
;
private
set
;
}
...
...
@@ -98,6 +101,10 @@ namespace FLY.Thick.Base.UI.OnInit
}
}
/// <summary>
/// 从 warnings.service 容器获取全部 报警服务, 把 全部报警服务的报警内容 整合到 Errors
/// </summary>
public
class
WarningSystemManager
:
INotifyPropertyChanged
{
public
event
PropertyChangedEventHandler
PropertyChanged
;
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UiModule/DynAreaIO.xaml.cs
View file @
7ff61276
...
...
@@ -195,16 +195,14 @@ namespace FLY.Thick.Base.UI.UiModule
UpdateError
();
}
private
void
WarningService_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
private
void
WarningSystem_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
if
(
e
.
PropertyName
==
nameof
(
Reflect_SeviceClient
.
IsConnected
))
{
UpdateError
();
}
}
private
void
WarningSystem_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
if
(
e
.
PropertyName
==
nameof
(
warningSystem
.
ReasonList
))
else
if
(
e
.
PropertyName
==
nameof
(
warningSystem
.
ReasonList
))
{
if
(
warningSystem
.
ReasonList
!=
null
&&
warningSystem
.
ReasonList
.
Count
()
>
0
)
reason_list_index
=
warningSystem
.
ReasonList
.
Count
()
-
1
;
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Server/FilmPositionDetect.cs
View file @
7ff61276
...
...
@@ -266,8 +266,10 @@ namespace FLY.Thick.Base.Server
double
v
=
MmOfR
/
1000.0
/
(
dt
-
dtRound
).
TotalMinutes
;
if
(
v
<
(
FilmVelocity
-
1
))
FilmVelocity
=
v
;
if
(
v
>=
(
FilmVelocity
-
1
))
return
;
FilmVelocity
=
v
;
double
p1
=
RCnt
*
MmOfR
/
1000.0
;
...
...
Project.SQLiteHelper/SQLiteHelper/SQLiteDbContext.cs
View file @
7ff61276
...
...
@@ -257,9 +257,14 @@ namespace SQLite
sqls
.
RemoveAll
(
sql
=>
sql
==
null
);
if
(
sqls
.
Count
==
0
)
return
;
sqliteHelper
.
QueryTran
(
sqls
);
int
cnt
=
0
;
foreach
(
var
sql
in
sqls
)
{
cnt
+=
sqliteHelper
.
ExecuteNonQuery
(
sql
);
}
if
(
cnt
>
0
)
{
//数据库压缩
sqliteHelper
.
ExecuteNonQuery
(
"VACUUM"
);
}
}
/// <summary>
...
...
@@ -387,6 +392,7 @@ namespace SQLite
//把sqls里面为空的全部删除
if
(
sqliteHelper2
.
QueryTran
(
sqls
))
{
//数据库压缩
sqliteHelper2
.
ExecuteNonQuery
(
"VACUUM"
);
}
...
...
Project.SQLiteHelper/SQLiteHelper/SQLiteHelper.cs
View file @
7ff61276
...
...
@@ -446,18 +446,21 @@ namespace SQLite
/// <param name="parameters">执行增删改语句所需要的参数,参数必须以它们在SQL语句中的顺序为准。</param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public
void
ExecuteNonQuery
(
string
sql
)
public
int
ExecuteNonQuery
(
string
sql
)
{
int
ret
=
0
;
using
(
SQLiteConnection
connection
=
new
SQLiteConnection
(
ConnectionString
))
{
using
(
SQLiteCommand
command
=
new
SQLiteCommand
(
connection
))
{
connection
.
Open
();
command
.
CommandText
=
sql
;
command
.
ExecuteNonQuery
();
ret
=
command
.
ExecuteNonQuery
();
connection
.
Close
();
}
}
return
ret
;
}
...
...
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