Notices


Reply
Thread Tools
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#691
Originally Posted by Wikiwide View Post
Where is the new API described?
It's just that the class has a new hidden member so the plugins need to be recompiled against the updated maemo-dev (i.e. updated header file.)

I'll get round to updating the plugins page to reflect the new callbacks and the Python plugins.

Originally Posted by Wikiwide View Post
Right now new Mbarcode cannot work because of my out-of-date plug-in. Just crashes at first loading of the plug-ins.

Are getImage and getInformativeText mandatory functions?
No they are not mandatory.

Originally Posted by Wikiwide View Post
I will upload here code and compiled library if I manage to compile my plugin with new API.
Cool

Originally Posted by Wikiwide View Post
Note: I don't really understand how can signal be connected to MaemoBarcodeWindow* parent when I haven't taken plugin's parent at all; this->parent = parent; is obsolete. But it doesn't really matter.

Note about QrCode plugin: its image is too small in "Set Plugins" window. And if some-when I will need to use an image, I would be interested in knowing how to adapt it to needed size (small in results, large in settings).
The plugin settings page is a placeholder - it uses the icon property of the row (which generates a very small icon image from the supplied QImage) while the results window uses a custom delegate and renders the QImage at a larger size. The rendering of the plugin + sink name is also not ideal and needs to be changed.

I'll get round to making the plugin settings window use a custom delegate + renderer, but I thought people might like some working, if cosmetically not optimum, code before I headed off for Christmas
 

The Following User Says Thank You to lardman For This Useful Post:
Posts: 5 | Thanked: 6 times | Joined on Oct 2010
#692
Hi,

I've been using mbarcode for a few weeks now, mostly for fun and to show off the phone, as I did not have a real use for it. It works really well, though.

Recently I tidied up my library and thought that it would be a good idea to index it, since I found out that I'd bought a few books twice, after thinking that I'd lost my original copy (yes, I'm that well organized). So basically I wrote a pretty straightforward Perl script to read a list of ISBNs, ask Amazon for metadata on the books, and write the metadata to a database. Now I just need a way to get the ISBNs without typing them one by one.

This is where I finally have a real use for a barcode reader. I tried zbarcam but it dies immediately on my N900 ("system error: queuing video buffer (VIDIOC_QBUF): Input/output error (5)").

Basically, what I need is a simple plugin for mbarcode that appends the decoded data to a text file. If I understand correctly, if only one plugin is activated, it is possible to make it run immediately without going through the "results" window.

Since I have a) little C++ skills and absolutely no Qt experience, and b) not managed to make the Python example show up in the plugins list, and even less Python experience than C++... I guess I'm requesting a feature?

(Boy, I hate writing feature request posts, it makes me feel really unappreciative of the existing functionality.)
 

The Following User Says Thank You to fga For This Useful Post:
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#693
Originally Posted by fga View Post
Hi,

I've been using mbarcode for a few weeks now, mostly for fun and to show off the phone, as I did not have a real use for it. It works really well, though.

Recently I tidied up my library and thought that it would be a good idea to index it, since I found out that I'd bought a few books twice, after thinking that I'd lost my original copy (yes, I'm that well organized). So basically I wrote a pretty straightforward Perl script to read a list of ISBNs, ask Amazon for metadata on the books, and write the metadata to a database. Now I just need a way to get the ISBNs without typing them one by one.

This is where I finally have a real use for a barcode reader. I tried zbarcam but it dies immediately on my N900 ("system error: queuing video buffer (VIDIOC_QBUF): Input/output error (5)").

Basically, what I need is a simple plugin for mbarcode that appends the decoded data to a text file. If I understand correctly, if only one plugin is activated, it is possible to make it run immediately without going through the "results" window.

Since I have a) little C++ skills and absolutely no Qt experience, and b) not managed to make the Python example show up in the plugins list, and even less Python experience than C++... I guess I'm requesting a feature?

(Boy, I hate writing feature request posts, it makes me feel really unappreciative of the existing functionality.)
This is exactly the reason I started writing mBarcode, then I got a bit distracted along the way with feature-creep!

I've been doing some hacking on a Python app to do this, but it's no-where near finished (itemdb in Garage, and in fact I need to push some updates to that).

In the short term, let's see if we can get your Python save-to-a-text-file code working - can you create a tarball and attach it (.py is not allowed as an extension for attachments) or copy and paste the code into a reply? Also try starting mBarcode from the terminal and see what the error is (it will tell you why the plugin didn't load).
 

