Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PresentMonDLL.get_instance().GetData throws TypeError #2

Open
badaz opened this issue Dec 9, 2022 · 0 comments
Open

PresentMonDLL.get_instance().GetData throws TypeError #2

badaz opened this issue Dec 9, 2022 · 0 comments

Comments

@badaz
Copy link

badaz commented Dec 9, 2022

Hi,

I'm trying to run the example of the lib but I'm getting this error:

Traceback (most recent call last):
  File "C:\Users\Sve\code\apex-oled-fps-counter\src\__main__.py", line 32, in <module>
    main ()
  File "C:\Users\Sve\code\apex-oled-fps-counter\src\__main__.py", line 21, in main
    data = fps_inspector.get_all_fliprates ()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sve\code\apex-oled-fps-counter\Lib\site-packages\fps_inspector_sdk\fps_inspector.py", line 125, in get_all_fliprates
    res = PresentMonDLL.get_instance().GetData (current_size, time_arr, fliprate_arr)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type

I'm running the script in Windows Powershell (elevated)
The PID passed to the script is that of the currently focused window
The values passed to the GetData function are as follow:

[4] # current_size
[0.00000 0.00000 0.00000 0.00000] # time_arr
[0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000] # fliprate_arr

What strikes me is that the type of the current_size variable is numpy.ndarray, and GetData's first parameter name suggest it is waiting for an int.

When I pass curent_size[0] as the first param, the error is gone and I get my results.

Did I miss something ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant