Commit ed4d37f9 by wangonghui
parents d9f016be 5778ea87
......@@ -141,7 +141,7 @@ namespace VIZ.Package.Connection
string errorMessage = null;
VizImage img = this.vizEnginePool.RequestImage(message, IMAGE_GET_TIME_OUT, ref errorMessage);
if (!string.IsNullOrWhiteSpace(errorMessage))
if (img == null || !string.IsNullOrWhiteSpace(errorMessage))
return null;
return img.Image;
......
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Package.Storage;
namespace VIZ.Package.Domain
{
......@@ -39,7 +40,7 @@ namespace VIZ.Package.Domain
/// <returns>场景父级</returns>
public static string GetSceneParent(this PageModelBase pageBase)
{
string parent = ApplicationDomainEx.CurrentPage.ScenePath.Substring(0, ApplicationDomainEx.CurrentPage.ScenePath.LastIndexOf('/'));
string parent = pageBase.ScenePath.Substring(0, pageBase.ScenePath.LastIndexOf('/'));
return parent;
}
......@@ -58,5 +59,24 @@ namespace VIZ.Package.Domain
return Guid.Empty;
}
/// <summary>
/// 获取Viz场景层
/// </summary>
/// <param name="pageBase">页模型基类</param>
/// <returns>Viz场景层</returns>
public static VizScene GetVizScene(this PageModelBase pageBase)
{
if (pageBase == null)
return VizScene.MAIN_SCENE;
switch (pageBase.Layer)
{
case VizLayer.FRONT_LAYER: return VizScene.FRONT_SCENE;
case VizLayer.MAIN_LAYER: return VizScene.MAIN_SCENE;
case VizLayer.BACK_LAYER: return VizScene.BACK_SCENE;
default: return VizScene.MAIN_SCENE;
}
}
}
}
......@@ -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
// =============================================================================
......
......@@ -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 PageThumbnailConverter : IValueConverter
public class PageThumbnailMultiConverter : IMultiValueConverter
{
[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 = bitmap.GetHbitmap();
IntPtr hBitmap = bmp.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();
}
......
......@@ -104,7 +104,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Converter\ConnGroupStatus2BrushConverter.cs" />
<Compile Include="Converter\PageThumbnailConverter.cs" />
<Compile Include="Converter\PageThumbnailMultiConverter.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
......@@ -50,7 +50,7 @@ namespace VIZ.Package.Module
this.vizCommandService.SetObject(conn, ApplicationDomainEx.CurrentPage.ScenePath, ApplicationDomainEx.CurrentPage.Layer);
if (obj != null)
{
this.vizCommandControlObjectService.SetControlObject(conn, obj);
this.vizCommandControlObjectService.SetControlObject(conn, obj, newPageBase.GetVizScene());
this.vizCommandControlObjectService.SetCustomControlFieldValue(conn, obj.AllFiledNodes);
}
if (view != null)
......@@ -350,7 +350,7 @@ namespace VIZ.Package.Module
{
if (obj != null)
{
this.vizCommandControlObjectService.SetControlObject(conn, obj);
this.vizCommandControlObjectService.SetControlObject(conn, obj, newPageBase.GetVizScene());
this.vizCommandControlObjectService.SetCustomControlFieldValue(conn, obj.AllFiledNodes);
}
view?.TakeUpdate(conn);
......
......@@ -128,6 +128,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -170,6 +170,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -35,14 +35,16 @@
<TextBlock Text="X:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,20,0" Grid.Row="0"></TextBlock>
<common:LeftRightTextEdit Grid.Row="0" Grid.Column="1" Height="30"
dxe:NumericMaskOptions.ValueAfterDelete="ZeroThenNull"
dxe:NumericMaskOptions.HideInsignificantZeros="True"
dxe:NumericMaskOptions.AlwaysShowDecimalSeparator="False"
MaskType="Numeric" Mask="##########.###"
MaskType="Numeric"
EditValue="{Binding Path=X,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></common:LeftRightTextEdit>
<TextBlock Text="Y:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,20,0" Grid.Row="1"></TextBlock>
<common:LeftRightTextEdit Grid.Row="1" Grid.Column="1" Height="30"
dxe:NumericMaskOptions.ValueAfterDelete="ZeroThenNull"
dxe:NumericMaskOptions.HideInsignificantZeros="True"
dxe:NumericMaskOptions.AlwaysShowDecimalSeparator="False"
MaskType="Numeric" Mask="##########.###"
MaskType="Numeric"
EditValue="{Binding Path=Y,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></common:LeftRightTextEdit>
<!-- 编辑模式 -->
......
......@@ -266,6 +266,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -26,8 +26,9 @@
Width="200" Grid.Column="1"
Margin="20,0,0,0"
dxe:NumericMaskOptions.ValueAfterDelete="ZeroThenNull"
dxe:NumericMaskOptions.HideInsignificantZeros="True"
dxe:NumericMaskOptions.AlwaysShowDecimalSeparator="False"
MaskType="Numeric" Mask="##########.###"
MaskType="Numeric"
EditValue="{Binding Path=EditValue,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></dxe:TextEdit>
</Grid>
</UserControl>
......@@ -115,6 +115,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -122,6 +122,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -171,6 +171,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -115,6 +115,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -71,6 +71,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -17,6 +17,9 @@
d:DesignHeight="30" d:DesignWidth="200">
<Grid>
<dxe:TextEdit x:Name="PART_Text" Margin="1" Background="Transparent" ShowBorder="False"
dxe:NumericMaskOptions.ValueAfterDelete="ZeroThenNull"
dxe:NumericMaskOptions.HideInsignificantZeros="True"
dxe:NumericMaskOptions.AlwaysShowDecimalSeparator="False"
MaskType="Numeric" EditValueChanged="EditValueChanged"></dxe:TextEdit>
</Grid>
</local:ListCellEditBase>
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -81,6 +81,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -155,6 +155,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -128,6 +128,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -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}}"/>
......
......@@ -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.SelectedValues == 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
// ============================================================
......@@ -355,7 +437,10 @@ namespace VIZ.Package.Module
this.TryUpdateScrollElementPackage();
IPageTemplateService service = ApplicationDomainEx.ServiceManager.GetService<IPageTemplateService>(ViewServiceKeys.PAGE_TEMPLATE_SERVICE);
this.SceneTemplateModels = service.SceneTemplateModels.Where(p => p.ScenePath != ApplicationDomainEx.CurrentPage?.ScenePath).ToObservableCollection();
this.SceneTemplateModels = service.SceneTemplateModels.Where(p => p.ScenePath != ApplicationDomainEx.CurrentPage?.ScenePath &&
p.GetSceneParent() == ApplicationDomainEx.CurrentPage.GetSceneParent()).ToObservableCollection();
if (this.ScrollElementPackage != null)
{
this.SelectedSceneTemplateModel = this.SceneTemplateModels.FirstOrDefault(p => p.ScenePath == this.ScrollElementPackage.TemplateScenePath);
......@@ -364,10 +449,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 +507,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;
......
......@@ -117,6 +117,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -36,20 +36,23 @@
<TextBlock Text="X:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,20,0" Grid.Row="0"></TextBlock>
<common:LeftRightTextEdit Grid.Row="0" Grid.Column="1" Height="30"
dxe:NumericMaskOptions.ValueAfterDelete="ZeroThenNull"
dxe:NumericMaskOptions.HideInsignificantZeros="True"
dxe:NumericMaskOptions.AlwaysShowDecimalSeparator="False"
MaskType="Numeric" Mask="##########.###"
MaskType="Numeric"
EditValue="{Binding Path=X,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></common:LeftRightTextEdit>
<TextBlock Text="Y:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,20,0" Grid.Row="1"></TextBlock>
<common:LeftRightTextEdit Grid.Row="1" Grid.Column="1" Height="30"
dxe:NumericMaskOptions.ValueAfterDelete="ZeroThenNull"
dxe:NumericMaskOptions.HideInsignificantZeros="True"
dxe:NumericMaskOptions.AlwaysShowDecimalSeparator="False"
MaskType="Numeric" Mask="##########.###"
MaskType="Numeric"
EditValue="{Binding Path=Y,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></common:LeftRightTextEdit>
<TextBlock Text="Z:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,20,0" Grid.Row="2"></TextBlock>
<common:LeftRightTextEdit Grid.Row="2" Grid.Column="1" Height="30"
dxe:NumericMaskOptions.ValueAfterDelete="ZeroThenNull"
dxe:NumericMaskOptions.HideInsignificantZeros="True"
dxe:NumericMaskOptions.AlwaysShowDecimalSeparator="False"
MaskType="Numeric" Mask="##########.###"
MaskType="Numeric"
EditValue="{Binding Path=Z,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></common:LeftRightTextEdit>
<!-- 编辑模式 -->
......
......@@ -292,6 +292,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -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>
......@@ -27,5 +27,10 @@ namespace VIZ.Package.Module
WPFHelper.BindingViewModel(this, new FieldEditViewModel());
}
private void NavigationControl_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
}
}
}
......@@ -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);
......
......@@ -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();
......@@ -170,7 +174,7 @@ namespace VIZ.Package.Module
});
// 将当前值上至预览
this.vizCommandControlObjectService.SetControlObject(ApplicationDomainEx.PreviewConn, this.ControlObject);
this.vizCommandControlObjectService.SetControlObject(ApplicationDomainEx.PreviewConn, this.ControlObject, ApplicationDomainEx.CurrentPage.GetVizScene());
// 插件处理
PageModel pageModel = msg.Page as PageModel;
......
<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>
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());
}
}
}
......@@ -21,7 +21,7 @@
<!-- 系统版本 -->
<TextBlock Text="系统版本:" VerticalAlignment="Center" HorizontalAlignment="Right"
Grid.Row="1" Grid.Column="0" Margin="0,0,10,0"></TextBlock>
<TextBlock Text="V1.1.0.03171405_beta" VerticalAlignment="Center" HorizontalAlignment="Left"
<TextBlock Text="V1.2.0.03231400_beta" VerticalAlignment="Center" HorizontalAlignment="Left"
Grid.Row="1" Grid.Column="1"></TextBlock>
</Grid>
</dx:ThemedWindow>
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()
{
}
// ==========================================================
// 属性
// ==========================================================
// ==========================================================
// 命令
// ==========================================================
}
}
......@@ -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>
......
......@@ -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>
......@@ -267,7 +268,7 @@ namespace VIZ.Package.Module
if (vm == null)
return;
ApplicationDomainEx.ProjectDbContext.Dispose();
ApplicationDomainEx.ProjectDbContext?.Dispose();
this.OpenProject(vm.SelectedFileModel.Path);
}
......@@ -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
// =====================================================================
......
......@@ -9,6 +9,7 @@
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:common="clr-namespace:VIZ.Package.Common;assembly=VIZ.Package.Common"
xmlns:storage="clr-namespace:VIZ.Package.Storage;assembly=VIZ.Package.Storage"
......@@ -31,8 +32,8 @@
</ResourceDictionary.MergedDictionaries>
<resource:RowHandleConverter x:Key="RowHandleConverter"></resource:RowHandleConverter>
<resource:PageThumbnailConverter x:Key="PageThumbnailConverter"
CommandThumbnail="/VIZ.Package.Module.Resource;component/Images/cmd_template.png"></resource:PageThumbnailConverter>
<resource:PageThumbnailMultiConverter x:Key="PageThumbnailMultiConverter"
CommandThumbnail="/VIZ.Package.Module.Resource;component/Images/cmd_template.png"></resource:PageThumbnailMultiConverter>
<fcore:Bitmap2ImageSourceConverter x:Key="Bitmap2ImageSourceConverter"></fcore:Bitmap2ImageSourceConverter>
<fcore:Enum2EnumDescriptionConverter x:Key="Enum2EnumDescriptionConverter" EnumType="{x:Type storage:PageType}"></fcore:Enum2EnumDescriptionConverter>
<fcore:Bool2SolidColorBrushConverter x:Key="RowHandleBgConverter"
......@@ -127,9 +128,8 @@
<dxg:GridColumn Header="序号" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False" Width="40" AllowResizing="False">
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<Grid Background="{Binding Path=Row.IsOpen,Converter={StaticResource RowHandleBgConverter}}">
<Rectangle Fill="{Binding Path=Row.IsTake,Converter={StaticResource RowHandleTakeConverter}}"
Width="10" HorizontalAlignment="Left"></Rectangle>
<Grid>
<Rectangle Fill="{Binding Path=Row.IsTake,Converter={StaticResource RowHandleTakeConverter}}"></Rectangle>
<TextBlock Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding RowData.RowHandle,Converter={StaticResource RowHandleConverter}}"></TextBlock>
</Grid>
</DataTemplate>
......@@ -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>
......@@ -398,6 +403,26 @@
SelectedItems="{Binding Path=SelectedPages}"
ColumnsSource="{Binding ElementName=uc, Path=DataContext.Columns}"
ColumnGeneratorTemplateSelector="{StaticResource ResourceKey=ColumnDefintionGeneratorTemplateSelector}">
<dxg:GridControl.Resources>
<Style TargetType="{x:Type dxg:RowControl}">
<Style.Triggers>
<DataTrigger Binding="{Binding Row.IsOpen}" Value="True">
<Setter Property="Background" Value="#AA0078D7"></Setter>
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Row.IsOpen}" Value="True"></Condition>
<Condition Binding="{Binding IsActive,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type dxdo:LayoutPanel}}}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="Background" Value="#FF0078D7"></Setter>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</dxg:GridControl.Resources>
<dxg:GridControl.ContextMenu>
<common:ContextMenuEx BindingTargetType="{x:Type dx:DXTabControl}">
<MenuItem Header="添加命令页" Command="{Binding Path=DataContext.CreateCmdPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type common:ContextMenuEx}}}"/>
......
......@@ -4,9 +4,11 @@
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:dxcn="http://schemas.devexpress.com/winfx/2008/xaml/core/internal"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
......@@ -119,9 +121,28 @@
</MultiBinding>
</Grid.IsHitTestVisible>
<dxg:GridControl ItemsSource="{Binding Path=SceneTemplateModels}" ShowBorder="False" SelectionMode="Row"
SelectedItem="{Binding Path=SelectedSceneTemplateModel}" x:Name="t"
<dxg:GridControl x:Name="grid" ItemsSource="{Binding Path=SceneTemplateModels}" ShowBorder="False" SelectionMode="Row"
SelectedItem="{Binding Path=SelectedSceneTemplateModel}"
SelectedItems="{Binding Path=SelectedSceneTemplateModels}">
<dxg:GridControl.Resources>
<Style TargetType="{x:Type dxg:RowControl}">
<Style.Triggers>
<DataTrigger Binding="{Binding Row.IsOpen}" Value="True">
<Setter Property="Background" Value="#AA0078D7"></Setter>
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Row.IsOpen}" Value="True"></Condition>
<Condition Binding="{Binding IsActive,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type dxdo:LayoutPanel}}}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="Background" Value="#FF0078D7"></Setter>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</dxg:GridControl.Resources>
<dxg:GridControl.ContextMenu>
<ContextMenu>
<MenuItem Header="打开" Command="{Binding Path=PlacementTarget.DataContext.OpenScenePageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
......@@ -136,9 +157,8 @@
<dxg:GridColumn Header="序号" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False" Width="40" AllowResizing="False">
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<Grid Background="{Binding Path=Row.IsOpen,Converter={StaticResource RowHandleBgConverter}}">
<Rectangle Fill="{Binding Path=Row.IsTake,Converter={StaticResource RowHandleTakeConverter}}"
Width="10" HorizontalAlignment="Left"></Rectangle>
<Grid>
<Rectangle Fill="{Binding Path=Row.IsTake,Converter={StaticResource RowHandleTakeConverter}}"></Rectangle>
<TextBlock Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding RowData.RowHandle,Converter={StaticResource RowHandleConverter}}"></TextBlock>
</Grid>
</DataTemplate>
......
using System;
using DevExpress.Xpf.Docking;
using DevExpress.Xpf.Grid;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
......
......@@ -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);
}
}
}
......@@ -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;
}
......
......@@ -356,7 +356,7 @@ namespace VIZ.Package.Module
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
this.vizCommandService.Start(conn, null, VizLayer.MAIN_LAYER);
this.vizCommandService.Start(conn, null, ApplicationDomainEx.CurrentPage.Layer);
view?.PreviewIn(conn);
}
......@@ -391,7 +391,7 @@ namespace VIZ.Package.Module
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
this.vizCommandService.Continue(conn, null, VizLayer.MAIN_LAYER);
this.vizCommandService.Continue(conn, null, ApplicationDomainEx.CurrentPage.Layer);
view?.PreviewContinue(conn);
}
......@@ -420,7 +420,7 @@ namespace VIZ.Package.Module
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
this.vizCommandService.Stop(conn, null, VizLayer.MAIN_LAYER);
this.vizCommandService.Stop(conn, null, ApplicationDomainEx.CurrentPage.Layer);
view?.PreviewOut(conn);
}
......@@ -464,7 +464,7 @@ namespace VIZ.Package.Module
{
if (obj != null)
{
this.vizCommandControlObjectService.SetControlObject(conn, obj);
this.vizCommandControlObjectService.SetControlObject(conn, obj, ApplicationDomainEx.CurrentPage.GetVizScene());
this.vizCommandControlObjectService.SetCustomControlFieldValue(conn, obj.AllFiledNodes);
}
view?.PreviewUpdate(conn);
......@@ -575,7 +575,14 @@ namespace VIZ.Package.Module
{
if (msg.Page.PageType == PageType.Scene)
{
this.vizCommandService.SetObject(ApplicationDomainEx.PreviewConn, msg.Page.ScenePath, VizLayer.MAIN_LAYER);
List<VizLayer> layers = new List<VizLayer> { VizLayer.FRONT_LAYER, VizLayer.MAIN_LAYER, VizLayer.BACK_LAYER };
layers.Remove(msg.Page.Layer);
foreach (VizLayer layer in layers)
{
this.vizCommandService.SetObjectEmpty(ApplicationDomainEx.PreviewConn, layer);
}
this.vizCommandService.SetObject(ApplicationDomainEx.PreviewConn, msg.Page.ScenePath, msg.Page.Layer);
}
// 发送节目单项初始化完成消息
......
......@@ -32,7 +32,7 @@
</ResourceDictionary>
</UserControl.Resources>
<GroupBox Header="插件映射" Padding="10" Margin="10">
<GroupBox Header="数据模板映射" Padding="10" Margin="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
......
......@@ -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>
......@@ -474,6 +478,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>
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -31,6 +31,19 @@ namespace VIZ.Package.Service
}
/// <summary>
/// 设置空场景
/// </summary>
/// <param name="conn">连接</param>
/// <param name="layer">图层</param>
public void SetObjectEmpty(ConnModel conn, VizLayer layer)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
conn.EndpointManager.Request($"RENDERER*{layer} SET_OBJECT");
}
/// <summary>
/// 重新加载场景
/// </summary>
/// <param name="conn">连接</param>
......
......@@ -110,7 +110,7 @@ namespace VIZ.Package.Service
ConnModel conn = ApplicationDomainEx.PreviewConn;
// 获取控制对象ID
List<string> ids = this.vizCommandControlObjectService.GetControlObjectIds(conn);
List<string> ids = this.vizCommandControlObjectService.GetControlObjectIds(conn, VizScene.MAIN_SCENE);
string objectId = ids.FirstOrDefault();
if (string.IsNullOrWhiteSpace(objectId))
......@@ -122,7 +122,7 @@ namespace VIZ.Package.Service
string groupPath = this.vizCommandService.GroupAdd(conn, pageBase.ScenePath, objectId, VizGroupMoveDirection.BOTTOM);
// SCENE*TITLES/2022/YC/YC_CUP2*TREE GET
List<VizTreeNodeInfo> treeNodeList = this.vizCommandControlObjectService.GetTreeNodeList(conn);
List<VizTreeNodeInfo> treeNodeList = this.vizCommandControlObjectService.GetTreeNodeList(conn, VizScene.MAIN_SCENE);
VizTreeNodeInfo groupNode = treeNodeList.FirstOrDefault(p => p.Path == groupPath);
if (groupNode == null)
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment