Пример #1
0
        internal void Add(double Minium, double Maximum, TraceLoggerPlus TL)
        {
            TL.LogMessage("AxisRates.Add", "Before m_Rates.Length: " + m_Rates.Length);
            Rate r = new Rate(Minium, Maximum);                 // Create a new rate to add to the new array

            Rate[] NewRateArray = new Rate[m_Rates.Length + 1]; // Create a new Rate array to replace the current one
            TL.LogMessage("AxisRates.Add", "NewRateArray.Length: " + NewRateArray.Length);
            Array.Copy(m_Rates, NewRateArray, m_Rates.Length);  // Copy the current contents of the m_Rated array to the new array
            NewRateArray[m_Rates.Length] = r;                   // Add the new rate the the new Rates array.
            m_Rates = NewRateArray;                             // Make m_Rates point at the new larger array
            TL.LogMessage("AxisRates.Add", "After m_Rates.Length: " + m_Rates.Length);
        }
Пример #2
0
 public ServerConfigurationForm(TraceLoggerPlus Logger, string serviceType, string ipAddressString, decimal portNumber, string userName, string password) : this()
 {
     TL = Logger;
     TL.LogMessage("ServerConfigurationForm", "Form initialiser starting");
     deviceNumberIndexes  = new Dictionary <string, int>();
     configuredDevices    = new Dictionary <string, ConfiguredDevice>();
     this.serviceType     = serviceType;
     this.ipAddressString = ipAddressString;
     this.portNumber      = portNumber;
     this.userName        = userName;
     this.password        = password;
     TL.LogMessage("ServerConfigurationForm", "Form initialiser completed");
 }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TelescopeBaseClass"/> class.
        /// Must be public for COM registration.
        /// </summary>
        public TelescopeBaseClass(string RequiredDriverNumber, string RequiredDriverDisplayName, string RequiredProgId)
        {
            try
            {
                // Initialise variables unique to this particular driver with values passed from the calling class
                DriverNumber      = RequiredDriverNumber;
                DriverDisplayName = RequiredDriverDisplayName; // Driver description that displays in the ASCOM Chooser.
                DriverProgId      = RequiredProgId;

                if (TL == null)
                {
                    TL = new TraceLoggerPlus("", string.Format(SharedConstants.TRACELOGGER_NAME_FORMAT_STRING, DriverNumber, DEVICE_TYPE));
                }
                RemoteClientDriver.ReadProfile(clientNumber, TL, DEVICE_TYPE, DriverProgId,
                                               ref traceState, ref debugTraceState, ref ipAddressString, ref portNumber, ref remoteDeviceNumber, ref serviceType, ref establishConnectionTimeout, ref standardServerResponseTimeout,
                                               ref longServerResponseTimeout, ref userName, ref password, ref manageConnectLocally, ref imageArrayTransferType, ref imageArrayCompression);

                Version version = Assembly.GetEntryAssembly().GetName().Version;
                TL.LogMessage(clientNumber, DEVICE_TYPE, "Starting initialisation, Version: " + version.ToString());

                clientNumber = RemoteClientDriver.GetUniqueClientNumber();
                TL.LogMessage(clientNumber, DEVICE_TYPE, "This instance's unique client number: " + clientNumber);

                RemoteClientDriver.ConnectToRemoteServer(ref client, ipAddressString, portNumber, serviceType, TL, clientNumber, DEVICE_TYPE, standardServerResponseTimeout, userName, password);

                URIBase = string.Format("{0}{1}/{2}/{3}/", SharedConstants.API_URL_BASE, SharedConstants.API_VERSION_V1, DEVICE_TYPE, remoteDeviceNumber.ToString());
                TL.LogMessage(clientNumber, DEVICE_TYPE, "This devices's base URI: " + URIBase);
                TL.LogMessage(clientNumber, DEVICE_TYPE, "Establish communications timeout: " + establishConnectionTimeout.ToString());
                TL.LogMessage(clientNumber, DEVICE_TYPE, "Standard server response timeout: " + standardServerResponseTimeout.ToString());
                TL.LogMessage(clientNumber, DEVICE_TYPE, "Long server response timeout: " + longServerResponseTimeout.ToString());
                TL.LogMessage(clientNumber, DEVICE_TYPE, string.Format("User name is Null or Empty: {0}, User name is Null or White Space: {1}", string.IsNullOrEmpty(userName), string.IsNullOrWhiteSpace(userName)));
                TL.LogMessage(clientNumber, DEVICE_TYPE, string.Format("User name length: {0}", password.Length));
                TL.LogMessage(clientNumber, DEVICE_TYPE, string.Format("Password is Null or Empty: {0}, Password is Null or White Space: {1}", string.IsNullOrEmpty(password), string.IsNullOrWhiteSpace(password)));
                TL.LogMessage(clientNumber, DEVICE_TYPE, string.Format("Password length: {0}", password.Length));

                TL.LogMessage(clientNumber, DEVICE_TYPE, "Completed initialisation");
            }
            catch (Exception ex)
            {
                TL.LogMessageCrLf(clientNumber, DEVICE_TYPE, ex.ToString());
            }
        }
Пример #4
0
        public void InitUI(ServerConfigurationForm parent, TraceLoggerPlus Logger)
        {
            setupForm = parent;
            TL        = Logger;
            TL.LogMessage(0, 0, 0, "InitUI", "Start");
            profile = new Profile();
            TL.LogMessage(0, 0, 0, "InitUI", "Created Profile");

            cmbDeviceType.Items.Add(SharedConstants.DEVICE_NOT_CONFIGURED);
            TL.LogMessage(0, 0, 0, "InitUI", "Added Device not configured");


            foreach (string deviceType in profile.RegisteredDeviceTypes)
            {
                TL.LogMessage(0, 0, 0, "InitUI", "Adding item: " + deviceType);
                cmbDeviceType.Items.Add(deviceType);
                deviceTypes.Add(deviceType); // Remember the device types on this system
            }
            TL.LogMessage(0, 0, 0, "InitUI", "Setting selected index to 0");

            cmbDeviceType.SelectedIndex = 0;
            TL.LogMessage(0, 0, 0, "InitUI", "Finished");
        }
Пример #5
0
 public SetupDialogForm(TraceLoggerPlus TraceLogger) : this()
 {
     TL = TraceLogger;
 }