user8015732
user8015732

Reputation:

Is there a faster setLabel method in appJar

I'm making an app to view CAN data from a car using appJar. I have a thread getting the CAN buffer then sending it to the main loop using queueFucntion. the function queued to the main loop iterates threw the buffer and sends the data to the Label with the same address as the data.

I found that CAN overloads the main loop queue (raise Full). when I time the function sent to the main queue it has a run time of about ~4ms but when I add a label that matches a message it shoots up to ~100ms.

I think this means the setLabel method takes to long. and I want to know if there is a faster way. Ultimately a faster setLabel won't actually solve my problem but it will help

update

I use wing personal 7 as an IDE for python and when I ran my program from outside of wing my code ran a lot faster and didn't overflow but my question still stands.

update x2

I implemented message filtering at the module level by hijacking the module as a parent. this helped a crap tonne but as my app runs it starts developing a delay between the car and the output and I think that means the buffer is filling up.

Upvotes: 0

Views: 52

Answers (1)

user8015732
user8015732

Reputation:

I found that gui.addLabel() returns the actual label object.

When you use gui.setLable(title, text) appJar uses a widget manager class to Search a dictionary of created Label objects with a key matching the title setLabel the sets that dict value using .config(text=text)

So basically you can bypass the searching by keeping track of the label yourself and using

yourLabelHere.config(text='Your string here')

In theory, this is faster but int practice I don't really know

Upvotes: 0

Related Questions