|
@@ -12,6 +12,7 @@ using System.Text.RegularExpressions;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
|
+using System.Windows.Controls.Primitives;
|
|
|
using System.Windows.Data;
|
|
|
using System.Windows.Documents;
|
|
|
using System.Windows.Input;
|
|
@@ -140,15 +141,33 @@ namespace MV485.uc
|
|
|
cmbMeterType.SelectedItem = null;
|
|
|
//cmbFlowRate.Text = "";
|
|
|
cmbDnValue.SelectedItem = null;
|
|
|
- cmbNumCount.Text = "";
|
|
|
- cmbIndCount.Text = "";
|
|
|
+ //cmbNumCount.Text = "";
|
|
|
+ cmbNumCount.SelectedItem = null;
|
|
|
+ //cmbIndCount.Text = "";
|
|
|
+ cmbIndCount.SelectedItem = null;
|
|
|
//cmbBrightVal.Text = "";
|
|
|
cmbLastUnit.SelectedItem = null;
|
|
|
txtLastValue.Text = "";
|
|
|
- dtpLastValueTime.Text = "";
|
|
|
+ //dtpLastValueTime.Text = "";
|
|
|
+ //dtpLastValueTime.Value = null;
|
|
|
+ //dtpLastValueTime.ClearValue(dtpLastValueTime.ValueProperty);
|
|
|
+ //dtpLastValueTime.SelectedDate = null;
|
|
|
+ //dtpLastValueTime.Value = null; // 第一步:清空 Value 依赖属性
|
|
|
+ //dtpLastValueTime.SelectedDate = null; // 清空基础类 DatePicker 的值
|
|
|
+
|
|
|
+ dtpLastValueTime.Value = null;
|
|
|
+
|
|
|
+ dtpLastValueTime.ApplyTemplate();
|
|
|
+ var tb = dtpLastValueTime.Template.FindName("PART_TextBox_New", dtpLastValueTime) as DatePickerTextBox;
|
|
|
+ var cal = dtpLastValueTime.Template.FindName("PART_Calendar", dtpLastValueTime) as Calendar;
|
|
|
+ if (tb != null) tb.Text = "";
|
|
|
+ if (cal != null) cal.SelectedDate = null;
|
|
|
+
|
|
|
+ //dtpLastValueTime.v
|
|
|
txtMeterRegion.Text = "";
|
|
|
txtFeatureRegion.Text = "";
|
|
|
|
|
|
+
|
|
|
//cmbSampleInterval.Text = "";
|
|
|
cmbSampleInterval.SelectedItem = null;
|
|
|
//txtFirstHour.Text = "";
|
|
@@ -163,7 +182,7 @@ namespace MV485.uc
|
|
|
|
|
|
cmbLastUnit.ItemsSource = Tools.LastUnitMap; //.UnitList;
|
|
|
cmbNumCount.ItemsSource = Tools.NumList;
|
|
|
- cmbIndCount.ItemsSource = Tools.NumList;
|
|
|
+ cmbIndCount.ItemsSource = Tools.IndList; //Tools.NumList;
|
|
|
//cmbBrightVal.ItemsSource = Tools.BrightList;
|
|
|
cmbSampleInterval.ItemsSource = Tools.SampleIntervalList;
|
|
|
cmbFirstHour.ItemsSource = Enumerable.Range(0, 24).ToList();
|
|
@@ -722,14 +741,16 @@ namespace MV485.uc
|
|
|
if (runConfig.DigitCountWRFlag &&
|
|
|
(runConfig.MeterType == Constant.METER_TYPE_NUM_IND || runConfig.MeterType == Constant.METER_TYPE_NUM))
|
|
|
{
|
|
|
- cmbNumCount.Text = runConfig.DigitCount.ToString();
|
|
|
+ //cmbNumCount.Text = runConfig.DigitCount.ToString();
|
|
|
+ cmbNumCount.SelectedItem = runConfig.DigitCount;
|
|
|
grdNumCount.Visibility = Visibility.Visible;
|
|
|
}
|
|
|
|
|
|
if (runConfig.IndCountWRFlag &&
|
|
|
(runConfig.MeterType == Constant.METER_TYPE_NUM_IND || runConfig.MeterType == Constant.METER_TYPE_IND ))
|
|
|
{
|
|
|
- cmbIndCount.Text = runConfig.IndCount.ToString();
|
|
|
+ //cmbIndCount.Text = runConfig.IndCount.ToString();
|
|
|
+ cmbIndCount.SelectedItem = runConfig.IndCount;
|
|
|
grdIndCount.Visibility = Visibility.Visible;
|
|
|
}
|
|
|
|
|
@@ -861,30 +882,40 @@ namespace MV485.uc
|
|
|
|
|
|
if (runConfig.MeterType == Constant.METER_TYPE_NUM_IND || runConfig.MeterType == Constant.METER_TYPE_NUM)
|
|
|
{
|
|
|
- if (string.IsNullOrWhiteSpace(cmbNumCount.Text) ||
|
|
|
- !byte.TryParse(cmbNumCount.Text, out byte digitCount) ||
|
|
|
- !(digitCount >0 && digitCount <= 10))
|
|
|
+ //if (string.IsNullOrWhiteSpace(cmbNumCount.Text) ||
|
|
|
+ // !byte.TryParse(cmbNumCount.Text, out byte digitCount) ||
|
|
|
+ // !(digitCount >0 && digitCount <= 10))
|
|
|
+ //{
|
|
|
+ // MessageBox.Show(Application.Current.MainWindow, "请输入数字个数", "提示",
|
|
|
+ // MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
+ if(cmbNumCount.SelectedItem == null)
|
|
|
{
|
|
|
- MessageBox.Show(Application.Current.MainWindow, "请输入数字个数", "提示",
|
|
|
+ MessageBox.Show(Application.Current.MainWindow, "请选择数字个数", "提示",
|
|
|
MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
|
- return;
|
|
|
}
|
|
|
runConfig.DigitCountWRFlag = true;
|
|
|
- runConfig.DigitCount = digitCount;
|
|
|
+ runConfig.DigitCount = (byte)cmbNumCount.SelectedItem; //digitCount;
|
|
|
}
|
|
|
|
|
|
if(runConfig.MeterType == Constant.METER_TYPE_NUM_IND || runConfig.MeterType == Constant.METER_TYPE_IND)
|
|
|
{
|
|
|
- if(string.IsNullOrWhiteSpace(cmbIndCount.Text) ||
|
|
|
- !byte.TryParse(cmbIndCount.Text,out byte indCount) ||
|
|
|
- !(indCount >0 && indCount <=10))
|
|
|
+ //if(string.IsNullOrWhiteSpace(cmbIndCount.Text) ||
|
|
|
+ // !byte.TryParse(cmbIndCount.Text,out byte indCount) ||
|
|
|
+ // !(indCount >0 && indCount <=10))
|
|
|
+ //{
|
|
|
+ // MessageBox.Show(Application.Current.MainWindow, "请输入指针个数", "提示",
|
|
|
+ // MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
+ if (cmbIndCount.SelectedItem == null)
|
|
|
{
|
|
|
- MessageBox.Show(Application.Current.MainWindow, "请输入指针个数", "提示",
|
|
|
+ MessageBox.Show(Application.Current.MainWindow, "请选择指针个数", "提示",
|
|
|
MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
|
- return;
|
|
|
}
|
|
|
runConfig.IndCountWRFlag = true;
|
|
|
- runConfig.IndCount = indCount;
|
|
|
+ runConfig.IndCount = (byte)cmbIndCount.SelectedItem; //indCount;
|
|
|
}
|
|
|
|
|
|
//此项已经不需要了
|