Example #1
0
 /// <summary>
 /// The constructor.
 /// </summary>
 /// <param name="strParam">Specifies the parameters which shold contains the 'FilePath'=path key=value pair.</param>
 public StandardQueryWAVFile(string strParam = null)
 {
     if (strParam != null)
     {
         strParam = ParamPacker.UnPack(strParam);
         PropertySet ps = new PropertySet(strParam);
         m_strPath = ps.GetProperty("FilePath");
     }
 }
Example #2
0
        /// <summary>
        /// The constructor.
        /// </summary>
        /// <param name="strSchema">Specifies the database schema.</param>
        /// <param name="rgCustomQueries">Optionally, specifies any custom queries to diretly add.</param>
        /// <remarks>
        /// The database schema defines the number of custom queries to use along with their names.  A simple key=value; list
        /// defines the streaming database schema using the following format:
        /// \code{.cpp}
        ///  "ConnectionCount=1;
        ///   Connection0_CustomQueryName=Test1;
        ///   Connection0_CustomQueryParam=param_string1
        /// \endcode
        /// Each param_string specifies the parameters of the custom query and may include the database connection string, database
        /// table, and database fields to query.
        /// </remarks>
        public MgrQueryGeneral(string strSchema, List <IXCustomQuery> rgCustomQueries)
        {
            m_colCustomQuery.Load();
            m_schema = new PropertySet(strSchema);

            m_colCustomQuery.Add(new StandardQueryTextFile());
            m_colCustomQuery.Add(new StandardQueryWAVFile());

            foreach (IXCustomQuery icustomquery in rgCustomQueries)
            {
                m_colCustomQuery.Add(icustomquery);
            }

            int nConnections = m_schema.GetPropertyAsInt("ConnectionCount");

            if (nConnections != 1)
            {
                throw new Exception("Currently, the general query type only supports 1 connection.");
            }

            string strConTag           = "Connection0";
            string strCustomQuery      = m_schema.GetProperty(strConTag + "_CustomQueryName");
            string strCustomQueryParam = m_schema.GetProperty(strConTag + "_CustomQueryParam");

            IXCustomQuery iqry = m_colCustomQuery.Find(strCustomQuery);

            if (iqry == null)
            {
                throw new Exception("Could not find the custom query '" + strCustomQuery + "'!");
            }

            if (iqry.QueryType != CUSTOM_QUERY_TYPE.BYTE && iqry.QueryType != CUSTOM_QUERY_TYPE.REAL_FLOAT && iqry.QueryType != CUSTOM_QUERY_TYPE.REAL_DOUBLE)
            {
                throw new Exception("The custom query '" + iqry.Name + "' must support the 'CUSTOM_QUERY_TYPE.BYTE' or 'CUSTOM_QUERY_TYPE.REAL_FLOAT' or 'CUSTOM_QUERY_TYPE.REAL_DOUBLE' query type!");
            }

            string strParam = ParamPacker.UnPack(strCustomQueryParam);

            m_iquery = iqry.Clone(strParam);
            m_iquery.Open();
        }