Inheritance: System.Windows.Forms.Form
Esempio n. 1
0
        // This function is called at the very start of application execution.
        public void StartApplication()
        {
            // make an acquisitor and connect ourself to its events
            acquisitor = new Acquisitor();
            acquisitor.Data += new DataEventHandler(DataHandler);
            acquisitor.ScanFinished += new ScanFinishedEventHandler(ScanFinishedHandler);

            controllerWindow = new ControllerWindow(this);
            controllerWindow.Show();

            // initialise the profile manager
            profileManager.Window = controllerWindow;
            profileManager.Start();

            // try to load in the last profile set
            // first deserialize the profile set path
            //try
            //{
            //    BinaryFormatter bf = new BinaryFormatter();
            //    String settingsPath = (string)Environs.FileSystem.Paths["settingsPath"];
            //    String filePath = settingsPath + "\\ScanMaster\\profilePath.bin";
            //    FileStream fs = File.Open(filePath, FileMode.Open);
            //    lastProfileSetPath = (string)bf.Deserialize(fs);
            //    fs.Close();
            //}
            //catch (Exception)
            //{
            //    Console.Error.WriteLine("Couldn't find saved profile path");
            //}
            //try
            //{
            //    if (lastProfileSetPath != null) LoadProfileSet(lastProfileSetPath);
            //}
            //catch (Exception e)
            //{
            //    Console.Error.WriteLine("Couldn't load last profile set");
            //    Console.Error.WriteLine(e.Message);
            //}

            // initialise the parameter helper
            parameterHelper = new ParameterHelper();
            parameterHelper.Initialise();

            // connect the acquisitor to the profile manager, which will send it events when the
            // user is in tweak mode.
            profileManager.Tweak +=new TweakEventHandler(acquisitor.HandleTweak);

            // Get access to any other applications required
            Environs.Hardware.ConnectApplications();

            // run the main event loop
            Application.Run(controllerWindow);
        }
Esempio n. 2
0
 //        private int sequenceLength = 1;
 //        private int shotEvery = 10000;
 //
 //        MainWindow m;
 //
 public PatternGenTest(ControllerWindow m)
 {
     //		this.m = m;
 }