From f9cf37353cb16d8969c6bef6de9e3bedbea10ae5 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期五, 25 八月 2023 17:41:26 +0800
Subject: [PATCH] 修改传感器类型和元数据类型为值域(下拉列表框)

---
 DataLoader/MainWindow.xaml.cs |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/DataLoader/MainWindow.xaml.cs b/DataLoader/MainWindow.xaml.cs
index a98651c..efb818d 100644
--- a/DataLoader/MainWindow.xaml.cs
+++ b/DataLoader/MainWindow.xaml.cs
@@ -136,21 +136,27 @@
                 MessageBox.Show("璇烽�夋嫨璧勬簮鐩綍锛�", "鎻愮ず");
                 return;
             }
+
             CommonProp.SourcePath = this.tbSource.Text.Trim();
             if (string.IsNullOrEmpty(CommonProp.SourcePath) || !Directory.Exists(CommonProp.SourcePath))
             {
                 MessageBox.Show("璇烽�夋嫨鏁版嵁鐩綍鎴栨暟鎹洰褰曚笉瀛樺湪锛�", "鎻愮ず");
                 return;
             }
+
             CommonProp.TargetPath = this.tbTarget.Text.Trim();
             if (string.IsNullOrEmpty(CommonProp.TargetPath) || !Directory.Exists(CommonProp.TargetPath))
             {
                 MessageBox.Show("璇烽�夋嫨鍏ュ簱鐩綍鎴栧叆搴撶洰褰曚笉瀛樺湪锛�", "鎻愮ず");
                 return;
             }
-            CommonProp.SensorType = this.tbSensorType.Text.Trim();
-            ContentControl cc = this.cbMetaType.SelectedItem as ContentControl;
-            CommonProp.MetaType = null == cc || "璇烽�夋嫨" == cc.Content.ToString() ? string.Empty : cc.Content.ToString();
+
+            ContentControl ccSensor = this.tbSensorType.SelectedItem as ContentControl;
+            int.TryParse(ccSensor.Tag.ToString(), out CommonProp.SensorType);
+
+            ContentControl ccMeta = this.cbMetaType.SelectedItem as ContentControl;
+            int.TryParse(ccMeta.Tag.ToString(), out CommonProp.MetaType);
+
             CommonProp.AcqTime = this.dpAcqTime.SelectedDate;
 
             this.isBusy = true;

--
Gitblit v1.9.3