Copy signal value in DVE - simulator

I'm using Synopsys DVE simulator and want to copy value from the waveform window, but I cannot find any button or option to do this. Ctrl+C copies the full path of the signal, but not the current value of the signal. The DVE user guide does not mention this function, but I think this can be done. Any suggestion is well-appreciated.
For example, in the following screenshot, how to copy the value 14'h001e?

You just need to move the mouse over the signal, then press shift to save the signal in the Tooltip viewer. Finally copy to clipboard. Is that easy.

Related

QFileDialog keeps reopening

I wrote a Qt plugin for QGIS, and inside it I have a QPushButton browse_btn to browse for an output folder.
I use the QFileDialog.getExistingDirectory function and it all works fine. However if I close the plugin and open it again, then click the pushbutton to add a path, the opened window for choosing the path will re-open after I choose a path or close it. If I close the plugin a open it again the 'choose path' window will reopen 3 time and so on...
The similar problem is still open here and in comments here and probably solved here, but since there is no code provided I cannot apply it to solve my problem.
The exact code is following:
self.dlg.browse_btn.clicked.connect(self.set_output)
def set_output(self):
folder_path = str(QFileDialog.getExistingDirectory(self.dlg, u"Pick a folder"))
if not folder_path:
return None
I think this happens because each time I open-close the plugin the separate connection is created with self.dlg.browse_btn.clicked.connect(self.set_output), and it only disconnects after I relaunch QGIS
Try this - Add a boolean flag isConnected to your class (or dlg) and init this flag to false.
Then change your connection line to this
if (!self.isConnected):
self.dlg.browse_btn.clicked.connect(self.set_output)
self.isConnected = true

AutoHotKey: send Ctrl+V inside of itself without recursiving

I have this script, when I press Ctrl+Win+Z it runs a Paste (Ctrl+V), then if ScrollLock is enabled it flushes Clipboard, deleting the content I just pasted.
^#A::
Send ^v
if GetKeyState("ScrollLock", "T"){
Clipboard =
}
Return
Now I wanna bind this command to Ctrl+V itself. But when I do so, I receive a dialog saying that "71 hotkeys have been received in the last 1092ms" and asking if I wanna continue.
I believe it's recursiving on itself. Every Send ^v triggers the command again.
How can I do that work? I don't want the clear clipboard to be in another shortcut, because I might forget to use this other shortcut and use Ctrl+V instead. I wanna use standard Ctrl+V for pasting and ScrollLock to set when clipboard should be flushed after it.
The $ prefix prevents hotkeys from triggering themselves:
$^v:: ; ....

Download file from firefox using autoit

I try to download file using Autoit from Firefox 28.0.
I try to download a exe file,popup flashed but autoit window info tool cannot recognize the save button.
how can i automate this.
My scripts looks like
Local $hWnd=WinActivate("[CLASS:MozillaDialogClass]")
WinWaitActive($hWnd)
;MsgBox(1,$hWnd,$hWnd)
;ControlClick($hWnd,"","Save")
ControlClick($hWnd,"&Save File","")
;WinClose("[CLASS:MozillaDialogClass]")
how can i automate this......
Right now both of your ControlClick attempts are incorrect. The correct syntax is ControlClick(Window title or handle, *window* text, control *id*, ...). Look at the helpfile and examples for it to see what you're not doing right currently.
The firefox download dialog is a little tricky, googling gives a lot of results for people who have tried to do the same thing and struggled.
The easiest method is to click the window at the coordinates of the button. ControlClick can be used for this (simply leave the control id blank). The AutoIt window info tool should give ControlClick coords when you try and select where the button is.
That method does assume that the button is always in the same place, which is not necessarily the case. Alternatives are to use ControlSend to send the Alt+S combination (or whatever it is for that button).
And finally, it's worth mentioning the IUIAutomation framework which has shown to be very reliable for automating windows that aren't using standard winapi controls.
The simplest way to do is as follows on mozilla:
Use the following code on autoit.au3 file
ControlFocus ( "MozillaDialogClass", "", "" )
Sleep(10)
Send("{ENTER}")
Execute the same file in selenium using:
Runtime.getRuntime().exec("C:\\Users\\Balaji\\Desktop\\autoit.exe");
Use the below code to download a file in Firefox using AutoIt.
WinWait("[TITLE:Opening ; CLASS:MozillaDialogClass]","", 10)
If WinExists("[TITLE:Opening ; CLASS:MozillaDialogClass]") Then
; Perform keyboard ALT key + s key to select Save File Radio button using keyboard shortcut.
ControlFocus ( "[TITLE:Opening ; CLASS:MozillaDialogClass]","", "" )
Send("!s")
; Wait for 2 seconds
Sleep(2000)
; Press Keyboard ENTER button.
Send("{ENTER}")
EndIf

How to set user command in Qt Fakevim?

