.Net Automation: WindowMove positioning is strange

.Net Automation: WindowMove positioning is strange

Postby RJA4000 » Wed Jun 01, 2022 1:55 pm

Hello

I'm still improving on my MI Pro mesurement automation with VB .Net
What a great tool !
Incredibly fexible and powerful already.
Thanks for all the late additions, by the way.


I encountered an issue though, with automation
I'm now trying to organize and arrange DDP windows automatically from .Net
My goal is to start from some basic Panel setings (one for THD, one for IMD SMPTE, one for Multitone, and so on) and programatically arrange (hide/show/move) the DDPs according to the specific test (DAC, analog DUT, ADC)

My problem is the following:
I have a hard time to understand how the X/Y/W/H works.

As an example, on a FHD screen:
MIPro.SetWindowPosition(MIPro.nWindowID.WND_OSCILLOSCOPE, 1, 1, 1052, 242, True)
will position the Oscilloscope in the top left of the work window.

And then,
MIPro.SetWindowPosition(MIPro.nWindowID.WND_SPECTRUM_ANALYZER, 1, 243, 1052, 704, True) ' Spectrum
position the Specrum analyzer window just below it.
So far so good (except that I don't see 1 pixel margins outside of the windows)

But I then expect
MIPro.SetWindowPosition(MIPro.nWindowID.WND_DDP_VIEWER + 8, 1054, 1, 330, 161, True) 'SINAD
to position the UDDP9 vertically at the same position than the Oscilloscope, as they use the same Y value
Unfortunately, that doesn't seem to work: Positioning is at the top of the Menu line

Also, horizontally, it seems the Oscilloscope and Spectrum windows - which include a border, are sized at the requested size + the border size.
And therefore, even horizontal positionning for the DDP is not behaving as expected...

Could you please have a look, when times allow ?

Have a good day



(By the way, I also added new whishes :-)
Being able to retrieve and set a DDP Alias would be great.
Also READING the current window position and state would be great.)
RJA4000
 
Posts: 97
Joined: Sun Jul 28, 2019 2:28 am

Re: .Net Automation: WindowMove positioning is strange

Postby VirtinsTech » Fri Jun 03, 2022 2:54 am

In Multi-Instrument, the Oscilloscope, Spectrum Analyzer, Spectrum 3D Pot, Multimeter windows are confined in the main window, while others are not, including the main window itself, Signal Generator, 16 x DDP viewers, DDP Array Viewer, 8 x Data Logger, Device Test Plan and LCR Meter, 8 x DDC, and 8 x X-Y Plots. The origin of the former is at the upper left corner of the client area of the main window, while the origin of the latter is at the upper left corner of the screen. The border styles of these two groups of windows are also different under Themes: Classic 1, Visual Style 1 & Visual Style 2, but similar under Themes: Classic 2 and Visual Style 3. The Theme can be changed via [Setting]>[Display]>"Theme"

BTW, the screen layout should normally be done by saving a Panel Setting File and then loading it using LoadPanelSettingFile(). TileWindow() can be used to re-arrange the layout automatically.
VirtinsTech
Site Admin
 
Posts: 290
Joined: Tue Oct 01, 2013 3:06 pm

Re: .Net Automation: WindowMove positioning is strange

Postby RJA4000 » Sat Jun 11, 2022 11:31 pm

VirtinsTech wrote:the screen layout should normally be done by saving a Panel Setting File and then loading it using LoadPanelSettingFile().

Yes, I know
But creating a Pane setting different for each use case is a nightmare.

So I created a template like this one for SINAD/THD/SNR measurements.

2022-06-11 12_37_21-Greenshot_25pc.png
2022-06-11 12_37_21-Greenshot_25pc.png (95.01 KiB) Viewed 15371 times


On the left, you have the Oscillo and the Spectrum.
Immediately to the right, you have the most relevant DDPs.

My goal is to snapshot this left area and attach it to illustrate the equipment review.

2022-06-11 17_23_31-Greenshot_50_Crop.png
2022-06-11 17_23_31-Greenshot_50_Crop.png (111.83 KiB) Viewed 15371 times


As you can see, to the right to this and just on the left of the generator, there are some other (U)DDPs, either filled from external (DMM => .Net => SETUDDP() - Thanks for that !), by formula, or internaly.
They will be usefull for more in-depth check of the measurements by interested people (and the full screen will therefore be attached to the review)

According to the actual test case, I plan to move some of the right UDDPs above the DDP Array (and shrink it accordingly) and hide the useless ones.
For a DAC, I need the DAC Output Voltage
For and ADC, the ADC input is relevant
For a Mic Preamp, the DUT Gain and DUT Input voltage are the key ones
...

So by programming this "window move", I can dynamically adapt the Screen
And maintain only ONE Panel setting (that I can not edit otherwise).
RJA4000
 
Posts: 97
Joined: Sun Jul 28, 2019 2:28 am

Re: .Net Automation: WindowMove positioning is strange

Postby VirtinsTech » Sat Jun 18, 2022 2:43 am

Thanks for the detailed explanation.
VirtinsTech
Site Admin
 
Posts: 290
Joined: Tue Oct 01, 2013 3:06 pm


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron