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
f3befbca
Commit
f3befbca
authored
Mar 22, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
命令窗口辅助
parent
a261c56c
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
360 additions
and
34 deletions
+360
-34
VIZ.Package.Domain/RecordLogConstants.cs
+5
-0
VIZ.Package.Module.Resource/Converter/PageThumbnailMultiConverter.cs
+11
-9
VIZ.Package.Module.Resource/Icons/icon_cmd_32x32.png
+0
-0
VIZ.Package.Module.Resource/VIZ.Package.Module.Resource.csproj
+5
-1
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ScrollElementsEdit/ScrollElementsEditPanel.xaml
+3
-7
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ScrollElementsEdit/ScrollElementsEditPanelModel.cs
+93
-4
VIZ.Package.Module/ControlObject/FieldEdit/View/FieldEditView.xaml
+2
-2
VIZ.Package.Module/ControlObject/FieldEdit/View/FieldEditView.xaml.cs
+5
-0
VIZ.Package.Module/ControlObject/FieldEdit/ViewModel/FieldEditViewModel.cs
+0
-2
VIZ.Package.Module/ControlObject/FieldTree/ViewModel/FieldTreeViewModel.cs
+4
-0
VIZ.Package.Module/Help/About/View/AboutPageCommandWindow.xaml
+89
-0
VIZ.Package.Module/Help/About/View/AboutPageCommandWindow.xaml.cs
+30
-0
VIZ.Package.Module/Help/About/ViewModel/AboutPageCommandWindowModel.cs
+29
-0
VIZ.Package.Module/Main/View/MainTopView.xaml
+2
-0
VIZ.Package.Module/Main/ViewModel/MainTopViewModel.cs
+20
-0
VIZ.Package.Module/Page/Group/View/PageGroupView.xaml
+9
-4
VIZ.Package.Module/PageCommand/Controller/PageCommandController.cs
+30
-0
VIZ.Package.Module/PageCommand/PageCommandLifeCycle.cs
+1
-0
VIZ.Package.Module/VIZ.Package.Module.csproj
+8
-0
VIZ.Package.Service/DB/Page/PageService.cs
+12
-4
VIZ.Package.Service/Viz/VizCommandElementService.cs
+2
-1
No files found.
VIZ.Package.Domain/RecordLogConstants.cs
View file @
f3befbca
...
...
@@ -35,6 +35,11 @@ namespace VIZ.Package.Domain
/// </summary>
public
const
string
SYSTEM_HOT_KEY
=
"触发快捷键"
;
/// <summary>
/// 页命令日志
/// </summary>
public
const
string
SYSTEM_PAGE_CMD_LOG
=
"页命令日志"
;
// =============================================================================
// Task
// =============================================================================
...
...
VIZ.Package.Module.Resource/Converter/PageThumbnailConverter.cs
→
VIZ.Package.Module.Resource/Converter/PageThumbnail
Multi
Converter.cs
View file @
f3befbca
...
...
@@ -11,13 +11,14 @@ using System.Windows.Data;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Storage
;
namespace
VIZ.Package.Module.Resource
{
/// <summary>
/// 页缩略图转化器
/// </summary>
public
class
PageThumbnail
Converter
:
I
ValueConverter
public
class
PageThumbnail
MultiConverter
:
IMulti
ValueConverter
{
[
DllImport
(
"gdi32.dll"
,
SetLastError
=
true
)]
private
static
extern
bool
DeleteObject
(
IntPtr
hObject
);
...
...
@@ -27,20 +28,21 @@ namespace VIZ.Package.Module.Resource
/// </summary>
public
ImageSource
CommandThumbnail
{
get
;
set
;
}
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
public
object
Convert
(
object
[]
values
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
PageModelBase
pageBase
=
value
as
PageModelBase
;
if
(
pageBase
==
null
)
if
(
values
==
null
||
values
.
Length
!=
2
)
return
null
;
if
(
pageBase
.
PageType
==
Storage
.
PageType
.
Command
)
if
(!(
values
[
1
]
is
PageType
type
))
return
null
;
if
(
type
==
PageType
.
Command
)
return
this
.
CommandThumbnail
;
Bitmap
bitmap
=
pageBase
.
ThumbnailBitmap
;
if
(
bitmap
==
null
)
if
(!(
values
[
0
]
is
Bitmap
bmp
))
return
null
;
IntPtr
hBitmap
=
b
itma
p
.
GetHbitmap
();
IntPtr
hBitmap
=
b
m
p
.
GetHbitmap
();
ImageSource
wpfBitmap
=
System
.
Windows
.
Interop
.
Imaging
.
CreateBitmapSourceFromHBitmap
(
hBitmap
,
IntPtr
.
Zero
,
...
...
@@ -53,7 +55,7 @@ namespace VIZ.Package.Module.Resource
return
wpfBitmap
;
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
public
object
[]
ConvertBack
(
object
value
,
Type
[]
targetTypes
,
object
parameter
,
CultureInfo
culture
)
{
throw
new
NotImplementedException
();
}
...
...
VIZ.Package.Module.Resource/Icons/icon_cmd_32x32.png
0 → 100644
View file @
f3befbca
392 Bytes
VIZ.Package.Module.Resource/VIZ.Package.Module.Resource.csproj
View file @
f3befbca
...
...
@@ -104,7 +104,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Converter\ConnGroupStatus2BrushConverter.cs" />
<Compile Include="Converter\PageThumbnailConverter.cs" />
<Compile Include="Converter\PageThumbnail
Multi
Converter.cs" />
<Compile Include="Converter\VizControlFieldTypeStringConverter.cs" />
<Compile Include="Converter\ResourceFileSelectionModeConverter.cs" />
<Compile Include="Converter\RichText2TextConverter.cs" />
...
...
@@ -290,5 +290,8 @@
<ItemGroup>
<Resource Include="Images\cmd_template.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\icon_cmd_32x32.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ScrollElementsEdit/ScrollElementsEditPanel.xaml
View file @
f3befbca
...
...
@@ -14,7 +14,7 @@
xmlns:local="clr-namespace:VIZ.Package.Module"
d:DataContext="{d:DesignInstance Type=local:ScrollElementsEditPanelModel}"
d:Background="White"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="800">
<UserControl.Resources>
...
...
@@ -103,14 +103,10 @@
<!-- 数据 -->
<dxg:GridControl ItemsSource="{Binding Path=ItemsSource}" ShowBorder="True" Grid.Row="1" AllowDrop="True"
ColumnsSource="{Binding Path=Columns}" SelectionMode="
Cell
" Margin="10"
ColumnsSource="{Binding Path=Columns}" SelectionMode="
Row
" Margin="10"
SelectedItem="{Binding Path=SelectedValue}"
SelectedItems="{Binding Path=SelectedValues}"
ColumnGeneratorTemplate="{StaticResource ColumnTemplate}">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="SelectionChanged" PassEventArgsToCommand="True" Command="{Binding Path=SelectionChangedCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<dxg:GridControl.ContextMenu>
<ContextMenu>
<MenuItem Header="添加" Command="{Binding Path=PlacementTarget.DataContext.AddCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
...
...
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ScrollElementsEdit/ScrollElementsEditPanelModel.cs
View file @
f3befbca
...
...
@@ -34,6 +34,9 @@ namespace VIZ.Package.Module
{
// 初始化命令
this
.
InitCommand
();
// 初始化消息
this
.
InitMessage
();
}
/// <summary>
...
...
@@ -51,6 +54,16 @@ namespace VIZ.Package.Module
this
.
PreviewSetPosCommand
=
new
VCommand
(
this
.
PreviewSetPos
);
}
/// <summary>
/// 初始化消息
/// </summary>
private
void
InitMessage
()
{
ApplicationDomainEx
.
MessageManager
.
Register
<
PageOpenMessage
>(
this
,
this
.
OnPageOpenMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
PageSaveMessage
>(
this
,
this
.
OnPageSaveMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
PageSaveAsMessage
>(
this
,
this
.
OnPageSaveAsMessage
);
}
// ============================================================
// Service & Controller
// ============================================================
...
...
@@ -149,6 +162,20 @@ namespace VIZ.Package.Module
#
endregion
#
region
SelectedValues
--
当前选中项的集合
private
ObservableCollection
<
ExpandoObject
>
selectedValues
=
new
ObservableCollection
<
ExpandoObject
>();
/// <summary>
/// 当前选中项的集合
/// </summary>
public
ObservableCollection
<
ExpandoObject
>
SelectedValues
{
get
{
return
selectedValues
;
}
set
{
selectedValues
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
SelectedValues
));
}
}
#
endregion
#
region
ScrollElementPackage
--
底飞数据包
private
ScrollElementPackageEntity
scrollElementPackage
;
...
...
@@ -255,10 +282,14 @@ namespace VIZ.Package.Module
/// </summary>
private
void
Remove
()
{
if
(
this
.
SelectedValue
==
null
)
if
(
this
.
SelectedValue
s
==
null
||
this
.
SelectedValues
.
Count
==
0
)
return
;
this
.
ItemsSource
.
Remove
(
this
.
SelectedValue
);
List
<
ExpandoObject
>
list
=
this
.
SelectedValues
.
ToList
();
foreach
(
ExpandoObject
item
in
list
)
{
this
.
ItemsSource
.
Remove
(
item
);
}
}
#
endregion
...
...
@@ -336,6 +367,57 @@ namespace VIZ.Package.Module
// Message
// ============================================================
/// <summary>
/// 页打开消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnPageOpenMessage
(
PageOpenMessage
msg
)
{
this
.
ScrollElementPackage
=
null
;
this
.
SceneTemplateModels
=
null
;
this
.
SelectedSceneTemplateModel
=
null
;
this
.
Columns
=
null
;
this
.
ItemsSource
=
null
;
this
.
SelectedValue
=
null
;
this
.
PreviewPosition
=
0
;
}
/// <summary>
/// 页保存消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnPageSaveMessage
(
PageSaveMessage
msg
)
{
if
(
this
.
ScrollElementPackage
==
null
||
ApplicationDomainEx
.
CurrentPage
==
null
||
this
.
ControlField
==
null
)
return
;
if
(
this
.
ScrollElementPackage
.
TemplateOrPageID
!=
ApplicationDomainEx
.
CurrentPage
.
GetTemplateIdOrPageId
())
return
;
if
(
this
.
ScrollElementPackage
.
FieldIdentifier
!=
this
.
ControlField
.
FieldIdentifier
)
return
;
this
.
scrollElementService
.
SaveScrollElementPackageToDB
(
this
.
ScrollElementPackage
);
}
/// <summary>
/// 页另存为消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnPageSaveAsMessage
(
PageSaveAsMessage
msg
)
{
if
(
this
.
ScrollElementPackage
==
null
||
ApplicationDomainEx
.
CurrentPage
==
null
||
this
.
ControlField
==
null
)
return
;
if
(
this
.
ScrollElementPackage
.
TemplateOrPageID
!=
ApplicationDomainEx
.
CurrentPage
.
GetTemplateIdOrPageId
())
return
;
if
(
this
.
ScrollElementPackage
.
FieldIdentifier
!=
this
.
ControlField
.
FieldIdentifier
)
return
;
this
.
scrollElementService
.
SaveScrollElementPackageToDB
(
this
.
ScrollElementPackage
);
}
// ============================================================
// Public Function
// ============================================================
...
...
@@ -364,10 +446,14 @@ namespace VIZ.Package.Module
// 只处理文本与图片类型
List
<
ControlFieldNodeModel
>
fields
=
new
List
<
ControlFieldNodeModel
>();
foreach
(
var
field
in
this
.
ScrollElementPackage
.
TemplateFields
)
if
(
this
.
ScrollElementPackage
!=
null
&&
this
.
ScrollElementPackage
.
TemplateFields
!=
null
)
{
fields
.
Add
(
this
.
vizCommandControlObjectService
.
CreateControlFieldNodeModeFromEntity
(
field
));
foreach
(
var
field
in
this
.
ScrollElementPackage
.
TemplateFields
)
{
fields
.
Add
(
this
.
vizCommandControlObjectService
.
CreateControlFieldNodeModeFromEntity
(
field
));
}
}
this
.
Columns
=
this
.
scrollElementService
.
GetDynamicColumns
(
ApplicationDomainEx
.
CurrentPage
,
controlObject
,
fields
).
ToObservableCollection
();
this
.
ItemsSource
=
this
.
scrollElementService
.
GetDynamicList
(
fields
,
this
.
ControlField
.
Value
).
ToObservableCollection
();
...
...
@@ -418,6 +504,9 @@ namespace VIZ.Package.Module
/// <returns>字段值</returns>
public
override
string
GetFieldValue
()
{
if
(
this
.
ScrollElementPackage
==
null
)
return
string
.
Empty
;
string
value
=
this
.
scrollElementService
.
GetScrollElementValue
(
this
.
ScrollElementPackage
.
TemplateScenePath
,
this
.
ScrollElementPackage
.
TemplateFields
,
this
.
ItemsSource
,
VizScrollElementRootTag
.
entry
);
return
value
;
...
...
VIZ.Package.Module/ControlObject/FieldEdit/View/FieldEditView.xaml
View file @
f3befbca
...
...
@@ -57,7 +57,7 @@
</StackPanel>
</Border>
<!-- 字段编辑 -->
<fcommon:NavigationControl ItemsSource="{Binding Path=NavigationConfigs}" Grid.Row="2" Margin="0,5,0,0"
SelectedValue="{Binding Path=SelectedNavigationConfig,Mode=OneWay}"></fcommon:NavigationControl>
<fcommon:NavigationControl ItemsSource="{Binding Path=NavigationConfigs}" Grid.Row="2" Margin="0,5,0,0"
PreviewMouseLeftButtonDown="NavigationControl_PreviewMouseLeftButtonDown"
SelectedValue="{Binding Path=SelectedNavigationConfig,Mode=OneWay}"></fcommon:NavigationControl>
</Grid>
</UserControl>
VIZ.Package.Module/ControlObject/FieldEdit/View/FieldEditView.xaml.cs
View file @
f3befbca
...
...
@@ -27,5 +27,10 @@ namespace VIZ.Package.Module
WPFHelper
.
BindingViewModel
(
this
,
new
FieldEditViewModel
());
}
private
void
NavigationControl_PreviewMouseLeftButtonDown
(
object
sender
,
MouseButtonEventArgs
e
)
{
}
}
}
VIZ.Package.Module/ControlObject/FieldEdit/ViewModel/FieldEditViewModel.cs
View file @
f3befbca
...
...
@@ -148,9 +148,7 @@ namespace VIZ.Package.Module
{
// 当前没有打开的页或模板 || 当前没有打开的项目
if
(
ApplicationDomainEx
.
CurrentPage
==
null
||
ApplicationDomainEx
.
ProjectDbContext
==
null
)
{
return
;
}
// 字段树服务不可用
IFieldTreeService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IFieldTreeService
>(
ViewServiceKeys
.
FIELD_TREE_SERVICE
);
...
...
VIZ.Package.Module/ControlObject/FieldTree/ViewModel/FieldTreeViewModel.cs
View file @
f3befbca
...
...
@@ -153,7 +153,11 @@ namespace VIZ.Package.Module
ThreadHelper
.
SafeRun
(
action
:
()
=>
{
if
(
msg
.
Page
.
PageType
!=
PageType
.
Scene
)
{
this
.
ControlObject
=
null
;
this
.
SelectedControlField
=
null
;
return
;
}
// 从本地数据库获取控制对象
ControlObjectEntity
entity
=
this
.
controlObjectService
.
GetControlObject
(
msg
.
Page
)?.
FirstOrDefault
();
...
...
VIZ.Package.Module/Help/About/View/AboutPageCommandWindow.xaml
0 → 100644
View file @
f3befbca
<dx:ThemedWindow x:Class="VIZ.Package.Module.AboutPageCommandWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:local="clr-namespace:VIZ.Package.Module"
mc:Ignorable="d" d:Background="Black"
d:DataContext="{d:DesignInstance Type=local:AboutCustomControlFieldWindowModel}"
WindowStartupLocation="CenterScreen"
Title="摩羯座播控系统" Height="700" Width="1200">
<Grid>
<RichTextBox IsReadOnly="True" Background="Transparent" Margin="5" Foreground="White">
<FlowDocument>
<!-- 注册字段 -->
<Paragraph FontSize="18" FontWeight="Bold">页命令</Paragraph>
<Table>
<Table.Columns>
<TableColumn Width="100"></TableColumn>
<TableColumn Width="160"></TableColumn>
<TableColumn Width="Auto"></TableColumn>
<TableColumn Width="Auto"></TableColumn>
</Table.Columns>
<TableRowGroup>
<TableRow>
<TableCell>
<Paragraph FontSize="14" FontWeight="Bold">命令</Paragraph>
</TableCell>
<TableCell>
<Paragraph FontSize="14" FontWeight="Bold">参数</Paragraph>
</TableCell>
<TableCell>
<Paragraph FontSize="14" FontWeight="Bold">示例</Paragraph>
</TableCell>
<TableCell>
<Paragraph FontSize="14" FontWeight="Bold">示例描述</Paragraph>
</TableCell>
</TableRow>
<TableRow>
<TableCell>
<Paragraph Margin="0,10,0,0">delay</Paragraph>
</TableCell>
<TableCell>
<Paragraph Margin="0,10,0,0">毫秒</Paragraph>
</TableCell>
<TableCell>
<Paragraph Margin="0,10,0,0">delay 5000</Paragraph>
</TableCell>
<TableCell>
<Paragraph Margin="0,10,0,0">延时5000毫秒</Paragraph>
</TableCell>
</TableRow>
<TableRow>
<TableCell>
<Paragraph Margin="0,10,0,0">log</Paragraph>
</TableCell>
<TableCell>
<Paragraph Margin="0,10,0,0">日志内容</Paragraph>
</TableCell>
<TableCell>
<Paragraph Margin="0,10,0,0">log hello word!</Paragraph>
</TableCell>
<TableCell>
<Paragraph Margin="0,10,0,0">在操作日志中记录"hello word!"</Paragraph>
</TableCell>
</TableRow>
<TableRow>
<TableCell>
<Paragraph Margin="0,10,0,0">send</Paragraph>
</TableCell>
<TableCell>
<Paragraph Margin="0,10,0,0">VIZ命令</Paragraph>
</TableCell>
<TableCell>
<Paragraph Margin="0,10,0,0">send RENDERER*MAIN_LAYER SET_OBJECT SCENE*TestScene</Paragraph>
</TableCell>
<TableCell>
<Paragraph Margin="0,10,0,0">向Viz引擎发送命令"RENDERER*MAIN_LAYER SET_OBJECT SCENE*TestScene"</Paragraph>
</TableCell>
</TableRow>
</TableRowGroup>
</Table>
</FlowDocument>
</RichTextBox>
</Grid>
</dx:ThemedWindow>
VIZ.Package.Module/Help/About/View/AboutPageCommandWindow.xaml.cs
0 → 100644
View file @
f3befbca
using
DevExpress.Xpf.Core
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
using
VIZ.Framework.Core
;
namespace
VIZ.Package.Module
{
/// <summary>
/// Interaction logic for AboutPageCommandWindow.xaml
/// </summary>
public
partial
class
AboutPageCommandWindow
:
ThemedWindow
{
public
AboutPageCommandWindow
()
{
InitializeComponent
();
WPFHelper
.
BindingViewModel
(
this
,
new
AboutPageCommandWindowModel
());
}
}
}
VIZ.Package.Module/Help/About/ViewModel/AboutPageCommandWindowModel.cs
0 → 100644
View file @
f3befbca
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Core
;
namespace
VIZ.Package.Module
{
/// <summary>
/// 关于页命令模型
/// </summary>
public
class
AboutPageCommandWindowModel
:
ViewModelBase
{
public
AboutPageCommandWindowModel
()
{
}
// ==========================================================
// 属性
// ==========================================================
// ==========================================================
// 命令
// ==========================================================
}
}
VIZ.Package.Module/Main/View/MainTopView.xaml
View file @
f3befbca
...
...
@@ -87,6 +87,8 @@
Command="{Binding Path=AboutCommand}"/>
<dxb:BarButtonItem Content="关于自定义控制字段" Glyph="/VIZ.Package.Module.Resource;component/Icons/icon_custom_32x32.png"
Command="{Binding Path=AboutCustomControlFieldCommand}"/>
<dxb:BarButtonItem Content="关于页命令" Glyph="/VIZ.Package.Module.Resource;component/Icons/icon_cmd_32x32.png"
Command="{Binding Path=AboutPageCommandCommand}"/>
</dxb:BarSubItem>
</dxb:MainMenuControl>
</StackPanel>
...
...
VIZ.Package.Module/Main/ViewModel/MainTopViewModel.cs
View file @
f3befbca
...
...
@@ -53,6 +53,7 @@ namespace VIZ.Package.Module
this
.
ResetLayoutCommand
=
new
VCommand
(
this
.
ResetLayout
);
this
.
AboutCommand
=
new
VCommand
(
this
.
About
);
this
.
AboutCustomControlFieldCommand
=
new
VCommand
(
this
.
AboutCustomControlField
);
this
.
AboutPageCommandCommand
=
new
VCommand
(
this
.
AboutPageCommand
);
}
/// <summary>
...
...
@@ -465,6 +466,25 @@ namespace VIZ.Package.Module
#
endregion
#
region
AboutPageCommandCommand
--
关于页命令命令
/// <summary>
/// 关于页命令命令
/// </summary>
public
VCommand
AboutPageCommandCommand
{
get
;
set
;
}
/// <summary>
/// 关于页命令
/// </summary>
private
void
AboutPageCommand
()
{
AboutPageCommandWindow
window
=
new
AboutPageCommandWindow
();
window
.
Owner
=
ApplicationDomainEx
.
MainWindow
;
window
.
ShowDialog
();
}
#
endregion
// =====================================================================
// Message
// =====================================================================
...
...
VIZ.Package.Module/Page/Group/View/PageGroupView.xaml
View file @
f3befbca
...
...
@@ -31,8 +31,8 @@
</ResourceDictionary.MergedDictionaries>
<resource:RowHandleConverter x:Key="RowHandleConverter"></resource:RowHandleConverter>
<resource:PageThumbnail
Converter x:Key="PageThumbnail
Converter"
CommandThumbnail="/VIZ.Package.Module.Resource;component/Images/cmd_template.png"></resource:PageThumbnail
Converter>
<resource:PageThumbnail
MultiConverter x:Key="PageThumbnailMulti
Converter"
CommandThumbnail="/VIZ.Package.Module.Resource;component/Images/cmd_template.png"></resource:PageThumbnailMulti
Converter>
<fcore:Bitmap2ImageSourceConverter x:Key="Bitmap2ImageSourceConverter"></fcore:Bitmap2ImageSourceConverter>
<fcore:Enum2EnumDescriptionConverter x:Key="Enum2EnumDescriptionConverter" EnumType="{x:Type storage:PageType}"></fcore:Enum2EnumDescriptionConverter>
<fcore:Bool2SolidColorBrushConverter x:Key="RowHandleBgConverter"
...
...
@@ -175,9 +175,14 @@
VisibleIndex="{Binding Path=VisibleIndex,Mode=TwoWay}">
<common:GridColumnResizeMinHeight.CellTemplate>
<DataTemplate>
<fcommon:ResizeImageControl ImageSource="{Binding Path=Row,Converter={StaticResource PageThumbnailConverter}}"
IconSource="/VIZ.Package.Module.Resource;component/Icons/image_20x20.png"
<fcommon:ResizeImageControl IconSource="/VIZ.Package.Module.Resource;component/Icons/image_20x20.png"
ShowImageMinWidth="50" ShowImageMinHeight="50">
<fcommon:ResizeImageControl.ImageSource>
<MultiBinding Converter="{StaticResource PageThumbnailMultiConverter}">
<Binding Path="Row.ThumbnailBitmap"/>
<Binding Path="Row.PageType"/>
</MultiBinding>
</fcommon:ResizeImageControl.ImageSource>
</fcommon:ResizeImageControl>
</DataTemplate>
</common:GridColumnResizeMinHeight.CellTemplate>
...
...
VIZ.Package.Module/PageCommand/Controller/PageCommandController.cs
View file @
f3befbca
...
...
@@ -5,6 +5,8 @@ using System.Text;
using
System.Threading.Tasks
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Service
;
using
VIZ.Package.Storage
;
namespace
VIZ.Package.Module
{
...
...
@@ -14,6 +16,11 @@ namespace VIZ.Package.Module
public
class
PageCommandController
{
/// <summary>
/// 操作日志服务
/// </summary>
private
RecordLogService
recordLogService
=
new
RecordLogService
();
/// <summary>
/// 延时
/// </summary>
/// <remarks>
...
...
@@ -32,6 +39,15 @@ namespace VIZ.Package.Module
public
const
string
CMD_SEND
=
"send"
;
/// <summary>
/// 记录日志
/// </summary>
/// <remarks>
/// 示例:log xxx
/// 描述:记录命令日志
/// </remarks>
public
const
string
CMD_LOG
=
"log"
;
/// <summary>
/// 开始执行命令
/// </summary>
/// <param name="pageBase">页</param>
...
...
@@ -83,6 +99,7 @@ namespace VIZ.Package.Module
{
case
CMD_DELAY
:
this
.
ExecuteLine_Delay
(
pageBase
,
conn
,
cmd
,
args
);
break
;
case
CMD_SEND
:
this
.
ExecuteLine_Send
(
pageBase
,
conn
,
cmd
,
args
);
break
;
case
CMD_LOG
:
this
.
ExecuteLine_Log
(
pageBase
,
conn
,
cmd
,
args
);
break
;
}
}
...
...
@@ -117,5 +134,18 @@ namespace VIZ.Package.Module
conn
.
EndpointManager
.
Send
(
args
);
}
/// <summary>
/// 执行 -- 记录命令日志
/// </summary>
/// <param name="pageBase">页</param>
/// <param name="conn">连接</param>
/// <param name="cmd">命令</param>
/// <param name="args">参数</param>
private
void
ExecuteLine_Log
(
PageModelBase
pageBase
,
ConnModel
conn
,
string
cmd
,
string
args
)
{
// 记录操作日志
this
.
recordLogService
.
AppendLog
(
ApplicationConstants
.
APPLICATION_GROUP_NAME
,
RecordLogOperate
.
System
,
RecordLogTrigger
.
System
,
RecordLogConstants
.
SYSTEM_PAGE_CMD_LOG
,
args
);
}
}
}
VIZ.Package.Module/PageCommand/PageCommandLifeCycle.cs
View file @
f3befbca
...
...
@@ -42,6 +42,7 @@ namespace VIZ.Package.Module
info
.
ID
=
PLUGIN_ID
;
info
.
Name
=
PLUGIN_NAME
;
info
.
ViewType
=
typeof
(
PageCommandView
);
info
.
Icon
=
"/VIZ.Package.Module.Resource;component/Icons/icon_cmd_32x32.png"
;
return
info
;
}
...
...
VIZ.Package.Module/VIZ.Package.Module.csproj
View file @
f3befbca
...
...
@@ -129,7 +129,11 @@
<Compile Include="ControlObject\FieldEdit\Edit\ScrollElementsEdit\ScrollElementsEditPanelModel.cs" />
<Compile Include="Control\Controller\ControlController.cs" />
<Compile Include="Control\Service\IControlService.cs" />
<Compile Include="Help\About\ViewModel\AboutPageCommandWindowModel.cs" />
<Compile Include="Help\About\ViewModel\AboutCustomControlFieldWindowModel.cs" />
<Compile Include="Help\About\View\AboutPageCommandWindow.xaml.cs">
<DependentUpon>AboutPageCommandWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Help\About\View\AboutCustomControlFieldWindow.xaml.cs">
<DependentUpon>AboutCustomControlFieldWindow.xaml</DependentUpon>
</Compile>
...
...
@@ -470,6 +474,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Help\About\View\AboutPageCommandWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Help\About\View\AboutCustomControlFieldWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
...
...
VIZ.Package.Service/DB/Page/PageService.cs
View file @
f3befbca
...
...
@@ -4,6 +4,7 @@ using log4net.Repository.Hierarchy;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Drawing
;
using
System.Linq
;
using
System.Reflection
;
using
System.Text
;
...
...
@@ -290,13 +291,20 @@ namespace VIZ.Package.Service
return
;
}
using
(
System
.
IO
.
MemoryStream
ms
=
new
System
.
IO
.
MemoryStream
())
using
(
Bitmap
dest
=
new
Bitmap
(
bmp
.
Width
,
bmp
.
Height
,
bmp
.
PixelFormat
))
using
(
Graphics
g
=
Graphics
.
FromImage
(
dest
))
{
bmp
.
Save
(
ms
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Jpeg
);
ms
.
Position
=
0
;
g
.
DrawImage
(
bmp
,
0
,
0
);
using
(
System
.
IO
.
MemoryStream
ms
=
new
System
.
IO
.
MemoryStream
())
{
dest
.
Save
(
ms
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Jpeg
);
ms
.
Position
=
0
;
ApplicationDomainEx
.
ProjectDbContext
.
SceneThumbnailCache
.
Upload
(
id
,
$"
{
id
}
"
,
ms
);
ApplicationDomainEx
.
ProjectDbContext
.
SceneThumbnailCache
.
Upload
(
id
,
$"
{
id
}
"
,
ms
);
}
}
}
catch
(
Exception
ex
)
{
...
...
VIZ.Package.Service/Viz/VizCommandElementService.cs
View file @
f3befbca
...
...
@@ -71,7 +71,8 @@ namespace VIZ.Package.Service
if
(
ApplicationDomainEx
.
PreviewConn
==
null
||
!
ApplicationDomainEx
.
PreviewConn
.
IsConnected
)
return
null
;
string
result
=
ApplicationDomainEx
.
PreviewConn
.
EndpointManager
.
Request
(
$"
{
ApplicationDomainEx
.
VizPreviewRenderer
}
*TREE*$object*FUNCTION*ControlObject*in SET ON_CONTAINER
{
scrollElementField
.
FieldIdentifier
}
GEOM*currentPos GET"
);
ApplicationDomainEx
.
PreviewConn
.
EndpointManager
.
Request
(
$"
{
ApplicationDomainEx
.
VizPreviewRenderer
}
*TREE*$object*FUNCTION*ControlObject*in SET ON_CONTAINER
{
scrollElementField
.
FieldIdentifier
}
GEOM*currentPos GET"
);
string
result
=
ApplicationDomainEx
.
PreviewConn
.
EndpointManager
.
Request
(
$"
{
ApplicationDomainEx
.
VizPreviewRenderer
}
*TREE*$object*FUNCTION*ControlObject**result GET"
);
if
(
string
.
IsNullOrWhiteSpace
(
result
)
||
result
.
StartsWith
(
ApplicationConstants
.
VIZ_COMMAND_RESULT_ERROR_PREFIX
))
return
null
;
...
...
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