Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Package
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.Package
Commits
2ecdc430
Commit
2ecdc430
authored
Jan 13, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日志, 添加List单元格聚焦
parent
d560862c
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
237 additions
and
7 deletions
+237
-7
VIZ.Package.Connection/Protocol/VIZ/VizEndpointManager.cs
+17
-1
VIZ.Package.Domain/ApplicationConstants.cs
+1
-0
VIZ.Package.Domain/Enum/LogType.cs
+29
-0
VIZ.Package.Domain/Message/ControlObject/ControlListFieldChangedMessage.cs
+40
-0
VIZ.Package.Domain/Message/Log/LogMessage.cs
+4
-1
VIZ.Package.Domain/VIZ.Package.Domain.csproj
+3
-0
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
+1
-1
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ListEdit/ListCellEditBase.cs
+27
-1
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ListEdit/ListEditPanel.xaml
+1
-1
VIZ.Package.Module/Log/View/LogView.xaml
+11
-1
VIZ.Package.Module/Log/ViewModel/LogViewModel.cs
+59
-0
VIZ.Package.Module/Preview/VizPreview/ViewModel/VizPreviewViewModel.cs
+18
-0
VIZ.Package.Service/Viz/VizCommandControlObjectService.cs
+25
-0
VIZ.Package.Service/Viz/VizCommandService.cs
+1
-1
No files found.
VIZ.Package.Connection/Protocol/VIZ/VizEndpointManager.cs
View file @
2ecdc430
...
...
@@ -101,6 +101,13 @@ namespace VIZ.Package.Connection
public
void
Send
(
string
message
)
{
this
.
vizEnginePool
.
Send
(
message
);
// 记录日志
LogMessage
msg
=
new
LogMessage
();
msg
.
Type
=
LogType
.
VizLog
;
msg
.
Log
=
$"[
{
this
.
RemoteIP
}
:
{
this
.
RemotePort
}
] 发送:
{
message
}
"
;
ApplicationDomainEx
.
MessageManager
.
Send
(
msg
);
}
/// <summary>
...
...
@@ -110,7 +117,16 @@ namespace VIZ.Package.Connection
/// <returns>返回值</returns>
public
string
Request
(
string
message
)
{
return
this
.
vizEnginePool
.
Request
(
message
);
string
result
=
this
.
vizEnginePool
.
Request
(
message
);
// 记录日志
LogMessage
msg
=
new
LogMessage
();
msg
.
Type
=
LogType
.
VizLog
;
msg
.
Log
=
$"[
{
this
.
RemoteIP
}
:
{
this
.
RemotePort
}
] 发送:
{
message
}
返回:
{
result
}
"
;
ApplicationDomainEx
.
MessageManager
.
Send
(
msg
);
return
result
;
}
/// <summary>
...
...
VIZ.Package.Domain/ApplicationConstants.cs
View file @
2ecdc430
...
...
@@ -21,5 +21,6 @@ namespace VIZ.Package.Domain
/// Viz 层集合
/// </summary>
public
readonly
static
List
<
VizLayer
>
VIZ_LAYERS
=
new
List
<
VizLayer
>
{
VizLayer
.
FRONT_LAYER
,
VizLayer
.
MAIN_LAYER
,
VizLayer
.
BACK_LAYER
};
}
}
VIZ.Package.Domain/Enum/LogType.cs
0 → 100644
View file @
2ecdc430
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 日志等级
/// </summary>
public
enum
LogType
{
/// <summary>
/// 日志
/// </summary>
Log
,
/// <summary>
/// Viz日志
/// </summary>
VizLog
,
/// <summary>
/// 错误
/// </summary>
Error
}
}
VIZ.Package.Domain/Message/ControlObject/ControlListFieldChangedMessage.cs
0 → 100644
View file @
2ecdc430
using
System
;
using
System.Collections.Generic
;
using
System.Dynamic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 控制列字段改变消息
/// </summary>
public
class
ControlListFieldChangedMessage
{
/// <summary>
/// 控制对象
/// </summary>
public
ControlObjectModel
ControlObject
{
get
;
set
;
}
/// <summary>
/// 控制字段
/// </summary>
public
ControlFieldNodeModel
ControlField
{
get
;
set
;
}
/// <summary>
/// 动态对象
/// </summary>
public
object
Object
{
get
;
set
;
}
/// <summary>
/// 行索引
/// </summary>
public
int
ListLine
{
get
;
set
;
}
/// <summary>
/// 字段名
/// </summary>
public
string
FieldIdentifier
{
get
;
set
;
}
}
}
VIZ.Package.Domain/Message/Log/LogMessage.cs
View file @
2ecdc430
...
...
@@ -11,7 +11,10 @@ namespace VIZ.Package.Domain
/// </summary>
public
class
LogMessage
{
/// <summary>
/// 日志类型
/// </summary>
public
LogType
Type
{
get
;
set
;
}
/// <summary>
/// 日志信息
...
...
VIZ.Package.Domain/VIZ.Package.Domain.csproj
View file @
2ecdc430
...
...
@@ -75,12 +75,15 @@
<Compile Include="ApplicationConstants.cs" />
<Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Core\GridColumnDefinition.cs" />
<Compile Include="Enum\LogType.cs" />
<Compile Include="Enum\ModulePluginIds.cs" />
<Compile Include="Enum\ViewServiceKeys.cs" />
<Compile Include="Info\VizTreeNodeInfo.cs" />
<Compile Include="Message\Application\ApplicationCloseMessage.cs" />
<Compile Include="Message\Conn\ConnChangedMessage.cs" />
<Compile Include="Message\ControlObject\ControlListFieldChangedMessage.cs" />
<Compile Include="Message\ControlObject\ControlFieldChangedMessage.cs" />
<Compile Include="Message\Log\LogMessage.cs" />
<Compile Include="Message\Page\PageOpenMessage.cs" />
<Compile Include="Message\Page\PageInitedMessage.cs" />
<Compile Include="Message\Project\ProjectSaveMessage.cs" />
...
...
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
View file @
2ecdc430
...
...
@@ -100,7 +100,7 @@ namespace VIZ.Package.Module
this
.
Execute
(
controlObjectAction
:
(
obj
,
conn
)
=>
{
this
.
vizCommandService
.
Continue
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
ScenePath
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
this
.
vizCommandService
.
TakeContinue
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
},
pluginAction
:
(
view
,
conns
)
=>
{
...
...
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ListEdit/ListCellEditBase.cs
View file @
2ecdc430
using
System
;
using
DevExpress.Data
;
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Dynamic
;
using
System.Linq
;
...
...
@@ -19,6 +21,7 @@ namespace VIZ.Package.Module
public
ListCellEditBase
()
{
this
.
DataContextChanged
+=
CellEditBase_DataContextChanged
;
this
.
PreviewMouseLeftButtonDown
+=
ListCellEditBase_PreviewMouseLeftButtonDown
;
}
/// <summary>
...
...
@@ -64,6 +67,29 @@ namespace VIZ.Package.Module
}
/// <summary>
/// 鼠标点击时触发
/// </summary>
private
void
ListCellEditBase_PreviewMouseLeftButtonDown
(
object
sender
,
System
.
Windows
.
Input
.
MouseButtonEventArgs
e
)
{
DevExpress
.
Xpf
.
Grid
.
EditGridCellData
cellData
=
this
.
DataContext
as
DevExpress
.
Xpf
.
Grid
.
EditGridCellData
;
if
(
cellData
==
null
)
return
;
GridColumnDefinition
columnDefinition
=
cellData
.
Column
.
DataContext
as
GridColumnDefinition
;
if
(
columnDefinition
==
null
)
return
;
ControlListFieldChangedMessage
msg
=
new
ControlListFieldChangedMessage
();
msg
.
ControlObject
=
columnDefinition
.
ControlObject
;
msg
.
ControlField
=
columnDefinition
.
ControlField
;
msg
.
Object
=
cellData
.
Row
;
msg
.
ListLine
=
cellData
.
RowData
.
RowHandle
.
Value
;
msg
.
FieldIdentifier
=
columnDefinition
.
FieldName
;
ApplicationDomainEx
.
MessageManager
.
Send
(
msg
);
}
/// <summary>
/// 更新
/// </summary>
/// <param name="columnDefinition">列定义</param>
...
...
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ListEdit/ListEditPanel.xaml
View file @
2ecdc430
...
...
@@ -103,7 +103,7 @@
</UserControl.Resources>
<Grid>
<dxg:GridControl ItemsSource="{Binding Path=ItemsSource}" ShowBorder="False" Grid.Column="1" AllowDrop="True"
<dxg:GridControl
x:Name="grid"
ItemsSource="{Binding Path=ItemsSource}" ShowBorder="False" Grid.Column="1" AllowDrop="True"
ColumnsSource="{Binding Path=Columns}"
ColumnGeneratorTemplate="{StaticResource ColumnTemplate}">
<dxg:GridControl.ContextMenu>
...
...
VIZ.Package.Module/Log/View/LogView.xaml
View file @
2ecdc430
...
...
@@ -3,10 +3,20 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:local="clr-namespace:VIZ.Package.Module"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:LogViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<TextBox x:Name="tb" IsReadOnly="True" AcceptsReturn="False" VerticalScrollBarVisibility="Auto"></TextBox>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Button Width="80" Height="20" Content="清除" Command="{Binding Path=ClearCommand}" HorizontalAlignment="Left"></Button>
<TextBox x:Name="tb" IsReadOnly="True" AcceptsReturn="False" VerticalScrollBarVisibility="Auto"
Grid.Row="1"></TextBox>
</Grid>
</UserControl>
VIZ.Package.Module/Log/ViewModel/LogViewModel.cs
View file @
2ecdc430
...
...
@@ -24,9 +24,68 @@ namespace VIZ.Package.Module
/// </summary>
public
LogViewModel
()
{
// 初始化命令
this
.
InitCommand
();
// 初始化消息
this
.
InitMessage
();
/// 注册服务
ApplicationDomainEx
.
ServiceManager
.
AddService
(
ViewServiceKeys
.
LOG_VIEW_SERVICE
,
this
);
}
/// <summary>
/// 初始化命令
/// </summary>
private
void
InitCommand
()
{
this
.
ClearCommand
=
new
VCommand
(
this
.
Clear
);
}
/// <summary>
/// 初始化消息
/// </summary>
private
void
InitMessage
()
{
ApplicationDomainEx
.
MessageManager
.
Register
<
LogMessage
>(
this
,
this
.
OnLogMessage
);
}
// ==================================================================================
// Command
// ==================================================================================
#
region
ClearCommand
--
清除消息
/// <summary>
/// 清除消息
/// </summary>
public
VCommand
ClearCommand
{
get
;
set
;
}
/// <summary>
/// 清除
/// </summary>
private
void
Clear
()
{
this
.
ClearLog
();
}
#
endregion
// ==================================================================================
// Message
// ==================================================================================
/// <summary>
/// 处理日志消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnLogMessage
(
LogMessage
msg
)
{
string
log
=
$"
{
DateTime
.
Now
.
ToString
(
"HH:mm:ss"
)}
<
{
msg
.
Type
}
>
{
msg
.
Log
}
"
;
this
.
AppendLog
(
log
);
}
// ==================================================================================
// Public Function
// ==================================================================================
...
...
VIZ.Package.Module/Preview/VizPreview/ViewModel/VizPreviewViewModel.cs
View file @
2ecdc430
...
...
@@ -67,6 +67,7 @@ namespace VIZ.Package.Module
ApplicationDomainEx
.
MessageManager
.
Register
<
PageOpenMessage
>(
this
,
this
.
OnPageOpenMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ApplicationCloseMessage
>(
this
,
this
.
OnApplicationCloseMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ControlFieldChangedMessage
>(
this
,
this
.
OnControlFieldChangedMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ControlListFieldChangedMessage
>(
this
,
this
.
OnControlListFieldChangedMessage
);
}
// ================================================================================
...
...
@@ -449,6 +450,23 @@ namespace VIZ.Package.Module
this
.
vizCommandControlObjectService
.
ShowFocus
(
ApplicationDomainEx
.
PreviewConn
,
msg
.
ControlObject
,
msg
.
ControlField
);
}
/// <summary>
/// 控制列字段改变时触发
/// </summary>
/// <param name="msg">消息</param>
private
void
OnControlListFieldChangedMessage
(
ControlListFieldChangedMessage
msg
)
{
// 引擎未准备好 || 当前没有选中的节目单项目 则不处理
if
(!
this
.
IsEngineReady
||
ApplicationDomainEx
.
CurrentPage
==
null
)
return
;
// 不需要显示区域
if
(!
this
.
IsShowBB
)
return
;
this
.
vizCommandControlObjectService
.
ShowFocus
(
ApplicationDomainEx
.
PreviewConn
,
msg
.
ControlObject
,
msg
.
ControlField
,
msg
.
ListLine
,
msg
.
FieldIdentifier
);
}
// ================================================================================
// Public Function
// ================================================================================
...
...
VIZ.Package.Service/Viz/VizCommandControlObjectService.cs
View file @
2ecdc430
...
...
@@ -379,6 +379,31 @@ namespace VIZ.Package.Service
}
/// <summary>
/// 设置控制字段聚焦
/// </summary>
/// <param name="conn">连接</param>
/// <param name="obj">控制对象</param>
/// <param name="field">控制字段</param>
/// <param name="listLine">行数</param>
/// <param name="fieldIdentifier">字段名</param>
public
void
ShowFocus
(
ConnModel
conn
,
ControlObjectModel
obj
,
ControlFieldNodeModel
field
,
int
listLine
,
string
fieldIdentifier
)
{
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
VizConfigEntity
config
=
ApplicationDomainEx
.
VizConfig
;
if
(
config
.
EngineFullType
==
EngineFullType
.
VIZ_Eng3
)
{
conn
.
EndpointManager
.
Send
(
$"RENDERER*TREE*
{
obj
.
TreeNodePath
}
*FUNCTION*ControlObject*in SET WITH LIST INDEX
{
listLine
}
FOCUS
{
fieldIdentifier
}
"
);
}
else
if
(
config
.
EngineFullType
==
EngineFullType
.
VIZ_Eng4
)
{
conn
.
EndpointManager
.
Send
(
$"
{
ApplicationDomainEx
.
VizPreviewRenderer
}
*TREE*
{
obj
.
TreeNodePath
}
*FUNCTION*ControlObject*in SET WITH LIST INDEX
{
listLine
}
FOCUS
{
fieldIdentifier
}
"
);
}
}
/// <summary>
/// 获取控制字段类型
/// </summary>
/// <param name="type">字段类型</param>
...
...
VIZ.Package.Service/Viz/VizCommandService.cs
View file @
2ecdc430
...
...
@@ -248,7 +248,7 @@ namespace VIZ.Package.Service
/// 继续版子
/// </summary>
/// <param name="conn">连接</param>
/// <param name="layer">层</param>
s
/// <param name="layer">层</param>
public
void
TakeContinue
(
ConnModel
conn
,
VizLayer
layer
)
{
conn
.
EndpointManager
.
Send
(
$"RENDERER*UPDATE SET 1"
);
...
...
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