Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

Can't save printer with Configtool #314

Open
shakenov-chinga opened this issue Nov 6, 2018 · 9 comments
Open

Can't save printer with Configtool #314

shakenov-chinga opened this issue Nov 6, 2018 · 9 comments

Comments

@shakenov-chinga
Copy link

Hi.
I'm trying to save loaded and edited printer configurations. This error message is printed in terminal whenever I save, no matter if it is editted or not.

Traceback (most recent call last):
File "/home/chinga/Dropbox/Teacup_Firmware-master/configtool/gui.py", line 246, in onSavePrinterConfig
rc = self.pgPrinter.onSaveConfig(evt)
File "/home/chinga/Dropbox/Teacup_Firmware-master/configtool/printerpanel.py", line 198, in onSaveConfig
return self.saveConfigFile(path)
File "/home/chinga/Dropbox/Teacup_Firmware-master/configtool/printerpanel.py", line 246, in saveConfigFile
v1 = pg.getValues()
File "/home/chinga/Dropbox/Teacup_Firmware-master/configtool/mechanicalpage.py", line 242, in getValues
result['HOMING_STEP4'] = self.getHomingValue('HOMING_STEP4', result)
File "/home/chinga/Dropbox/Teacup_Firmware-master/configtool/mechanicalpage.py", line 231, in getHomingValue
return (self.labels.keys()[self.labels.values().index(result[name][0])], True) ValueError: 'n' is not in list

@Wurstnase
Copy link
Collaborator

I can confirm this issue. Looks like the button with '-' will return something different than expected. Also for other homing-keys if they are '-'. E.g. for Step 4 it is 'n'. For Step 2 it is 'y'.

@Wurstnase
Copy link
Collaborator

Ok, I found what happened.

I load printer.mendel.h. Want to save it as e.g. printer.test.h. Now the DEFINE_HOMING looks like:

/** \def DEFINE_HOMING

  Order (and number) of homing movements.
*/
#ifndef DEFINE_HOMING
  #define DEFINE_HOMING(...)
#endif
//DEFINE_HOMING_START
DEFINE_HOMING(('x', False), ('y_negative', True), ('z_negative', True), ('n', False))
//DEFINE_HOMING_END

@Wurstnase
Copy link
Collaborator

Uff... Lot's of work.
Please check https://github.com/Traumflug/Teacup_Firmware/tree/configtool_homing
Feedback is welcome.

Homing is fixed. Also this should work with Python3 now.

I'm currently not very happy, with the double defines of homingKeys in mechanicalpage.py and printer.py. But I don't have any good idea for this.

@sv1
Copy link

sv1 commented Apr 6, 2019

With python 2.7.13 on Debian, I can not run configtool at all.

$ ./configtool.py
Traceback (most recent call last):
File "./configtool.py", line 191, in
StartGui(getSettings())
File "./configtool.py", line 38, in getSettings
settings = Settings(None, cmdFolder, arg)
File "/opt/linux/Teacup_Firmware/configtool/settings.py", line 53, in init
self.loaded = self.readConfig(ini)
File "/opt/linux/Teacup_Firmware/configtool/settings.py", line 78, in readConfig
self.cflags = cfg_get("cflags")
File "/opt/linux/Teacup_Firmware/configtool/settings.py", line 73, in cfg_get
val = cfg.get(key, values[key])
File "/usr/lib/python2.7/dist-packages/configparser.py", line 1302, in get
fallback=fallback)
File "/usr/lib/python2.7/dist-packages/configparser.py", line 816, in get
d)
File "/usr/lib/python2.7/dist-packages/configparser.py", line 401, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "/usr/lib/python2.7/dist-packages/configparser.py", line 450, in _interpolate_some
u"found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: u'%F_CPU% -mmcu=%CPU% -Wall -Wstrict-prototypes -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Winline -fno-move-loop-invariants -fno-tree-scev-cprop -Os -ffunction-sections -finline-functions-called-once -mcall-prologues -Wa,-adhlns=%ALNAME% -save-temps=obj'

@Wurstnase
Copy link
Collaborator

I've currently not much time to do any support but probably this issue was already fixed in
https://github.com/Traumflug/Teacup_Firmware/tree/python_upgrade .

Can you please check?

@sv1
Copy link

sv1 commented Apr 6, 2019 via email

@sv1
Copy link

sv1 commented Apr 6, 2019 via email

@Wurstnase
Copy link
Collaborator

Wurstnase commented Apr 7, 2019

Please install the latest wxpython: https://wxpython.org/pages/downloads/index.html
wx3.0 is not supported with python_upgrade-branch.

@Wurstnase
Copy link
Collaborator

Everything now in the experimental branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants