Commit 6ee12cfa by wangonghui

时钟控件功能开发

parent 0b0adb28
......@@ -168,5 +168,10 @@ namespace VIZ.Package.Domain
/// 该值不会入库,仅在内存中保留
/// </remarks>
public static List<TransitionLogicSceneInfoModel> SceneInfoListWithTransitionLogic { get; private set; } = new List<TransitionLogicSceneInfoModel>();
/// <summary>
/// 时钟控件保存信息
/// </summary>
public static ClockFieldEntity ClockField { get; set; }
}
}
<UserControl x:Class="VIZ.Package.Module.ClockEditPanel"
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:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="650">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="500"/>
<ColumnDefinition Width="150"/>
</Grid.ColumnDefinitions>
<StackPanel Height="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="150"/>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<dxe:DateEdit x:Name="TimePickerUP" Mask="T" MaskUseAsDisplayFormat="True" Grid.Row="0" Grid.Column="1" Height="30" ShowEditorButtons="False" Text="{Binding UpTime,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<dxe:DateEdit.StyleSettings>
<dxe:DateEditTimePickerStyleSettings/>
</dxe:DateEdit.StyleSettings>
</dxe:DateEdit>
<TextBlock Text="HH:MM:SS" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="13"/>
<RadioButton Grid.Row="0" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Content="正计时" IsChecked="{Binding RadioUP}" Width="60" FontSize="13" />
<CheckBox Grid.Column="0" Grid.Row="1" Content="停止于" Height="40" IsChecked="{Binding StopIsCheck}" FontSize="13" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<dxe:DateEdit x:Name="TimePickerDown" Mask="T" MaskUseAsDisplayFormat="True" Grid.Row="1" Grid.Column="1" Height="30"
ShowEditorButtons="False" Text="{Binding DownTime,Mode=TwoWay}" Visibility="{Binding IsStopVisibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<dxe:DateEdit.StyleSettings>
<dxe:DateEditTimePickerStyleSettings/>
</dxe:DateEdit.StyleSettings>
</dxe:DateEdit>
<TextBlock Text="HH:MM:SS" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="13" Visibility="{Binding IsStopVisibility,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<RadioButton Grid.Row="1" Grid.Column="4" HorizontalAlignment="Center" VerticalAlignment="Center" Content="倒计时" Width="60" IsChecked="{Binding RadioDown}" FontSize="13" />
</Grid>
</StackPanel>
<GroupBox Grid.Row="1" Header="Live Control" Height="80" HorizontalAlignment="Center" FontSize="13">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="90"/>
</Grid.ColumnDefinitions>
<Button Content="START" Height="40" Width="75" Grid.Column="0" Command="{Binding StartCommand}"/>
<Button Content="STOP" Height="40" Width="75" Grid.Column="1" Command="{Binding StopCommand}"/>
<Button Content="CONT" Height="40" Width="75" Grid.Column="2" Command="{Binding ContCommand}"/>
<Button Content="FREEZE" Height="40" Width="70" Grid.Column="3" Command="{Binding FreezeCommand}"/>
<Button Content="UNFREEZE" Height="40" Grid.Column="4" Command="{Binding UnFreezeCommand}"/>
</Grid>
</GroupBox>
</Grid>
</StackPanel>
<GroupBox Header="Action" Grid.Column="1" FontSize="13">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<RadioButton Content="无" Grid.Row="0" IsChecked="{Binding RadioNone}" />
<RadioButton Content="设置及开始" Grid.Row="1" IsChecked="{Binding RadioSetStart}"/>
<RadioButton Content="设置及停止" Grid.Row="2" IsChecked="{Binding RadioSetStop}"/>
<RadioButton Content="停止" Grid.Row="3" IsChecked="{Binding RadioStop}"/>
<RadioButton Content="继续" Grid.Row="4" IsChecked="{Binding RadioContinue}"/>
<RadioButton Content="冻结" Grid.Row="5" IsChecked="{Binding RadioFreeze}"/>
<RadioButton Content="解冻" Grid.Row="6" IsChecked="{Binding RadioUnFreeze}" />
</Grid>
</GroupBox>
</Grid>
</UserControl>
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.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.Package.Module
{
/// <summary>
/// Interaction logic for ClockEditPanel.xaml
/// </summary>
public partial class ClockEditPanel : UserControl
{
public ClockEditPanel()
{
InitializeComponent();
//WPF的绑定
WPFHelper.BindingViewModel(this, new ClockEditPanelModel());
}
}
}
......@@ -134,6 +134,13 @@ namespace VIZ.Package.Module
ViewType = typeof(CustomVideoEditPanel),
ViewCreated = this.OnViewCreated
});
//时钟类型
this.navigationConfigs.Add(new NavigationConfig {
Key = VizControlFieldType.clock.ToString(),
ViewType = typeof(ClockEditPanel),
ViewCreated=this.OnViewCreated
}) ;
}
// =============================================================
......
......@@ -298,6 +298,12 @@ namespace VIZ.Package.Module
mediaConfig = mediaConfig ?? new MediaConfigEntity();
ApplicationDomainEx.MediaConfig = mediaConfig;
//时钟控件加载读取
ClockFieldEntity clockFieldEntity = ApplicationDomainEx.LocalDbContext.ClockField.FindAll().FirstOrDefault();
clockFieldEntity= clockFieldEntity ?? new ClockFieldEntity();
ApplicationDomainEx.ClockField= clockFieldEntity;
// Step 3. 加载插件信息
ApplicationDomainEx.PluginInfos = this.pluginService.LoadPluginInfos();
this.UpdatePluginInfos(vizConfig);
......
......@@ -93,6 +93,10 @@
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Compile Include="ControlObject\FieldEdit\Edit\Clock\ClockEditPanel.xaml.cs">
<DependentUpon>ClockEditPanel.xaml</DependentUpon>
</Compile>
<Compile Include="ControlObject\FieldEdit\Edit\Clock\ClockEditPanelModel.cs" />
<Compile Include="ControlObject\FieldEdit\Edit\RadioEdit\RadioEditPanel.xaml.cs">
<DependentUpon>RadioEditPanel.xaml</DependentUpon>
</Compile>
......@@ -422,6 +426,10 @@
<Folder Include="ProjectManager\Model\" />
</ItemGroup>
<ItemGroup>
<Page Include="ControlObject\FieldEdit\Edit\Clock\ClockEditPanel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ControlObject\FieldEdit\Edit\RadioEdit\RadioEditPanel.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......
......@@ -322,7 +322,30 @@ namespace VIZ.Package.Service
/// <param name="value">值</param>
public void SetControlObjectValue(ConnModel conn, string treeNodePath, string fieldIdentifier, string value)
{
conn.EndpointManager.Send($"MAIN_SCENE*TREE*{treeNodePath}*FUNCTION*ControlObject*in SET ON {fieldIdentifier} SET {value}");
string str = $"MAIN_SCENE*TREE*{treeNodePath}*FUNCTION*ControlObject*in SET ON {fieldIdentifier} SET {value}";
conn.EndpointManager.Send(str);
}
/// <summary>
/// 设置时钟控制对象
/// </summary>
/// <param name="conn"></param>
/// <param name="treeNodePath"></param>
/// <param name="fieldIdentifier"></param>
/// <param name="value"></param>
public void SetControlObjectClockValue(ConnModel conn, string treeNodePath, string fieldIdentifier, string value)
{
string str = $"MAIN_SCENE*TREE*{treeNodePath}*FUNCTION*ControlObject*in SET ON {fieldIdentifier} SET {value} ";
conn.EndpointManager.Send(str);
}
public void SetControlObjectClockCmd(ConnModel conn, string treeNodePath, string fieldIdentifier,string upValue, string downValue,string cmd)
{
string str = $"MAIN_SCENE*TREE*{treeNodePath}*FUNCTION*ControlObject*in SET ON {fieldIdentifier} SET *TIME SET {upValue},*LIMIT SET {downValue},*DIRECTION SET {cmd}";
conn.EndpointManager.Send(str);
}
/// <summary>
......@@ -548,6 +571,9 @@ namespace VIZ.Package.Service
if (type == "custom_video")
return VizControlFieldType.custom_video;
if (type == "clock")
return VizControlFieldType.clock;
return VizControlFieldType.none;
}
......
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
public class ClockFieldEntity
{
/// <summary>
/// 编号
/// </summary>
[BsonId(true)]
public int Id { get; set; }
/// <summary>
/// 倒计时
/// </summary>
public bool RadioDown { get; set; } = true;
/// <summary>
/// 正计时
/// </summary>
public bool RadioUp { get; set; }=false;
}
}
......@@ -94,6 +94,12 @@ namespace VIZ.Package.Storage
/// 自定义 视频
/// </summary>
[Description("自定义 视频")]
custom_video
custom_video,
/// <summary>
/// 时钟
/// </summary>
[Description("时钟")]
clock
}
}
......@@ -39,6 +39,7 @@ namespace VIZ.Package.Storage
this.ConnGroup = this.Database.GetCollection<ConnGroupEntity>();
this.Conn = this.Database.GetCollection<ConnEntity>();
this.PluginMappingConfig = this.Database.GetCollection<PluginMappingConfigEntity>();
this.ClockField = this.Database.GetCollection<ClockFieldEntity>();
}
/// <summary>
......@@ -71,6 +72,12 @@ namespace VIZ.Package.Storage
/// </summary>
public ILiteCollection<ConnEntity> Conn { get; private set; }
/// <summary>
/// 时钟保存字段
/// </summary>
public ILiteCollection<ClockFieldEntity> ClockField { get; private set; }
/// <summary>
/// 插件映射
/// </summary>
......
......@@ -100,6 +100,7 @@
<Compile Include="Entity\Config\PluginMappingConfigEntity.cs" />
<Compile Include="Entity\Conn\ConnEntity.cs" />
<Compile Include="Entity\Conn\ConnGroupEntity.cs" />
<Compile Include="Entity\ControlObject\ClockFieldEntity.cs" />
<Compile Include="Entity\ControlObject\ControlFieldEntity.cs" />
<Compile Include="Entity\ControlObject\ControlObjectEntity.cs" />
<Compile Include="Entity\Page\PageEntityBase.cs" />
......
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