Code: Select all
D:
CD D:\Programme\C.I.P
S2xyY.exe /ini:S2xyYSingleRead.iniCode: Select all
D:
CD D:\Programme\C.I.P
S2xyY.exe /ini:S2xyYSingleRead.iniSo KLAPPT es! Puh, das war eine schwere Geburt!!Bitmonster wrote:Code: Select all
D: CD D:\Programme\C.I.P S2xyY.exe /ini:S2xyYSingleRead.ini
damdy-cash wrote: PS: Ich wollte ca. Mitte April das Excel- Sheet rausgeben und auch gleich das Auslesen f├╝r den SpyderTV reinpacken. Meinst Du das klappt?
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="554">
<Folder Name="SpyderTV">
<Macro Name="Start one reading">
<Action>
EventGhost.PythonCommand(u'SpyderTV_ReadingTime = 12')
</Action>
<Action Name="Find Dialog">
Window.FindWindow(u'SpyderTV.exe', u'Support-Diagnose-Tool', u'ThunderRT6FormDC', None, None, 1, False, 0.0)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(823), 1, False)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(842), 2, True)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(852), 2, False)
</Action>
</Macro>
<Macro Name="Setup SpyderTV" id="823">
<Action Name="Find Mainwindow">
Window.FindWindow(u'SpyderTV.exe', u'SpyderTV', u'ThunderRT6FormDC', None, None, 1, False, 1.0)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(839), 0, True)
</Action>
<Action>
System.Execute(u'C:\\Programme\\SpyderTV\\SpyderTV.exe', u'/support', 0, False, 2)
</Action>
<Action Name="Find Splashscreen">
Window.FindWindow(u'SpyderTV.exe', u'', u'ThunderRT6FormDC', None, None, 1, False, 20.0)
</Action>
<Action>
Window.MoveTo(-10000, 0)
</Action>
<Action Name="Find Mainwindow">
Window.FindWindow(u'SpyderTV.exe', u'SpyderTV', u'ThunderRT6FormDC', None, None, 1, False, 20.0)
</Action>
<Action>
Window.Resize(1, 1)
</Action>
<Action>
Window.MoveTo(-10000, 0)
</Action>
<Action Name="Find Textbox">
Window.FindWindow(u'SpyderTV.exe', u'Support-Diagnose-Tool', u'ThunderRT6FormDC', None, u'ThunderRT6TextBox', 1, False, 0.0)
</Action>
<Action>
Window.SendKeys(u'{Right}{Right}{Right}{Back}{Back}{Back}')
</Action>
<Action>
Window.SendKeys(u'{SpyderTV_ReadingTime}')
</Action>
<Action Name="Find Dialog">
Window.FindWindow(u'SpyderTV.exe', u'Support-Diagnose-Tool', u'ThunderRT6FormDC', None, None, 1, False, 5.0)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(842), 2, True)
</Action>
<Action>
EventGhost.Wait(2.0)
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(852), 2, False)
</Action>
</Macro>
<Macro Name="Close SpyderTV" id="839">
<Action Name="Find Mainwindow">
Window.FindWindow(u'SpyderTV.exe', u'SpyderTV', u'ThunderRT6FormDC', None, None, 1, False, 0.0)
</Action>
<Action>
Window.Close()
</Action>
</Macro>
<Macro Name="Press Button" id="842">
<Action Name="Find Dialog">
Window.FindWindow(u'SpyderTV.exe', u'Support-Diagnose-Tool', u'ThunderRT6FormDC', None, None, 1, False, 0.0)
</Action>
<Action>
Window.BringToFront()
</Action>
<Action>
Window.MoveTo(0, 0)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action Name="Find Button">
Window.FindWindow(u'SpyderTV.exe', u'Support-Diagnose-Tool', u'ThunderRT6FormDC', u'', u'ThunderRT6UserControlDC', 1, False, 0.0)
</Action>
<Action Name="Press Button">
EventGhost.PythonScript(u'import win32con\nimport win32api\nimport win32gui\n\nhwnd = eg.lastFoundWindows[0]\nleft, top, right, bottom = win32gui.GetClientRect(hwnd)\nleft, top = win32gui.ClientToScreen(hwnd, (left, top))\n\ns_width = 1024\ns_height = 768\nx = left + right / 2\ny = top + bottom / 2\n\nx = int(round(x * (65535 / s_width)))\ny = int(round(y * (65535 / s_height)))\n\nwin32api.mouse_event(win32con.MOUSEEVENTF_ABSOLUTE|win32con.MOUSEEVENTF_MOVE, x, y, 0, 0)\nwin32api.mouse_event(win32con.MOUSEEVENTF_ABSOLUTE|win32con.MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)\nwin32api.mouse_event(win32con.MOUSEEVENTF_ABSOLUTE|win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)')
</Action>
<Action Name="Find Dialog">
Window.FindWindow(u'SpyderTV.exe', u'Support-Diagnose-Tool', u'ThunderRT6FormDC', None, None, 1, False, 0.0)
</Action>
<Action>
Window.MoveTo(-10000, 0)
</Action>
<Action>
EventGhost.PythonCommand(u'eg.Wait(SpyderTV_ReadingTime + 1)')
</Action>
</Macro>
<Macro Name="Analyze result" id="852">
<Action Name="Find Dialog">
Window.FindWindow(u'SpyderTV.exe', u'Support-Diagnose-Tool', u'ThunderRT6FormDC', None, None, 1, False, 5.0)
</Action>
<Action>
Window.MoveTo(0, 0)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action Name="Analyze result">
EventGhost.PythonScript(u'import wx \nimport win32gui\n\n\ndef OnToFile(hwnd):\n result = []\n context = wx.ScreenDC() \n memory = wx.MemoryDC() \n left, top, right, bottom = win32gui.GetClientRect(hwnd)\n left, top = win32gui.ClientToScreen(hwnd, (left, top))\n bitmap = wx.EmptyBitmap(right, bottom, -1) \n memory.SelectObject(bitmap) \n memory.Blit(0, 0, right, bottom, context, left, top) \n \n\n for x,y in ((113, 31), (113, 119), (113, 207), (265, 295)):\n s = ""\n \n def is_set(x1, y1):\n return memory.GetPixel(x+x1, y+y1) == (0,0,0)\n \n for i in range (0,5):\n if is_set(7, 55):\n s += ","\n x += 22\n continue\n if is_set(3,46) and is_set(3,33):\n s += "."\n x += 22\n continue\n \n if is_set(2,36):\n if is_set(1,36):\n if is_set(0,27):\n num = 4\n else:\n num = 3\n else:\n if is_set(1,35):\n num = 5\n elif is_set(1,12):\n num = 9\n else:\n num = 8\n else:\n if is_set(2,17):\n if is_set(2,16):\n num = 0\n else:\n num = 6\n else:\n if is_set(1,44):\n num = 2\n elif is_set(2,1):\n num = 7\n else:\n num = 1\n \n s += str(num)\n x += 44\n print s\n result.append(s)\n \n \n memory.SelectObject(wx.NullBitmap) \n #bitmap.SaveFile("test.bmp", wx.BITMAP_TYPE_BMP) \n \n fd = open("c:/SpyderTV.csv", "at")\n fd.write(";".join(result))\n fd.write("\\n")\n fd.close()\n \n eg.result = "\\r\\n".join(result)\n \nOnToFile(eg.lastFoundWindows[0])')
</Action>
<Action>
System.SetClipboard(u'{eg.result}')
</Action>
</Macro>
</Folder>
</EventGhost>so passt das bestens.Bitmonster wrote:Ich hab das Posting oben mal editiert um eine entsprechend erweiterte Funktion. Die Werte sollten jetzt zeilenweise in der Zwischenablage landen.
Code: Select all
eg.result = "\r\n".join(result)Code: Select all
eg.result = "\r\n".join(result[0:2])klappt es.Bitmonster wrote: jepp, mitCode: Select all
eg.result = "\r\n".join(result[0:3])
Code: Select all
result.append(s)Code: Select all
result.append(s + "0")