kcjengr / probe_basic

User interface for the LinuxCNC machine control.
https://kcjengr.github.io/probe_basic/
GNU General Public License v3.0
90 stars 58 forks source link

Subroutine unify and move to nc files #100

Open dpslwk opened 11 months ago

dpslwk commented 11 months ago

Subroutine unify and move to nc files

The main aim of this PR is to remove the 4 duplicate copies of subroutines that exist in the PB source.

In order to do this the subroutines will be move from under the machine config folder and placed in a new probe_basic folder under nc_files. While doing this move the routines have also been split into 4 sub directories, subroutines, probe, atc, lathe.

All INI files have updated [RS274NGC]SUBROUTINE_PATH's to load the new directories.

Layout before

├── configs
│   ├── atc_sim
│   │   ├── macros_sim_inch
│   │   ├── macros_sim_metric
│   │   ├── python
│   │   └── vismach_parts
│   ├── probe_basic
│   │   ├── hallib
│   │   ├── python
│   │   ├── subroutines
│   │   └── user_tabs
│   │       ├── template_main
│   │       └── template_sidebar
│   └── probe_basic_lathe
│       ├── hallib
│       ├── python
│       └── subroutines

Layout after

├── linuxcnc
│   ├── configs
│   │   ├── probe_basic_atc_sim
│   │   │   ├── python
│   │   │   └── vismach_parts
│   │   ├── probe_basic_manual_sim
│   │   │   ├── hallib
│   │   │   ├── python
│   │   │   └── user_tabs
│   │   │       ├── template_main
│   │   │       └── template_sidebar
│   │   └── probe_basic_lathe_sim
│   │       ├── hallib
│   │       └── python
│   └── nc_files
│       └── probe_basic
│           ├── atc_carousel
│           ├── lathe
│           ├── probe
│           └── subroutines

Our current debain install script first copies configs folder to /usr/share/configs then copies its contents (the 3 sim folders) to ~/linuxcnc/configs/

So current users have the as install configs at /usr/share/configs/ and a user copy in ~/linuxcnc/configs/
Base the current config instructions (forum.linuxcnc.org) user are told to copy the subroutines folder from ~/linuxcnc/configs/probe_basic/subroutines/ to there machine config directory ~/linuxcnc/configs/my-machine/subroutines/
At update we overwrite the whole ~/linuxcnc/configs/probe_basic/subroutines/ folder but there own machine copies of subroutines are not changes in anyway. This does mean they do not automaticity get changes to existing routines but also do not get any new routines we add that might be need by a new ui widget.

After this the install script will copy the two folders linuxcnc/configs and linuxcnc/nc_files to /usr/share/probe_basic/
Then the machine configs under /usr/share/probe_basic/configs/ will be copied to ~/linuxcnc/configs/, overwriting all files therein.
Then the subroutines will be copied from /usr/share/probe_basic/nc_files/probe_basic/ to ~/linuxcnc/nc_files/probe_basic/. Now this will only copy over new files that do not already exist. This means that if a user has modified say ~/linuxcnc/nc_files/probe_basic/atc_carousel/m21.ngc there changes will not be lost, but if we add say /usr/share/probe_basic/nc_files/probe_basic/atc_carousel/m222.ngc it would be copied to ~/linuxcnc/nc_files/probe_basic/atc_carousel/m222.ngc
[RS274NGC]SUBROUTINE_PATH is update to point to all 3 (or 4 for lathe) folders.

New users (or new machine config conversions) will no longer need to copy the subroutines folder into there machine configuration. Existing user may chose to keep there current setup or just update there [RS274NGC]SUBROUTINE_PATH to use the new setup

Split folders

subroutines

This folder contains some basic subroutines called from various parts of the UI
It does include the tool_touch_off routine that is used with a tool setter

probe

This folder contains the probing subroutines that are called form the PROBING tab

atc_carousel

This folder contains carousel style ATC subroutines
These routines are all called form the ATC tab in the main UI or as part of M6 remap.
They automatically support any of the of the sizes currently available (8, 10, 12, 14, 16, 18, 20, 21, 24) based on your INI's \[ATC\]POCKETS setting

If you have an ATC these are the files that you most likely will need to adjust to your needs, see the README.md in the directory for more details

lathe

This folder contains lathe subroutines for probe_basic_lathe
Some of these are unique to the lathe UI and some are tweaked versions of routines in the other folders that override there normal behaviour

Post Merge tasks