染色机计算机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

50 lines
1.4 KiB

using DyeingComputer.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 System.Windows.Threading;
using static System.Net.WebRequestMethods;
namespace DyeingComputer.View
{
/// <summary>
/// EquipmentSimulationView.xaml 的交互逻辑
/// </summary>
public partial class EquipmentSimulationView : UserControl
{
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();
}
}
}