Skip to content

Conversation

@heeplr
Copy link
Contributor

@heeplr heeplr commented Nov 29, 2023

This pull request enables file loading when the UI is running on a different host than the milltask.
If the .nml config doesn't contain a "REMOTE" process line, it does nothing. It basically detects when we're running remotely and then transfers the file contents in chunks via the NML API for the milltask to store it in a unique, temporary file.

It contains two aspects:

  1. It introduces EMC2_TMP_DIR at configure time (similar to other EMC2_*_DIR macros)
  2. When a process that has cms->ProcessType == CMS_REMOTE_TYPE and is named != "emc", then
  • multiple EMC_TASK_PLAN_OPEN messages will be sent, each containing a chunk of the file's contents, the filename and the size of the chunk.
  • each chunk will be written to a temporary file on the host running milltask (with process name == "emc")
  • the temporary file will be deleted upon EMC_TASK_PLAN_CLOSE

As a bonus, usage of hardcoded /tmp has been replaced by the new EMC2_TMP_DIR.

daniel added 2 commits November 29, 2023 10:47
When a process named != "emc" that has cms->ProcessType == CMS_REMOTE_TYPE, then
* multiple EMC_TASK_PLAN_OPEN messages will be sent, each containing a chunk of the file's contents
* each chunk will be stored in a temporary file on the host running milltask (process name == "emc")
* the temporary file will be deleted upon EMC_TASK_PLAN_CLOSE
@andypugh andypugh merged commit 9856e99 into LinuxCNC:master Dec 11, 2023
@heeplr
Copy link
Contributor Author

heeplr commented Dec 11, 2023

As a note: This PR depends on #2718 to work.

Btw: This also would work locally and should bypass issues like #2762 as a side effect.
But since it's arguably questionable to load a file locally in 1024 byte chunks, I made it affect remote processes only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants