コード例 #1
0
ファイル: AboutForm.cs プロジェクト: T0T4R4/ASCOM.Wise40
        public AboutForm(FormDash dashForm)
        {
            _dash = dashForm;
            InitializeComponent();

            string appVersion = String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}.{1}", version.Major, version.Minor);

            labelAbout.Text = "This dashboard controls the Wise 40 inch Observatory at" + Const.crnl +
                              "Mizpe Ramon, Israel." + Const.crnl +
                              Const.crnl +
                              "The Wise Observatory is operated by the" + Const.crnl +
                              Const.crnl +
                              "Department of Astrophysics" + Const.crnl +
                              "School of Physics and Astronomy" + Const.crnl +
                              "Raymond and Beverly Sackler Faculty of Exact Sciences" + Const.crnl +
                              Const.crnl +
                              "Tel Aviv University" + Const.crnl +
                              Const.crnl +
                              "Author: Arie Blumenzweig <*****@*****.**>" + Const.crnl +
                              "since October 2016" + Const.crnl;

            labelDashVersion.Text          = appVersion;
            labelTelescopeVersion.Text     = _dash.wiseTelescope.DriverVersion;
            labelDomeVersion.Text          = _dash.wiseDome.DriverVersion;
            labelFocuserVersion.Text       = _dash.wiseFocuser.DriverVersion;
            labelSafeToOperateVersion.Text = _dash.wiseSafeToOperate.DriverVersion;
            labelBoltwoodVersion.Text      = _dash.wiseBoltwood.DriverVersion;
            labelVantageProVersion.Text    = ASCOM.Wise40.VantagePro.WiseVantagePro.DriverVersion;
            labelFilterWheelVersion.Text   = _dash.wiseFilterWheel.DriverVersion;

            labelCurrentCommit.Text = Dash.Properties.Resources.CurrentCommit;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: T0T4R4/ASCOM.Wise40
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (args.Length == 1)
            {
                if (args[0] == "--dio-monitor")
                {
                    Application.Run(new ASCOM.Wise40.HardwareForm(new ASCOM.DriverAccess.Telescope("ASCOM.Remote1.Telescope")));
                }
                else if (args[0].StartsWith("--mode="))
                {
                    WiseSite.OpMode mode;

                    if (Enum.TryParse <WiseSite.OpMode>(args[0].Substring("--mode=".Length).ToUpper(), out mode))
                    {
                        WiseSite.OperationalMode = mode;
                    }
                }

                Environment.Exit(0);
            }
            else
            {
                // Set the unhandled exception mode to force all Windows Forms errors to go through
                // our handler.
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                formDash = new FormDash();

                Application.ApplicationExit += new EventHandler(formDash.OnApplicationExit);

                // Add the event handler for handling UI thread exceptions to the event.
                Application.ThreadException += new ThreadExceptionEventHandler(formDash.HandleThreadException);

                // Add the event handler for handling non-UI thread exceptions to the event.
                AppDomain.CurrentDomain.UnhandledException +=
                    new UnhandledExceptionEventHandler(formDash.HandleDomainUnhandledException);

                Application.Run(formDash);
            }
        }