You Are Here:

Community: Developer Discussion Boards

#1 Old module sensor,class EventFilter , sample code - 2008-07-02, 02:39

Join Date: Jun 2008
Posts: 12
Zamoth_bg
Offline
Registered User
Hello

I wish to use the n95 accelerator for a interface I am developing. The problem that the built-in filters that come with Python do not suffice for me and I want to fine tune myself the input. So I want to extend EventFilter and embed all the logic needed for filtering there. Problem is I am not that good with Python, neither with developing on n95. So I read the Python documentation but I do not understand it.

class EventFilter
The EventFilter class provides a generic interface for event filters. The default implementation
only passes events on, i.e. events are not fi ltered. Classes deriving from EventFilter can decide
if an event should be delivered at all as well as they can alter the data that is passed on to the
So far so good. I understand it so far.
callback.
callback
This is where the event filter's callback is stored. In case the EventFilter object is used
together with a Sensor object, the Sensor object will handle correct setting of this variable.
I do not understand the second sentence. What is suppose to be that object? A function?
init ()
Initialises the event filter object. The callback member is initialised to None.
del ()
Destructs the event filter object. This method calls cleanup, which can be overridden by
deriving classes to clean up resources.
event(data)
This method is the place where event filtering takes place, and hence this method should be
overridden by deriving classes.ok Overridden event methods can deliver their own data to the
callback; the data delivered may be data Is that "data" some specific kind of object? or any other set of data. In case the event is decided
to be delivered, overriding instances should call self.callback, which by default takes one
argument. Ok if we have true call the callback, if not no. But what kind of input do I get? Is "data" the input? What is it? Is it x,y,z also?
cleanup()
Cleans up any resources needed by the event lter. The default implementation does not need
this feature. This method is called by the destructor del .Ok I understand.



Ok... If someone can help me with the previous question in bold that will be great. Also if someone can write me a small simple code how the event method should work that would be very helpful.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting started using Carbide c++ 1.1 -> how to import the sample code terchris Carbide.c++ IDE and plug-ins 3 2007-11-20 10:12
Where can i find sample code? eqing2008 General Symbian C++ 2 2006-11-30 08:15
Sample code for MMS? yanxiang General Discussion 0 2004-08-25 07:42
Notice from ForumNokia -- sample Java code... paulbrow General Messaging 4 2003-06-05 09:40
MMS sample code??? Nokia_Archive General Messaging 1 2002-05-23 16:51

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia