3using System.Collections.Generic;
10using System.Threading.Tasks;
43 m_colCustomQuery.
Load();
51 m_colCustomQuery.
Add(icustomquery);
55 if (nConnections != 1)
56 throw new Exception(
"Currently, the general query type only supports 1 connection.");
58 string strConTag =
"Connection0";
59 string strCustomQuery = m_schema.
GetProperty(strConTag +
"_CustomQueryName");
60 string strCustomQueryParam = m_schema.
GetProperty(strConTag +
"_CustomQueryParam");
64 throw new Exception(
"Could not find the custom query '" + strCustomQuery +
"'!");
67 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!");
70 m_iquery = iqry.
Clone(strParam);
87 m_colCustomQuery.
Add(iqry);
94 public void Reset(
int nStartOffset)
129 List<double[]> rgData = m_iquery.
QueryRealD();
131 if (rgData ==
null || rgData.Count == 0 || rgData[0].Length == 0)
134 double[] rgFullData =
new double[rgData[0].Length * rgData.Count];
137 for (
int i = 0; i < rgData.Count; i++)
139 Array.Copy(rgData[i], 0, rgFullData, nOffset, rgData[i].Length);
140 nOffset += rgData[i].Length;
143 return new SimpleDatum(
true, rgData.Count, 1, rgData[0].Length, -1, DateTime.MinValue, rgFullData.ToList(), 0,
false, -1);
149 if (rgData ==
null || rgData.Count == 0 || rgData[0].Length == 0)
152 float[] rgFullData =
new float[rgData[0].Length * rgData.Count];
155 for (
int i = 0; i < rgData.Count; i++)
157 Array.Copy(rgData[i], 0, rgFullData, nOffset, rgData[i].Length);
158 nOffset += rgData[i].Length;
161 return new SimpleDatum(
true, rgData.Count, 1, rgData[0].Length, -1, DateTime.MinValue, rgFullData.ToList(), 0,
false, -1);
167 if (rgData ==
null || rgData.Length == 0)
170 return new SimpleDatum(
false, rgData.Length, 1, 1, -1, DateTime.MinValue, rgData.ToList(), 0,
false, -1);
The CancelEvent provides an extension to the manual cancel event that allows for overriding the manua...
void Set()
Sets the event to the signaled state.
Specifies a key-value pair of properties.
string GetProperty(string strName, bool bThrowExceptions=true)
Returns a property as a string value.
int GetPropertyAsInt(string strName, int nDefault=0)
Returns a property as an integer value.
The SimpleDatum class holds a data input within host memory.
The CustomQueryCollection manages the external Custom Queries placed in the
void Load()
Loads all custom query DLL's (if found).
IXCustomQuery Find(string strName)
Locates a custom query by name and returns it.
void Add(IXCustomQuery iqry)
Directly adds a custom query to the list.
The MgrQueryTime class manages the collection of data queries, and the internal data queue that conta...
byte[] ConvertOutput(float[] rg, out string type)
Converts the output values into the native type used by the CustomQuery.
SimpleDatum Query(int nWait)
Query the next data in the streaming database.
void AddDirectQuery(IXCustomQuery iqry)
Add a custom query directly to the streaming database.
Dictionary< string, float > QueryInfo()
The Query information returns information about the data queried such as header information.
void Shutdown()
Shutdown the data queries and consolidation thread.
void Reset(int nStartOffset)
Reset the query to the start date used in Initialize, optionally with an offset from the start.
MgrQueryGeneral(string strSchema, List< IXCustomQuery > rgCustomQueries)
The constructor.
List< int > GetQuerySize()
Returns the query size of the data in the form: [0] = channels [1] = height [2] = width.
The ParamPacker is use to pack and unpack parameters sent to each custom query.
static string UnPack(string str)
Unpack the custom query parameters.
The StandardQueryTextFile provides queries that read text (*.txt) files residing in a given directory...
The StandardQueryWAVFile provides queries that read sound frequencies from (*.WAV) files residing in ...
The custom query interface defines the functions implemented by each Custom Query object used to spec...
CUSTOM_QUERY_TYPE QueryType
Returns the custom query type supported by the custom query.
void Open()
Open a connection to the underlying database using the connection string specified.
IXCustomQuery Clone(string strParam)
Return a new instance of the custom query.
string Name
Returns the name of the Custom Query.
List< float[]> QueryRealF()
Query the data as a set one or more float arrays.
byte[] QueryBytes()
Query the raw bytes.
List< double[]> QueryRealD()
Query the data as a set one or more double arrays.
Dictionary< string, float > QueryInfo()
The Query information returns information about the data queried such as header information.
byte[] ConvertOutput(float[] rg, out string strType)
Converts the output values into the native type used by the CustomQuery.
void Reset()
Reset the custom query.
List< int > GetQuerySize()
Returns the query count for the current query.
void Close()
Close a currently open connection.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.db.stream namespace contains all data streaming related classes.
CUSTOM_QUERY_TYPE
Defines the custom query type to use.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...