The Following User Says Thank You to lardman For This Useful Post:
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#694
Originally Posted by fga View Post
Since I have ... b) not managed to make the Python example show up in the plugins list, and even less Python experience than C++...
Ah I misread, my apologies. Well the comment about running mBarcode from the command line still stands, and I'll scribble together something to append barcodes to a text file for you.
 

The Following User Says Thank You to lardman For This Useful Post:
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#695
I've not tried this, but it should do basically what you want, hopefully!

Touchscreen seems to have just failed on my N900 so I can't actually test it.
Attached Files
File Type: txt isbn_saver.py.txt (3.1 KB, 135 views)
 

The Following 2 Users Say Thank You to lardman For This Useful Post:
Posts: 5 | Thanked: 6 times | Joined on Oct 2010
#696
Originally Posted by lardman View Post
Also try starting mBarcode from the terminal and see what the error is (it will tell you why the plugin didn't load).
I had tried that already, actually, but it didn't print anything special:

Code:
Created scanner
Enabled scanner
Created image
QMetaObject::connectSlotsByName: No matching signal for on_btnReducePriority_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_btnIncreasePriority_clicked()
I haven't found any documentation on the repository about where to install Python plugins; somewhere earlier in the thread I think I remember reading something about copying them to /usr/share/mbarcode/plugins/pythonqt. Since my earlier post here I found out that there was a /opt/maemo/usr/share/etc hierarchy as well (the result of an optification later in the development?), but copying the plugin there as well didn't help. Still no messages on the console. What am I doing wrong?

I do have the python wrapper plugin installed, by the way (unless the version currently in the repositories doesn't work, or is that the same as SVN head? I am not familiar with garage either...)

(edit) I should add my thanks for replying this fast on New Year's Eve, and even producing code for a random user!

Last edited by fga; 2010-12-31 at 18:53. Reason: happy new year
 

The Following User Says Thank You to fga For This Useful Post:
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#697
It should be placed in /usr/share/mbarcode/plugins/pythonqt/ part of the app is optified, and eventually that directory will be a symlink to the /opt stuff.

Curious that you don't see any output in the terminal.

My N900 has suddenly started working again (thank goodness!) so I'll have a look myself and get back to you.
 

The Following User Says Thank You to lardman For This Useful Post:
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#698
Right, 'twas my fault. I've just pushed updated versions of mBarcode and the pythonqtwrapper plugin to Extras-devel. These should provide more debugging output now. In addition the problem was that I'd not added a dep on libshiboken1.0 for the pythonqtplugin (though I have now).

I've also attached a fixed version of the Python code (you need to install python-pyside manually - normally this would be a dep of this python code's deb file. This is quite a large install, but it goes to /opt, so shouldn't be a problem. OTOH as it doesn't actually use PySide you could well be able to remove that import & superclass references (to QtGui.QWidget iirc) and see if it works anyway.)

In any case let me know how you get on, and a Happy New Year to everyone
Attached Files
File Type: txt isbn_saver.py.txt (3.1 KB, 194 views)

Last edited by lardman; 2010-12-31 at 22:23.
 

The Following 2 Users Say Thank You to lardman For This Useful Post:
Posts: 5 | Thanked: 6 times | Joined on Oct 2010
#699
OK, it works better now. I installed python-pyside, updated mbarcode and plugins. The plugin appears in the list and outputs correctly to barcodes.txt, looks good.

The problem now is that the Results page appears even if the "Auto-run plugin" option is checked; not only this makes the workflow difficult (ideally you'd just run the camera over the barcodes with no other interaction necessary), but there is nothing to interact with on the page (I disabled all plugins except the isbn saver), it just stays there and doesn't respond to the back button either, so it needs to killed from the window switcher.

Attached is the stdout and stderr from mbarcode while it's started up, scans a barcode, looks for plugins, does its thing with the barcode, displays results and is killed from the window switcher.

Happy new year to all.
Attached Files
File Type: txt mbarcode-output.txt (2.9 KB, 123 views)
 

The Following 2 Users Say Thank You to fga For This Useful Post:
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#700
Right, fixed that problem and a few others, I'm currently trying to push to Extras-devel, but the autobuilder web page doesn't seem to be responding.

Hopefully just a temporary glitch, I'll try again this afternoon. In the meantime I've attached the updated deb here.
Attached Files
File Type: deb mbarcode_0.3.0-2_armel.deb (105.4 KB, 104 views)
 

The Following 2 Users Say Thank You to lardman For This Useful Post:
Reply

Tags
barcode, camera, mbarcode


 
Forum Jump


All times are GMT. The time now is 22:29.