maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   mbarcode (https://talk.maemo.org/showthread.php?t=34996)

dragly 2010-05-21 19:22

Re: mbarcode
 
Quote:

Originally Posted by daemonforce (Post 669575)
I hate to sound like a downer(cow?) but I've been trying to hack up the code in mbarcode for a little while due to a launch problem I have with the downloaded package. I'm using camera 3.5 and mbarcode 0.0.8-0 with fair process but I have to manually launch mbarcode via cmdline. Why is it so difficult to make an application shortcut in hildon? I've tried forcing to start with @prefix@/usr/bin/mbarcode and I still can't get anywhere with it.

Program works just fine but the launcher is broken.

You are running an outdated version of mbarcode, so I would suggest that you upgrade to the newest version if your device is an N900. If you are running mbarcode on an earlier Nokia tablet I think you'll have to wait until someone (maybe lardman) ports it back first. I don't have any other tablet myself, so I'm unable to do it myself.

edbanger 2010-05-21 21:07

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 669754)
I experienced the same bug too and was hoping noone used that version before I got to fix it :-p It is the default search providers that have been overwritten with an URL containing the first barcode you searched for.

To fix this you just have to update to the newest version of the plugin and remove the config file by running this command in terminal:
Code:

rm /home/user/.config/mbarcode/webrequest-plugin.conf
The next time you run the application everything should be as it is supposed to. :)

And it is, indeed, working flawlessly now!
Thanks a bunch, and do well on your exams (I'm sorry I might have kept you away from your books.)

dragly 2010-05-21 23:43

Re: mbarcode
 
Quote:

Originally Posted by edbanger (Post 669876)
And it is, indeed, working flawlessly now!
Thanks a bunch, and do well on your exams (I'm sorry I might have kept you away from your books.)

Thanks! And no worries; it is just fun to do something programming when you get tired of reading - especially when it turns out right :)

dragly 2010-05-24 12:17

Re: mbarcode
 
I got an idea to call refocus on a time interval instead of only when the "Refocus" button is clicked. I have updated the newest version of mbarcode with this, and would really like to hear if this works as expected for everybody ;) If it does, I believe we could remove the 'Refocus' button completely.

edbanger 2010-05-24 13:10

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 673152)
I got an idea to call refocus on a time interval instead of only when the "Refocus" button is clicked. I have updated the newest version of mbarcode with this, and would really like to hear if this works as expected for everybody ;) If it does, I believe we could remove the 'Refocus' button completely.

Working perfectly for me here, interval is also well chosen.
For me it doesn't seem I'll need to use the manual refocus again.

Another nice, and user-friendly addition to the app. Thanks Dragly

hopla 2010-05-24 14:34

Re: mbarcode
 
Hi,

Couple of questions about this wonderful app:

