this->millimeters_of_travel = 0L;
}
+Gcode::Gcode(const Gcode& to_copy){
+ this->command.assign( to_copy.command );
+ this->millimeters_of_travel = to_copy.millimeters_of_travel;
+ this->has_m = to_copy.has_m;
+ this->has_g = to_copy.has_g;
+ this->m = to_copy.m;
+ this->g = to_copy.g;
+ this->add_nl = to_copy.add_nl;
+ this->stream = to_copy.stream;
+}
+
+Gcode& Gcode::operator= (const Gcode& to_copy){
+ if( this != &to_copy ){
+ this->command.assign( to_copy.command );
+ this->millimeters_of_travel = to_copy.millimeters_of_travel;
+ this->has_m = to_copy.has_m;
+ this->has_g = to_copy.has_g;
+ this->m = to_copy.m;
+ this->g = to_copy.g;
+ this->add_nl = to_copy.add_nl;
+ this->stream = to_copy.stream;
+ }
+ return *this;
+}
+
+
// Whether or not a Gcode has a letter
bool Gcode::has_letter( char letter ){
//return ( this->command->find( letter ) != string::npos );
class Gcode {
public:
Gcode(const string&, StreamOutput*);
-
+ Gcode(const Gcode& to_copy);
+ Gcode& operator= (const Gcode& to_copy);
+
bool has_letter ( char letter );
double get_value ( char letter );
const string command;
double millimeters_of_travel;
- bool call_on_gcode_execute_event_immediatly;
- bool on_gcode_execute_event_called;
bool has_m;
bool has_g;
gcode->millimeters_of_travel = sqrt( pow( target[X_AXIS]-this->current_position[X_AXIS], 2 ) + pow( target[Y_AXIS]-this->current_position[Y_AXIS], 2 ) + pow( target[Z_AXIS]-this->current_position[Z_AXIS], 2 ) );
- //if( gcode->call_on_gcode_execute_event_immediatly == true ){
- //printf("GCODE B: %s \r\n", gcode->command.c_str() );
- // this->kernel->call_event(ON_GCODE_EXECUTE, gcode );
- // gcode->on_gcode_execute_event_called = true;
- //}
this->distance_in_gcode_is_known( gcode );
gcode->millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
- //if( gcode->call_on_gcode_execute_event_immediatly == true ){
- //printf("GCODE C: %s \r\n", gcode->command.c_str() );
- // this->kernel->call_event(ON_GCODE_EXECUTE, gcode );
- // gcode->on_gcode_execute_event_called = true;
- //}
-
this->distance_in_gcode_is_known( gcode );
/*