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.
79 lines
2.4 KiB
79 lines
2.4 KiB
using DyeingComputer.ViewModel;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Net;
|
|
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.Markup;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Animation;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Shapes;
|
|
using System.Windows.Threading;
|
|
using System.Xml.Linq;
|
|
using static DyeingComputer.UserClass.SqliteHelper;
|
|
using static DyeingComputer.Windows.ViewStep;
|
|
|
|
namespace DyeingComputer.Windows
|
|
{
|
|
/// <summary>
|
|
/// ViewProgram.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class Sampling : Window
|
|
{
|
|
DateTime times = DateTime.Now;
|
|
TimeSpan timeSpan;
|
|
public int CALL_time = 60;
|
|
public Sampling()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
Confirm_.IsEnabled = false;
|
|
ADD_.IsEnabled = false;
|
|
timeSpan = new TimeSpan(0, 0, 0, CALL_time);
|
|
DispatcherTimer disTimer = new DispatcherTimer
|
|
{
|
|
Interval = TimeSpan.FromMilliseconds(950) //毫秒
|
|
};
|
|
disTimer.Tick += DisTimer_1S;
|
|
disTimer.Start();//计时开始
|
|
}
|
|
void DisTimer_1S(object sender, EventArgs e)
|
|
{
|
|
TimeSpan timeSpanT = DateTime.Now - times;
|
|
TIME_.Text = timeSpanT.ToString(@"hh\:mm\:ss");
|
|
|
|
if (timeSpanT > timeSpan)
|
|
{
|
|
Confirm_.IsEnabled = true;
|
|
ADD_.IsEnabled = true;
|
|
}
|
|
}
|
|
|
|
private void Confirm_Click(object sender, RoutedEventArgs e)//确认
|
|
{
|
|
MainWindowViewModel.UserCall_OK = true;
|
|
MainWindowViewModel.STEP_TIME = 0;
|
|
MainWindowViewModel.Alert_bell = false;
|
|
this.Close(); //关闭窗口
|
|
}
|
|
|
|
private void ADD_Click(object sender, RoutedEventArgs e)//
|
|
{
|
|
MainWindowViewModel.STEP_TIME = 0;
|
|
MainWindowViewModel.Alert_bell = false;
|
|
this.Close(); //关闭窗口
|
|
}
|
|
|
|
}
|
|
}
|
|
|