コード例 #1
0
ファイル: MainForm.cs プロジェクト: TopMouse72/BU1
        public MainForm() : base("CDI检测机系统", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString())
        {
            InitializeComponent();
            //Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            ClassCommonSetting.ProgramLog(LogFile.Level.Info, "Main", "Run version: " + Version);
            //初始化硬件
            SplashProcessInfo = "初始化硬件...";
            HardwarePool.SystemHardware.instance.Init();
            HardwarePool.SystemHardware.instance.Open();
            SerialProtocalCollection.instance.ConnectProtocol();
            SplashProcessInfo = "加载参数,打开CDIVision...";
            ClassCommonSetting.CommonInit();
            this.LogOutTime = GetLogOutTime(ClassCommonSetting.SysParam.LogOutTime);

            //初始化工作区域
            SplashProcessInfo = "初始化工作区域...";
            zones             = ClassWorkZones.Instance;
            zones.AllZoneInit();
            SplashProcessInfo = "初始化工作流程...";
            workflow          = ClassWorkFlow.Instance;
            workflow.WorkFlowInit();
            //初始化主界面
            SplashProcessInfo = "初始化界面...";
            auto        = AutoPanel.Instance;
            setting     = new ConfigurationPanel();
            manual      = new ManualOperationPanel();
            product     = new ProductPanel();
            calibration = new CalibrationPanel();
            monitor     = new MonitorPanel();
            AddInterface(PanelType.AutoFace, auto);
            AddInterface(PanelType.SettingFace, setting);
            AddInterface(PanelType.ManualFace, manual);
            AddInterface(PanelType.ProductFace, product);
            AddInterface(PanelType.DebugFace, calibration);
            AddInterface(PanelType.MonitorFace, monitor);
            ClassCommonSetting.SysParam.AddParaInterface(product);
            ClassCommonSetting.SysParam.CurrentProductParam.SetDataToInterface(product);
            ClassCommonSetting.SysParam.CurrentProductParam.AddParaInterface(calibration);

            zones.SPC.AddGUI(auto);
            zones.SPC.AddGUI(monitor);

            //事件挂钩
            CommonFunction.SysPublisher.subscribeMeToSystemEvents(zones);
            CommonFunction.SysPublisher.subscribeMeToSystemEvents(workflow);
            zones.WorkZone外框架.HookErrorEvent();
            auto.HookErrorEvent();
            workflow.TimeUsage.AddTimeUsageGUI(auto);
            zones.AddTimeUsage(auto);
            ClassCommonSetting.SocketToAOI.subscribeMeToResponseEvents(zones.WorkZone尺寸测量);
            HookErrorEvent();
            CommonFunction.SysPublisher.subscribeMeToSystemEvents(this);
            this.UserLoggedIn     += MainForm_UserLoggedIn1;
            this.UserLoggedOut    += MainForm_UserLoggedOut1;
            product.SaveParaEvent += Product_SaveParaEvent;
            //发送事件
            CommonFunction.SysPublisher.notifyProductChangeEventSubscribers(null, new StateEventArgs(ClassCommonSetting.SysParam.CurrentProduct, ""));
        }
コード例 #2
0
ファイル: ProductPanel.cs プロジェクト: ZEN-ZAI/Final-Project
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #3
0
 protected void ProductList_SelectedIndexChanged(object sender, EventArgs e)
 {
     ProductPanel.Update();
     if (ProductList.SelectedIndex == 1)
     {
         FileUpload1.Visible = true;
     }
     else
     {
         FileUpload1.Visible = false;
     }
 }
コード例 #4
0
        public ProductPanel CreatePanel(Product p)
        {
            ProductPanel panel = null;

            if (p is Book)
            {
                panel = new BookPanel((Book)p);
            }
            else if (p is Magazine)
            {
                panel = new MagazinePanel((Magazine)p);
            }
            else
            {
                panel = new MusicCDPanel((MusicCD)p);
            }

            return(panel);
        }
コード例 #5
0
    void CreateProductsAndUI()
    {
        products = new Dictionary <ProductType, Product>();

        foreach (ProductPrototype proto in productsPrototypes)
        {
            GameObject   go    = Instantiate(productPanelPrefab);
            ProductPanel panel = go.GetComponent <ProductPanel>();
            Product      p     = new Product(proto);

            //FIXME: не тут надо подписываться
            //p.ProductSold += Funds.Instance.OnProductSold;
            //p.ProductSold += SoundController.Instance.OnProductSold;
            //p.BuildingPurchased += SoundController.Instance.OnBuy;

            go.transform.SetParent(gameField);
            go.name = "Product - " + p.ProductName;

            panel.AssignProduct(p);
            products.Add(proto.productType, p);
            OnProductCreated(p);
        }
    }
コード例 #6
0
 private void bunifuFlatButton3_Click(object sender, EventArgs e)
 {
     ProductPanel.Show();
 }
コード例 #7
0
 public SendStocks()
 {
     InitializeComponent();
     ProductPanel.Hide();
 }
コード例 #8
0
 private void Btnview_Click(object sender, EventArgs e)
 {
     ProductPanel.Show();
 }
コード例 #9
0
 public Inventory()
 {
     InitializeComponent();
     ProductPanel.Hide();
 }