コード例 #1
0
/**
 * Reads the commanded azimuth from Mount2 telescope.
 *
 */
CORBA::Double Mount2RefAzDevIO::read(ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl)
{
	ACS_SHORT_LOG( (LM_INFO, "Mount2RefAzDevIO: read"));
	CORBA::Double ret_val(0.0);
//	char *msg;
//	unsigned long read_alt, read_azm;
//	CORBA::Double azm;

	Communication comm = Communication("/dev/ttyUSB0");
	ret_val = comm.getAzm();
//	SerialRS232 *sp = new SerialRS232("/dev/ttyUSB0");
//	sp->write_RS232("z");
//	msg = sp->read_RS232();
//	sscanf(msg,"%08lX,%08lX#",&read_azm,&read_alt);
//
//#define MAX_PRECISE_ROTATION 4294967296.0
//
//	azm = (double)read_azm / MAX_PRECISE_ROTATION;
//	azm *= 360.0;
//
//	ret_val = azm;
//
//	timestamp=getTimeStamp();
//	delete sp;
	return ret_val;
}