This commit is contained in:
sc committed 2025-02-15 23:28:55 +08:00
commit 429b5a6601
3 files changed
+35 -14

No files matched your search

+4
View File
@@ -14,5 +14,9 @@
<Image Width="300" Height="300" gif:ImageBehavior.AnimatedSource="/Lmage/10001.gif"
gif:ImageBehavior.RepeatBehavior="Forever" HorizontalAlignment="Left" Canvas.Left="20" Canvas.Top="180"/>
</Canvas>
<TextBlock x:Name="M_T" HorizontalAlignment="Left" Height="30" Margin="260,180,0,0" TextWrapping="Wrap" Text="C" TextAlignment="Right"
VerticalAlignment="Top" Width="100" FontSize="20" Background="White" Padding="5,0,5,0"/>
<TextBlock x:Name="M_L" HorizontalAlignment="Left" Height="30" Margin="260,340,0,0" TextWrapping="Wrap" Text="L" TextAlignment="Right"
VerticalAlignment="Top" Width="100" FontSize="20" Background="White" Padding="5,0,5,0"/>
</Grid>
</UserControl>
+23 -1
View File
@@ -1,4 +1,5 @@
using System;
using DyeingComputer.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -12,6 +13,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using static System.Net.WebRequestMethods;
namespace DyeingComputer.View
{
@@ -23,6 +26,25 @@ namespace DyeingComputer.View
public EquipmentSimulationView()
{
InitializeComponent();
CountDown();
}
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
{
M_T.Text = string.Format(" {0:###.#}", Convert.ToDouble(MainWindowViewModel.Selet_dtm("1010"))) + "°C";
M_L.Text = string.Format("{0:D4}", Convert.ToInt16(MainWindowViewModel.Selet_dtm("1015"))) + "L";
}
public void CountDown()
{
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每1秒调用一次Tick
{
Interval = TimeSpan.FromSeconds(1)//秒
};
timer1s.Tick += Tick_Event_1S;
timer1s.Start();
}
}
}