Skip to content

Commit

Permalink
Merge pull request #899 from wolfmanjm/upstreamedge
Browse files Browse the repository at this point in the history
Fix jog screen to use WCS as well
  • Loading branch information
wolfmanjm committed Mar 31, 2016
2 parents d033854 + 639e1e9 commit aa919ae
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 16 deletions.
10 changes: 10 additions & 0 deletions src/modules/utils/panel/PanelScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "Gcode.h"
#include "LcdBase.h"
#include "libs/StreamOutput.h"
#include "Robot.h"

using namespace std;

Expand Down Expand Up @@ -84,6 +85,15 @@ void PanelScreen::send_command(const char *gcstr)
}
}

void PanelScreen::get_current_pos(float *cp)
{
Robot::wcs_t mpos= THEKERNEL->robot->get_axis_position();
Robot::wcs_t pos= THEKERNEL->robot->mcs2wcs(mpos);
cp[0]= THEKERNEL->robot->from_millimeters(std::get<X_AXIS>(pos));
cp[1]= THEKERNEL->robot->from_millimeters(std::get<Y_AXIS>(pos));
cp[2]= THEKERNEL->robot->from_millimeters(std::get<Z_AXIS>(pos));
}

void PanelScreen::on_main_loop()
{
// for each command in queue send it
Expand Down
1 change: 1 addition & 0 deletions src/modules/utils/panel/PanelScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class PanelScreen

friend class Panel;
protected:
void get_current_pos(float *p);
void send_gcode(std::string g);
void send_gcode(const char *gm_code, char parameter, float value);
void send_command(const char *gcstr);
Expand Down
5 changes: 0 additions & 5 deletions src/modules/utils/panel/screens/ControlScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ void ControlScreen::enter_menu_control()
THEPANEL->enter_menu_mode();
}

void ControlScreen::get_current_pos(float *cp)
{
THEKERNEL->robot->get_axis_position(cp);
}

void ControlScreen::set_current_pos(char axis, float p)
{
// change pos by issuing a G0 Xnnn
Expand Down
1 change: 0 additions & 1 deletion src/modules/utils/panel/screens/ControlScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class ControlScreen : public PanelScreen
void display_axis_line(char axis);
void enter_axis_control(char axis);
void enter_menu_control();
void get_current_pos(float *p);
void set_current_pos(char axis, float p);
char control_mode;
char controlled_axis;
Expand Down
9 changes: 0 additions & 9 deletions src/modules/utils/panel/screens/WatchScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,6 @@ float WatchScreen::get_current_speed()
return 6000.0F / THEKERNEL->robot->get_seconds_per_minute();
}

void WatchScreen::get_current_pos(float *cp)
{
Robot::wcs_t mpos= THEKERNEL->robot->get_axis_position();
Robot::wcs_t pos= THEKERNEL->robot->mcs2wcs(mpos);
cp[0]= THEKERNEL->robot->from_millimeters(std::get<X_AXIS>(pos));
cp[1]= THEKERNEL->robot->from_millimeters(std::get<Y_AXIS>(pos));
cp[2]= THEKERNEL->robot->from_millimeters(std::get<Z_AXIS>(pos));
}

void WatchScreen::get_sd_play_info()
{
void *returned_data;
Expand Down
1 change: 0 additions & 1 deletion src/modules/utils/panel/screens/WatchScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class WatchScreen : public PanelScreen
void get_current_status();
float get_current_speed();
void set_speed();
void get_current_pos(float *cp);
void get_sd_play_info();
const char *get_status();
const char *get_network();
Expand Down

0 comments on commit aa919ae

Please sign in to comment.