Jump to content

Myicq

Active Members
  • Posts

    334
  • Joined

  • Last visited

Profile Information

  • Location
    Odense, DK
  • Interests
    AutoIT, Perl, recumbent biking, power tools, woodworking

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Myicq's Achievements

  1. I have been using the excellent CommMG for a long time. Always happy with performance. Today I have been using two different connections: one for a digital I/O board, and another for sending data. I time the communication using high precision "QueryPerformanceFrequency". I could not understand a difference between my settings and the measured timer. Using debugging I found that this code would take approx 70..100 msec - or about 35 msec each. ; --- select the I/O connection to trigger _CommSwitch(1) _CommSendstring("1") _CommSendstring("Q") ; --- select the data connection to send data _CommSwitch(4) _CommSendstring("XYZ") while without the _CommSwitch() the code block would take < 2 msec. I tried with the 64 bit version of CommMG as well. No difference. This may all be due to Windows functions being slow, and probably can't be improved ? Is there a way to avoid commswitch, such as using two instances of something - my experience is not enough to suggest what. In Delphi, I would have used two instances of a connection.
  2. I have a small script that works using function keys (not related to gaming or keylogging). I set the keys using something like Opt ('GUIoneventmode', 1) HotKeySet("{F4}", "_functionF4") This is all good. But at times I wish to have my script open, and use other software on same machine. These other software may use function keys as well. Problem is that AutoIT has "captured" the function key, and thereby, the function key won't do anything in the other program. My question is: what is best approach to "not handle" the hotkeys when autoIT script is not focused ? And pass on keypress to the other software ? I could of course add a timer/ event to check for focus and set /unset hotkeys, but I think there should be a simpler way ?
  3. Thing is though, I WANT to view any lines that are ConsoleWrite("debugtext" & @crlf) So it's only the 5-6 lines indicating the calling scripts and wrapper I want to suppress.
  4. This may be a dumb question.. but my vertical screen space is fairly limited. I don't need (always) to see all the debug output from autoIT compiler, wrapper etc. Can I turn this part off: (optionally) >"D:\AutoIt3\SciTE\..\AutoIt3.exe" "D:\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\temp\xx.au3" +>11:35:44 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0 Keyboard:00000406 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0406) +> SciTEDir => D:\AutoIt3\SciTE UserDir => C:\Users\XXX\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\XXX\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:D:\AutoIt3 input:D:\temp\XX.au3 +>11:35:44 AU3Check ended.rc:0 >Running:(3.3.12.0):D:\AutoIt3\autoit3.exe "D:\temp\xx.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
  5. Made first steps with this one. Looks promising. But there are two things I could not figure, also not from examples. Given the following JSON structure: { "Name" : "Documentation", "Source" : ".", "Destination" : "..\\", "Pages" : { "abc" : "xxx" , "Configuration" : { "Here is my first key with a long name" : "test.md", "Another key with a strange name" : "this.md" }, "def" : "blah" } } I can get each part no problem. But as can be seen from "Configuration" the keys are not known, and may have long names. This leads me to two questions: 1) while iterating over "Pages", how can I know the type (differ "abc" = string from "Configuration" = object). I did try to use .type but always get "string" back. 2) while iterating over "Configuration", I get a lot of entries for the code below. I expected only two. And 2a) is there way to access configuration by index directly ? Here is what I tried so far: $oJSON = _OO_JSON_Init() $jsObj = $oJSON.parse(FileRead("docnet.json")) $keys = $jsObj.keys($jsObj.Pages) for $k in $keys if StringLen( $k) > 0 then ;- I get a lot of empty here so have to put in this test. Not sure why ? ConsoleWrite(">>>" & $k & " >>> " ) $t = $jsObj.Pages.type($k) ;- This always returns "string". ConsoleWrite("Type is ==> " & $t & @CRLF) ConsoleWrite($jsObj.Pages.item($k) & @CRLF) endif Next Thanks
  6. Is there any example code for large (touch screen friendly) check boxes ? I need to create a gui full-screen with about 16 different check boxes, approx 1x1 cm size. As this is not directly possible with Windows, I wonder if anyone has example code already ? My take would be to put Windings font in a label, and keep state behind the scenes in an sqlite database. Is this approach best way ?
  7. You don't specify your application, but if you have to enter a lot of data (as in 1000s or millions), you definately want to study on "transaction" syntax. This is part of SQL syntax, and not as such AutoIT related. But just a good practice. Otherwise, the database will be updated after every write, which is slowing your queries a lot after some number. I have started to us SQLite a lot with just the :memory: database, since it makes data structure handling trivial in some cases, where the alternative would be arrays. Especially where you need to select / update / delete the data. Just my 2c. Corrections welcomed if I am wrong!
  8. Here is the script so far. I have not been able to make the delay work, because the WM_MESSAGE only fires after keypress. So if I press two keys fast, and nothing else, it does not search until next keypress. Desired is to fire after last keypress+500 msec. Feedback is welcomed. Purpose of this script is to allow client to select a template. I want to display ONLY the name, but have other properties returned when selected. Search function is realtively fast already, but just for good measure, I would like to learn about the delay. and, if I could have done the same without SQLite, I would be happy to learn ! listbox-example.zip
  9. @AutoBert: I think this is pretty much along my thinking as well. I will try to pull something together, and post here.
  10. I am experimenting with a small gui where operator can filter results in a listbox based on another input box (source follows later). And then by selecting "NAME" column get other columns returned. I will use SQLite in the background to store actual data, and Excel as original source of data. It pretty much works. My only question is: can I delay a GuiRegisterMsg event, so that, schematically: * key event registers * has n msec passed since last keypress ? * if yes, then filter results. Else reset time counter. Reason is I don't want to delay gui too much if user is typing fast. I would prefer if this could be done in a non-blocking way, so no sleep() command. I am not using guionevent mode. Thanks for any help!
  11. Hello Chimp, No, it is obviously 12 columns, but 4 datasets instead of 2. Think "sheets of labels", where each line is a sheet. Sometimes you have less, other times more labels. Each label has 1, maybe 4, maybe 3 fields. Your change correctly puts the number of fields on each line, but invalidates the datasets. I have updated the script so that the correct number of blank fields are added.
  12. Just a small example, hope it will be useful to someone. (and not too trivial / simple) If the method can be improved, I would be happy to learn about it. Task : take a csv file with data, possibly organized in sets. Each line contains 1..n sets of data. Think 1 line of is a paper of labels. Each paper may have 1.. n labels where each label is 1 or more fields. Transform this to different column count of data set. Purpose is to transform customer data into different applications where different organization of data is needed. Source can of course be 1 column only. Example If this is transformed into 4 columns, result should be The code: Is this example script too simple to be allowed here ?
  13. @Melba23 of course, and I understand. Will try to detail here, sorry if being too verbose. Application is to create datafile for a print application (think endless webs, ticket printers, newspapers etc). This print application prints tickets / papers etc with numbers. Typically the paper is cut into smaller rolls, each roll then containing numbers from X-Y. So, the press must print f.ex 1..5900 1..5900 or reversed. The catch here is that the particular printing machine prints a certain width every print. Each "width" can contain from 1 to, say, 10 ticket. That is why the datafile must have several numbers in each line. Further, the print application may have several lanes, which each may use a different numbering series. I calculate the no. of tickets per print based on this width and ticket size. So, in the printout, a very simple numbering series could be (prints separated by bar) 1 2 3 | 4 5 6 | 7 8 9 | 1 2 3 | 4 5 6 | 7 8 9 | ... ^ restart of DB That adds up. But if it does not add up, the database file must be (I can't see other solution) added to until it matches a complete width, otherwise there will be holes in the print. The fields are statically linked, and the length of a print is constant. 1 2 3 | 4 5 6 | 7 8 9 | 10 | ^can't end here, or there would be unwanted blanks. The length of the finished database is not going to be infinite, typically number series are less than 10.000, and the maximum no. of repeats is never more than no. of tickets per print * amount of numbers. So for 3 tickets, and 3000 numbers, maximum 9000. Often less though. With 4 and 18 numbers, criteria is fulfilled after 9 lines, not 36. Below a screenshot of a typical print, this one has counting right-to-left (position of objects is indefferent and handled). Each print like this is one record. This example has 6 identical lanes, but could be different. I understand this is very specific, and I have already recieved some good input and ideas. I think I have an idea of the solution. Once complete, this part makes AU3 a very critical part of an every day application helping millions of labels and tickets have numbers.
  14. Forgot to add (and can't edit): Reason to loop around: Image you print the lines from this array on a continous paper running right-to-left. If you reach the end of the array, you restart. The numbers must now be an ever-continous string of 1,2,3 | ,4,5,6 | ,7,8,9 | ,10,1,2 | ,3,4,5 | ,6,7,8 | ,9,10,.... The can't be lines with only 2 or 1 digit. The bars should clarify.
  15. Thanks all for your answers ! Especially because it was more a puzzle / algorithm question, more than autoit stuff. I have learned from the examples, but maybe I did not explain well enough that the 2D initial array can be of different size. I will try to give another example and what I think could provide correct solution. 1) take a number of 1D arrays (or a single 2D array). This could be as simple as 1,2,3,4,5,6,7,8,9,10 2) now print this array so that it matches with example 3 columns. (10 placed in column 3). This is not always possible, but will at _maximum_ take 3 * 10 (lines * elements) lines. Now, if I had a second 1d array, I would also have to use 10 lines (same length). Hopefully it's clear now what I mean by "looping around." My proposed solution now. (for 2d arrays) The solution I am going to program soon will be: 1) treat the 2D array like 1D arrays, and create separately results as above. That part is simple. 2) now I have as many 2D arrays as I had lines in the original 2D array. 3) now I can take rows 1 and concatenate, rows 2 and concatenate etc. For final result . Example: Not sure if this is the fasted way, but it's the only one I can overview right now.
×
×
  • Create New...