コード例 #1
0
 public void Dispose()
 {
     // Clean up the tracelogger and util objects
     tl.Enabled = false;
     tl.Dispose();
     tl = null;
     //utilities.Dispose();
     //utilities = null;
     //astroUtilities.Dispose();
     //astroUtilities = null;
     Hardware.Dispose();
     Hardware = null;
 }
コード例 #2
0
        public SetupDialogForm(Dome Dome_ext, Hardware_class Hardware_ext)
        {
            //Link to parent Dome and Hardware classes
            DomeDriverLnk = Dome_ext;
            HardwareLnk   = Hardware_ext;

            InitializeComponent();
            // Initialise current values of user settings from the ASCOM Profile


            // Initialise current values of user settings from the ASCOM Profile
            ipaddr.Text = Hardware_class.ip_addr;
            port.Text   = Hardware_class.ip_port;
            login.Text  = Hardware_class.ip_login;
            pass.Text   = Hardware_class.ip_pass;

            chkTrace.Checked     = DomeDriverLnk.traceState;
            chkDebugFlag.Checked = HardwareLnk.debugFlag;

            txtNetworkTimeout.Text   = Convert.ToInt32(MyWebClient.NETWORK_TIMEOUT / 1000).ToString();
            txtCacheConnect.Text     = Hardware_class.CACHE_CHECKCONNECTED_INTERVAL.ToString();
            txtCacheRead.Text        = Hardware_class.CACHE_SHUTTERSTATUS_INTERVAL_NORMAL.ToString();
            txtCacheReadReduced.Text = Hardware_class.CACHE_SHUTTERSTATUS_INTERVAL_REDUCED.ToString();


            //Write driver version
            Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            string driverVersion = String.Format(CultureInfo.InvariantCulture, "{0}.{1} build {2}.{3}", ver.Major, ver.Minor, ver.Build, ver.Revision);
            //MessageBox.Show("Application " + assemName.Name + ", Version " + ver.ToString());
            string fileVersion = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion;

            lblDriverInfo.Text = DomeDriverLnk.DriverInfo;
            lblVersion.Text    = "Driver: " + fileVersion;
            lblVersion.Text   += Environment.NewLine + "Assembly: " + driverVersion;
            lblVersion.Text   += Environment.NewLine + "Compile time: " + RetrieveLinkerTimestamp().ToString("yyyy-MM-dd HH:mm");

            //Language
            cmbLang.DataSource = new CultureInfo[] {
                CultureInfo.GetCultureInfo("en-US"),
                CultureInfo.GetCultureInfo("ru-RU")
            };
            cmbLang.DisplayMember = "NativeName";
            cmbLang.ValueMember   = "Name";
            cmbLang.SelectedValue = Hardware_class.currentLang;
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Vedrus_rolloffroof"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public Dome()
        {
            tl = new TraceLogger("", "Vedrus_rolloffroof");
            #if DEBUG
            tl.Enabled = true; //at least for debugging - log will be always created no matter the value of traceState
            tl.LogMessage("Dome", "Init traceloger (debug mode)");
            #endif

            Hardware = new Hardware_class(this);

            ReadProfile(); // Read device configuration from the ASCOM Profile store

            //set the correct logger state
            tl.Enabled = traceState;
            tl.LogMessage("Dome", "Starting initialisation");

            Hardware.debugFlag = debugState;
            connectedState     = false; // Initialise connected to false

            //utilities = new Util(); //Initialise util object
            //astroUtilities = new AstroUtils(); // Initialise astro utilities object

            tl.LogMessage("Dome", "Completed initialisation");
        }