管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2024-09-02 ee22df6c94793777fe5b28f2886ebeb2ba2c4256
DataLoader/MainWindow.xaml.cs
@@ -29,12 +29,14 @@
            this.DataContext = this;
        }
        // 窗口加载完成
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            CommonProp.Owner = this;
            CommonProp.Init();
            this.btnLoad.IsEnabled = false;
            this.btnDel.IsEnabled = false;
            this.btnImport.IsEnabled = false;
            lvView.DataContext = viewDatas;
@@ -44,6 +46,7 @@
            LogOut.Info("************  应用程序启动成功! ************");
        }
        // 获取元数据类型
        private List<MetaType> GetMetaTypes()
        {
            List<MetaType> list = new List<MetaType>();
@@ -134,26 +137,52 @@
                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;
            this.viewDatas.Clear();
            Importor.GetFiles(viewDatas);
            Importor.Loading(viewDatas);
            this.isBusy = false;
        }
        // 删除
        private void Del_MouseLeftButtonDown(object sender, RoutedEventArgs e)
        {
            if (null == this.viewDatas || this.viewDatas.Count == 0) return;
            int i = 0;
            while (i < this.viewDatas.Count)
            {
                if (this.viewDatas[i] != null && this.viewDatas[i].Checked)
                {
                    this.viewDatas.RemoveAt(i);
                    continue;
                }
                i++;
            }
        }
        // 导入
        private void Import_MouseLeftButtonDown(object sender, RoutedEventArgs e)
        {