simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] Now - about SWIG and C++ api: how to use it?


From: ThomasK
Subject: Re: [Simulavr-devel] Now - about SWIG and C++ api: how to use it?
Date: Mon, 23 Jan 2012 20:45:47 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Lightning/1.0b2 Thunderbird/3.1.16

Hi Andrey,

it wasn't on list, so I left your message untouched below.

> print self.GetCurrentTime()

Sorry, was my mistake, it must be: self.getCurrentTime() (starting with lower character for method name)

This is a real python method, see ex_utils.py in examples/python directory.

cu, Thomas

Am 23.01.2012 11:00, schrieb Andrey Gill:
Good day!

Thank you for your answer here:
http://www.mail-archive.com/address@hidden/msg01553.html
(I do not know will it message display on mailing list or not, so copy
the link).
There you advised me to see C++ source codes, for understand behaviour
of program. I know a little C++, so it is useful advise for me.
Then, you advised me to use print self.GetCurrentTime() to know
"processor system time". Well, I inserted it in my python file - and got
an error message:

print self.GetCurrentTime()
AttributeError: 'TestBaseClass' object has no attribute 'GetCurrentTime'

Buggy code is:

def test_03(self):
"check PC and PC size"
self.assertEqual(self.device.PC_size, 2)
self.doRun(1)
print self.GetCurrentTime()

Nothing criminal! But I am now clever boy and know about C++ api - so I
used grep to see where is GetCurrentTime in source files?
I found it in file systemclock.h: it is in definition of class
SystemClock. My python script do not use this class definitely, so - it
is inherited somewhere? But - there are a lot of names of this class in
many files. For example, many such words in file pysimulavr_wrap.cpp.
But - where and how it is inherited, and where my error - in parameter,
or somewhere else - I do not know, how to search. Maybe I have to study
SWIG, python and how first makes things for second? Or it is not necessary?

Best regards,
Andrey V. Gill



reply via email to

[Prev in Thread] Current Thread [Next in Thread]