Esempio n. 1
0
STDMETHODIMP CVisText::put_scale(VARIANT newVal)
{
	int alen;
	double *aptr;
	if( VariantToArray(&alen,&aptr,&newVal) ) return E_INVALIDARG;
	if( alen<2 ) { delete aptr; return E_INVALIDARG; }
	ScaleX=(float)aptr[0];
	ScaleY=(float)aptr[1];
	
	if(VisWindow && Show){ 
		VisWindow->requestUpdate();
		if(VisWindow->logmode) VisWindow->logAction(tag,ACTION_SCALE,aptr,alen);
	}

	delete aptr;
	return S_OK;
}
Esempio n. 2
0
STDMETHODIMP CVisText::put_color(VARIANT newVal)
{
	int alen;
	double *aptr;
	if( VariantToArray(&alen,&aptr,&newVal) ) return E_INVALIDARG;
	if( alen<3 ) { delete aptr; return E_INVALIDARG; }
	Color[0]=(float)aptr[0];
	Color[1]=(float)aptr[1];
	Color[2]=(float)aptr[2];
	if( alen==4) Alpha=(float)aptr[3];

#if INDEX_MODE
	ColorIndex=VisWindow->ColorRGB2I(Color);
#endif

	if(VisWindow && Show){ 
		VisWindow->requestUpdate();
		if(VisWindow->logmode) VisWindow->logAction(tag,ACTION_COLOR,aptr,alen);
	}
	delete aptr;
	return S_OK;
}
Esempio n. 3
0
STDMETHODIMP CVisObject::put_pos(VARIANT newVal)
{
	// This is really ugly, but I wanted to remain Automation Compliant
	// so it can be called matlab, e.g.

	int alen;
	double *aptr;
	if( VariantToArray(&alen,&aptr,&newVal) ) return E_INVALIDARG;
	if( alen<2 ) { delete aptr; return E_INVALIDARG; }
	X=(float)aptr[0];
	Y=(float)aptr[1];

	if(VisWindow && Show){ 
		VisWindow->requestUpdate();
		// if(VisWindow->logmode) VisWindow->logAction(tag,ACTION_POS,aptr,alen);
		/* NOTE!! For now, don't log position changes, since they are
			causing troubles for TDT/Sensors due to rapid changes 
		*/
	}
	delete aptr;
	return S_OK;
}
Esempio n. 4
0
STDMETHODIMP CVisCalibrate::put_pos(VARIANT newVal)
{
	// In case caller asks, you're not ready for the new target yet
	tReady = 0;

	// This is really ugly, but I wanted to remain Automation Compliant
	// so someday this could be called from matlab.
	int alen;
	double *aptr;
	if( VariantToArray(&alen,&aptr,&newVal) ) return E_INVALIDARG;
	if( alen<2 ) { delete aptr; return E_INVALIDARG; }

	// Now Store Data
	xpos[tCount]=(float)aptr[0];
	ypos[tCount]=(float)aptr[1];
	if(alen>2) zpos[tCount]=(float)aptr[2];
	else posDim = 2;
	
	delete aptr;
	tCount++;

 //HResultErrMessageBox("screw you",S_OK);

	// If done, calulate Calibration and Store
	if(tCount == tN )
	{
		// Remove the disk
		pID->Release();
		// Do the work
		compute();
	}
	// Else prepare next target
	else 
	{
		presentTarget();
	}

	return S_OK;
}
Esempio n. 5
0
STDMETHODIMP CVisWindow::put_countersize(VARIANT newVal)
{
	int alen,cw,ch;
	double *aptr;
	if( VariantToArray(&alen,&aptr,&newVal) ) return E_INVALIDARG;
	if( alen<2 ) { delete aptr; return E_INVALIDARG; }
	counterSize[0]=(float)aptr[0];
	counterSize[1]=(float)aptr[1];


	cw = (int)(counterSize[0]*width);
	ch = (int)(counterSize[1]*height);
	if( cw!=counterW || ch!=counterH ){
		counterW = cw;
		counterH = ch;
		if(logmode){
			requestUpdate();
			logAction(0,ACTION_SCALE,aptr,2);
		}
	}
	delete aptr;
	return S_OK;
}
Esempio n. 6
0
STDMETHODIMP CVisWindow::put_counterpos(VARIANT newVal)
{
	int alen,cx,cy;
	double *aptr;
	if( VariantToArray(&alen,&aptr,&newVal) ) return E_INVALIDARG;
	if( alen<2 ) { delete aptr; return E_INVALIDARG; }
	counterPos[0]=(float)aptr[0];
	counterPos[1]=(float)aptr[1];


	cx = (int)(counterPos[0]*width);
	cy = (int)(counterPos[1]*height);
	if( cx!=counterX || cy!=counterY ){
		counterX = cx;
		counterY = cy;
		if(logmode){
			requestUpdate();
			logAction(0,ACTION_POS,aptr,2);
		}
	}
	delete aptr;
	return S_OK;
}