diff --git a/Simulation/simulationCanvas.py b/Simulation/simulationCanvas.py index 6cece122..80967134 100644 --- a/Simulation/simulationCanvas.py +++ b/Simulation/simulationCanvas.py @@ -103,7 +103,7 @@ def recompute(self): self.verticalPoints = range(int(int(topBottomBound/self.gridSize.value)*self.gridSize.value), -topBottomBound, -1 * int(self.gridSize.value)) self.horizontalPoints = range(int(int(leftRigthBound/self.gridSize.value)*self.gridSize.value), -leftRigthBound, -1 * int(self.gridSize.value)) - #self.doSpecificCalculation() + self.doSpecificCalculation() for j in self.verticalPoints: for i in self.horizontalPoints: diff --git a/main.py b/main.py index f7a5e348..701bded6 100755 --- a/main.py +++ b/main.py @@ -437,26 +437,8 @@ def close_settings(self, settings): def push_settings_to_machine(self, *args): - cmdString = ("B03" - +" A" + str(self.data.config.get('Maslow Settings', 'bedWidth')) - +" C" + str(self.data.config.get('Maslow Settings', 'bedHeight')) - +" Q" + str(self.data.config.get('Maslow Settings', 'motorSpacingX')) - +" E" + str(self.data.config.get('Maslow Settings', 'motorOffsetY')) - +" F" + str(self.data.config.get('Maslow Settings', 'sledWidth')) - +" R" + str(self.data.config.get('Maslow Settings', 'sledHeight')) - +" H" + str(self.data.config.get('Maslow Settings', 'sledCG')) - +" I" + str(self.data.config.get('Maslow Settings', 'zAxis')) - +" J" + str(self.data.config.get('Advanced Settings', 'encoderSteps')) - +" K" + str(self.data.config.get('Advanced Settings', 'gearTeeth')) - +" M" + str(self.data.config.get('Advanced Settings', 'chainPitch')) - +" N" + str(self.data.config.get('Maslow Settings' , 'zDistPerRot')) - +" P" + str(self.data.config.get('Advanced Settings', 'zEncoderSteps')) - + " " - ) - - self.data.gcode_queue.put(cmdString) - #Split the settings push into two so that it doesn't exceed the maximum line length + #Push motor configuration settings to machine if int(self.data.config.get('Advanced Settings', 'enablePosPIDValues')) == 1: @@ -477,27 +459,48 @@ def push_settings_to_machine(self, *args): KiV = 1 KdV = 0 - if self.data.config.get('Advanced Settings', 'kinematicsType') == 'Quadrilateral': - kinematicsType = 1 - print "quadrilateral recognized" - else: - kinematicsType = 2 - print "triangular kinematics recognized" - cmdString = ("B03" + + cmdString = ("B12" + +" I" + str(self.data.config.get('Maslow Settings', 'zAxis')) + +" J" + str(self.data.config.get('Advanced Settings', 'encoderSteps')) + +" K" + str(self.data.config.get('Advanced Settings', 'gearTeeth')) + +" M" + str(self.data.config.get('Advanced Settings', 'chainPitch')) + +" N" + str(self.data.config.get('Maslow Settings' , 'zDistPerRot')) + +" P" + str(self.data.config.get('Advanced Settings', 'zEncoderSteps')) +" S" + str(KpPos) +" T" + str(KiPos) +" U" + str(KdPos) +" V" + str(KpV) +" W" + str(KiV) +" X" + str(KdV) + + " " + ) + + self.data.gcode_queue.put(cmdString) + + #Push kinematics settings to machine + if self.data.config.get('Advanced Settings', 'kinematicsType') == 'Quadrilateral': + kinematicsType = 1 + else: + kinematicsType = 2 + + cmdString = ("B03" + +" A" + str(self.data.config.get('Maslow Settings', 'bedWidth')) + +" C" + str(self.data.config.get('Maslow Settings', 'bedHeight')) + +" Q" + str(self.data.config.get('Maslow Settings', 'motorSpacingX')) + +" E" + str(self.data.config.get('Maslow Settings', 'motorOffsetY')) + +" F" + str(self.data.config.get('Maslow Settings', 'sledWidth')) + +" R" + str(self.data.config.get('Maslow Settings', 'sledHeight')) + +" H" + str(self.data.config.get('Maslow Settings', 'sledCG')) +" Y" + str(kinematicsType) +" Z" + str(self.data.config.get('Advanced Settings', 'rotationRadius')) + " " ) self.data.gcode_queue.put(cmdString) - + + ''' Update Functions @@ -604,8 +607,6 @@ def setPosOnScreen(self, message): except: print "One Machine Position Report Command Misread" return - - def setErrorOnScreen(self, message):