OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => User Request for Applications => Topic started by: fleegle on December 08, 2005, 11:11:49 am

Title: Foot-operated Zaurus Counter
Post by: fleegle on December 08, 2005, 11:11:49 am
I need a simple counter program. The idea would be to have three rows of up/down counters with an up and down button for each row, plus a reset to zero button.

I, um, want to use it to count rows and increases/decreases when knitting and I don't want to stop and hit the space bar with my hand. I want to do it with my toe.

This seems like it would be really simple. I did something similar in VBA, but I am helpless in the face of Linux. Anybody out there to help me?
Title: Foot-operated Zaurus Counter
Post by: lardman on December 08, 2005, 11:55:54 am
What kind of interface do you have on your toe-switch?

Si
Title: Foot-operated Zaurus Counter
Post by: tombraider on December 08, 2005, 12:12:16 pm
Hee, hee,  I'm a knitter also and have wanted a counter like that for stitches and rows for awhile.  Never thought of a "toe counter" though.  :-)


Quote
I need a simple counter program. The idea would be to have three rows of up/down counters with an up and down button for each row, plus a reset to zero button.

I, um, want to use it to count rows and increases/decreases when knitting and I don't want to stop and hit the space bar with my hand. I want to do it with my toe.

This seems like it would be really simple. I did something similar in VBA, but I am helpless in the face of Linux. Anybody out there to help me?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106468\"][{POST_SNAPBACK}][/a][/div]
Title: Foot-operated Zaurus Counter
Post by: fleegle on December 09, 2005, 05:23:00 am
It's a toenail interface.  

There are actually a lot of knitters out there who want something like this. It's saleable! Especially if you include a simple routine for calculating even increases and decreases. I can work that out for you in, say Basic or, ah, Fortran code.

And if you coded it in a language that can be ported to to Win CE, you really would have a good product for sale. Simple, but we all want one!

Quote
What kind of interface do you have on your toe-switch?

Si
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106478\"][{POST_SNAPBACK}][/a][/div]
Title: Foot-operated Zaurus Counter
Post by: lardman on December 09, 2005, 06:36:47 am
I don't want to write one but I was going to tell you how easy it would be to interface the switch hardware with the Zaurus - I imagine there are a couple of possibilities for it: serial, usb, parallel, or some other digital input via a custom card.

If you've already written something in VBA it's not going to be all that difficult to write something for the Zaurus (different languages etc., but not that hard to learn).


Si
Title: Foot-operated Zaurus Counter
Post by: craigtyson on December 09, 2005, 07:11:29 am
What you realy need is a set of bluetooth needles which can tell the Z stich count, avarage no of stiches per min, calories used, heart rate of knitter.......


I think I need some profesional help.............................
Title: Foot-operated Zaurus Counter
Post by: fleegle on December 10, 2005, 11:21:58 am
Well, I took a look at some Zaurus development tools, and I can't get a clue. Is is possible to develop something on the PC and then having a kindhearted person convert it to whatever is needed on the Z? All I want is a simple counter....like six little buttons that go up, down, and reset. It would seem that for the Z, you have to hand-code the buttons--good grief! I haven't done that since 1970. Can you point me to the simplest way to proceed? I can get all the textbooks, as I am a compositor for a computer book company.

The bluetooth needles are a great idea! Too bad the Z doesn't have bluetooth either. sigh.

Quote
I don't want to write one but I was going to tell you how easy it would be to interface the switch hardware with the Zaurus - I imagine there are a couple of possibilities for it: serial, usb, parallel, or some other digital input via a custom card.

If you've already written something in VBA it's not going to be all that difficult to write something for the Zaurus (different languages etc., but not that hard to learn).


Si
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106554\"][{POST_SNAPBACK}][/a][/div]
Title: Foot-operated Zaurus Counter
Post by: jfv on December 10, 2005, 12:36:19 pm
I think people are confused about what you want to do. Do you mean you want the buttons on the screen so you can tap them with your toe with the Zaurus on the floor? Seems hard to believe but nothing else seems to make sense with your posts. Some of the previous replies were wandering if you had some pedal gadget that you wanted to interface with the Zaurus. By the way, which Zaurus? Which ROM? I'd suggest you look into Python, and you can Kopsis's Python setup for the Zaurus (search the forums or look in the Python section).

I'll add below some code I found on the web that implements two buttons, one up one down.
All you need to do is repeat three times, maybe.

Felipe

Example qupdown.py, module Y206 (Python)
Altering a label as a result of button presses - Python Qt

