コード例 #1
1
        private void ensureOscilloscope()
        {
            //// put Osc_DLL.dll in C:\Windows

            if (oscilloscope == null)
            {
                string oscilloscopeIniFile = Project.startupPath + "..\\..\\LibOscilloscope\\Scope_Desk.ini";

                oscilloscope = Oscilloscope.Create(oscilloscopeIniFile, null);

                if (oscilloscope != null)
                {
                    Tracer.Trace("loaded oscilloscope DLL");
                    oscilloscope.Show();        // appears in separate window
                }
                else
                {
                    Tracer.Error("Couldn't load oscilloscope DLL");
                    Tracer.Error("Make sure " + oscilloscopeIniFile + " is in place");
                    Tracer.Error("Make sure C:\\WINDOWS\\Osc_DLL.dll is in place and registered with regsvr32");
                }
            }
        }
コード例 #2
0
        private Hashtable wiiValuesControls = new Hashtable(); // of WiimoteValuesUserControl

        #endregion Fields

        #region Constructors

        public ControllerTestForm()
        {
            InitializeComponent();

            oscPortTextBox.Text = "9123";
            oscStopButton.Enabled = false;

            DateTime t1 = DateTime.Now;
            SettingsPersister.ReadOptions();
            TimeSpan ts = DateTime.Now - t1;
            Tracer.WriteLine("ReadOptions() took " + ts.Milliseconds + " ms");

            Tracer.setInterface(statusBar, statusBar2, null); // mainProgressBar);
            Tracer.WriteLine("GUI up");

            periodicMaintenanceTimer = new System.Windows.Forms.Timer();
            periodicMaintenanceTimer.Interval = 500;
            periodicMaintenanceTimer.Tick += new EventHandler(periodicMaintenance);
            periodicMaintenanceTimer.Start();

            Tracer.WriteLine("OK: Maintenance ON");

            // put Osc_DLL.dll in C:\Windows

            string oscilloscopeIniFile = Project.startupPath + "..\\..\\LibOscilloscope\\Scope_Desk.ini";

            oscilloscope = Oscilloscope.Create(oscilloscopeIniFile, null);

            if (oscilloscope != null)
            {
                Tracer.Trace("loaded oscilloscope DLL");
                oscilloscope.Show();        // appears in separate window
            }
            else
            {
                Tracer.Error("Couldn't load oscilloscope DLL");
                Tracer.Error("Make sure " + oscilloscopeIniFile + " is in place");
                Tracer.Error("Make sure C:\\WINDOWS\\Osc_DLL.dll is in place and registered with regsvr32");
            }
        }