* Is there any Python script/plugin integration yet? (from what I could make out by reading this topic, there isn't?)

* If I wanted to integrate a Python script with this program at this moment, what are my options? (someone mentioned DBUS?)

* If there isn't any easy integration yet: wouldn't it be a good idea to provide a simple 'Execute program/script' plugin that just lets you configure (multiple) programs/scripts to be run, with the result of the scan as command line parameter(s)? Each configured program/script would be run when you click on it's button that is show on the 'Results from scan' screen.
This would allow integration with practically anything, no?

* Regarding the latest improvement about refocus: I just installed mbarecode from extras-devel, but the auto refocus feature isn't there. Or is this just uploaded to the garage page, but not the repo?

Hopla

dragly 2010-05-24 14:52

Re: mbarcode
 
Quote:

Originally Posted by hopla (Post 673332)
* Is there any Python script/plugin integration yet? (from what I could make out by reading this topic, there isn't?)
* If I wanted to integrate a Python script with this program at this moment, what are my options? (someone mentioned DBUS?)

It is not ready yet, but we are looking into PythonQt. It seems to be a bit more work than expected to integrate this, but we'll give it a try. For the moment I'm afraid there are no ways to interact with mbarcode other than through C++ Qt plugins.
Quote:

Originally Posted by hopla (Post 673332)
* If there isn't any easy integration yet: wouldn't it be a good idea to provide a simple 'Execute program/script' plugin that just lets you configure (multiple) programs/scripts to be run, with the result of the scan as command line parameter(s)? Each configured program/script would be run when you click on it's button that is show on the 'Results from scan' screen.
This would allow integration with practically anything, no?

This sounds like a really good idea. It should be a simple case of making a plugin similar to the webrequest plugin, and just change the URLs to commands and have the commands run in terminal or something instead of opening the browser. However, I think I'll focus on integrating Python completely first, but a script launcher is a decent alternative.
Quote:

Originally Posted by hopla (Post 673332)
* Regarding the latest improvement about refocus: I just installed mbarecode from extras-devel, but the auto refocus feature isn't there. Or is this just uploaded to the garage page, but not the repo?

There are no new buttons indicating auto focus other than that you will see the image refocusing and the refocus button becoming disabled every 1.5 seconds. The package should be in extras-devel. If it doesn't work you should try to update the package using App Manager and check that the version is 0.1.9. You can check the version of the package if you look at the number next to mbarcode in the uninstall menu in App Manager.

hopla 2010-05-24 15:16

Re: mbarcode
 
Allright, thanks!

The auto refocus feature is working as well now, I didn't have an updated package db when I first installed mbarcode :) It works pretty good, allthough I wouldn't let an epileptic person look at it :p

dragly 2010-05-24 15:25

Re: mbarcode
 
Quote:

Originally Posted by hopla (Post 673379)
Allright, thanks!

The auto refocus feature is working as well now, I didn't have an updated package db when I first installed mbarcode :) It works pretty good, allthough I wouldn't let an epileptic person look at it :p

No, I wouldn't recommend to do that :p I have no idea why the flickering occurs, nor why it is so intense. Maybe it has something to do with the underlying camera libraries? If someone has an idea about how to fix that, please speak up :)

Spyder 2010-05-25 03:19

Re: mbarcode
 
dragly, I'm replying to your post from my thread about the GUI for mBarcode (http://talk.maemo.org/showthread.php?t=48151). I don't have any formal graphic design expertise, but I've been doing web development and advertising on the side for a long time. I threw together my vision for mBarcode, although its not my app so feel free to tear it apart (because I added some extra buttons you don't have in your current design). Thoughts?

http://www.rajivoberoi.com/images/mBarCode.jpg

salle74 2010-05-25 05:13

Re: mbarcode
 
Is it easy to add a search engine? I live in Sweden and it is a site called (http://www.prisjakt.nu/) that is very popular.

dragly 2010-05-25 09:02

Re: mbarcode
 
Yes, that is fairly easy. Just scan a barcode, click Search the Web, click on the window title menu, select Add Custom Provider, type in Prisjakt as name, and http://www.prisjakt.nu/search.php?query=%s as the Address. If barcodes are supported over at Prisjakt it should work.

Spyder 2010-05-25 19:35

Re: mbarcode
 
dragly, dude I'm pretty sure you missed my post! It was on the previous page at the bottom :P

http://talk.maemo.org/showpost.php?p...&postcount=210

dragly 2010-05-25 22:30

Re: mbarcode
 
Quote:

Originally Posted by Spyder (Post 676864)
dragly, dude I'm pretty sure you missed my post! It was on the previous page at the bottom :P

http://talk.maemo.org/showpost.php?p...&postcount=210

Actually, I didn't miss it, but I figured I wouldn't get the time to respond earlier today ;) And that gave me some time to think about your suggestion as well.

First of all I must say that it looks really sexy! The design is neat and clean, yet prettier than the default Maemo look. However, a few things come to mind when I see it, which needs to be discussed:
  1. Should the scanner show up in full screen or in a small widget (like your design and the current)? Some other scanners seem to use full screen with overlayed icons, which looks pretty, but I'm not sure about how it affects the user experience. Others do it the same way as we do. Any thoughts?
  2. I believe the options like "Search Froogle" etc. should show up in a new window like they do now. This makes it easier to maintain a longer list as we get more plugins and choices. The design of the list could use some freshening up, though.
  3. Cramping everything into one window makes it harder to read the text and hit the buttons. I think it is better for the user experience if we divide the process into a few more windows instead.
  4. If we implement a major design change like you have suggested, we'll have to think about how we can make it integrate well with the default Maemo design. This is because I believe most plugin developers don't want to use a lot of time to integrate their plugins into a different mBarcode design. In other words; we should ensure that when we change the GUI-design of the application itself, the plugin developers won't have to make any changes to their code at all.

I've considered to move the options like "Open Image", "Scan" and maybe some other stuff like "History" and "About" to a startup screen. Somewhat like they do in Shop Savvy:
http://blog.mywebgrocer.com/wp-conte...screenshot.jpg
Do you think this would be a good idea?

Anyways, nice work and thanks for the suggestion! I would really like to have you on the team for some design work. Do you design icons as well?

Spyder 2010-05-26 00:25

Re: mbarcode
 
Hey, sorry, I jumped the gun! I saw you respond to another post and figured you missed mine since it was on a previous page.

My thoughts:

1. I feel that fullscreen apps take away from the Maemo experience of multitasking if done improperly. When I'm in a fullscreen app with no multitasking button, if I need to switch to another program I need to press the power button, tap 'phone' and then get to the main UI through the phone interface (like in Brain Party). However, if done right, then it's great, like in Maps, where it still retains the time, back and close, so the user isn't "trapped" in your app.

2. I didn't even notice that search options show up in a different list :o that's a great idea! haha

3. This goes with #2. I agree completely, which also goes back to having a main menu screen like you suggested, which I think is a better way to engage the user and add future options easily, and not tie yourself into "just" scanning barcodes.

I have no experience coding for Maemo, so I design a "dream" interface not knowing if its feasible. But I'd love to help you out where ever I can, just let me know! I do not design icons persay, but I do have a vast collection of free icons that I use in my websites and designs.

tvogel 2010-05-26 11:08

Re: mbarcode
 
@dragly Don't want to threaten your exams, but just in case you do a rebuild, you could switch to building against the Qt 4.6.2 from PR 1.2 instead of the libqt4-maemo5-* packages. Currently makes it necessary to have 4.6.2 installed twice.

dragly 2010-05-26 13:42

Re: mbarcode
 
@tvogel: That's quickly done and the packages are actually already prepared, so no worries about the exams there :)

For the moment I've already uploaded the PR1.2 version of mbarcode, but I didn't get time to build and upload the plugins. I believe I'll get time to do that tonight or tomorrow.

lardman 2010-05-26 15:33

Re: mbarcode
 
Quote:

Originally Posted by hopla (Post 673332)
Hi,

Couple of questions about this wonderful app:

* Is there any Python script/plugin integration yet? (from what I could make out by reading this topic, there isn't?)

* If I wanted to integrate a Python script with this program at this moment, what are my options? (someone mentioned DBUS?)

I'd really like to get the Python stuff in and working so we can open up the app for more plugin developers.

I'll take another look at how we might be able to get it up and running this evening.

The other option was to broadcast DBUS messages when a barcode is found, this was pretty simple in GTK+, not sure about Qt.

lardman 2010-05-26 15:46

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 673389)
No, I wouldn't recommend to do that :p I have no idea why the flickering occurs, nor why it is so intense. Maybe it has something to do with the underlying camera libraries? If someone has an idea about how to fix that, please speak up :)

I'll have a look at this - I originally set the framerate to be quite low as every frame is passed to the decoders. It might be a better bet to drop frames if the decoders are busy (must check and see if I did this!)

dragly 2010-05-26 21:09

Re: mbarcode
 
The new packages that are built against libqt4 in PR1.2 are on their way through the autobuilder now. If everything works as expected they should be ready for download from extras-devel in 10 minutes.

Quote:

Originally Posted by lardman
I'd really like to get the Python stuff in and working so we can open up the app for more plugin developers.

I'll take another look at how we might be able to get it up and running this evening.

The other option was to broadcast DBUS messages when a barcode is found, this was pretty simple in GTK+, not sure about Qt.

Sounds good! I have been looking at PythonQt a bit myself and it seems reasonable that we should be able to make a framework for plugins on top of it. About DBUS messages I think it should be fairly easy to work with those in Qt as well. There is some info about them here: http://doc.qt.nokia.com/4.6//intro-to-dbus.html

But I suggest we go for PythonQt first and DBUS second. With PythonQt we should more easily be able to integrate plugins in the main app.

Quote:

Originally Posted by lardman
I'll have a look at this - I originally set the framerate to be quite low as every frame is passed to the decoders. It might be a better bet to drop frames if the decoders are busy (must check and see if I did this!)

You've talked about it earlier, but I don't remember if you implemented it. Thanks for having a look at it :) You know that pipeline stuff a lot better than I do ;)