Code: [Select]
import sys
from qt import *

class MainWindow(QMainWindow):
    val = 17
    def __init__(self, *args):
        apply(QMainWindow.__init__, (self, ) + args)

        self.vlayout = QHBoxLayout(self, 10, 5)

        self.labelValue = QLabel(str(MainWindow.val), self)
        self.down = QPushButton("Lower", self)
        self.up = QPushButton("Higher", self)

        self.vlayout.addWidget(self.down)
        self.vlayout.addWidget(self.labelValue)
        self.vlayout.addWidget(self.up)

        self.connect(self.down, SIGNAL("clicked()"), self.reduce)
        self.connect(self.up, SIGNAL("clicked()"), self.increase)  
        
    def reduce(self):
        MainWindow.val -= 1
        self.setval()

    def increase(self):
        MainWindow.val += 1
        self.setval()

    def setval(self):
        self.labelValue.setText(str(MainWindow.val))

def main(args):
    app=QApplication(args)
    win=MainWindow()
    win.show()
    app.connect(app, SIGNAL("lastWindowClosed()")
                , app
                , SLOT("quit()")
                )
    app.exec_loop()

if __name__=="__main__":
        main(sys.argv)
Title: Foot-operated Zaurus Counter
Post by: fleegle on December 11, 2005, 05:38:10 am
Yes-- All I want are buttons in the screen that I can tap with my toe. You can see what I mean here: http://www.palmsource.com/interests/knitting/ (http://www.palmsource.com/interests/knitting/). Scroll down to the Countable program. I am tempted to buy an old Palm just to have this program, but I love my Z.

I have an 860 with the original Sharp rom and semi-English menus.

Thanks for the snippet, but I have no idea what to do with it to make it into a real program.

Quote
I think people are confused about what you want to do. Do you mean you want the buttons on the screen so you can tap them with your toe with the Zaurus on the floor? Seems hard to believe but nothing else seems to make sense with your posts. Some of the previous replies were wandering if you had some pedal gadget that you wanted to interface with the Zaurus. By the way, which Zaurus? Which ROM? I'd suggest you look into Python, and you can Kopsis's Python setup for the Zaurus (search the forums or look in the Python section).

I'll add below some code I found on the web that implements two buttons, one up one down.
All you need to do is repeat three times, maybe.

Felipe

Example qupdown.py, module Y206 (Python)
Altering a label as a result of button presses - Python Qt

Code: [Select]
import sys
from qt import *

class MainWindow(QMainWindow):
    val = 17
    def __init__(self, *args):
        apply(QMainWindow.__init__, (self, ) + args)

        self.vlayout = QHBoxLayout(self, 10, 5)

        self.labelValue = QLabel(str(MainWin


dow.val), self)
        self.down = QPushButton("Lower", self)
        self.up = QPushButton("Higher", self)

        self.vlayout.addWidget(self.down)
        self.vlayout.addWidget(self.labelValue)
        self.vlayout.addWidget(self.up)

        self.connect(self.down, SIGNAL("clicked()"), self.reduce)
        self.connect(self.up, SIGNAL("clicked()"), self.increase)  
        
    def reduce(self):
        MainWindow.val -= 1
        self.setval()

    def increase(self):
        MainWindow.val += 1
        self.setval()

    def setval(self):
        self.labelValue.setText(str(MainWindow.val))

def main(args):
    app=QApplication(args)
    win=MainWindow()
    win.show()
    app.connect(app, SIGNAL("lastWindowClosed()")
                , app
                , SLOT("quit()")
                )
    app.exec_loop()

if __name__=="__main__":
        main(sys.argv)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106688\"][{POST_SNAPBACK}][/a][/div]
Title: Foot-operated Zaurus Counter
Post by: jfv on December 11, 2005, 10:37:22 am
It is a real, complete program. If you save the code to a file, say qtupdown.py, and you have Python installed (instructions elsewhere as in my previous post), then issuing the command
Code: [Select]
python qtupdown.pyon the command line will run the program.  As I said I found this program on a tutorial somewhere when I was trying to learn Python. I never got very far with Python, so I won't offer to get the program closer to what you wanted, but I'm sure it's not very hard. It might get time consuming adjusting the placement and size of the buttons and so on.

One warning. I noticed one unitended line break on the posted code that came from cutting and pasting. Once that is fixed the program should run as is. Python is an interpreted language so a program is just a text file. No compilation necessary.

Having said that, if a program exists for the Palm, get a cheap second-hand Palm and go for it. At least you will not be putting your Zaurus at risk.

Felipe