Vectric Quick Data_Ver_1.0
-
- Vectric Apprentice
- Posts: 84
- Joined: Thu Jan 04, 2024 12:22 am
- Model of CNC Machine: hd-510
Re: Vectric Quick Data_Ver_1.0
On my machine 3 of them look like this. The Hot keys starts big enough that it makes sense:
- Adrian
- Vectric Archimage
- Posts: 15396
- Joined: Thu Nov 23, 2006 2:19 pm
- Model of CNC Machine: ShopBot PRS Alpha 96x48
- Location: Surrey, UK
Re: Vectric Quick Data_Ver_1.0
That looks like you've got quite a hefty scale set in your Windows display settings.
- sharkcutup
- Vectric Wizard
- Posts: 3495
- Joined: Sat Mar 26, 2016 3:48 pm
- Model of CNC Machine: Shark HD3 Pro Extended Bed with Spindle
- Location: U.S.A.
Re: Vectric Quick Data_Ver_1.0
Yup, he does --- 4k 16" (3840x2400) set to 200%
Sharkcutup
V-Carve Pro Tips, Gadget Tips & Videos
YouTube Channel - Sharkcutup CNC
V-Carve Pro 12.013
YouTube Channel - Sharkcutup CNC
V-Carve Pro 12.013
-
- Vectric Apprentice
- Posts: 84
- Joined: Thu Jan 04, 2024 12:22 am
- Model of CNC Machine: hd-510
Re: Vectric Quick Data_Ver_1.0
Another suggestion. In the Hot key list you have occasional headings that for me get lost in the noise, would bumping their size a couple of points and getting rid of the word wrapping for those lines help them stand out better.
And lastly, looking at the code, I see you try to save and restore the window sizes using RegistryRead and Write but at least here, it does not seem to work. I can tell the Write worked because the entries in the registry are populated with the expected 1250 x 850 and 1250 x 375. It does respect changes in the registry as I changed them to 1250 x 1200 and 1250 x 575 and you changed them right back to 850 and 375 when you hit the first RegistryWrite() in the code. I have 2 suggestions. You're going through a lot of effort to change from integers to strings and back again when you could just save two integers for each window. I assume the first time you call Write before a window is opened, You might also want to rename RegistryWrite() to RegistryInit() and only call it once at the start of the program.
I fixed the overwrite problem by replacing most of the calls to RegistryWrite() with this:
and the all calls to RegistryWrite() with something like this:
And after all that, I found that the calls to dialog.WindowWidth and dialog.WindowHeight always return the initial value so the effort to save and restore window sizes sees to be for naught. But this is the fist time I've ever tried to write LUA, so who knows what I might have done wrong.
And lastly, looking at the code, I see you try to save and restore the window sizes using RegistryRead and Write but at least here, it does not seem to work. I can tell the Write worked because the entries in the registry are populated with the expected 1250 x 850 and 1250 x 375. It does respect changes in the registry as I changed them to 1250 x 1200 and 1250 x 575 and you changed them right back to 850 and 375 when you hit the first RegistryWrite() in the code. I have 2 suggestions. You're going through a lot of effort to change from integers to strings and back again when you could just save two integers for each window. I assume the first time you call Write before a window is opened, You might also want to rename RegistryWrite() to RegistryInit() and only call it once at the start of the program.
I fixed the overwrite problem by replacing most of the calls to RegistryWrite() with this:
Code: Select all
function RegistrySaveWindow(Name, data)
local RegistrySave = Registry(Project.GadgetTitle)
RegistrySave:SetString(Name, data)
return true
end
Code: Select all
RegistrySaveWindow("DialogWindow.HotKeysXY", DialogWindow.HotKeysXY)
-
- Vectric Apprentice
- Posts: 84
- Joined: Thu Jan 04, 2024 12:22 am
- Model of CNC Machine: hd-510
Re: Vectric Quick Data_Ver_1.0
I do. There must be a way to query Windows to find out the current screen size and resolution to make more intelligent choices when sizing windows but I don't know enough about LUA to know if there is a way. I'm used to .NET and then it's easy.
- sharkcutup
- Vectric Wizard
- Posts: 3495
- Joined: Sat Mar 26, 2016 3:48 pm
- Model of CNC Machine: Shark HD3 Pro Extended Bed with Spindle
- Location: U.S.A.
Re: Vectric Quick Data_Ver_1.0
Ira thank you for your input and thoughts! Terrific feedback!
I am not at the computer right now but as soon as I am I will definitely looked into those items.
Thank you,
Sharkcutup
I am not at the computer right now but as soon as I am I will definitely looked into those items.
Thank you,
Sharkcutup
V-Carve Pro Tips, Gadget Tips & Videos
YouTube Channel - Sharkcutup CNC
V-Carve Pro 12.013
YouTube Channel - Sharkcutup CNC
V-Carve Pro 12.013
- sharkcutup
- Vectric Wizard
- Posts: 3495
- Joined: Sat Mar 26, 2016 3:48 pm
- Model of CNC Machine: Shark HD3 Pro Extended Bed with Spindle
- Location: U.S.A.
Re: Vectric Quick Data_Ver_1.0
Check out this Version for your Setup --- Is it any better?ira wrote: ↑Sat Jan 18, 2025 10:27 pmAnother suggestion. In the Hot key list you have occasional headings that for me get lost in the noise, would bumping their size a couple of points and getting rid of the word wrapping for those lines help them stand out better.
And lastly, looking at the code, I see you try to save and restore the window sizes using RegistryRead and Write but at least here, it does not seem to work. I can tell the Write worked because the entries in the registry are populated with the expected 1250 x 850 and 1250 x 375. It does respect changes in the registry as I changed them to 1250 x 1200 and 1250 x 575 and you changed them right back to 850 and 375 when you hit the first RegistryWrite() in the code. I have 2 suggestions. You're going through a lot of effort to change from integers to strings and back again when you could just save two integers for each window. I assume the first time you call Write before a window is opened, You might also want to rename RegistryWrite() to RegistryInit() and only call it once at the start of the program.
I fixed the overwrite problem by replacing most of the calls to RegistryWrite() with this:
and the all calls to RegistryWrite() with something like this:Code: Select all
function RegistrySaveWindow(Name, data) local RegistrySave = Registry(Project.GadgetTitle) RegistrySave:SetString(Name, data) return true end
And after all that, I found that the calls to dialog.WindowWidth and dialog.WindowHeight always return the initial value so the effort to save and restore window sizes sees to be for naught. But this is the fist time I've ever tried to write LUA, so who knows what I might have done wrong.Code: Select all
RegistrySaveWindow("DialogWindow.HotKeysXY", DialogWindow.HotKeysXY)
Sharkcutup
V-Carve Pro Tips, Gadget Tips & Videos
YouTube Channel - Sharkcutup CNC
V-Carve Pro 12.013
YouTube Channel - Sharkcutup CNC
V-Carve Pro 12.013
-
- Vectric Apprentice
- Posts: 84
- Joined: Thu Jan 04, 2024 12:22 am
- Model of CNC Machine: hd-510
Re: Vectric Quick Data_Ver_1.0
It seems better. It leaves alone my registry changes so the windows are a reasonable size. I would caution you, that coding the way you've implemented RegistryWrite where it always writes everything is conceptually going to bite you in the rear some day when something gets saved you didn't expect. Maybe not this time, but assuming that you know enough to insure the side effect you purposefully put into your code never causes a problem. That's why I changed it to RegistrySaveWindow().
- sharkcutup
- Vectric Wizard
- Posts: 3495
- Joined: Sat Mar 26, 2016 3:48 pm
- Model of CNC Machine: Shark HD3 Pro Extended Bed with Spindle
- Location: U.S.A.
Re: Vectric Quick Data_Ver_1.0
In bold above --- I did not enter any of your registry changes that you noted. I only changed the Window sizes that you had noted in one of your previous posts to accommodate your setup.ira wrote: ↑Sun Jan 19, 2025 3:37 amIt seems better. It leaves alone my registry changes so the windows are a reasonable size. I would caution you, that coding the way you've implemented RegistryWrite where it always writes everything is conceptually going to bite you in the rear some day when something gets saved you didn't expect. Maybe not this time, but assuming that you know enough to insure the side effect you purposefully put into your code never causes a problem. That's why I changed it to RegistrySaveWindow().
I also made changes to the Text Headings that you noted too!
Sharkcutup
V-Carve Pro Tips, Gadget Tips & Videos
YouTube Channel - Sharkcutup CNC
V-Carve Pro 12.013
YouTube Channel - Sharkcutup CNC
V-Carve Pro 12.013
- Adrian
- Vectric Archimage
- Posts: 15396
- Joined: Thu Nov 23, 2006 2:19 pm
- Model of CNC Machine: ShopBot PRS Alpha 96x48
- Location: Surrey, UK
Re: Vectric Quick Data_Ver_1.0
The display is via the browser interface with HTML so scaling etc should be handled within that so it's more of a HTML/CSS/Javascript etc coding issue than LUA.
Been a long time since I developed a gadget for anything other than my own use so I'm not sure if dialogs can scale dynamically within the browser with callbacks etc.
- sharkcutup
- Vectric Wizard
- Posts: 3495
- Joined: Sat Mar 26, 2016 3:48 pm
- Model of CNC Machine: Shark HD3 Pro Extended Bed with Spindle
- Location: U.S.A.
Re: Vectric Quick Data_Ver_1.0
Correct Adrian I have been able to scaling accomplished in HTML. As of now Just haven't found a way to get that HTML to work within the LUA coding strategy. And I haven't given up yet either.
Sharkcutup
Sharkcutup
V-Carve Pro Tips, Gadget Tips & Videos
YouTube Channel - Sharkcutup CNC
V-Carve Pro 12.013
YouTube Channel - Sharkcutup CNC
V-Carve Pro 12.013
-
- Vectric Apprentice
- Posts: 84
- Joined: Thu Jan 04, 2024 12:22 am
- Model of CNC Machine: hd-510
Re: Vectric Quick Data_Ver_1.0
I'm not looking for how to scale, more for how to size the window on startup. I'm not even sure what information is really needed, but if you could get screen dimensions you could likely get anything else needed to make an educated guess. Then again if WindowWidth and Height worked you could just save the last setting and all would be fine. Once it stopped setting the registry back to the default values and I could just edit the registry to put in decent numbers for me, it was fine, but saving them would be better.
- adze_cnc
- Vectric Wizard
- Posts: 5204
- Joined: Sat Jul 27, 2013 10:08 pm
- Model of CNC Machine: AXYZ 4008 (VCarve Pro v9.519)
- Location: Vancouver, BC, Canada
Re: Vectric Quick Data_Ver_1.0
Lua is meant to be lightweight and easily portable and thus is quite stripped down to the bare metal. To get screen resolution would rely on communicating with an API (probably written in C as Lua communicates most readily with that) that would then query the Windows API to get the screen co-ordinates. Much like .NET does.
To make matters worse, Lua is embedded into the Vectric products so you can't really write you own C routines and call them (I'm not 100% sure on C co-routines so I may be wrong).
Perhaps Javascript can be used to query the screen dimensions and dynamically re-size the Window from the size specified by the Vectric API call to create a browser dialog?
I'm curious... what is the diagonal measurement of your monitor?
To make matters worse, Lua is embedded into the Vectric products so you can't really write you own C routines and call them (I'm not 100% sure on C co-routines so I may be wrong).
Perhaps Javascript can be used to query the screen dimensions and dynamically re-size the Window from the size specified by the Vectric API call to create a browser dialog?
I'm curious... what is the diagonal measurement of your monitor?
-
- Vectric Apprentice
- Posts: 84
- Joined: Thu Jan 04, 2024 12:22 am
- Model of CNC Machine: hd-510
Re: Vectric Quick Data_Ver_1.0
This laptop is 16" diagonal, the 2 monitors on my desktop are 32 I think. All are 4K.