1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.ServiceModel;
- using System.IO;
- using System.Reflection;
- using System.ServiceProcess;
- using Aitex.Core.RT.Log;
- using Caliburn.Micro;
- using OpenSEMI.ClientBase;
- using OpenSEMI.ClientBase.UI;
- using OpenSEMI.ClientBase.Handlers;
- using VirgoUI.Client.Models.Sys;
- using MECF.Framework.Common.DataCenter;
- namespace VirgoUI.Client
- {
- public class ClientApp : OpenSEMI.ClientBase.BaseApp
- {
- public ClientApp()
- {
- }
- protected override void OnInitialize()
- {
- try
- {
- //States looper to update UI
- this.stateImp = new StatesImp(QueryDataClient.Instance.Service);
- this.StatesManager = new StatesHandler(this.stateImp.GetStates, this.stateImp.Keys);
- this.StatesManager.Handle();
- //wafer status looper
- this.waferStatusImp = new WaferStatusImp(QueryDataClient.Instance.Service);
- this.WaferStatusManager = new WaferStatusHandler(this.waferStatusImp.GetWaferStatus, ModuleManager.ModulesID);
- this.WaferStatusManager.Handle();
- ModuleManager.Initialize();
- //need get the view in OpenSEMI.ClientBase by Calibrun (Dialog view and so on)
- var file = string.Format("{0}OpenSEMI.ClientBase.dll", System.AppDomain.CurrentDomain.BaseDirectory);
- if (File.Exists(file))
- {
- Assembly assembly = Assembly.LoadFile(file);
- AssemblySource.Instance.Add(assembly);
- }
- }
- catch (Exception ex)
- {
- LOG.Error(ex.StackTrace);
- }
- }
- public override void Dispose()
- {
- base.Dispose();
- this.WaferStatusManager.looper.Terminate();
- this.StatesManager.looper.Terminate();
- }
- public MainViewModel ViewModelSwitcher { get; set; }
- private StatesImp stateImp;
- private WaferStatusImp waferStatusImp;
- public override void SwitchPage(string mainMenu, string subMenu, object parameter)
- {
- ViewModelSwitcher.SwitchPage(mainMenu, subMenu, parameter);
- }
- }
- }
|