瀏覽代碼

更新界面

样式分支
fyf 2 年之前
父節點
當前提交
e0ef49d63f
共有 5 個文件被更改,包括 51 次插入18 次删除
  1. +3
    -5
      BPASmartClient.SCADAControl/NewConveyorBelt.xaml.cs
  2. +3
    -3
      BPASmartClient.SCADAControl/Silos.xaml
  3. +45
    -10
      BPASmartClient.SCADAControl/Silos.xaml.cs
  4. 二進制
     
  5. 二進制
     

+ 3
- 5
BPASmartClient.SCADAControl/NewConveyorBelt.xaml.cs 查看文件

@@ -281,10 +281,8 @@ namespace BPASmartClient.SCADAControl
#region 属性变更事件
public void Register()
{
if (EventRunName != MessageNameEnum.Null)
{
Class_InnerMessageBus.GetInstance().ListenMessage(this, EventRunName.ToString(), "EventRunNameHandler");
}
if (EventRunName != MessageNameEnum.Null) Class_InnerMessageBus.GetInstance().ListenMessage(this, EventRunName.ToString(), "EventRunNameHandler");

}

public void EventRunNameHandler(object sender, InnerMessageEventArgs e)
@@ -297,7 +295,7 @@ namespace BPASmartClient.SCADAControl
{

RunEnumModel runEnum = (RunEnumModel)e.obj_MessageObj;
if (runEnum.ID == Text)
//if (runEnum.ID == Text)
{
Direction = runEnum.Run == RunEnum.Run ? 1 : ((runEnum.Run == RunEnum.Run_Left) ? 2 : 0);
}


+ 3
- 3
BPASmartClient.SCADAControl/Silos.xaml 查看文件

@@ -42,14 +42,14 @@ d:DesignHeight="270" d:DesignWidth="180" >
VerticalAlignment="Bottom"
Margin="0 0 0 35"
FontSize="45"
Foreground="#FFCCD61F"
Foreground="#FFCCD61F" Tag="Title"
Text="{Binding Title,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock
Margin="0,20,0,0"
HorizontalAlignment="Center"
FontSize="20"
Foreground="#FF00FFF9"
Foreground="#FF00FFF9" Tag="Value"
Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<TextBlock
Margin="0,20,0,0"
@@ -65,7 +65,7 @@ d:DesignHeight="270" d:DesignWidth="180" >
Margin="0,50,0,0"
HorizontalAlignment="Center"
FontSize="50"
Foreground="#FFFFA400"
Foreground="#FFFFA400" Tag="Text"
Text="{Binding Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<TextBlock
Grid.Row="1"


+ 45
- 10
BPASmartClient.SCADAControl/Silos.xaml.cs 查看文件

@@ -31,6 +31,11 @@ namespace BPASmartClient.SCADAControl
{
#region 临时变量
TextBlock textBlockCLKZ = null;
TextBlock textBlockValue=null;
TextBlock textBlockText = null;
TextBlock textBlockTitle = null;


Ellipse ellipseControl = null;
Storyboard storyboard = new Storyboard();
#endregion
@@ -44,8 +49,13 @@ namespace BPASmartClient.SCADAControl
//Value = "25.23";
//Title = "香料";
//Text = "1";
this.SizeChanged += Silos_SizeChanged; ;
//this.SizeChanged += Silos_SizeChanged; ;
this.Loaded += Silos_Loaded;
}

private void Silos_Loaded(object sender, RoutedEventArgs e)
{
Silos_SizeChanged(null, null);
}

public string ControlType => "物料仓";
@@ -96,6 +106,17 @@ namespace BPASmartClient.SCADAControl
if (tb.Tag.ToString() == "出料控制")
{
textBlockCLKZ = tb;
}else if (tb.Tag.ToString() == "Value")
{
textBlockValue = tb;
}
else if (tb.Tag.ToString() == "Text")
{
textBlockText = tb;
}
else if (tb.Tag.ToString() == "Title")
{
textBlockTitle = tb;
}
}
}
@@ -154,7 +175,9 @@ namespace BPASmartClient.SCADAControl
set { SetValue(ValueProperty, value); }
}
public static readonly DependencyProperty ValueProperty =
DependencyProperty.Register("Value", typeof(string), typeof(Silos), new PropertyMetadata(string.Empty));
DependencyProperty.Register("Value", typeof(string), typeof(Silos), new PropertyMetadata(new PropertyChangedCallback(onTargetChanged)));
private static void onTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => (d as Silos)?.TargetRefresh();
[Category("值设定")]
public string Text
{
@@ -162,7 +185,7 @@ namespace BPASmartClient.SCADAControl
set { SetValue(TextProperty, value); }
}
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register("Text", typeof(string), typeof(Silos), new PropertyMetadata(string.Empty));
DependencyProperty.Register("Text", typeof(string), typeof(Silos), new PropertyMetadata(new PropertyChangedCallback(onTargetChanged)));

[Category("值设定")]
public string Title
@@ -171,7 +194,7 @@ namespace BPASmartClient.SCADAControl
set { SetValue(TitleProperty, value); }
}
public static readonly DependencyProperty TitleProperty =
DependencyProperty.Register("Title", typeof(string), typeof(Silos), new PropertyMetadata(string.Empty));
DependencyProperty.Register("Title", typeof(string), typeof(Silos), new PropertyMetadata(new PropertyChangedCallback(onTargetChanged)));

[Category("消息名称")]
public MessageNameEnum EventRunName
@@ -207,6 +230,21 @@ namespace BPASmartClient.SCADAControl
#endregion

#region 函数
/// <summary>
/// 目标属性刷新
/// </summary>
public void TargetRefresh()
{
if (textBlockValue != null && textBlockText != null && textBlockTitle != null)
{
textBlockValue.Text = Value;
textBlockText.Text = Text;
textBlockTitle.Text = Title;

}
}


/// <summary>
/// 值变化刷新
/// </summary>
@@ -254,11 +292,8 @@ namespace BPASmartClient.SCADAControl
#region 运行事件
public void Register()
{
if (EventRunName != MessageNameEnum.Null)
{
Class_InnerMessageBus.GetInstance().ListenMessage(this, EventRunName.ToString(), "EventRunNameHandler");
Class_InnerMessageBus.GetInstance().ListenMessage(this, EventDataName.ToString(), "EventDataNameHandler");
}
if (EventRunName != MessageNameEnum.Null) Class_InnerMessageBus.GetInstance().ListenMessage(this, EventRunName.ToString(), "EventRunNameHandler");
if (EventDataName != MessageNameEnum.Null) Class_InnerMessageBus.GetInstance().ListenMessage(this, EventDataName.ToString(), "EventDataNameHandler");
}

public void EventRunNameHandler(object sender, InnerMessageEventArgs e)


二進制
查看文件


二進制
查看文件


Loading…
取消
儲存