
Burgs
Active Members-
Posts
277 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Burgs's Achievements

Universalist (6/7)
1
Reputation
-
Greetings, I realize this post is a few years old, however I wanted to thank you for posting it. I find this interesting and it got me to thinking a bit. I attempted to modify this code to create a financial 'candlestick' chart using either Chart.js or D3.js (as you had mentioned) however I was frustrated by the inability to render the chart and the candlestick elements within. I believe this is because IE is outdated and no longer supported so the IE commands within AutoIt are unable to handle modern JavaScript code and SVG graphics, at the very least. Not sure if there is any workaround...I thought WebDriver might be feasible, however as I understand it the browser renders as a separate window and cannot be embedded into an AutoIt GUI as I would like, although I could certainly be mistaken. Anyway thank you again for your interesting concept. Regards
-
How to simulate 'INV' or 'TAN ^ -1'...?
Burgs replied to Burgs's topic in AutoIt General Help and Support
Thanks for your input Melba, I think I have it now...just need to convert those results to degrees, which the calculator did automatically. I am old also...hahaha . Regards to you and the others that replied. -
How to simulate 'INV' or 'TAN ^ -1'...?
Burgs replied to Burgs's topic in AutoIt General Help and Support
Thanks to both of you that replied. I have attempted the ATan function, however I am seeing a value returned of "0.244978663126864", which is not what my Windows 11 calculator is returning (using '2nd' and 'Tan ^ -1'). Sorry about the "Degree(Tan($_value))" I mis-read the documentation and thought the value was returned in radians and I wanted to convert to degrees...however I see the INPUT is in radians. I am trying to reproduce the values in this information, "https://www.usgs.gov/educational-resources/determine-percent-slope-and-angle-slope". Specifically the information located in the second part of the page beginning at "Angle of Slope" in a bold font. -
Greetings, I have a need to use a Tan function to a power of "-1". On a calculator this is normally the "INV" key or possibly the "2nd" key. The "Tan ^ -1" should return a value in degrees. This seems to not be exactly possible using AutoIT. Here is a sample script: #include <MsgBoxConstants.au3> #include <Math.au3> Local $_value = .25 ConsoleWrite("tan convert to degrees value is: " & _Degree(Tan($_value)) & @CRLF) ;returns 14.63 *....SEEMS CLOSE...* should be 14.036 And I also attempted: ConsoleWrite("inverse tan of value is: " & Tan($_value) ^ -1 & @CRLF) ;returns 3.916 however should be 14.036 ConsoleWrite("inverse tan of value is: " & _Degree(Tan($_value) ^ -1) & @CRLF) ;returns 224.388 however should be 14.036 ConsoleWrite("inverse tan of value is: " & (Tan ^ -1) * ($_value) & @CRLF) ;returns 1.#INF As can be seen in the code...the closest answer (from what I get on a calculator) is "14.63"...when the calculator indicates it should be "14.036"...is there some reason for the discrepancy? Is simulation of a "INV" or "2nd" key on the calculator possible using AutoIT? I thank you in advance for any suggestion.
-
search for a program installation directory location?
Burgs replied to Burgs's topic in AutoIt General Help and Support
Thank you for the replies. I thought of checking the registry before, however was unsure if that would be 'fail proof'...not sure if all software installations display in the registry. I suppose I could supplement that with a search using "FileListToArray" in case of failure to locate in the registry as a workable solution...thanks again to each of you! -
Greetings, I have a fairly straightforward question. Is there a way to write script that would search for and determine the location of an installed program on any particular client machine? For example if I wanted to determine the location of a Gstreamer program installation on a client machine (for example if it is located in C:/Gstreamer directory where it normally would be...or not) is there some code snippet or command that would accomplish that? I thank you in advance. Regards.
-
haha yes I know...I always do that out of habit...but I've never had any problems with it...thanks for posting
-
Greetings, Thank you for the replies, much appreciated. @Nine why does your "Run" command not reference/call any command to open the console window? I mean how does AutoIT know the stated command you wrote is to be executed in the console? @Subz would I also be able to write the command alternatively as indicated in the documentation...using Run(@ComSpec & " /c " & 'commandName', "", @SW_HIDE) ...therefore it would read: Run(@ComSpec & " /c" & 'C:\gstreamer\1.0\x86_64\bin & gst-launch-1.0 videotestsrc ! autovideosink', "", @SW_HIDE, BitOR($STDERR_CHILD, $STDOUT_CHILD)) ....? does the "&" provide an attached 'second line' to be executed following the command before the "&" ('C:\gstreamer\1.0\x86_64\bin')...? Are the "STDERR_CHILD" and "STDOUT_CHILD" just regular strings? Therefore I could examine them with "StringInStr" for keywords such as "prerolling" or "error"...OR do I need to accomplish that using the "StderrRead" and "StdoutRead" which will produce the readable string(s)...? Thanks again for the responses and sorry for my additional questions...I'm just trying to wrap my head around this. Regards
- 3 replies
-
- gstreamer
- command line
-
(and 2 more)
Tagged with:
-
Greetings, I would like to be able to write a script to send commands to the console for creation of Gstreamer pipelines. I was thinking of something similar to this: Local $iPID = Run("C:\Windows\System32\cmd", "", @SW_MAXIMIZE) ;THIS OPENS THE CONSOLE...!!! if $iPID == 0 Then ConsoleWrite(@CRLF & "I DID NOT OPEN CMD...error: " & @error & @CRLF) if $iPID <> 0 Then ConsoleWrite(@CRLF & "I OPENED CMD...!!!" & @CRLF) $hCmd = WinGetHandle("C:\WINDOWS\system32\cmd.exe") if $hCmd <> 0 Then WinActivate($hCmd) ;ensure command console is active... $sOutput = Send("cd C:\gstreamer\1.0\x86_64\bin" & @CRLF, $SEND_RAW) $sOutput = Send("gst-launch-1.0 videotestsrc ! autovideosink" & @CRLF, $SEND_RAW) Sleep(3000) ControlSend($hCmd, "", "", "exit" & @CR) EndIf ;$hCmd NOT "0"... I don't really know if this is the best way to open the console and send commands into it. I'm also not sure about how to best catch any errors that may occur...likely this needs to be accomplished with the STDOUTREAD command however I've not had experience using it before and therefore would appreciate some advice that anybody may offer. Basically I'm seeking guidance on how to best automate the opening of the console, sending lines of commands to be executed, and handling any potential errors in the execution of those commands...I thank you in advance. Regards.
- 3 replies
-
- gstreamer
- command line
-
(and 2 more)
Tagged with:
-
Greetings, Sorry for the late reply. Thank you for the response...I tested your code and it seems to work fine. In the meantime I also arrived at another solution which seems to work, although not yet heavily tested: ReDim $_TREE_BRANCH[Ubound($_HIERARCHY)] GUISwitch($hGUI) For $_populate = 0 to Ubound($_HIERARCHY) - 1 _GUICtrlTreeView_BeginUpdate($idTreeView) if Int($_HIERARCHY[$_populate]) == 0 Then $_TREE_BRANCH[$_populate] = _GUICtrlTreeView_AddChild($idTreeView, $hItem, String($_STRUCTURES[$_populate])) Else if Int($_HIERARCHY[$_populate]) == Int($_HIERARCHY[$_populate - 1] + 1) Then $_TREE_BRANCH[$_populate] = _GUICtrlTreeView_AddChild($idTreeView, $_TREE_BRANCH[$_populate - 1], String($_STRUCTURES[$_populate])) EndIf ;Int($_HIERARCHY[$_populate]) EQUALS the 'previous' entry "+ 1"... ;therefore MUST be a 'subordinate' to that 'previous' entry... if Int($_HIERARCHY[$_populate]) == Int($_HIERARCHY[$_populate - 1]) Then $_parent = _GUICtrlTreeView_GetParentHandle($idTreeView, $_TREE_BRANCH[$_populate - 1]) if $_parent <> 0 Then $_TREE_BRANCH[$_populate] = _GUICtrlTreeView_AddChild($idTreeView, $_parent, String($_STRUCTURES[$_populate])) EndIf ;'$_HIERARCHY[$_populate]' EQUALS 'previous' entry... ;use same 'current superior' and/or 'parent'... if (Int($_HIERARCHY[$_populate]) <> Int($_HIERARCHY[$_populate - 1] + 1)) AND (Int($_HIERARCHY[$_populate]) <> Int($_HIERARCHY[$_populate - 1])) Then if (Int($_HIERARCHY[$_populate]) < Int($_HIERARCHY[$_populate - 1])) AND (Int($_HIERARCHY[$_populate]) <> 0) Then $_LOOKUP = _ArraySearch($_HIERARCHY, Int($_HIERARCHY[$_populate] - 1), 0, $_populate - 1, 0, 0, 0) ;search '$_HIERARCHY' array from END (from '$_populate' - 1) to BEGINNING to locate the 'superior' ;to the current '$_populate' value...! if Int($_LOOKUP) <> -1 Then $_TREE_BRANCH[$_populate] = _GUICtrlTreeView_AddChild($idTreeView, $_TREE_BRANCH[$_LOOKUP], String($_STRUCTURES[$_populate])) EndIf ;'$_populate' is less than '$_populate - 1' AND is NOT "0"... EndIf ;'$_HIERARCHY[$_populate]' does NOT EQUAL 'previous' entry "+ 1" OR 'previous' entry...MUST be a 'non-sequential' UNIT... EndIf ;'$_populate' is "0"...OR NOT... _GUICtrlTreeView_EndUpdate($idTreeView) Next ;Next $_populate, cycle thru '$_HIERARCHY' array to build 'TREEVIEW' Controls I suppose either way should get the job accomplished. I thank you again very much !
-
Hello, I am having great difficulty with something I would have thought to be fairly easy. I have an array containing (military) organization strings, similar to this: 42nd Battalion Company A 1st Platoon 1st Squad 2nd Squad 3rd Squad 2nd Platoon ...1st, 2nd, 3rd Squad 3rd Platoon ...1st, 2nd, 3rd Squad Company B ...etc... I also have an associated array that contains the 'hierarchy' information associated with each string..."0", "1","2", etc ...therefore using example above the "0" would associate with "42nd Battalion", while "1" would be "Company A", "2" is "1st Platoon", etc. Each sequential number is a 'child' of the preceding number. Therefore the information above would appear in the array as "0", "1", "2", "3", "3", "3", "2", "3", "3", "3", "2", "3", "3", "3", "1", etc... My issue is that I'm having great difficulty creating a 'Treeview' control using this information. Mainly due to the fact that entries can, and will...repeat (for example multiple entries for "Company A", "Company B", "1st Platoon", "1st Squad", etc, etc). The following code is operative, however it does not create the treeview items as 'child' entries of one another...it simply lists each item as a separate entity. For $_populate = 0 to Ubound($_HIERARCHY) - 1 _GUICtrlTreeView_BeginUpdate($idTreeView) _GUICtrlTreeView_Add($idTreeView, $_HIERARCHY[$_populate], String($_STRUCTURES[$_populate])) _GUICtrlTreeView_EndUpdate($idTreeView) Next ;Next $_populate, cycle thru '$_HIERARCHY' array to build 'TREEVIEW' Controls As I mentioned earlier I thought I could manage this...however i'm pulling out quite a bit of my hair trying to get this working properly...any help would be appreciated. I thank you in advance.
-
_ArrayInsert into last array position?
Burgs replied to Burgs's topic in AutoIt General Help and Support
OK thank you for the reply, I will try that. -
Greetings, I seem to be having a problem trying to insert values into an array in excess of the size of the array (its Ubound value). I thought the command would simply 'ReDim' the array in order to add another value...however that does not seem to be happening. My code is as below: ;**SET DYNAMIC ARRAY DIMENSIONS... $vValue = Int($_STRUCTURE_LEVEL - 1) ;seek the '$_HIERARCHY' level that is one 'previous' to the 'current' value...! $iStart = 0 ;set to begin search from element "0" in array... Do $_Files_Located = _Arraysearch($_HIERARCHY, $vValue, $iStart) if Int($_Files_Located) <> -1 Then $iEnd = 1 For $_RIGGING = 0 to Ubound($_LINE_DETAIL3) - 1 _ArrayInsert($_STRUCTURES, $_Files_Located + $iEnd, String($_LINE_DETAIL3[$_RIGGING])) _ArrayInsert($_HIERARCHY, $_Files_Located + $iEnd, Int($_STRUCTURE_LEVEL)) _ArrayInsert($_INFERIOR_TMPLS, $_Files_Located + $iEnd, Int(-1)) $iEnd += 1 ;increment EACH ITERATION... Next ;Next $_RIGGING EndIf ;'$_Files_Located' NOT "-1"...value for previous '$_STRUCTURE_LEVEL' ;was located in '$_HIERARCHY' array... $iStart += (Ubound($_LINE_DETAIL3) + 1) ;increment the offset index element position to begin the next search... ;"+ 1" to INCLUDE the 'parent' ('searched') UNIT...! Until $_Files_Located == -1 ;end loop when previous '$_STRUCTURE_LEVEL' is NOT found in '$_HIERARCHY' array... ;** This code routine works perfectly fine except when the 'searched' value ($_Files_Located) happens to be the final element position in the searched array...how can I modify this routine so that the final additions at the end of the array(s) are made? I thank in advance for any replies.
-
Thanks again for the information...it is helpful. I'll continue playing around with it to see what I can see...regards.
-
Thanks for the response. No I did not change the '$hListView' handle, I just mis-understood it...sorry about that. here is a basic synopsis of the issue I am having recognizing a ComboBox Control that I add to the same (TAB) page the ListView control is within: $hGui = GUICreate("test", 768, 689), $hEdit, $tEdit GUISetState(@SW_SHOW, $hGui) $_THE_TABS = GUICtrlCreateTab(1, 40, 768, 612, BitOR($GUI_SS_DEFAULT_TAB, $TCS_FOCUSONBUTTONDOWN)) GUICtrlSetState($_THE_TABS, $GUI_ENABLE) GUICtrlSetState($_THE_TABS, $GUI_SHOW) $_Startup_TAB = GUICtrlCreateTabItem("Startup") ;...some stuff $_DB_TAB = GUICtrlCreateTabItem("Databases") $_DB_FIELD = GUICtrlCreateCombo("", 10, 126, 175, 300) GUICtrlSetState($_DB_FIELD, $GUI_ENABLE) GUICtrlSetState($_DB_FIELD, $GUI_SHOW) GUICtrlComboBox_AddString($_DB_FIELD, String("Testing1") GUICtrlComboBox_AddString($_DB_FIELD, String("Testing2") ;this seems to work to store the 'handles' for the control... if _GUICtrlComboBox_GetComboBoxInfor($_DB_FIELD, $tInfo) Then $idTBLCombo = DLLStructGetData($tInfo, "hCombo") $idTBLEdit = DLLStructGetData($tInfo, "hEdit") $idTBLList = DLLStructGetData($tInfo, "hList") EndIf ;establish handles to structures of the ComboBox Control $idListView = GUICtrlCreateListView("", 10, 300, 400, 180, $GUI_SS_DEFAULT_LISTVIEW-$LVS_SINGLESEL, $WS_EX_CLIENTEDGE) _GUICtrlListView_SetExtendedListViewStyle($idListView, $LVS_EX_DOUBLEBUFFER+$LVS_EX_FULLROWSELECT+$LVS_EX_HEADERDRAGDROP) $hHeader = _GUICtrlListView_GetHeader($idListView) $hListView = GUICtrlGetHandle($idListView) ;CombBox open and close events $idComboOpen = GUICtrlCreateDummy() $idComboClose = GUICtrlCreateDummy() ;Handle WM_NOTIFY messages for the ListView ;Open the ComboBox on click/double click GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ;Subclass callback functions Local $pListViewCallback = DllCallbackGetPtr(DllCallbackRegister("ListViewCallback", "lresult", "hwnd;uint,wparam,lparam,uint_ptr,dword_ptr")) Local $pHeaderCallback = DllCallbackGetPtr(DllCallbackRegister("HeaderCallback", "lresult", "hwnd;uint,wparam,lparam,uint_ptr,dword_ptr")) Local $pEidtCallback = DllCallbackGetPtr(DllCallbackRegister("EditCallback", "lresult", "hwnd;uint,wparam,lparam,uint_ptr,dword_ptr")) Local $pListCommand = DllCallbackGetPtr(DllCallbackRegister("ListCommand", "lresult", "hwnd;uint,wparam,lparam,uint_ptr,dword_ptr")) Local $pGuiCallback = DllCallbackGetPtr(DllCallbackRegister("GuiCallback", "lresult", "hwnd;uint,wparam,lparam,uint_ptr,dword_ptr")) ... While 1 Sleep(10) $_MAIN_MOUSE_ID = GUIGetCursorInfo($hGui) if IsArray($_MAIN_MOUSE_ID) == 1 Then $_MAIN_MOUSE_ID = $_MAIN_MOUSE_ID[4] $hHandle = ControlGetHandle($hGui, "", $_MAIN_MOUSE_ID) $aMsg = GUIGetMsg($GUI_EVENT_ARRAY) Switch $aMsg[1] Case $hGui Switch $aMsg[0] Case $idTBLCombo MsgBox(0, "$idTBLCombo", "ComboBox clicked") ;IGNORED...NEVER fires Case $idTBLEdit MsgBox(0, "$idTBLEdit", "Edit clicked") ;IGNORED...NEVER fires Case $idTBLList MsgBox(0, "$idTBLList", "List clicked") ;IGNORED...NEVER fires Case $GUI_EVENT_PRIMARYDOWN, $GUI_EVENT_SECONDARYDOWN if $hHandle <> $hListView Then consolewrite("Mouse is HOVERED over 'Control Handle': " & $hHandle & @CRLF) ;works to show handle consolewrite("'$idTBLCombo': " & $idTBLCombo & @CRLF) ;NEVER fires... consolewrite("'$idTBLEdit': " & $idTBLEdit & @CRLF) ;will fire if click is inside 'Edit' of the Combox consolewrite("'$idTBLList': " & $idTBLList & @CRLF) ;only seems to display the area of the GUI after Listbox ;is no longer displayed on the click... EndIf ;'click' event was NOT on the ListView Control... if Not $bComboOpen Then ContinueLoop if $bListboxOpen Then ContinueLoop Local $aPos = MouseGetWindowPos($hListView) if Not ($aPos[0] > $aRect[0] AND $aPos[0] < $aRect[2] AND $aPos[1] > $aRect[1] AND $aPos[1] < $aRect[1] + 20) Then GUICtrlSendToDummy($idComboClose) ;Delete ComboBox if $aPos[0] > 0 AND $aPos[1] > 0 AND $aPos[0] < $aSize[2] AND $aPos[1] < $aSize[3] Then _WinAPI_SetFocus($hListView) ;Set focus to ListView if mouse click is inside ListView EndIf EndSwitch EndSwitch EndIf ;$_MAIN_MOUSE_ID is an array Wend I thank you in advance for any suggestions...as I noted in the code example above...I seem to be able to recognize a 'click' event within the 'Edit' of my ComboBox only...i'd like to be able to fire off some commands as soon as the selection is made in the 'List' part of the control...when the user clicks one of the items in the dropdown list. Regards.