Commit 6135859d by wangonghui

设置字体颜色功能开发

parent 2ee39501
......@@ -67,17 +67,8 @@ namespace VIZ.Package.Module
/// </summary>
private void Start()
{
var pageModel = ApplicationDomainEx.CurrentPage as PageModel;
ConnGroupModel group = ApplicationDomainEx.ConnGroups.FirstOrDefault(p => p.GroupID == pageModel.ConnGroupID);
foreach (var item in group.Items)
{
if (!item.IsEnabled || !item.IsConnected)
continue;
item.EndpointManager.Send("CLOCK0 START");
}
SendTakeCmd("CLOCK0 START");
}
......@@ -91,17 +82,8 @@ namespace VIZ.Package.Module
/// </summary>
private void Stop()
{
var pageModel = ApplicationDomainEx.CurrentPage as PageModel;
ConnGroupModel group = ApplicationDomainEx.ConnGroups.FirstOrDefault(p => p.GroupID == pageModel.ConnGroupID);
foreach (var item in group.Items)
{
if (!item.IsEnabled || !item.IsConnected)
continue;
item.EndpointManager.Send("CLOCK0 STOP");
}
SendTakeCmd("CLOCK0 STOP");
}
......@@ -115,6 +97,16 @@ namespace VIZ.Package.Module
/// </summary>
private void Cont()
{
SendTakeCmd("CLOCK0 CONT");
}
/// <summary>
/// Viz发送命令Take命令行
/// </summary>
/// <param name="cmd"></param>
private void SendTakeCmd(string cmd)
{
var pageModel = ApplicationDomainEx.CurrentPage as PageModel;
ConnGroupModel group = ApplicationDomainEx.ConnGroups.FirstOrDefault(p => p.GroupID == pageModel.ConnGroupID);
......@@ -124,7 +116,7 @@ namespace VIZ.Package.Module
if (!item.IsEnabled || !item.IsConnected)
continue;
item.EndpointManager.Send("CLOCK0 CONT");
item.EndpointManager.Send(cmd);
}
}
/// <summary>
......
......@@ -7,7 +7,7 @@
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
mc:Ignorable="d"
x:Name="colorEditControl"
d:DesignHeight="300" d:DesignWidth="380">
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
<dx:ColorToBrushConverter x:Key="ColorToBrushConverter" />
......@@ -53,7 +53,7 @@
</DataTemplate>
</UserControl.Resources>
<Grid>
<Grid VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
......@@ -71,7 +71,7 @@
<ColumnDefinition Width="85"/>
<ColumnDefinition Width="85"/>-->
<ColumnDefinition Width="340"/>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<dxe:ButtonEdit ShowText="False" AllowDefaultButton="False" IsEnabled="{Binding BtnGroupEnable,Mode=TwoWay}">
......@@ -82,7 +82,7 @@
</dxe:ButtonEdit>
<CheckBox Content="E" Margin="10,0,0,0"
<CheckBox Content="启用" Margin="10,0,0,0"
ToolTip="Title Safe"
IsChecked="{Binding Path=IsEnabledAll,Mode=TwoWay}" Grid.Column="4">
</CheckBox>
......@@ -124,7 +124,11 @@
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="Shininess" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<dxe:TextEdit Grid.Column="1" Text="{Binding Path=Shininess,Mode=TwoWay}" HorizontalAlignment="Left" Height="30" Width="80" VerticalAlignment="Center"/>
<dxe:TextEdit Grid.Column="1"
Text="{Binding Path=Shininess,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment="Left" Height="30" Width="80"
Mask="[0-9]\d?|100" MaskType="RegEx" MaskUseAsDisplayFormat="True" ShowError="False"
VerticalAlignment="Center"/>
</Grid>
</WrapPanel>
......@@ -140,7 +144,9 @@
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="Alpha" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<dxe:TextEdit Grid.Column="1" Text="{Binding Path=Alpha,Mode=TwoWay}" HorizontalAlignment="Left" Width="80" Height="30" VerticalAlignment="Center"/>
<dxe:TextEdit Grid.Column="1" Text="{Binding Path=Alpha,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Width="80" Height="30" ShowError="False"
VerticalAlignment="Center" Mask="[0-9]\d?|100" MaskType="RegEx"
MaskUseAsDisplayFormat="True"/>
</Grid>
</WrapPanel>
......
......@@ -333,6 +333,16 @@ namespace VIZ.Package.Service
conn.EndpointManager.Send(str);
}
/// <summary>
/// 设置时钟的发送命令字符串
/// </summary>
/// <param name="conn"></param>
/// <param name="scene"></param>
/// <param name="treeNodePath"></param>
/// <param name="fieldIdentifier"></param>
/// <param name="upValue"></param>
/// <param name="downValue"></param>
/// <param name="cmd"></param>
public void SetControlObjectClockCmd(ConnModel conn, VizScene scene, string treeNodePath, string fieldIdentifier, string upValue, string downValue, string cmd)
{
string str = $"{scene}*TREE*{treeNodePath}*FUNCTION*ControlObject*in SET ON {fieldIdentifier} SET *TIME SET {upValue},*LIMIT SET {downValue},*DIRECTION SET {cmd}";
......@@ -597,8 +607,8 @@ namespace VIZ.Package.Service
if (type == "clock")
return VizControlFieldType.clock;
//if (type == "color")
// return VizControlFieldType.color;
if (type == "color")
return VizControlFieldType.color;
return VizControlFieldType.none;
}
......
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