Repository navigation
GUIs: read [DISPLAY]CYCLE_TIME with one rule - #4677
grandixximo wants to merge 2 commits into
Conversation
|
I would much prefer the unit to be seconds, at least for all new configurations. |
Every GUI and VCP now reads [DISPLAY]CYCLE_TIME the way gmoccapy did, as agreed at the 2026-09-13 developer meeting (LinuxCNC#4497 item 3): a value from 0.001 up to but not including 1.0 is seconds, 1.0 or more is milliseconds, anything else is reported and 0.150 s is used, as for a missing value. Seconds is the documented unit, as for the other times in the INI file; milliseconds keep working for existing configs. common/cycle_time.py holds the rule for the Python readers: AXIS, gmoccapy, gscreen, hal_glib (GladeVCP) and iniinfo (QtVCP). tklinuxcnc applies it in Tcl; it used to multiply every value by 1000, so a value in milliseconds gave an update period in seconds. gscreen accepts seconds and values below 50 ms instead of replacing them with 100 ms. AXIS (20 ms), QtVCP, GladeVCP and gscreen (100 ms) and tklinuxcnc (200 ms) had their own defaults; all use 0.150 s now. pncconf and the plasmac2 migration write 0.100 like stepconf. Fixes LinuxCNC#4424
Convert the 76 sample configs that gave [DISPLAY]CYCLE_TIME in milliseconds (100, 150, 300) to seconds (0.100, 0.150, 0.300), so new configs copied from them use seconds. The update periods do not change.
e0b7f05 to
7d7f8ba
Compare
|
All (peetty sure) the gui toolkits use ms not seconds. I would prefer not to do the conversion and at least to me 100 is a much simpler and easier to read number then .1 |
|
But the unit isn't in the configuration, and a lot of different units are used throughout Linuxcnc. We are in the process of unifying them, and seconds is the SI base unit and just makes sense to use for everything. |
|
You were not at the meeting (#4497 item 3), so for context: there was no full agreement on the unit. What was decided is that both keep working and the configs drift towards one of them. @rene-dev argued for seconds, and the others were in favour or did not mind, so this PR moves what the tree writes to seconds and still reads ms. The contrast that came up was [TASK]CYCLE_TIME: same name, in seconds. Nobody at the meeting was sure it still did anything. I checked, and it does: it sets the period of task's main loop (emctaskmain.cc). Seconds is also the unit the INI is built on, since every velocity and acceleration on the joints and axes is per second. The toolkits taking ms is internal: the shared reader converts once, and |
|
That is exactly what Im talking about, having different units for everything is really confusing for the user, especially if you need to compare them. Everything else is in terms of seconds, doesn't matter what the underlying system uses. Im sure you don't write gcode in encoder counts ;) |
|
Are you going to change the servo period to seconds then? Why not use the unit that makes the most practical sense? I also don't like axis DEFAULT_LINEAR_JOG_VEL in seconds for the same reason. Machinists think in unit per minute not unit per second. I did the work to change it to ms so as not to break configs but move to ms. I understand your thought process but but that's not how human think. They use the unit that makes most sense for the process your are talk of. But in the end.. I've said my point - change it to whatever you like. |
|
I am a human, and when I see this I just think, why? I mean I know why, but why? lol jokes apart, the user facing ms still works, and if you like that better you can keep using it, this is mostly about internal consistency, and new users not getting confused about what the units are for CYCLE_TIME If we go ms, I think TASK CYCLE_TIME should also change to ms, and possibly get the same logic when less than 1 actually is seconds, to not break all the configs out there... I'll keep this open, but not merge it, and let the discussion evolve, I hear you Chris :-) |
Fixes #4424.
At the 2026-09-13 meeting (#4497 item 3) it was agreed that every GUI/VCP first reads
[DISPLAY]CYCLE_TIMEthe gmoccapy way:0.001 <= value < 1.0is seconds,value >= 1.0is milliseconds, anything else warns and uses the default of 150 ms. Whether to move to a single unit later is a separate question and not part of this PR.lib/python/common/cycle_time.py:display_cycle_time(inifile, warn)returns milliseconds and reports an invalid value throughwarn(stderr without a callback). AXIS, gmoccapy, gscreen,hal_glib.py(GladeVCP) andiniinfo.py(QtVCP, QtPlasmaC) call it.CYCLE_TIME = 100gave a 100 s update period.CYCLE_TIME = 100like pncconf (it wrote0.100, same period).HALPIN_CYCLEwhere the code readsHALPIN_CYCLE_TIME.tests/display-cycle-timechecks the boundaries (0.0009, 0.001, 0.5, 0.999, 1, 100, negative, zero, missing, non-numeric) without a running LinuxCNC.Behaviour changes:
CYCLE_TIMEchange: AXIS was 20 ms, QtVCP, GladeVCP and gscreen 100 ms, tklinuxcnc 200 ms.0.0005into a 0 ms timer and a negative value into a negative one.Tested with
runtests tests/display-cycle-time tests/ui-smoke/{axis,gmoccapy,qtdragon}, and by starting AXIS, tklinuxcnc and gscreen under xvfb with valid and invalid values.