QtPyVCP - Work Offset Table - WIP

More
27 Dec 2019 18:37 #153299 by Donb9261
All,

This is a work in progress but coming along fairly well.

I am able to load the work offset via the .var file in the config and then insert each offset into a QTableWidget by row per offset (G54 ~ G59.3).

Currently it works via a QPushButton for dev. But, on final the offsets will load when the QMainWindow loads and will be editable (Future Release will have user level privileges based on security policies ie.. Operator, Skilled Operator, Master Operator). And like the tool table, highlight the active offset based on the planner status.

Just wanted to get some feedback in reference to what UI elements might need to be included.

I will most likely stick to the standard editing tactic as per most other controllers. When a change is made to the cell data the data is written back to the .var file and then the table reloads with the new current value. But, does not set the active offset. As with most controllers if the offset is edited you must specifically recall the offset via MDI or some other means as the work offset is modal and should never be changed outside a controlled environment or while cutting.

Question for Kurt:

If the .var file is edited outside LCNC while the planner is active, once the file is saved does the filechanged event get fired to reload the .var file? The tool table has a reload event after save. Just wondering how I might handle it. Your thoughts would be appreciated. I may be sweating nothing but want to make sure.

In any case a couple screenshots to get your mind working...

Pre-Button Click Event



Post Button Click Event (The values for each group are the same except R) (But all are unique to the respective offset)



Vars



Don San
Attachments:
The following user(s) said Thank You: tommylight, Leon82

Please Log in or Create an account to join the conversation.

More
27 Dec 2019 19:23 #153304 by Donb9261
Kurt,

Looking through the commands there is not a load_work_tabel() function like there is for load_tool_table(). Knowing this is a LCNC mainline function and not tied to QtPyVCP, is there a method that could be created to force LCNC to read in the offset table. It does whenever you do G10 L2 Pxx XYZABCUVWR otherwise after using the G10 L2 to set say G55 to X-3.4567 like so G10 L2 P2 X-3.4567 and then subsequentlay calling G55 later you would get the old value. Which you do not.

From my understanding, the .var file is loaded upon reading the .ini file. Restarting the control is obviously not an option.

So I suppose there has to be a function triggered by the G10 L2 that forces the planner to pick up the new offset data. Scratching my head.

Please Log in or Create an account to join the conversation.

More
27 Dec 2019 20:36 #153310 by Donb9261
Found this from the GladeVCP project. It should work. Just have to collect all the table edits made and submit one at a time through a for loop calling G10 L2 Pxx XYZABCUVWR for each offset. Then switch from MDI to Manual and back to MDI will force the var file write function and recall. I suppose the thought was if you execute a G10 L2 you must be in MDI anyways.
 # now update linuxcnc to the change
        try:
            global lncnc_runnning
            if lncnc_running:
                ### SET MDI_MODE
                if self.status.task_mode != self.linuxcnc.MODE_MDI:
                    self.cmd.mode(self.linuxcnc.MODE_MDI)
                    self.cmd.wait_complete()
                if row == 1:
                    self.cmd.mdi("G10 L2 P0 %s %10.4f" % (self.axisletters[axisnum], qualified))
                elif row == 2:
                    if col == 3:
                        self.cmd.mdi("G10 L2 P0 R %10.4f" % (qualified))
                elif row == 3:
                    self.cmd.mdi("G92 %s %10.4f" % (self.axisletters[axisnum], qualified))
                else:
                    pnum = system_to_p(self.store[row][0])
                    if not pnum == None:
                        self.cmd.mdi("G10 L2 P%d %s %10.4f" % (pnum, self.axisletters[axisnum], qualified))
                ### SET MANUAL_MODE
                self.cmd.mode(self.linuxcnc.MODE_MANUAL)
                self.cmd.wait_complete()
                ### SET BACK TO MDI
                self.cmd.mode(self.linuxcnc.MODE_MDI)
                self.cmd.wait_complete()
                self.gstat.emit('reload-display')

Gonna take a lot of code and head scratching make this work. How fun...

Please Log in or Create an account to join the conversation.

More
27 Dec 2019 21:05 #153315 by Leon82
I found one today
Sorry for the crude pic again

Attachments:

Please Log in or Create an account to join the conversation.

More
27 Dec 2019 22:00 #153322 by Donb9261
Is that slot in the GladeVCP project or QtVCP or QtPyVCP? Or did you develop that slot yourself?

Please Log in or Create an account to join the conversation.

More
27 Dec 2019 22:42 #153327 by Leon82

Is that slot in the GladeVCP project or QtVCP or QtPyVCP? Or did you develop that slot yourself?


its in the qtpyvcp
i didnt add anthing special. i noticed it in probe basic also

Please Log in or Create an account to join the conversation.

More
28 Dec 2019 01:46 #153347 by Donb9261
After you showed me that I did some digging and found that there is a plugin offset_table.py but on my machine it was not installed and does not appear in the widget browser in designer.

I checked the runtime folder and compared to the dev folder and sure enough the dev folder has the plugin.

The question is why? And how can I install the plugin.

I have the yaml file configured as stated in the plugin comments.

Any help proceeding would be appreciated.

I suppose I could just bypass the plugin and code out my own rendition but that seems repetitive considering there is a plugin for that already.

Please Log in or Create an account to join the conversation.

More
28 Dec 2019 01:53 #153348 by Leon82

After you showed me that I did some digging and found that there is a plugin offset_table.py but on my machine it was not installed and does not appear in the widget browser in designer.

I checked the runtime folder and compared to the dev folder and sure enough the dev folder has the plugin.

The question is why? And how can I install the plugin.

I have the yaml file configured as stated in the plugin comments.

Any help proceeding would be appreciated.

I suppose I could just bypass the plugin and code out my own rendition but that seems repetitive considering there is a plugin for that already.


I have updated a few times I think I am on 2.9 now. I haven't updated to 3.0 yet I was going to wait untill the run from line is merged

Please Log in or Create an account to join the conversation.

Moderators: KCJLcvette
Time to create page: 0.202 seconds
Powered by Kunena Forum