tvogel 2010-05-26 22:43

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 680769)
The new packages that are built against libqt4 in PR1.2 are on their way through the autobuilder now. If everything works as expected they should be ready for download from extras-devel in 10 minutes.

Works great, thanks!

Here is a websearch URL for codecheck.info:

Code:

http://www.codecheck.info/mobi/results?text=%s

tvogel 2010-05-26 22:47

Re: mbarcode
 
A nice plugin which comes to my mind would be a metasearch plugin which just queries all (or a user defined subset) of the available web search URLs in parallel and gathers which are actually returning hits.

Not completely trivial because they usually will return very different "no results" pages...

But maybe a keyword indicating an empty result page per search engine might suffice.

lardman 2010-05-27 11:34

Re: mbarcode
 
Ok, so the pipeline is currently running at its native framerate and 640x480 resolution (only the middle of which is used for the scanning/display to allow the user to hold the barcode further from the camera).

Therefore there's probably not much I can fix here re. strobing effects. Are these effects severe? I've not really noticed anything.

I guess improvements to the gst elements might yield better performance still if anyone wants to take a crack at them.

dragly 2010-05-27 12:27

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 682439)
Ok, so the pipeline is currently running at its native framerate and 640x480 resolution (only the middle of which is used for the scanning/display to allow the user to hold the barcode further from the camera).

