Jump to content

Recommended Posts

Posted

My goal is to automate the reading of the gamma setting of my videoprojector. (next step will be the writing)

Sony has  a program name  "Sony Projector Calibration Pro" to read/write/modify the parameter

with WinGettext ("[TITLE:Gamma Setting]") i can see the current gamma table select  (2.1 in the picture) but i don't know how to select the other possible values (in my case 1.8, 2.0,2.1,....off)

Once the gamma is selected, i will need to point to file/export (other option is import)  to save the configuration from the projector to my PC

 

gamma_setting.JPG

gamma2.JPG

Posted (edited)

Can you identify specific control with the AutoIt windows info tool? If you can then you should be able to use ControlCommad to select specific entry inside that combobox.

 

Edit: I see thatvyou can get control info. Play with control command. If it fails try with _GUICtrlComboBox_SelectString

Edited by ahmet
Posted (edited)

i try 

#include <GuiComboBox.au3>

local $a
$a=WinGettext ("[TITLE:Gamma Setting]")    ;CLASS:WindowsForms10.COMBOBOX.app.0.378734a; NAME:ComboBox1;  INSTANCE:4
$a=ControlCommand ("[TITLE:Gamma Setting]","","[CLASS:WindowsForms10.COMBOBOX.app.0.378734a; NAME:ComboBox1;  INSTANCE:4]","SelectString", '2.1')
msgbox(0,@ScriptLineNumber,$a)

$a=WinGetHandle("[TITLE:Gamma Setting]")
$a=_GUICtrlComboBox_SelectString($a,"1.8")
msgbox(0,@ScriptLineNumber,$a)

but no good. could you help me more

edit :

with  $a=ControlCommand ("[TITLE:Gamma Setting]","","[NAME:ComboBox1]","ShowDropDown", '')

i have a dropdown of the combolist

Edited by michelb2
Posted

Consider using handle instead of text and always check for error. 

Also _GUICtrlComboBox_SelectString uses window handle instead of control handle.  Try this :

#include <GuiComboBox.au3>

Local $a=WinGetHandle ("Gamma Setting")
ConsoleWrite($a & @CRLF)
Local $b=ControlGetHandle ($a,"","WindowsForms10.COMBOBOX.app.0.378734a4")
ConsoleWrite($b & @CRLF)

ControlCommand($a, "", $b, "SelectString", '2.1')
ConsoleWrite(@error & @CRLF)

Sleep(2000)

Local $c=_GUICtrlComboBox_SelectString($b,"1.8")
ConsoleWrite($c & @CRLF)

 

Posted

Great improvement, i can now select an item in the gamma table and in the color table.

now the goal is to Save vp in menu   File: (items=Import GCMS File, Export GCMS File ,Exit)

i try 

local $b_file= ControlGetHandle ($a,"","WindowsForms10.Window.8.app.0.378734a7")   ; given par au3info_x64

Local $c=_GUICtrlComboBox_SelectString($b_file,"Export GCMS File")

but nothing happen

(when i manually click on file then on export GCMS File, a window name "Enregistrer sous" (save as) have to open to select a file name) , next step wille be to name the file

 

 

Posted (edited)

It does not seem to be a standard menu.  You will need to work with it.  Here a few suggestions :

1- Try sending Alt - F to launch the file menu
2- Try clicking the control (MenuStrip1)

I am out of town for a week, so good luck...

ps. always use handle and confirm that the handle found corresponds to what Au3info tool gives you...

Edited by Nine
Posted

@nine

Alt F works !!!! thanks a lot

@rudi

the gamma parameters are not at all an EDID information so monitor_info_view is useless

Posted (edited)

it's me again !

now, i can open the program, select the window "gamma setting", select the right value of gamma in gamma table, select tue right color and export the data in menu file/export.

my mission now is to check AND verify the real time transmitting checkbox and the 64 points radio button.

with 

$a=WinGetHandle("Gamma Setting")
$b=ControlGetHandle ($a,"","WindowsForms10.BUTTON.app.0.378734a5")
_GUICtrlButton_Click ( $b )         ;ok

i can check/uncheck the real time transmitting checkbox (flip -flop)

but 