(1) For example, I want to set map gd g* in Qt's Fakevim like below but failed.
(2) And also I'd like to set F3 as the save command, how to do it?
(3) In Fakevim, it provides an option "Read .vimrc", but where to find the file .vimrc?
Thank you!
It doesn't look like there is a lot of documentation for FakeVim, so official sources might not exist. Most of this was obtained by experimentation.
If you want to dig deeper, I guess there's no source as official as the actual source: http://qt.gitorious.org/qt-creator/qt-creator/blobs/0809986e501415fe2c8508800b94b5b3169dc048/src/plugins/fakevim/fakevimplugin.cpp
User commands
First off, realize that in Tools>Options>FakeVim>User Command Mapping, you're only setting what your user actions will perform, not how you perform them.
By default, user command #1 is triggered by pressing Alt-V, then 1.
Alt-V, then 2, triggers user action #2, and so on.
You can change the keyboard shortcuts through the general QtCreator configuration interface, under Tools>Options>Environment>Keyboard. There is a "FakeVim" section with all the user actions listed. Select your user action of choice, press the little "erase" icon in the input field under "Shortcut", then press your desired shortcut key, which should appear in the input field.
Second, to finish a command where you would normally press enter, you should literally type in <CR> after the commands. You also need to enter in ':' to enter command mode.
So if you wanted to map the vim save command, ":w", to F3 via FakeVim, you would:
Go to Tools>Options>FakeVim>User Command Mapping.
Enter ":w<CR>" as one of the user commands (say #7).
Go to Tools>Options>Environment>Keyboard.
Find the FakeVim action "UserAction7".
Set F3 as a shortcut for it.
Now, every time you're in the editor, you should be able to click F3 and have the FakeVim :w command execute, which will save your file.
Note that there is also an option to set a shortcut for "Save" directly in the QtCreator keyboard settings, so for this particular shortcut you don't actually need to go through FakeVim.
Setting shortcuts for other vim commands should be similar. Note that you're restricted to the subset of vim commands that FakeVim implements. Refer to the source, linked above, for checking any particular command you're wondering about.
Vimrc file
On Linux this would be ~/.vimrc, a file in the user's home directory. I presume you're asking about Windows.
The best source I can find is this bug report about it being hard to use Fakevim's vimrc on Windows: https://bugreports.qt.io/browse/QTCREATORBUG-8748
Following that, the file Fakevim looks for is ".vimrc" in %USERPROFILE% (you can enter a name like that in Explorer to go to the folder). However, it's tricky to access a file with a name like that on Windows. (Thus why the real vim uses '_vimrc' on Windows -- but FakeVim apparently doesn't, at least at the moment.)
Here is a superuser page with workarounds for how to create such files on Windows: https://superuser.com/questions/64471/create-rename-a-file-folder-that-begins-with-a-dot-in-windows

How to Right click of File in Windows Explorer by AutoIt

I wish to simulate a right click on a file. This is done by opening a Windows Explorer window and then right clicking on it.
The main issue is finding the location of the file in Windows Explorer. I am currently using Autoit v3.3.8.1.
My code 's first line:
RunWait (EXPLORER.EXE /n,/e,/select,<filepath>)
The next step is the problem. Finding the coordinates of the file.
After that, right clicking at that coordinates (it seems to me at this time) is not a problem....
Some background:
OS: Windows 7 64-bit
Software Languages: C#, Autoit (for scripting)
The Autoit script is called by a code similar to that below:
Process p = new Process();
p.StartInfo.FileName = "AutoItScript.exe";
p.StartInfo.UseShellExecute = false;
p.Start();
The code is compiled into a console class file which is run at startup. The autoit script runs as the explorer window opens up.
It seems as though you are taking the wrong approach to the problem, so I'll answer what you are asking and what you should be asking.
First up though, that line of code is not valid, and is not what you want either. You want to automate the explorer window, and RunWait waits for the program to finish. Furthermore you want those items to be strings, that code would never work.
Finding the item in explorer
The explorer window is just a listview, and so you can use normal listview messages to find the coordinates of an item. This is done most simply by AutoIt's GUIListView library:
#include<GUIListView.au3>
Local $filepath = "D:\test.txt"
Local $iPid = Run("explorer.exe /n,/e,/select," & $filepath)
ProcessWait($iPid)
Sleep(1000)
Local $hList = ControlGetHandle("[CLASS:CabinetWClass]", "", "[CLASS:SysListView32; INSTANCE:1]")
Local $aClient = WinGetPos($hList)
Local $aPos = _GUICtrlListView_GetItemPosition($hList, _GUICtrlListView_GetSelectedIndices($hList))
MouseClick("Right", $aClient[0] + $aPos[0] + 4, $aClient[1] + $aPos[1] + 4)
As has already been mentioned, sending the menu key is definitely a better way than having to move the mouse.
Executing a subitem directly
This is how it should be done. Ideally you should never need an explorer window open at all, and everything can be automated in the background. This should always be what you aim to achieve, as AutoIt is more than capable in most cases. It all depends on what item you want to click. If it is one of the first few items for opening the file in various programs, then it is as simple as either:
Using ShellExecute, setting the verb parameter to whatever it is you want to do.
Checking the registry to find the exact command line used by the program. For this you will need to look under HKCR\.ext where ext is the file extension, the default value will be the name of another key in HKCR which has the actions and icon associated with the filetype. This is pretty well documented online, so google it.
If the action is not one of the program actions (so is built into explorer) then it is a little more complex. Usually the best way will be to look at task manager when you start the program and see what it runs. Other things can be found online, for example (un)zipping. Actions like copy, delete, rename, create shortcut, send to... They can all be done directly from AutoIt with the various File* functions.
With more information, it would be possible to give you more specific help.
First, you might want to look at the Microsoft Active Accessibility SDK. In particular look at this interface...
http://msdn.microsoft.com/en-us/library/accessibility.iaccessible.aspx
You can use this to walk the items in the control and find the one with the file name you are looking for and its screen location.
From there, maybe try something like this for simulating the right click.
How can I use automation to right-click with a mouse in Windows 7?
Once you have done the right click, use accessibility again to find the right option on the context menu.
Maybe there's an easier way, you should be able to cobble something together like this if you don't find one. Good luck!
Suppose I have a file named test.txt on D drive. It needs to right click for opening Context Menu. To do this, the following code should work:
Local $filepath = "D:\test.txt"
Local $iPid = Run("explorer.exe /n,/e,/select," & $filepath)
ProcessWait($iPid)
Sleep(1000)
Send('+{F10}')

Resources