Skip to content

Commit

Permalink
Implement abortSlew command in LX200
Browse files Browse the repository at this point in the history
  • Loading branch information
gzotti committed Oct 17, 2022
1 parent c6dae37 commit addc637
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
15 changes: 15 additions & 0 deletions plugins/TelescopeControl/src/Lx200/Lx200Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,18 @@ void Lx200Connection::sendCommand(Lx200Command *command)
}
}

void Lx200Connection::sendAbort()
{
#ifdef DEBUG4
*log_file << Now()
<< "Lx200Connection::sendAbort()"
<< StelUtils::getEndLineChar();
#endif
command_list.clear();
read_buff_end = read_buff;
write_buff_end = write_buff;
command_list.push_back(new Lx200CommandStopSlew(server));
flushCommandList();
//*log_file << Now() << "Lx200Connection::sendAbort() end"
// << StelUtils::getEndLineChar();
}
2 changes: 2 additions & 0 deletions plugins/TelescopeControl/src/Lx200/Lx200Connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class Lx200Connection : public SerialPort
void sendGoto(unsigned int ra_int, int dec_int);
void sendSync(unsigned int ra_int, int dec_int);
void sendCommand(Lx200Command * command);
//! Delete pending commands and send abort signal.
void sendAbort();
void setTimeBetweenCommands(long long int micro_seconds)
{
time_between_commands = micro_seconds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ void TelescopeClientDirectLx200::telescopeSync(const Vec3d &j2000Pos, StelObject
syncReceived(ra_int, dec_int);
}

void TelescopeClientDirectLx200::telescopeAbortSlew()
{
if (!isConnected())
return;
lx200->sendAbort();
}

void TelescopeClientDirectLx200::gotoReceived(unsigned int ra_int, int dec_int)
{
lx200->sendGoto(ra_int, dec_int);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class TelescopeClientDirectLx200 : public TelescopeClient, public Server
void performCommunication() override;
void telescopeGoto(const Vec3d &j2000Pos, StelObjectP selectObject) override;
void telescopeSync(const Vec3d &j2000Pos, StelObjectP selectObject) override;
void telescopeAbortSlew() override;
bool isInitialized(void) const override;

//======================================================================
Expand Down

0 comments on commit addc637

Please sign in to comment.