Local $iCount = ControlCommand($a,"","[ClassNN:WindowsForms10.BUTTON.app.0.378734a5]",  "ischecked", "")    ;nok
Local $iCount = ControlCommand($b,"","",  "ischecked", "")  ;nok
_GUICtrlButton_GetCheck ( $b ) => always 0
_GUICtrlButton_GetCheck ( $a ) => always 0

i can't check the value 

same problem with 64 points radio button

gamma4.JPG

Edited by michelb2
Posted (edited)
$a=WinGetHandle("Gamma Setting")
$b=ControlGetHandle ($a,"","WindowsForms10.BUTTON.app.0.378734a5")
_GUICtrlButton_Click ( $b )         ;ok
Local $iCount = ControlCommand($a,"","[ClassNN:WindowsForms10.BUTTON.app.0.378734a5]",  "ischecked", "")    ;nok
ConsoleWrite(@error&"<1 "&$iCount&">"&@cr)
Local $iCount = ControlCommand($b,"","",  "ischecked", "")  ;nok
ConsoleWrite(@error&"<2 "&$iCount&">"&@cr)
$iCount=_GUICtrlButton_GetState  ( $a )
ConsoleWrite(@error&"<3 "&$iCount&">"&@cr)
$iCount=_GUICtrlButton_GetState  ( $b )
ConsoleWrite(@error&"<4 "&$iCount&">"&@cr)
Exit

answer 

0<1 0>
0<2 0>
0<3 0>
0<4 0>

 

Edited by michelb2
Posted

still waiting for the answer to my last problem (isckeck not give me the answer)

 

I have a new question

read code below to see how i can have the file name if user modify the proposal ( $key_import=""  is a global variable define at the begginning of the script)

in this "Open window", user can use keyboard ' {enter} or {esc} or mouse ( click Ouvrir or Annuler) to action

how can i know what he  has done ?

 

gamma5.thumb.JPG.397e06b7a08e069d3ffe845728d6b02d.JPG

send(@TempDir&@cr)
Sleep(150)
send($oldfile);&@cr)
    local $tt=TimerInit()
    AdlibRegister("keycr",250)
    while true
        WinGetHandle("[CLASS:#32770]")
        if @error then
            AdlibUnRegister("keycr")
            ExitLoop
        EndIf
        if TimerDiff($tt)>20*1000 then ExitLoop
        Sleep(200)
    wend
    $oldfile=$key_import
    Sleep(200)
    exit     msgbox(0,@ScriptLineNumber,"import à valider si modif de oldfile "& $oldfile)

$b=ControlGetHandle ($a,"","WindowsForms10.BUTTON.app.0.378734a11")         ;button finish
_GUICtrlButton_Click ( $b )         ;ok mais non controlable par check
Return $oldfile
EndFunc
;==========Wait @cr======================================================================
func keycr()
local $b,$aa
    $aa=WinGetHandle("[CLASS:#32770]")
if @error then return
$b=wingettext($aa)
$key_import=StringRegExp($b,"(?s):\n(.*?)\n",3)[0]
EndFunc

 

Posted

i found a way to handle esc and enter keys

i need now to handle  the "ouvrir" and "annuler" button

AdlibRegister("keycr",250)
    HotKeySet("{ESC}", "HotKeyPressed")
    HotKeySet("{ENTER}", "HotKeyPressed")
    while true
        if @HotKeyPressed="{ESC}" then  ExitLoop
        if @HotKeyPressed="{ENTER}" then ExitLoop
        WinGetHandle("[CLASS:#32770]")
;==========Wait @cr======================================================================
func HotKeyPressed()
    Switch @HotKeyPressed
        Case "{ESC}"
            $key_import=""
            HotKeySet("{ESC}")
            AdlibUnRegister("keycr")
            WinClose("[CLASS:#32770]")
        Case "{ENTER}"
            HotKeySet("{ENTER}")
            AdlibUnRegister("keycr")
            WinClose("[CLASS:#32770]")
    EndSwitch
EndFunc

 

Posted

not really beautiful but it seems to work

Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client
$p=MouseGetPos()
;if ($p[0]>430 and $p[0]>512) and ($p[1]>532 and $p[1]>553) then ;click= ouvrir
if ($p[0]>530 and $p[0]<612) and ($p[1]>532 and $p[1]<553) then $oldfile="" ;click= annuler

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...