Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cdy816
Mars
提交
913d8a8a
Mars
项目概览
cdy816
/
Mars
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
913d8a8a
编写于
9月 14, 2020
作者:
cdy816
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
死区压缩算法Bug修复。压缩参数开发环境不更新Bug修改
上级
c5a6e60e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
117 addition
and
63 deletion
+117
-63
Common/Cdy.Tag.Network/SocketServer.cs
Common/Cdy.Tag.Network/SocketServer.cs
+62
-54
Develop/DBDevelopClientWebApi/DBDevelopClientWebApi.csproj
Develop/DBDevelopClientWebApi/DBDevelopClientWebApi.csproj
+4
-0
Develop/DbManager.Desktop/ViewModel/Tag/CompressParameterModelBase.cs
...nager.Desktop/ViewModel/Tag/CompressParameterModelBase.cs
+4
-2
Develop/DbManager.Desktop/ViewModel/Tag/TagViewModel.cs
Develop/DbManager.Desktop/ViewModel/Tag/TagViewModel.cs
+17
-1
RunTime/DBInRun/Program.cs
RunTime/DBInRun/Program.cs
+7
-0
RunTime/DBRuntime/His/Compress/Special/DeadAreaCompressUnit2.cs
...e/DBRuntime/His/Compress/Special/DeadAreaCompressUnit2.cs
+20
-2
RunTime/DBRuntime/His/Compress/Special/SlopeCompressUnit2.cs
RunTime/DBRuntime/His/Compress/Special/SlopeCompressUnit2.cs
+1
-2
RunTime/DBRuntime/His/HisEnginer2.cs
RunTime/DBRuntime/His/HisEnginer2.cs
+1
-1
RunTime/DBRuntime/His/obsolete/HisEnginer.cs
RunTime/DBRuntime/His/obsolete/HisEnginer.cs
+1
-1
未找到文件。
Common/Cdy.Tag.Network/SocketServer.cs
浏览文件 @
913d8a8a
...
...
@@ -118,71 +118,79 @@ namespace Cdy.Tag
/// <param name="port"></param>
protected
virtual
async
void
StartInner
(
int
port
)
{
if
(!
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
Windows
))
try
{
GCSettings
.
LatencyMode
=
GCLatencyMode
.
SustainedLowLatency
;
}
if
(!
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
Windows
))
{
GCSettings
.
LatencyMode
=
GCLatencyMode
.
SustainedLowLatency
;
}
if
(
UseLibuv
)
{
var
dispatcher
=
new
DispatcherEventLoopGroup
();
bossGroup
=
dispatcher
;
workGroup
=
new
WorkerEventLoopGroup
(
dispatcher
);
}
else
{
bossGroup
=
new
MultithreadEventLoopGroup
(
1
);
workGroup
=
new
MultithreadEventLoopGroup
();
}
if
(
UseLibuv
)
{
var
dispatcher
=
new
DispatcherEventLoopGroup
();
bossGroup
=
dispatcher
;
workGroup
=
new
WorkerEventLoopGroup
(
dispatcher
);
}
else
{
bossGroup
=
new
MultithreadEventLoopGroup
(
1
);
workGroup
=
new
MultithreadEventLoopGroup
();
}
X509Certificate2
tlsCertificate
=
null
;
if
(
IsSsl
)
{
// tlsCertificate = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "dotnetty.com.pfx"), "password");
}
X509Certificate2
tlsCertificate
=
null
;
if
(
IsSsl
)
{
// tlsCertificate = new X509Certificate2(Path.Combine(ExampleHelper.ProcessDirectory, "dotnetty.com.pfx"), "password");
}
var
bootstrap
=
new
ServerBootstrap
();
bootstrap
.
Group
(
bossGroup
,
workGroup
);
var
bootstrap
=
new
ServerBootstrap
();
bootstrap
.
Group
(
bossGroup
,
workGroup
);
if
(
UseLibuv
)
{
bootstrap
.
Channel
<
TcpServerChannel
>();
if
(
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
Linux
)
||
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
OSX
))
if
(
UseLibuv
)
{
bootstrap
.
Option
(
ChannelOption
.
SoReuseport
,
true
)
.
ChildOption
(
ChannelOption
.
SoReuseaddr
,
true
);
bootstrap
.
Channel
<
TcpServerChannel
>();
if
(
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
Linux
)
||
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
OSX
))
{
bootstrap
.
Option
(
ChannelOption
.
SoReuseport
,
true
)
.
ChildOption
(
ChannelOption
.
SoReuseaddr
,
true
);
}
}
else
{
bootstrap
.
Channel
<
TcpServerSocketChannel
>();
}
}
else
{
bootstrap
.
Channel
<
TcpServerSocketChannel
>();
}
bootstrap
.
Option
(
ChannelOption
.
SoBacklog
,
8192
)
.
ChildHandler
(
new
ActionChannelInitializer
<
IChannel
>(
channel
=>
{
IChannelPipeline
pipeline
=
channel
.
Pipeline
;
if
(
tlsCertificate
!=
null
)
bootstrap
.
Option
(
ChannelOption
.
SoBacklog
,
8192
)
.
ChildHandler
(
new
ActionChannelInitializer
<
IChannel
>(
channel
=>
{
pipeline
.
AddLast
(
TlsHandler
.
Server
(
tlsCertificate
));
}
pipeline
.
AddLast
(
"framing-enc"
,
new
LengthFieldPrepender
(
4
));
pipeline
.
AddLast
(
"framing-dec"
,
new
LengthFieldBasedFrameDecoder
(
Int32
.
MaxValue
,
0
,
4
,
0
,
4
));
mProcessHandle
=
new
ServerChannelHandler
(
this
);
mProcessHandle
.
DataArrived
=
new
ServerChannelHandler
.
DataArrivedDelegate
((
context
,
fun
,
data
)
=>
{
return
ExecuteCallBack
(
context
,
fun
,
data
);
});
pipeline
.
AddLast
(
mProcessHandle
);
}));
if
(
string
.
IsNullOrEmpty
(
mIp
))
{
boundChannel
=
await
bootstrap
.
BindAsync
(
port
);
IChannelPipeline
pipeline
=
channel
.
Pipeline
;
if
(
tlsCertificate
!=
null
)
{
pipeline
.
AddLast
(
TlsHandler
.
Server
(
tlsCertificate
));
}
pipeline
.
AddLast
(
"framing-enc"
,
new
LengthFieldPrepender
(
4
));
pipeline
.
AddLast
(
"framing-dec"
,
new
LengthFieldBasedFrameDecoder
(
Int32
.
MaxValue
,
0
,
4
,
0
,
4
));
mProcessHandle
=
new
ServerChannelHandler
(
this
);
mProcessHandle
.
DataArrived
=
new
ServerChannelHandler
.
DataArrivedDelegate
((
context
,
fun
,
data
)
=>
{
return
ExecuteCallBack
(
context
,
fun
,
data
);
});
pipeline
.
AddLast
(
mProcessHandle
);
}));
if
(
string
.
IsNullOrEmpty
(
mIp
))
{
boundChannel
=
await
bootstrap
.
BindAsync
(
port
);
}
else
{
boundChannel
=
await
bootstrap
.
BindAsync
(
IPAddress
.
Parse
(
mIp
),
port
);
}
}
else
catch
(
Exception
ex
)
{
boundChannel
=
await
bootstrap
.
BindAsync
(
IPAddress
.
Parse
(
mIp
),
port
);
LoggerService
.
Service
.
Erro
(
"SocketServer"
,
ex
.
Message
);
LoggerService
.
Service
.
Erro
(
"SocketServer"
,
ex
.
StackTrace
.
ToString
());
}
}
...
...
Develop/DBDevelopClientWebApi/DBDevelopClientWebApi.csproj
浏览文件 @
913d8a8a
...
...
@@ -19,4 +19,8 @@
<ProjectReference Include="..\..\Common\Cdy.Tag\Cdy.Tag.csproj" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy "$(TargetPath)" "$(SolutionDir)\Output" /y
if exist "$(TargetDir)$(TargetName).XML" copy "$(TargetDir)$(TargetName).XML" "$(SolutionDir)\Output\Xml" /y
if exist "$(TargetDir)$(TargetName).pdb" copy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)\Output" /y" />
</Target>
</Project>
Develop/DbManager.Desktop/ViewModel/Tag/CompressParameterModelBase.cs
浏览文件 @
913d8a8a
...
...
@@ -46,7 +46,6 @@ namespace DBInStudio.Desktop.ViewModel
}
}
#
endregion
...
Properties
...
#
region
...
Methods
...
...
...
@@ -64,7 +63,7 @@ namespace DBInStudio.Desktop.ViewModel
/// </summary>
public
virtual
void
FillParameters
()
{
}
#
endregion
...
Methods
...
...
...
@@ -109,6 +108,7 @@ namespace DBInStudio.Desktop.ViewModel
{
mDeadValue
=
value
;
FillParameters
();
OnPropertyChanged
(
"DeadValue"
);
}
}
}
...
...
@@ -180,6 +180,7 @@ namespace DBInStudio.Desktop.ViewModel
{
Parameters
.
Add
(
"DeadType"
,
Type
);
}
base
.
FillParameters
();
}
#
endregion
...
Methods
...
...
...
@@ -291,6 +292,7 @@ namespace DBInStudio.Desktop.ViewModel
{
Parameters
.
Add
(
"SlopeType"
,
Type
);
}
base
.
FillParameters
();
}
#
endregion
...
Methods
...
...
...
Develop/DbManager.Desktop/ViewModel/Tag/TagViewModel.cs
浏览文件 @
913d8a8a
...
...
@@ -993,6 +993,10 @@ namespace DBInStudio.Desktop
/// </summary>
private
void
CheckRecordTypeParameterModel
()
{
if
(
CompressParameterModel
!=
null
)
{
CompressParameterModel
.
PropertyChanged
-=
CompressParameterModel_PropertyChanged
;
}
if
(
mHisTagMode
==
null
)
{
CompressParameterModel
=
null
;
...
...
@@ -1011,7 +1015,19 @@ namespace DBInStudio.Desktop
CompressParameterModel
=
new
SlopeCompressParameterViewModel
()
{
Parameters
=
HisTagMode
.
Parameters
};
break
;
}
if
(
CompressParameterModel
!=
null
)
{
CompressParameterModel
.
PropertyChanged
+=
CompressParameterModel_PropertyChanged
;
}
}
private
void
CompressParameterModel_PropertyChanged
(
object
sender
,
System
.
ComponentModel
.
PropertyChangedEventArgs
e
)
{
if
(
mHisTagMode
!=
null
)
{
// mHisTagMode.Parameters = (sender as CompressParameterModelBase).Parameters;
IsChanged
=
true
;
}
}
/// <summary>
...
...
RunTime/DBInRun/Program.cs
浏览文件 @
913d8a8a
...
...
@@ -17,6 +17,7 @@ namespace DBInRun
{
Console
.
CancelKeyPress
+=
Console_CancelKeyPress
;
AppDomain
.
CurrentDomain
.
ProcessExit
+=
CurrentDomain_ProcessExit
;
AppDomain
.
CurrentDomain
.
FirstChanceException
+=
CurrentDomain_FirstChanceException
;
WindowConsolHelper
.
DisbleQuickEditMode
();
Runner
.
RunInstance
.
Init
();
...
...
@@ -156,6 +157,12 @@ namespace DBInRun
}
}
private
static
void
CurrentDomain_FirstChanceException
(
object
sender
,
System
.
Runtime
.
ExceptionServices
.
FirstChanceExceptionEventArgs
e
)
{
Console
.
WriteLine
(
e
.
Exception
.
StackTrace
);
e
.
Exception
.
HResult
=
0
;
}
/// <summary>
///
/// </summary>
...
...
RunTime/DBRuntime/His/Compress/Special/DeadAreaCompressUnit2.cs
浏览文件 @
913d8a8a
...
...
@@ -32,6 +32,10 @@ namespace Cdy.Tag
protected
ProtoMemory
mVarintMemory2
;
//Dictionary<int, double> dvals = new Dictionary<int, double>();
//Dictionary<int, int> dtims = new Dictionary<int, int>();
/// <summary>
///
/// </summary>
...
...
@@ -57,7 +61,7 @@ namespace Cdy.Tag
}
else
{
return
Math
.
Abs
((
newVal
-
preVal
)
/
preVal
)
>
deadArea
;
return
preVal
>
0
?
Math
.
Abs
((
newVal
-
preVal
)
/
preVal
)
>
deadArea
:
true
;
}
}
...
...
@@ -99,7 +103,7 @@ namespace Cdy.Tag
{
int
preids
=
0
;
mVarintMemory2
.
Reset
();
//dtims.Clear();
bool
isFirst
=
true
;
int
id
=
0
;
...
...
@@ -121,6 +125,8 @@ namespace Cdy.Tag
{
mVarintMemory2
.
WriteInt32
(
id
-
preids
);
}
//dtims.Add(i, id);
preids
=
id
;
}
else
{
...
...
@@ -431,6 +437,14 @@ namespace Cdy.Tag
target
.
Write
(
cqus
);
rsize
+=
4
;
rsize
+=
cqus
.
Length
;
//StringBuilder sb = new StringBuilder();
//foreach(var vv in dvals)
//{
// sb.Append(dtims[vv.Key] + "," + vv.Value+";");
//}
//System.IO.File.WriteAllText(DateTime.Now.Ticks.ToString() + ".deadarea", sb.ToString());
break
;
case
TagType
.
Float
:
FindEmpityIds
(
source
,
sourceAddr
,
(
int
)
count
,
emptys
);
...
...
@@ -947,6 +961,8 @@ namespace Cdy.Tag
double
dsval
=
0
;
mDCompress
.
Reset
();
mDCompress
.
Precision
=
this
.
Precision
;
//dvals.Clear();
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
if
(
i
!=
ig
)
...
...
@@ -957,6 +973,7 @@ namespace Cdy.Tag
mDCompress
.
Append
(
id
);
isFirst
=
false
;
dsval
=
id
;
//dvals.Add(i, id);
}
else
{
...
...
@@ -965,6 +982,7 @@ namespace Cdy.Tag
mDCompress
.
Append
(
id
);
// mMarshalMemory.Write(id);
dsval
=
id
;
//dvals.Add(i, id);
}
else
{
...
...
RunTime/DBRuntime/His/Compress/Special/SlopeCompressUnit2.cs
浏览文件 @
913d8a8a
...
...
@@ -96,13 +96,12 @@ namespace Cdy.Tag
{
isFirst
=
false
;
mVarintMemory2
.
WriteInt32
(
id
);
preids
=
id
;
}
else
{
mVarintMemory2
.
WriteInt32
(
id
-
preids
);
preids
=
id
;
}
preids
=
id
;
ig
=
usedIndex
.
ReadIndex
<
usedIndex
.
WriteIndex
?
usedIndex
.
IncRead
()
:
-
1
;
}
}
...
...
RunTime/DBRuntime/His/HisEnginer2.cs
浏览文件 @
913d8a8a
...
...
@@ -306,7 +306,7 @@ namespace Cdy.Tag
mHisTag
=
new
LongPoint3HisRunTag
()
{
Id
=
vv
.
Value
.
Id
,
Circle
=
vv
.
Value
.
Circle
,
Type
=
vv
.
Value
.
Type
,
TagType
=
vv
.
Value
.
TagType
,
RealMemoryAddr
=
realbaseaddr
,
RealMemoryPtr
=
realHandle
,
RealValueAddr
=
realaddr
,
CompressType
=
vv
.
Value
.
CompressType
,
Parameters
=
vv
.
Value
.
Parameters
};
break
;
}
mHisTag
.
MaxCount
=
count
;
mHisTag
.
MaxCount
=
count
-
1
;
mHisTags
.
Add
(
vv
.
Key
,
mHisTag
);
if
(
mHisTag
.
Type
==
Cdy
.
Tag
.
RecordType
.
Timer
)
...
...
RunTime/DBRuntime/His/obsolete/HisEnginer.cs
浏览文件 @
913d8a8a
...
...
@@ -298,7 +298,7 @@ namespace Cdy.Tag
mHisTag
=
new
LongPoint3HisRunTag
()
{
Id
=
vv
.
Value
.
Id
,
Circle
=
vv
.
Value
.
Circle
,
Type
=
vv
.
Value
.
Type
,
TagType
=
vv
.
Value
.
TagType
,
RealMemoryAddr
=
realbaseaddr
,
RealMemoryPtr
=
realHandle
,
RealValueAddr
=
realaddr
,
CompressType
=
vv
.
Value
.
CompressType
,
Parameters
=
vv
.
Value
.
Parameters
};
break
;
}
mHisTag
.
MaxCount
=
count
;
mHisTag
.
MaxCount
=
count
-
1
;
mHisTags
.
Add
(
vv
.
Key
,
mHisTag
);
if
(
mHisTag
.
Type
==
Cdy
.
Tag
.
RecordType
.
Timer
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录