diff --git a/config/config-syntax.txt b/config/config-syntax.txt index fdeea89..64c5ab3 100644 --- a/config/config-syntax.txt +++ b/config/config-syntax.txt @@ -35,23 +35,6 @@ acceleration there are three different and mutually exclusive variable names: All of these names MUST appear in the header file (with at most one of them un-commented out). -However, the variable KINEMATICS only has a finite set of values and would -seem to be a similar field, but there is only one variable name: KINEMATICS -- so it should only appear once. - -This is ok: - -//#define KINEMATICS KINEMATICS_STRAIGHT - -as is this: - -#define KINEMATICS KINEMATICS_STRAIGHT - -but this is not: - -#define KINEMATICS KINEMATICS_STRAIGHT -//#define KINEMATICS KINEMATICS_COREXY - Help Text - both board and printer files ---------------------------------------- diff --git a/config/printer.mendel.h b/config/printer.mendel.h index a6b5920..cf819f6 100644 --- a/config/printer.mendel.h +++ b/config/printer.mendel.h @@ -6,6 +6,7 @@ \***************************************************************************/ /** \def KINEMATICS_STRAIGHT KINEMATICS_COREXY + This defines the type of kinematics your printer uses. That's essential! Valid values (see dda_kinematics.h): @@ -20,7 +21,8 @@ are long and crossing toothed belts and a print head moving on the X-Y-plane. */ -#define KINEMATICS KINEMATICS_STRAIGHT +#define KINEMATICS_STRAIGHT +//#define KINEMATICS_COREXY /** \def STEPS_PER_M_X STEPS_PER_M_Y STEPS_PER_M_Z STEPS_PER_M_E Steps per meter ( = steps per mm * 1000 ), calculate these values diff --git a/config/printer.mendel90.h b/config/printer.mendel90.h index 8a037a8..0f9469c 100644 --- a/config/printer.mendel90.h +++ b/config/printer.mendel90.h @@ -6,6 +6,7 @@ \***************************************************************************/ /** \def KINEMATICS_STRAIGHT KINEMATICS_COREXY + This defines the type of kinematics your printer uses. That's essential! Valid values (see dda_kinematics.h): @@ -20,7 +21,8 @@ are long and crossing toothed belts and a print head moving on the X-Y-plane. */ -#define KINEMATICS KINEMATICS_STRAIGHT +#define KINEMATICS_STRAIGHT +//#define KINEMATICS_COREXY /** \def STEPS_PER_M_X STEPS_PER_M_Y STEPS_PER_M_Z STEPS_PER_M_E Steps per meter ( = steps per mm * 1000 ), calculate these values diff --git a/config/printer.tronxy.h b/config/printer.tronxy.h index 77ae780..c6b4889 100644 --- a/config/printer.tronxy.h +++ b/config/printer.tronxy.h @@ -6,6 +6,7 @@ \***************************************************************************/ /** \def KINEMATICS_STRAIGHT KINEMATICS_COREXY + This defines the type of kinematics your printer uses. That's essential! Valid values (see dda_kinematics.h): @@ -20,7 +21,8 @@ are long and crossing toothed belts and a print head moving on the X-Y-plane. */ -#define KINEMATICS KINEMATICS_STRAIGHT +#define KINEMATICS_STRAIGHT +//#define KINEMATICS_COREXY /** \def STEPS_PER_M_X STEPS_PER_M_Y STEPS_PER_M_Z STEPS_PER_M_E Steps per meter ( = steps per mm * 1000 ), calculate these values diff --git a/config/printer.wolfstrap.h b/config/printer.wolfstrap.h index 2c7a543..2753ec8 100644 --- a/config/printer.wolfstrap.h +++ b/config/printer.wolfstrap.h @@ -6,6 +6,7 @@ \***************************************************************************/ /** \def KINEMATICS_STRAIGHT KINEMATICS_COREXY + This defines the type of kinematics your printer uses. That's essential! Valid values (see dda_kinematics.h): @@ -20,7 +21,8 @@ are long and crossing toothed belts and a print head moving on the X-Y-plane. */ -#define KINEMATICS KINEMATICS_STRAIGHT +#define KINEMATICS_STRAIGHT +//#define KINEMATICS_COREXY /** \def STEPS_PER_M_X STEPS_PER_M_Y STEPS_PER_M_Z STEPS_PER_M_E Steps per meter ( = steps per mm * 1000 ), calculate these values diff --git a/configtool/mechanicalpage.py b/configtool/mechanicalpage.py index d64e179..bd7d831 100644 --- a/configtool/mechanicalpage.py +++ b/configtool/mechanicalpage.py @@ -184,23 +184,14 @@ class MechanicalPage(wx.Panel, Page): def insertValues(self, cfgValues): Page.insertValues(self, cfgValues) - k = 'KINEMATICS' - if k in cfgValues.keys(): - k = cfgValues[k] - if k in self.kinematicsKeys: - self.radioButtons[k].SetValue(True) - else: - self.radioButtons[self.kinematicsKeys[0]].SetValue(True) - else: - self.radioButtons[self.kinematicsKeys[0]].SetValue(True) + for tag in self.kinematicsKeys: + if tag in cfgValues.keys() and cfgValues[tag]: + self.radioButtons[tag].SetValue(True) def getValues(self): result = Page.getValues(self) for tag in self.kinematicsKeys: - rb = self.radioButtons[tag] - if rb.GetValue(): - result['KINEMATICS'] = tag, True - break + result[tag] = self.radioButtons[tag].GetValue() return result diff --git a/configtool/printer.generic.h b/configtool/printer.generic.h index 3d5b68c..3bbddb8 100644 --- a/configtool/printer.generic.h +++ b/configtool/printer.generic.h @@ -6,6 +6,7 @@ \***************************************************************************/ /** \def KINEMATICS_STRAIGHT KINEMATICS_COREXY + This defines the type of kinematics your printer uses. That's essential! Valid values (see dda_kinematics.h): @@ -20,7 +21,8 @@ are long and crossing toothed belts and a print head moving on the X-Y-plane. */ -#define KINEMATICS KINEMATICS_STRAIGHT +#define KINEMATICS_STRAIGHT +#define KINEMATICS_COREXY /** \def STEPS_PER_M_X STEPS_PER_M_Y STEPS_PER_M_Z STEPS_PER_M_E Steps per meter ( = steps per mm * 1000 ), calculate these values diff --git a/dda_kinematics.h b/dda_kinematics.h index c88656b..baf51f5 100644 --- a/dda_kinematics.h +++ b/dda_kinematics.h @@ -1,16 +1,12 @@ #ifndef _DDA_KINEMATICS_H #define _DDA_KINEMATICS_H +#include "config_wrapper.h" + #include #include "dda.h" -#define KINEMATICS_STRAIGHT 1 -#define KINEMATICS_COREXY 2 -//#define KINEMATICS_SCARA 3 - -#include "config_wrapper.h" - void carthesian_to_carthesian(TARGET *startpoint, TARGET *target, axes_uint32_t delta_um, axes_int32_t steps); @@ -27,11 +23,11 @@ static void code_axes_to_stepper_axes(TARGET *, TARGET *, axes_uint32_t, inline void code_axes_to_stepper_axes(TARGET *startpoint, TARGET *target, axes_uint32_t delta_um, axes_int32_t steps) { - #if KINEMATICS == KINEMATICS_STRAIGHT + #if defined KINEMATICS_STRAIGHT carthesian_to_carthesian(startpoint, target, delta_um, steps); - #elif KINEMATICS == KINEMATICS_COREXY + #elif defined KINEMATICS_COREXY carthesian_to_corexy(startpoint, target, delta_um, steps); -// #elif KINEMATICS == KINEMATICS_SCARA +// #elif defined KINEMATICS_SCARA // return carthesian_to_scara(startpoint, target, delta_um, steps); #else #error KINEMATICS not defined or unknown, edit your config.h. diff --git a/testcases/config.h.Profiling b/testcases/config.h.Profiling index b13fc45..76591b8 100644 --- a/testcases/config.h.Profiling +++ b/testcases/config.h.Profiling @@ -78,7 +78,8 @@ long and crossing toothed belts and a print head moving on the X-Y-plane. */ -#define KINEMATICS KINEMATICS_STRAIGHT +#define KINEMATICS_STRAIGHT +//#define KINEMATICS_COREXY /** \def STEPS_PER_M