예제 #1
0
 private void btn_inventory_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     try
     {
         contentBar.Children.Clear();
         Report.Slot_Status x = new Report.Slot_Status();
         contentBar.Children.Add(x);
     }
     catch (Exception ee)
     {
         System.Windows.MessageBox.Show(ee.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
예제 #2
0
 public void ShowReport()
 {
     contentBar.Children.Clear();
     Report.Slot_Status x = new Report.Slot_Status();
     contentBar.Children.Add(x);
 }
예제 #3
0
        public MainWindow()
        {
            //防止多开
            if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)
            {
                this.Close();
                return;
            }

            InitializeComponent();


            ColorValueInit();


            StaticRes.Global.CurrentLanguage = "Chinese";

            ResourceDictionary langRd = System.Windows.Application.LoadComponent(new Uri(@"Language\" + StaticRes.Global.CurrentLanguage + ".xaml", UriKind.Relative)) as ResourceDictionary;

            Resources.MergedDictionaries.Add(langRd);
            StaticRes.Global.CurrentLanguageRes = langRd;

            txt_version.Text = StaticRes.Global.Version.GetInfo();



            this.pbMainwindowMixing.Visibility = Visibility.Collapsed;



            InitConfiguration();

            InitSlotPosition();


            try
            {
                contentBar.Children.Clear();
                Report.Slot_Status x = new Report.Slot_Status();
                contentBar.Children.Add(x);
            }
            catch (Exception ee)
            {
                Common.Reports.LogFile.Log("Start System , Error:" + ee.Message);
                System.Windows.MessageBox.Show(ee.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            try
            {
                tm_expiry.Tick    += new EventHandler(Timer_Expiry);
                tm_expiry.Interval = TimeSpan.FromSeconds(300);
                tm_expiry.Start();
            }
            catch (Exception ee)
            {
                Common.Reports.LogFile.Log("Start System , Error:" + ee.Message);
            }

            try
            {
                HardwareControl.Motion_Control.Read_Motion_Config();
                HardwareControl.Initial_Hardware.ConnectIOCard();

                if (StaticRes.Global.Hardware_Connection)
                {
                    tm.Tick    += new EventHandler(Timer);
                    tm.Interval = TimeSpan.FromSeconds(0.5);
                    tm.Start();
                }
                HardwareControl.IO_Control.Yellow_Tower_Light_Setting();
            }
            catch (Exception ee)
            {
                StaticRes.Global.Need_Homing = false;
                Common.Reports.LogFile.Log("Start System , Error:" + ee.Message);
                System.Windows.MessageBox.Show(ee.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }