Exemplo n.º 1
0
        private void loadOther()
        {
            //logger.Info("Loading Other Settings..");
            allowMoreThanOneInstance = false;
            string s = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, "./application", "allowMoreThanOneInstance");

            bool b;

            if (bool.TryParse(s, out b))
            {
                allowMoreThanOneInstance = b;
            }

            PersistenceDirectory = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, "./Directories/Persistence", "value");
            PersistenceDirectory = FilesPathHelper.PathAddBackslash(PersistenceDirectory);

            s = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, "./Display/UpdateIntervalMs", "value");
            int i;

            if (int.TryParse(s, out i))
            {
                displayUpdateIntervalMs = i;
            }
            else
            {
                displayUpdateIntervalMs = 500;
            }
        }
Exemplo n.º 2
0
        public override void readConfiguration()
        {
            string xPathDAB = "./DAB/Ensemble";

            try
            {
                sUdpPort = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, xPathDAB, "udpPort");
                int port = 0;
                if (!int.TryParse(sUdpPort, out port))
                {
                    throw new Exception("Invalid udp Port");
                }

                sUdpIPAddress = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, xPathDAB, "udpIPAddress");
                IPAddress addr = null;
                if (!IPAddress.TryParse(sUdpIPAddress, out addr))
                {
                    throw new Exception("Invalid udp IPAddress");
                }
            }
            catch (Exception ex)
            {
                logger.Exception(ex);
                sUdpPort      = "8765";            //default
                sUdpIPAddress = "255.255.255.255"; //default
            }
            udpPort      = int.Parse(sUdpPort);
            udpIPAddress = IPAddress.Parse(sUdpIPAddress);

            try
            {
                wavOutDir = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, "./Directories/wavOut/" + modulation, "value");
                wavOutDir = FilesPathHelper.PathAddBackslash(wavOutDir);

                sFileMaxSize = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, "./Directories/wavOut/" + modulation, "maxSize");
                Muted        = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, xPathDAB, "muted") == "yes";
            }
            catch (Exception ex)
            {
                _msgBox.Show(ex.Message, "QIRX Configuration Audio Out File Settings Error", "OK", "Error");
            }
        }
Exemplo n.º 3
0
        private void loadLoggingSettings()
        {
            loggingDirectory  = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, "./Directories/logging", "value");
            loggingDirectory  = FilesPathHelper.PathAddBackslash(loggingDirectory);
            logFileNamePrefix = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, "./Logging/FileNamePrefix", "value");
            string s = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, "./Logging/MaxFileSizeKB", "value");
            int    i = 0;

            if (int.TryParse(s, out i))
            {
                maxLogFileSizeKB = i;
            }
            else
            {
                maxLogFileSizeKB = 2000;
            }

            try
            {
                loggerUdpAddress = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, "./Logging/UDP", "IPAddress");
                i = 0;
                s = XMLHelper.readSingleXMLNodeAttrib(ConfigFilePath, "./Logging/UDP", "Port");
                if (int.TryParse(s, out i))
                {
                    loggerUdpPort = i;
                }
                else
                {
                    loggerUdpPort = 878; //log4view default
                }
            }
            catch (Exception)
            {
                loggerUdpAddress = "Error";
                loggerUdpPort    = 0;
            }
        }