Therefore there's probably not much I can fix here re. strobing effects. Are these effects severe? I've not really noticed anything.

I guess improvements to the gst elements might yield better performance still if anyone wants to take a crack at them.

I've posted a video showing the artifacts on Flickr:
http://www.flickr.com/photos/dragly/4644741712/
Look for the green/purple flickering in the top of the scanning widget. This video doesn't show what it at times is like when scanning in darker places, where I often get a white strobe.

Since this is only making the scanning look a bit ugly, I don't think we should give this an high priority unless it's an easy fix. ;)

lardman 2010-05-27 19:57

Re: mbarcode
 
hmm, yeah that looks like the autofocus at work (and not finding focus - note how the text keeps going into and out of focus).

Perhaps we should alter the continuous autofocus code so that it tries less often if it fails multiple times...? Either that or we need to implement our own autofocus routines

dragly 2010-05-27 21:19

Re: mbarcode
 
I don't think the artifacts (the green and purple blinking) in the top corners are because of the autofocus. They appeared even before I added the autofocusing. I just got used to them after some time.

The LEDs turning off and on is because of the autofocus, but that doesn't really bother me, because it helps finding barcodes even in the pitch dark (don't know why anyone would do that though :p ).

If we are able to implement our own autofocus that would of course be the best, but in my opinion it works pretty well now. It does at least take much less time to scan a barcode than when I had to click the refocus button earlier.

lardman 2010-05-30 10:12

Re: mbarcode
 
Hmm, it's green and purple things is it, interesting, I'll see if I can spot that.

lamle 2010-06-03 19:21

Re: mbarcode
 
Hi all,
I am developing an application and in my application there is one part that I should search the engine based on its bar code. I examined mbarcode application for N900 in repository and would like to embed it to my application.
I have try this code
https://garage.maemo.org/plugins/scm...=maemo-barcode
It works and I got a plugin installed.
However, sorry for my stupidness but still I could not find out a way to use this plugin in my application.
I think it should be something like:
QRreader reader(myMainApplication);
reader.show();

