cafe-1.12.5 release
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
//#include <Python.h>
|
||||
//#endif
|
||||
|
||||
|
||||
extern void _main();
|
||||
using namespace NS_MOCHA;
|
||||
|
||||
@@ -43,33 +42,31 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
mexPrintf("Please use the method name (MATLAB char) as input to the first argument. \n");
|
||||
mexPrintf("The command: mocha \'show\' will display the methods available. \n");
|
||||
|
||||
mexPrintf("1st input argument Class Name: %s\n", mxGetClassName(prhs[0]));
|
||||
mexPrintf("1st input argument Class ID: %d\n", mxGetClassID(prhs[0]));
|
||||
mexPrintf("1st input argument to mocha must be of type char/mxCHAR_CLASS\n");
|
||||
//mexPrintf("1st input argument given has Class Name: %s\n", mxGetClassName(prhs[0]));
|
||||
//mexPrintf("1st input argument given has Class ID: %d\n", mxGetClassID(prhs[0]));
|
||||
//mexPrintf("1st input argument to mocha must be of type char/mxCHAR_CLASS\n");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
if (strcmp (mxGetClassName(prhs[0]),"string") ==0 ) {
|
||||
|
||||
mxChar * mess2 = static_cast<mxChar*>(mxGetData(prhs[0]));
|
||||
|
||||
mData = (mxArray *) mess2;
|
||||
messLength = METHOD_NAME_MAX_SIZE+1;
|
||||
//mxChar * mess2 = static_cast<mxChar*>(mxGetData(prhs[0]));
|
||||
//mData = (mxArray *) mess2;
|
||||
//messLength = METHOD_NAME_MAX_SIZE+1;
|
||||
|
||||
if ( mxGetString(mData, mess, messLength) == 1) {
|
||||
mexPrintf ("mxGetString has failed; input is not of mxChar type\n");
|
||||
}
|
||||
//if ( mxGetString(mData, mess, messLength) == 1) {
|
||||
// mexPrintf ("mxGetString has failed; input is not of mxChar type\n");
|
||||
//}
|
||||
|
||||
mexPrintf ("mocha does not support string/mxSTRING_CLASS as input\n");
|
||||
mexPrintf ("Please use char/mxCHAR_CLASS as data type for input\n");
|
||||
mexPrintf ("MATLAB mx library does not support string/mxSTRING_CLASS as input\n");
|
||||
mexPrintf ("Please use char/mxCHAR_CLASS as data type instead\n");
|
||||
mexPrintf("i.e., use single quotes instead of double quotes in input argument!\n");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
*/
|
||||
}
|
||||
//message
|
||||
|
||||
//Trick to handle mocha(402) input from monitor Action
|
||||
@@ -77,14 +74,32 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
messLength = METHOD_NAME_MAX_SIZE+1;
|
||||
if (mxIsChar(prhs[0]) )
|
||||
{
|
||||
mData = (mxArray *) prhs[0];
|
||||
mData = (mxArray *) prhs[0];
|
||||
mxGetString(mData, mess, messLength);
|
||||
}
|
||||
else if (!strcmp(mxGetClassName(prhs[0]), "string") )
|
||||
{
|
||||
|
||||
mexPrintf("1st input argument given has Class Name: %s\n", mxGetClassName(prhs[0]));
|
||||
mexPrintf("1st input argument given has Class ID: %d\n", mxGetClassID(prhs[0]));
|
||||
mexPrintf("1st input argument to mocha must be of type char/mxCHAR_CLASS\n");
|
||||
mexPrintf("Please use single quotes instead of double quotes in input argument!\n");
|
||||
|
||||
return;
|
||||
}
|
||||
else if (mochaIndex ==MONITOR_FLUSH_EVENT)
|
||||
{
|
||||
strcpy(mess,"monitorflushevent");
|
||||
}
|
||||
else
|
||||
{
|
||||
mexPrintf("1st input argument given has Class Name: %s\n", mxGetClassName(prhs[0]));
|
||||
mexPrintf("1st input argument given has Class ID: %d\n", mxGetClassID(prhs[0]));
|
||||
mexPrintf("1st input argument to mocha must be of type char/mxCHAR_CLASS\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char messOriginal[METHOD_NAME_MAX_SIZE+1];
|
||||
strcpy(messOriginal,mess);
|
||||
@@ -167,6 +182,7 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
|
||||
//mexPrintf("message %s\n", mess);
|
||||
//mexPrintf("message %s\n", messString.c_str());
|
||||
|
||||
|
||||
it_name = name_index.find(mess);
|
||||
|
||||
@@ -325,14 +341,12 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
|
||||
case SET:
|
||||
|
||||
|
||||
if (nrhs<3)
|
||||
{
|
||||
mexPrintf("Invalid Number of argument %d. Input: 'set', handle/pv, data \n", nrhs);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (mxIsChar(prhs[1]))
|
||||
{
|
||||
nh=1;
|
||||
@@ -421,9 +435,7 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
nh=mxGetNumberOfElements (prhs[1]);
|
||||
|
||||
}
|
||||
|
||||
///mexPrintf("nh=%d, nargin=%d\n", nh, nrhs);
|
||||
@@ -489,7 +501,7 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
break;
|
||||
|
||||
case MOCHA_VERSION:
|
||||
plhs[0]=mxCreateString((char *) "mocha-1.8.0 : 14 December 2018");
|
||||
plhs[0]=mxCreateString((char *) "mocha-1.12.5 (Qt5 compatible) : 15 March 2021");
|
||||
break;
|
||||
|
||||
case SHOW:
|
||||
@@ -1044,8 +1056,9 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
xData = (mxArray *) prhs[1];
|
||||
pvLength = PVNAME_MAX_SIZE+1;
|
||||
mxGetString(xData, pv, pvLength);
|
||||
|
||||
|
||||
handle=NS_MOCHA::open(pv);
|
||||
|
||||
|
||||
//return handle
|
||||
//plhs[0] = mxCreateDoubleScalar(handle);
|
||||
@@ -1351,7 +1364,6 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
(du[j].getPVName(),pvgroup.getGroupHandle());
|
||||
|
||||
|
||||
|
||||
//Match INPUT to CAFE DATATYPE
|
||||
if (mdtIndexOriginal==MOCHA_NATIVE)
|
||||
{
|
||||
@@ -2599,19 +2611,14 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
case GET:
|
||||
{
|
||||
|
||||
|
||||
|
||||
if (nrhs<2)
|
||||
{
|
||||
mexPrintf("Invalid Number of argument %d. Input: message, handle/pv \n", nrhs);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
handle=checkForHandle(prhs[1]);
|
||||
|
||||
|
||||
if(handle==0)
|
||||
{
|
||||
mexPrintf("Handle does not exist!\n");
|
||||
@@ -2640,11 +2647,8 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
if (mdtIndex==MOCHA_NATIVE)
|
||||
{
|
||||
|
||||
|
||||
|
||||
status=cafe.getHandleHelper().getDataTypeRequest(handle, rdt);
|
||||
|
||||
|
||||
if (status!=ICAFE_NORMAL)
|
||||
{
|
||||
mexPrintf("Error for handle input= %d \n", (uint32_T) mxGetScalar(prhs[1]) );
|
||||
@@ -2657,14 +2661,11 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
CAFE_DATATYPE cdt = (CAFE_DATATYPE) rdt;
|
||||
|
||||
|
||||
|
||||
mdtIndex=getMdtIndexFromCafeDataType(cdt);
|
||||
|
||||
|
||||
|
||||
if (cafe.getHandleHelper().isEnum(handle))
|
||||
{
|
||||
|
||||
mdtIndex=MOCHA_STRING;
|
||||
}
|
||||
}
|
||||
@@ -2672,7 +2673,6 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
nelem = cafe.getHandleHelper().getNelemClient(handle); //Change Request to Client
|
||||
|
||||
|
||||
|
||||
if (cafe.getHandleHelper().getOffset(handle) > 0 )
|
||||
{
|
||||
|
||||
@@ -2697,12 +2697,10 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
|
||||
//mexPrintf("get Cache: nelem = %d \n", nelem);
|
||||
|
||||
|
||||
if ( (cafe.getHandleHelper().getOffsetLast(handle) > 0) ||
|
||||
(cafe.getHandleHelper().getNelemToRetrieveFromCache(handle) > cafe.getHandleHelper().getNelemRequest(handle)))
|
||||
{
|
||||
|
||||
|
||||
//if (nelem > cafe.getHandleHelper().getNelemRequest(handle) ) {
|
||||
nelemPrevious=cafe.getHandleHelper().getNelemToRetrieveFromCache(handle);
|
||||
nelem = min( (unsigned int) nelem, cafe.getHandleHelper().getNelemRequest(handle)-cafe.getHandleHelper().getOffsetLast(handle));
|
||||
@@ -2716,6 +2714,14 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
|
||||
}
|
||||
|
||||
//special case for wf with dbr_char_t
|
||||
ChannelRegalia channelInfo;
|
||||
status=cafe.getChannelInfo(handle, channelInfo);
|
||||
unsigned int WFWithString = 0;
|
||||
if (channelInfo.getClassNameAsString().compare("waveform") ==0) {
|
||||
WFWithString = 1;
|
||||
}
|
||||
|
||||
switch (mdtIndex)
|
||||
{
|
||||
case MOCHA_DOUBLE:
|
||||
@@ -2786,57 +2792,91 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
break;
|
||||
|
||||
case MOCHA_UCHAR:
|
||||
plhs[0] = mxCreateNumericMatrix(1,nelem,mxUINT8_CLASS, mxREAL);
|
||||
ucharArray = (uint8_T *) mxGetData (plhs[0]);
|
||||
if(cacheFlag)
|
||||
{
|
||||
status=cafe.getCache(handle,ucharArray);
|
||||
}
|
||||
else
|
||||
{
|
||||
status=cafe.get(handle,ucharArray);
|
||||
}
|
||||
|
||||
//special case for wf with dbr_char_t
|
||||
/*
|
||||
if (WFWithString == 1) {
|
||||
|
||||
string wfStr;
|
||||
|
||||
if (cacheFlag)
|
||||
{
|
||||
status=cafe.getWFAsStringCache(handle,wfStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
status=cafe.getWFAsString(handle,wfStr);
|
||||
}
|
||||
|
||||
plhs[0] = mxCreateString( wfStr.c_str() );
|
||||
}
|
||||
else {
|
||||
*/
|
||||
plhs[0] = mxCreateNumericMatrix(1,nelem,mxUINT8_CLASS, mxREAL);
|
||||
ucharArray = (uint8_T *) mxGetData (plhs[0]);
|
||||
if(cacheFlag)
|
||||
{
|
||||
status=cafe.getCache(handle,ucharArray);
|
||||
}
|
||||
else
|
||||
{
|
||||
status=cafe.get(handle,ucharArray);
|
||||
}
|
||||
//}
|
||||
break;
|
||||
|
||||
case MOCHA_STRING:
|
||||
{
|
||||
dbr_string_t * stringArrayc = new dbr_string_t[nelem];
|
||||
|
||||
if(cacheFlag)
|
||||
{
|
||||
status=cafe.getCache(handle,stringArrayc);
|
||||
}
|
||||
else
|
||||
{
|
||||
status=cafe.get(handle,stringArrayc);
|
||||
}
|
||||
if (WFWithString ==1) {
|
||||
|
||||
//char *test[40];
|
||||
//test[0]="test";
|
||||
//test[1]="again";
|
||||
//mxChar *pr;
|
||||
//char *ptr_to_seed_data;
|
||||
//int c;
|
||||
string wfStr;
|
||||
|
||||
|
||||
if (status==ICAFE_NORMAL)
|
||||
{
|
||||
|
||||
if (nelem==1)
|
||||
if (cacheFlag)
|
||||
{
|
||||
plhs[0]=mxCreateString( stringArrayc[0] );
|
||||
status=cafe.getWFAsStringCache(handle,wfStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
plhs[0] = mxCreateCellMatrix(1,nelem);
|
||||
for (mwSignedIndex i=0; i <nelem; ++i)
|
||||
{
|
||||
mxSetCell (plhs[0], i, mxCreateString( stringArrayc[i] ));
|
||||
}
|
||||
status=cafe.getWFAsString(handle,wfStr);
|
||||
}
|
||||
}
|
||||
|
||||
delete [] stringArrayc;
|
||||
plhs[0] = mxCreateString( wfStr.c_str() );
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
dbr_string_t * stringArrayc = new dbr_string_t[nelem];
|
||||
|
||||
if(cacheFlag)
|
||||
{
|
||||
status=cafe.getCache(handle,stringArrayc);
|
||||
}
|
||||
else
|
||||
{
|
||||
status=cafe.get(handle,stringArrayc);
|
||||
}
|
||||
|
||||
|
||||
if (status==ICAFE_NORMAL)
|
||||
{
|
||||
|
||||
if (nelem==1)
|
||||
{
|
||||
plhs[0]=mxCreateString( stringArrayc[0] );
|
||||
}
|
||||
else
|
||||
{
|
||||
plhs[0] = mxCreateCellMatrix(1,nelem);
|
||||
for (mwSignedIndex i=0; i <nelem; ++i)
|
||||
{
|
||||
mxSetCell (plhs[0], i, mxCreateString( stringArrayc[i] ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete [] stringArrayc;
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Non DBR_TYPES
|
||||
@@ -2997,11 +3037,11 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
|
||||
if (cacheFlag)
|
||||
{
|
||||
status=cafe.getWFAsString(handle,wfStr);
|
||||
status=cafe.getWFAsStringCache(handle,wfStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
status=cafe.getWFAsStringCache(handle,wfStr);
|
||||
status=cafe.getWFAsString(handle,wfStr);
|
||||
}
|
||||
|
||||
//plhs[0] = mxCreateCellMatrix(1,2);
|
||||
@@ -4236,7 +4276,7 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
|
||||
size_t ne = mxGetNumberOfElements ( prhs[2]);
|
||||
|
||||
if(ne==0)
|
||||
if (ne==0)
|
||||
{
|
||||
mexPrintf("Empty Data Array in Input \n");
|
||||
return;
|
||||
@@ -4246,21 +4286,34 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
neWithinAllCells=0;
|
||||
iWithinAllCells=0;
|
||||
|
||||
mxClassID mxid =mxGetClassID( prhs[2]);
|
||||
|
||||
mxClassID mxid =mxGetClassID(prhs[2]);
|
||||
|
||||
|
||||
//This line is important for a string as the Number of Elements
|
||||
//is interpreted as the number of characters!!!
|
||||
//Hence for ne to be 1
|
||||
//Unless we have the special case of wf and DBR_CHAR
|
||||
//So let us first check if this is a waveform
|
||||
|
||||
unsigned short isWFWithString=0;
|
||||
|
||||
if (mxid==mxCHAR_CLASS)
|
||||
{
|
||||
ne=1;
|
||||
ChannelRegalia channelInfo;
|
||||
status=cafe.getChannelInfo(handle, channelInfo);
|
||||
//mexPrintf(channelInfo.getClassNameAsString().c_str());
|
||||
if (channelInfo.getClassNameAsString().compare("waveform") !=0) {
|
||||
ne=1;
|
||||
}
|
||||
else {
|
||||
isWFWithString = 1;
|
||||
}
|
||||
}
|
||||
|
||||
nelem = cafe.getHandleHelper().getNelemClient(handle);
|
||||
|
||||
|
||||
//handle does not exist
|
||||
if(nelem==0)
|
||||
if (nelem==0)
|
||||
{
|
||||
//status
|
||||
plhs[0] = mxCreateNumericMatrix(1,1,mxINT32_CLASS,mxREAL);
|
||||
@@ -4275,11 +4328,12 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
return;
|
||||
}
|
||||
|
||||
if(nelem!=ne)
|
||||
if (nelem!=ne)
|
||||
{
|
||||
cafe.getHandleHelper().setNelem(handle,ne);
|
||||
}
|
||||
|
||||
|
||||
mxArray *fout;
|
||||
switch(mxid)
|
||||
{
|
||||
@@ -4360,11 +4414,13 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
|
||||
scanCell(prhs[2]);
|
||||
|
||||
//Is it a waveform??
|
||||
//If neWithinAllCells =1 and wf and class is mx_char
|
||||
|
||||
inputStringCell = new dbr_string_t[neWithinAllCells];
|
||||
|
||||
cellToString(prhs[2]);
|
||||
|
||||
|
||||
if(neWithinAllCells!=ne)
|
||||
{
|
||||
cafe.getHandleHelper().setNelem(handle,neWithinAllCells);
|
||||
@@ -4377,17 +4433,132 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
}
|
||||
// Single String
|
||||
case mxCHAR_CLASS:
|
||||
dbr_string_t inputString;;
|
||||
mxGetString(prhs[2], inputString, sizeof(dbr_string_t));
|
||||
status=cafe.set(handle, inputString);
|
||||
char *buf;
|
||||
|
||||
size_t buflen;
|
||||
buflen = mxGetN(prhs[2]) + 1;
|
||||
/*
|
||||
buf = (char *) mxMalloc(buflen);
|
||||
|
||||
break;
|
||||
long mexStatus;
|
||||
|
||||
mexStatus = mxGetString(prhs[2], buf, (mwSize) buflen+10);
|
||||
if (mexStatus != 0) {
|
||||
mexWarnMsgIdAndTxt( "MATLAB:mxmalloc:mxGetString",
|
||||
"Failed to copy input string into allocated memory.");
|
||||
status = ECAFE_BADSTR;
|
||||
}
|
||||
*/
|
||||
buf=mxArrayToString(prhs[2]);
|
||||
|
||||
if (isWFWithString == 1) {
|
||||
//std::string tempStr = inputString;
|
||||
dbr_char_t * wfChar = new dbr_char_t [buflen+1];
|
||||
//dbr_char_t * setStrValues = (dbr_char_t *) mxMalloc(buflen+40); // new dbr_char_t [buflen];
|
||||
std::string wfStr = buf;
|
||||
unsigned short iCount = 0;
|
||||
for (std::string::size_type i=0; i < wfStr.size(); ++i) {
|
||||
char c = wfStr[i];
|
||||
|
||||
char cNext;
|
||||
if (c == '\\' && i < (wfStr.size()-1)) {
|
||||
|
||||
cNext = wfStr[i+1];
|
||||
bool recognizedFlag = true;
|
||||
wfChar[iCount] = NS_MOCHA::getEscapeSequence(cNext, recognizedFlag);
|
||||
//mexPrintf ("wf %d", wfChar[iCount]);
|
||||
/*
|
||||
switch (cNext) {
|
||||
case '0':
|
||||
wfChar[iCount] = '\0';
|
||||
break;
|
||||
case '\'':
|
||||
wfChar[iCount] = '\'';
|
||||
break;
|
||||
case '"':
|
||||
wfChar[iCount] = '\"';
|
||||
break;
|
||||
case '?':
|
||||
wfChar[iCount] = '\?';
|
||||
break;
|
||||
case '\\':
|
||||
wfChar[iCount] = '\\';
|
||||
break;
|
||||
case 'a':
|
||||
wfChar[iCount] = '\a';
|
||||
break;
|
||||
case 'b':
|
||||
wfChar[iCount] = '\b';
|
||||
break;
|
||||
case 'f':
|
||||
wfChar[iCount] = '\f';
|
||||
break;
|
||||
case 'n':
|
||||
wfChar[iCount] = '\n';
|
||||
break;
|
||||
case 'r':
|
||||
wfChar[iCount] = '\r';
|
||||
break;
|
||||
case 't':
|
||||
mexPrintf ("wf %c", wfChar[iCount]);
|
||||
wfChar[iCount] = '\t';
|
||||
mexPrintf ("wf %c", wfChar[iCount]);
|
||||
break;
|
||||
case 'v':
|
||||
wfChar[iCount] = '\v';
|
||||
break;
|
||||
default:
|
||||
// Unrecognized escape sequence; print slash and subsequent letter
|
||||
wfChar[iCount] = '\\';
|
||||
--i;
|
||||
break;
|
||||
}
|
||||
*/
|
||||
//if (wfChar[iCount] != '\\') {
|
||||
if (recognizedFlag) {
|
||||
++i;
|
||||
// mexPrintf ("wfplus i %d %d", wfChar[iCount], i);
|
||||
}
|
||||
}
|
||||
else {
|
||||
wfChar[iCount] = c;
|
||||
}
|
||||
++iCount;
|
||||
//setStrValues[i] = buf[i];
|
||||
}
|
||||
|
||||
|
||||
|
||||
cafe.getHandleHelper().setNelem(handle, iCount);
|
||||
//std::string tb = buf;
|
||||
//strcpy( (char*)(setStrValues), (const char*) buf); //"Hello \nWorld\0" );
|
||||
//setStrValues =(dbr_char_t *) tb.c_str(); //"Hello\tWorld\nA\0"; //(dbr_char_t *) buf; //
|
||||
status = cafe.set(handle, wfChar); // ) (dbr_char_t *) buf);
|
||||
|
||||
delete [] wfChar;
|
||||
// mxFree(setStrValues);
|
||||
|
||||
}
|
||||
else {
|
||||
status=cafe.set(handle, buf);
|
||||
}
|
||||
|
||||
|
||||
mxFree(buf);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
mexPrintf("mxClassID=%s (enum %d) is not supported; set not instigated!\n",
|
||||
mxGetClassName(prhs[2]), mxid);
|
||||
mexPrintf("mxClassID=%s (enum %d) is supported; i.e., use single instead of double quotes!\n",
|
||||
"char", mxCHAR_CLASS);
|
||||
|
||||
break;
|
||||
status = ECAFE_INVALID_SWITCH_CASE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(nelem!=ne) cafe.getHandleHelper().setNelem(handle,nelem); //back to old value
|
||||
|
||||
//status
|
||||
@@ -4408,9 +4579,6 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case SET_AND_GET:
|
||||
{
|
||||
if (nrhs<3)
|
||||
@@ -5361,6 +5529,39 @@ void macchinettaFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prh
|
||||
break;
|
||||
}
|
||||
|
||||
case GET_NO_MONITORS:
|
||||
{
|
||||
|
||||
|
||||
if (nrhs<2)
|
||||
{
|
||||
mexPrintf("Invalid Number of argument %d. Input: 'getNoMonitors', handle/pv \n", nrhs);
|
||||
return;
|
||||
}
|
||||
else if (nrhs>2)
|
||||
{
|
||||
mexPrintf("Ignoring arguments after the 2nd from the %d entered. Input: 'getNoMonitors', handle/pv \n", nrhs);
|
||||
}
|
||||
|
||||
handle=checkForHandle(prhs[1]);
|
||||
if(handle==0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
unsigned int nm;
|
||||
nm=cafe.getHandleHelper().getNmonitor(handle);
|
||||
|
||||
//number of monitors for this handle
|
||||
plhs[0] = mxCreateNumericMatrix(1,1,mxUINT32_CLASS,mxREAL);
|
||||
ulongArray = (uint32_T *) mxGetData(plhs[0]);
|
||||
|
||||
ulongArray[0]=nm;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case PRINT_MONITORS:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user