TelescopeClientDirectNexStar.cpp   TelescopeClientDirectNexStar.cpp 
skipping to change at line 101 skipping to change at line 101
//! queues a GOTO command //! queues a GOTO command
void TelescopeClientDirectNexStar::telescopeGoto(const Vec3d &j2000Pos) void TelescopeClientDirectNexStar::telescopeGoto(const Vec3d &j2000Pos)
{ {
if (!isConnected()) if (!isConnected())
return; return;
Vec3d position = j2000Pos; Vec3d position = j2000Pos;
if (equinox == EquinoxJNow) if (equinox == EquinoxJNow)
{ {
const StelNavigator* navigator = StelApp::getInstance().getC const StelCore* core = StelApp::getInstance().getCore();
ore()->getNavigator(); position = core->j2000ToEquinoxEqu(j2000Pos);
position = navigator->j2000ToEquinoxEqu(j2000Pos);
} }
//if (writeBufferEnd - writeBuffer + 20 < (int)sizeof(writeBuffer)) //if (writeBufferEnd - writeBuffer + 20 < (int)sizeof(writeBuffer))
//TODO: See the else clause, think how to do the same thing //TODO: See the else clause, think how to do the same thing
{ {
const double ra_signed = atan2(position[1], position[0]); const double ra_signed = atan2(position[1], position[0]);
//Workaround for the discrepancy in precision between Window s/Linux/PPC Macs and Intel Macs: //Workaround for the discrepancy in precision between Window s/Linux/PPC Macs and Intel Macs:
const double ra = (ra_signed >= 0) ? ra_signed : (ra_signed + 2.0 * M_PI); const double ra = (ra_signed >= 0) ? ra_signed : (ra_signed + 2.0 * M_PI);
const double dec = atan2(position[2], sqrt(position[0]*posit ion[0]+position[1]*position[1])); const double dec = atan2(position[2], sqrt(position[0]*posit ion[0]+position[1]*position[1]));
unsigned int ra_int = (unsigned int)floor(0.5 + ra*(((unsign ed int)0x80000000)/M_PI)); unsigned int ra_int = (unsigned int)floor(0.5 + ra*(((unsign ed int)0x80000000)/M_PI));
skipping to change at line 132 skipping to change at line 132
*/ */
} }
void TelescopeClientDirectNexStar::gotoReceived(unsigned int ra_int, int de c_int) void TelescopeClientDirectNexStar::gotoReceived(unsigned int ra_int, int de c_int)
{ {
nexstar->sendGoto(ra_int, dec_int); nexstar->sendGoto(ra_int, dec_int);
} }
//! estimates where the telescope is by interpolation in the stored //! estimates where the telescope is by interpolation in the stored
//! telescope positions: //! telescope positions:
Vec3d TelescopeClientDirectNexStar::getJ2000EquatorialPos(const StelNavigat or*) const Vec3d TelescopeClientDirectNexStar::getJ2000EquatorialPos(const StelCore*) const
{ {
const qint64 now = getNow() - time_delay; const qint64 now = getNow() - time_delay;
return interpolatedPosition.get(now); return interpolatedPosition.get(now);
} }
bool TelescopeClientDirectNexStar::prepareCommunication() bool TelescopeClientDirectNexStar::prepareCommunication()
{ {
//TODO: Nothing to prepare? //TODO: Nothing to prepare?
return true; return true;
} }
skipping to change at line 214 skipping to change at line 214
{ {
//Server time is "now", because this class is the server //Server time is "now", because this class is the server
const qint64 server_micros = (qint64) GetNow(); const qint64 server_micros = (qint64) GetNow();
const double ra = ra_int * (M_PI/(unsigned int)0x80000000); const double ra = ra_int * (M_PI/(unsigned int)0x80000000);
const double dec = dec_int * (M_PI/(unsigned int)0x80000000); const double dec = dec_int * (M_PI/(unsigned int)0x80000000);
const double cdec = cos(dec); const double cdec = cos(dec);
Vec3d position(cos(ra)*cdec, sin(ra)*cdec, sin(dec)); Vec3d position(cos(ra)*cdec, sin(ra)*cdec, sin(dec));
Vec3d j2000Position = position; Vec3d j2000Position = position;
if (equinox == EquinoxJNow) if (equinox == EquinoxJNow)
{ {
const StelNavigator* navigator = StelApp::getInstance().getC const StelCore* core = StelApp::getInstance().getCore();
ore()->getNavigator(); j2000Position = core->equinoxEquToJ2000(position);
j2000Position = navigator->equinoxEquToJ2000(position);
} }
interpolatedPosition.add(j2000Position, getNow(), server_micros, sta tus); interpolatedPosition.add(j2000Position, getNow(), server_micros, sta tus);
} }
 End of changes. 3 change blocks. 
7 lines changed or deleted 5 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/