Any help for sample code please.

lardman 2010-06-03 19:23

Re: mbarcode
 
What about going the other way round and making your application a plugin that runs within mbarcode?

Otherwise, to use the mbarcode implementation in your app, you'll need to setup the GStreamer pipeline and handle the events coming from the libzbar gst decoder element.

lamle 2010-06-03 20:30

Re: mbarcode
 
Hi,
Sorry to hassle but please use this thread not other one :).
My application is quite complicated and mbarcode should be a part of it.
Can you please give me some guidelines how to do it in the second way.
Please help me with this, I have been struggling with it quite a bit but still not much achievement
Can we have codes somewhere?

lardman 2010-06-03 21:12

Re: mbarcode
 
dragly! ;)

There are some example plugins in the repo.

What does your application do?

dragly 2010-06-03 21:26

Re: mbarcode
 
Hmm? Yes? :)

lamle, there is currently no easy way to integrate the backend in mbarcode into an other application since we don't yet have an API made. This is one of the things we'll be looking at in the future, but I guess it's not going to happen very soon. I'm not even sure how such an API would be best made either (DBus? Separate library with access to the camera widget?).

I think the closest you'll get for now is to make a plugin that sends a DBus message to your application from mbarcode (look at Qt Dbus documentation). However, this would make your users have to open up your application alongside mbarcode, which might be tedious.

The other solution is to copy the VideoWidget, BarcodeDetector and decoder classes from mbarcode and implement these statically in your application. mbarcode is open source, after all :) The problem with this solution is that you will have to update your application with changes in mbarcode if you want to stay up to date with the latest bugfixes etc.

I'm afraid there are no code examples of what you are trying as of yet, but we'll probably make it easier to do in the future, when we've figured out how to set up an API for other applications.

lamle 2010-06-04 07:46

Re: mbarcode
 
hi,
Thank you for your reply.
I will try to copy the whole mbarcode project and modify it then.
However, I just wonder what is the use of those plugins such as https://garage.maemo.org/plugins/scm...=maemo-barcode
if I cannot embed it in other application???

tvogel 2010-06-04 08:02

Re: mbarcode
 
Well, it's just useful for mbarcode itself. It's an extensible interface for postprocessing scanned data. The qrcode plugin will process data scanned from a QR barcode. Pretty self-explanatory if you read the code.

If you want to process that data in another way, just provide another plugin.

What license is your project under?

lardman 2010-06-04 08:59

Re: mbarcode
 
lamle, what are you actually trying to do in your application? That's why I suggested making your app a plugin that runs within mBarcode.

dragly 2010-06-04 09:28

Re: mbarcode
 
Quote:

Originally Posted by tvogel (Post 699090)
What license is your project under?

That's a good point I forgot to mention;

mBarcode is licensed with the GPL license, meaning that you should release your application with the same (or compatible) license if you copy code from mBarcode. In other words, you should make your application open source as well, if it is not already GPL-licensed.

You don't have to worry about this before you release/distribute your application, however :) While developing before distribution you don't have to release the source code.

I hope this is not problematic for you, but if it is, just give us a heads up and I'm sure we could figure something out.

lamle 2010-06-04 11:44

Re: mbarcode
 
Hi,
Thank you for your reply.
I am doing this as my thesis so license is not my concern right now. I just need it to work.
My idea is to implement a nice search function for my application. User do not need to type anything but scan the barcode of the device or engine, the application will read the code and display relevant information of the engine. My pursuit is to use stacked window, when I push one button, it will open mbarcode window, after I have scanned the code and get the result, mbarcode window will close and return the main screen with the updated information of the engine.
I am trying to build that mbarcode application in my computer but it seems to have some unmet dependencies.
Can you pls help me where can I have the include for those gboolean, gchar or guint?????
I am just newbie in this environment so your help is really precious for me.
By the way, this PR1.2 is working great now.:)

lardman 2010-06-04 12:07

Re: mbarcode
 
Quote:

