MainWindow.xaml.cs 1.94 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Navigation;
using System.Windows.Shapes;
using System.Windows.Forms;
using System.Reflection;
using System.Collections.ObjectModel;

using System.Net;
using FLY.Thick.Blowing.Server;
using FLY.Thick.Blowing.Server.OBJProxy;


namespace FLY.Thick.Blowing.UI.Fix.Server
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : FLY.ControlLibrary.WindowBigClose
    {
        FLY.AppHelper.WindowNotifyIconHelper notifyiconhelper;
        TDGage mGage;
        OBJProxy mOBJProxy;
33
        PicHistory mPicHistory;
潘栩锋's avatar
潘栩锋 committed
34 35 36 37 38 39
        public MainWindow()
        {
            InitializeComponent();

            mGage = new TDGage("Gage1");
            mOBJProxy = new OBJProxy(0, mGage);
40 41 42 43
            mPicHistory = new PicHistory();
            if (!mPicHistory.Enable)
                btnOpen.Visibility = Visibility.Collapsed;

44
            mGage.scanWarning.ScanWarningCheck += (s, e) =>
45 46 47
            {
                mPicHistory.Add(e.profile, e.scandata, e.isWarning);
            };
48
            Misc.BindingOperations.SetBinding(mGage.scanWarning, "IsAutoTarget", mPicHistory, "IsAutoTarget");
潘栩锋's avatar
潘栩锋 committed
49

50
            this.Title = (new Misc.Ver() { SrcType = typeof(MainWindow) }).ToString();
潘栩锋's avatar
潘栩锋 committed
51 52 53 54 55 56 57

            notifyiconhelper = new AppHelper.WindowNotifyIconHelper(this, this.Title);

            this.Hide();

            FObjBase.PollModule.Current.Start();

58
            this.DataContext = mGage.sysParam;
潘栩锋's avatar
潘栩锋 committed
59 60
        }

61
        private void button_open_Click(object sender, RoutedEventArgs e)
潘栩锋's avatar
潘栩锋 committed
62
        {
63 64
            string path = mPicHistory.RootPath;
            System.Diagnostics.Process.Start("explorer.exe", path);
潘栩锋's avatar
潘栩锋 committed
65 66 67
        }
    }
}