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
a9967594
Commit
a9967594
authored
Jul 12, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initparam 添加 数据库保存月数
parent
6f4472f1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
471 deletions
+82
-471
InitParamServiceClient.cs
...hick.Base/FLY.Thick.Base/Client/InitParamServiceClient.cs
+14
-6
IInitParamService.cs
...Y.Thick.Base/FLY.Thick.Base/IService/IInitParamService.cs
+5
-0
INITPARAM_OBJ_INTERFACE.cs
...e/FLY.Thick.Base/OBJ_INTERFACE/INITPARAM_OBJ_INTERFACE.cs
+2
-126
Initparam_OBJProxy.cs
...Base/FLY.Thick.Base/Server.OBJProxy/Initparam_OBJProxy.cs
+9
-5
InitParam.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Server/InitParam.cs
+52
-334
No files found.
Project.FLY.Thick.Base/FLY.Thick.Base/Client/InitParamServiceClient.cs
View file @
a9967594
...
...
@@ -7,6 +7,8 @@ using FObjBase;
using
FLY.Thick.Base.IService
;
using
FLY.Thick.Base.OBJ_INTERFACE
;
using
FLY.Thick.Base.Common
;
using
Newtonsoft.Json
;
namespace
FLY.Thick.Base.Client
{
public
class
InitParamServiceClient
:
FObj
,
IInitParamService
...
...
@@ -165,6 +167,10 @@ namespace FLY.Thick.Base.Client
/// </summary>
public
bool
HasHold
{
get
;
set
;
}
/// <summary>
/// 数据库保存的月数
/// </summary>
public
int
DBKeepMonth
{
get
;
set
;
}
#
endregion
#
region
INotifyPropertyChanged
成员
...
...
@@ -204,15 +210,16 @@ namespace FLY.Thick.Base.Client
hvelocity2
=
HVelocity2
,
hasProfileSample
=
HasProfileSample
,
hasHold
=
HasHold
hasHold
=
HasHold
,
dBKeepMonth
=
DBKeepMonth
};
string
json
=
JsonConvert
.
SerializeObject
(
p
);
//获取所有数据,设置推送
CurrObjSys
.
SetValueEx
(
mConn
,
mServerID
,
ID
,
INITPARAM_OBJ_INTERFACE
.
SET_PARAMS
,
p
.
ToBytes
(
));
Misc
.
Converter
.
StringToBytes
(
json
));
}
public
override
void
Dispose
()
{
...
...
@@ -238,10 +245,10 @@ namespace FLY.Thick.Base.Client
{
case
INITPARAM_OBJ_INTERFACE
.
GET_PARAMS
:
{
INITPARAM_OBJ_INTERFACE
.
Pack_Params
p
=
new
INITPARAM_OBJ_INTERFACE
.
Pack_Params
();
if
(!
p
.
TryParse
(
infodata
))
return
;
string
json
=
Misc
.
Converter
.
BytesToString
(
infodata
);
var
p
=
JsonConvert
.
DeserializeObject
<
INITPARAM_OBJ_INTERFACE
.
Pack_Params
>(
json
);
PosLength
=
p
.
poslength
;
AutoOrgInterval
=
p
.
auto_org_interval
;
PosOfGrid
=
p
.
posOfGrid
;
...
...
@@ -272,6 +279,7 @@ namespace FLY.Thick.Base.Client
HasProfileSample
=
p
.
hasProfileSample
;
HasHold
=
p
.
hasHold
;
DBKeepMonth
=
p
.
dBKeepMonth
;
}
break
;
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/IService/IInitParamService.cs
View file @
a9967594
...
...
@@ -122,6 +122,11 @@ namespace FLY.Thick.Base.IService
#
endregion
/// <summary>
/// 数据库保存的月数
/// </summary>
int
DBKeepMonth
{
get
;
set
;
}
void
Apply
();
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/OBJ_INTERFACE/INITPARAM_OBJ_INTERFACE.cs
View file @
a9967594
...
...
@@ -10,7 +10,7 @@ namespace FLY.Thick.Base.OBJ_INTERFACE
public
class
INITPARAM_OBJ_INTERFACE
{
#
region
Pack
public
class
Pack_Params
:
IPack
public
class
Pack_Params
{
public
int
poslength
;
...
...
@@ -47,131 +47,7 @@ namespace FLY.Thick.Base.OBJ_INTERFACE
public
bool
hasProfileSample
;
public
bool
hasHold
;
#
region
IPack
成员
public
byte
[]
ToBytes
()
{
List
<
byte
>
buf
=
new
List
<
byte
>();
buf
.
AddRange
(
BitConverter
.
GetBytes
(
poslength
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
adlag
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
auto_org_interval
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
posOfGrid
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
encoder1_mmpp
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
speed1scale
));
buf
.
AddRange
(
BitConverter
.
GetBytes
((
int
)
filmVSrc
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
filmVThreshold
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
encoder2_mmpp
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
encoder2_comp
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
mmOfR
));
buf
.
AddRange
(
BitConverter
.
GetBytes
((
int
)
data_valid_src
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
autof1f3
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
restartDelay
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
vscan
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
vjog
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
vaccuracy
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
svelocity
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
atime
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
dtime
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
hvelocity1
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
hvelocity2
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
hasProfileSample
));
buf
.
AddRange
(
BitConverter
.
GetBytes
(
hasHold
));
return
buf
.
ToArray
();
}
public
bool
TryParse
(
byte
[]
value
)
{
int
cnt
=
4
*
4
+
8
*
2
;
if
(
value
.
Length
<
cnt
)
return
false
;
int
idx
=
0
;
poslength
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
adlag
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
auto_org_interval
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
posOfGrid
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
encoder1_mmpp
=
BitConverter
.
ToDouble
(
value
,
idx
);
idx
+=
8
;
speed1scale
=
BitConverter
.
ToDouble
(
value
,
idx
);
idx
+=
8
;
cnt
+=
4
+
4
+
8
+
4
+
8
+
4
;
if
(
value
.
Length
<
cnt
)
return
false
;
filmVSrc
=
(
FilmVSRC
)
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
filmVThreshold
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
encoder2_mmpp
=
BitConverter
.
ToDouble
(
value
,
idx
);
idx
+=
8
;
encoder2_comp
=
BitConverter
.
ToSingle
(
value
,
idx
);
idx
+=
4
;
mmOfR
=
BitConverter
.
ToDouble
(
value
,
idx
);
idx
+=
8
;
data_valid_src
=
(
DATAVALIDSRC
)
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
cnt
+=
1
+
4
;
if
(
value
.
Length
<
cnt
)
return
false
;
autof1f3
=
BitConverter
.
ToBoolean
(
value
,
idx
);
idx
++;
restartDelay
=
BitConverter
.
ToInt32
(
value
,
idx
);
idx
+=
4
;
cnt
+=
4
*
8
;
if
(
value
.
Length
<
cnt
)
return
false
;
vscan
=
BitConverter
.
ToUInt32
(
value
,
idx
);
idx
+=
4
;
vjog
=
BitConverter
.
ToUInt32
(
value
,
idx
);
idx
+=
4
;
vaccuracy
=
BitConverter
.
ToUInt32
(
value
,
idx
);
idx
+=
4
;
svelocity
=
BitConverter
.
ToUInt32
(
value
,
idx
);
idx
+=
4
;
atime
=
BitConverter
.
ToUInt32
(
value
,
idx
);
idx
+=
4
;
dtime
=
BitConverter
.
ToUInt32
(
value
,
idx
);
idx
+=
4
;
hvelocity1
=
BitConverter
.
ToUInt32
(
value
,
idx
);
idx
+=
4
;
hvelocity2
=
BitConverter
.
ToUInt32
(
value
,
idx
);
idx
+=
4
;
cnt
+=
2
;
if
(
value
.
Length
<
cnt
)
return
false
;
hasProfileSample
=
BitConverter
.
ToBoolean
(
value
,
idx
);
idx
++;
hasHold
=
BitConverter
.
ToBoolean
(
value
,
idx
);
idx
++;
return
true
;
}
#
endregion
public
int
dBKeepMonth
;
}
#
endregion
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Server.OBJProxy/Initparam_OBJProxy.cs
View file @
a9967594
...
...
@@ -6,6 +6,7 @@ using FObjBase;
using
FLY.Thick.Base.OBJ_INTERFACE
;
using
FLY.Thick.Base.Common
;
using
FLY.Thick.Base.IService
;
using
Newtonsoft.Json
;
namespace
FLY.Thick.Base.Server.OBJProxy
{
...
...
@@ -74,9 +75,11 @@ namespace FLY.Thick.Base.Server.OBJProxy
hasProfileSample
=
mInitparam
.
HasProfileSample
,
hasHold
=
mInitparam
.
HasHold
hasHold
=
mInitparam
.
HasHold
,
dBKeepMonth
=
mInitparam
.
DBKeepMonth
};
infodata
=
p
.
ToBytes
();
string
json
=
JsonConvert
.
SerializeObject
(
p
);
infodata
=
Misc
.
Converter
.
StringToBytes
(
json
);
}
break
;
default
:
infodata
=
null
;
...
...
@@ -89,10 +92,10 @@ namespace FLY.Thick.Base.Server.OBJProxy
{
case
INITPARAM_OBJ_INTERFACE
.
SET_PARAMS
:
{
INITPARAM_OBJ_INTERFACE
.
Pack_Params
p
=
new
INITPARAM_OBJ_INTERFACE
.
Pack_Params
();
if
(!
p
.
TryParse
(
infodata
))
break
;
string
json
=
Misc
.
Converter
.
BytesToString
(
infodata
);
var
p
=
JsonConvert
.
DeserializeObject
<
INITPARAM_OBJ_INTERFACE
.
Pack_Params
>(
json
);
mInitparam
.
PosLength
=
p
.
poslength
;
mInitparam
.
ADLag
=
p
.
adlag
;
mInitparam
.
AutoOrgInterval
=
p
.
auto_org_interval
;
...
...
@@ -118,6 +121,7 @@ namespace FLY.Thick.Base.Server.OBJProxy
mInitparam
.
HasProfileSample
=
p
.
hasProfileSample
;
mInitparam
.
HasHold
=
p
.
hasHold
;
mInitparam
.
DBKeepMonth
=
p
.
dBKeepMonth
;
mInitparam
.
Apply
();
}
break
;
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Server/InitParam.cs
View file @
a9967594
This diff is collapsed.
Click to expand it.
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