Originally Posted by lamle (Post 699396)
My idea is to implement a nice search function for my application. User do not need to type anything but scan the barcode of the device or engine, the application will read the code and display relevant information of the engine.

Hmm, that sounds interesting. What types of engines are we talking here? Many years ago I used to do stock taking holiday work for a couple of car dealerships. I wrote a program on my Psion 3a so that I could type the barcode number into the device + location and it would collate the info at the end of the day so I could keep the running db in sync (I wrote that system too).

Barcode readers were far too much money back then, but it would be interesting to go back and do it using camera + barcode recognition.

Anyway I digress, but basically if you tell us in more detail what you're doing, you may get people interested and willing to help.

On a more technical note, what type of barcode are we talking about here?

Quote:

Originally Posted by lamle (Post 699396)
My pursuit is to use stacked window, when I push one button, it will open mbarcode window, after I have scanned the code and get the result, mbarcode window will close and return the main screen with the updated information of the engine.

My feeling is that this would work quite well as a plugin to mBarcode, but if you really want a standalone app then fair enough.


Quote:

Originally Posted by lamle (Post 699396)
I am trying to build that mbarcode application in my computer but it seems to have some unmet dependencies.
Can you pls help me where can I have the include for those gboolean, gchar or guint?????

glib...

Quote:

Originally Posted by lamle (Post 699396)
I am just newbie in this environment so your help is really precious for me.

Which is again why I thought writing a plugin for mbarcode might make your life easier. There's worse ahead than working out what glib is don't worry ;)

lamle 2010-06-04 13:44

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 699436)
On a more technical note, what type of barcode are we talking about here?

barcode or QR code are both ok.

Quote:

Originally Posted by lardman (Post 699436)
My feeling is that this would work quite well as a plugin to mBarcode, but if you really want a standalone app then fair enough.
Which is again why I thought writing a plugin for mbarcode might make your life easier. There's worse ahead than working out what glib is don't worry ;)

You are right definitely. I am sure that I have include<glib-2.0/glib.h> in the header and in .pro file also. I dont know why the application cries about hundreds of error and I cant even find where is the log file of esbox.
error.txt

Can you explain a little bit about your idea implementing plugin for mbarcode? I really dont know how to achieve that yet.

dragly 2010-06-04 14:00

Re: mbarcode
 
Quote:

Originally Posted by lamle (Post 699566)
barcode or QR code are both ok.
You are right definitely. I am sure that I have include<glib-2.0/glib.h> in the header and in .pro file also. I dont know why the application cries about hundreds of error and I cant even find where is the log file of esbox.
error.txt

Can you explain a little bit about your idea implementing plugin for mbarcode? I really dont know how to achieve that yet.

It seems like your error log has been cut off. I'm suspecting that you are missing some libraries and that the error log is mentioning the missing headers in the beginning. If you look at the control file in our debian folder, you'll find all the libraries it depends on at build (some of them are needless, but we've not yet cleaned that list up). The library packages should be these:
Code:

debhelper (>= 5), libzbar-dev, libdmtx-dev, gstreamer0.10-plugins-bad-dev | maemo-version (<5.0), libconic0-dev,
libgstreamer0.10-dev, libosso-abook-dev | maemo-version (<5.0), libosso-dev, libgtk2.0-dev,
libgconf2-dev, libglib2.0-dev, libebook-dev | maemo-version (<5.0), libgstreamer-plugins-base0.10-dev,
libcurl3-dev, mce-dev | maemo-version (<5.0), libmodest-dbus-client-dev, libhildonfm2-dev,
libqt4-dev

I believe running "apt-get install ..." with that list would do the trick (although you might have to run them without the paranthesis and | signs).

To develop a plugin you are probably best off at the moment by starting with the webrequest or QR-code plugin and modify parts of that code. You'll need the mbarcode-dev package to build the plugins. After building you put the plugin into /usr/share/mbarcode/plugins/ on your device.

I'm going to write a guide on writing plugins soon, but I'm afraid I don't have time to do that right now.


All times are GMT. The time now is 08:47.

vBulletin® Version 3.8.8