123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- using MV485.model;
- 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.Shapes;
- namespace MV485.Dlg
- {
- /// <summary>
- /// DlgExample.xaml 的交互逻辑
- /// </summary>
- public partial class DlgExample : Window
- {
- public DlgExample(ExampleType exampleType)
- {
- InitializeComponent();
- InitView(exampleType);
- }
- private void InitView(ExampleType exampleType)
- {
- string htmlPath;
-
- if(exampleType == ExampleType.MeterType)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "水表类型.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- //this.Title = Example.ExampleMap.Values.ge
- }
- else if(exampleType == ExampleType.DnValue)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "meter_dn.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.DigitCount)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "数字个数.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.IndicatorCount)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "指针个数.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.LastUnit)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "尾数单位.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.LastValue)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "表底读数.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.LastTime)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "读数时间.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.MeterRegion)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "表盘范围.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.DigitRegion)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "数字区域坐标.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.FWRegion)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "首尾指针同刻度坐标.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.SampleInterval)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "采样周期.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.SampleFirstHour)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "首采时间.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if (exampleType == ExampleType.BrightVal)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "亮度系数.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- else if(exampleType == ExampleType.UploadRedind)
- {
- htmlPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "example", "是否上传红色指针读数.htm");
- docBrowser.Navigate(new Uri(htmlPath));
- }
- if (Example.ExampleMap.TryGetValue(exampleType, out string title))
- {
- this.Title = $"{title} - 说明示例";
- }
- }
- //-----------------------------
- }
- }
|