Wednesday, August 5, 2015

Porting Drawpile to QML - part 2


The previous post dealt with rewriting the playback dialog in QML. Now it's time for the real meat: the canvas.

Tuesday, July 21, 2015

Porting Drawpile to QML - part 1

Drawpile 1.0 is now out and development of version 2.0 is in progress. One of the milestones for version 2.0 is the Qt Quick based canvas.

In version 1.0, the canvas view is implemented as a customized QGraphicsScene/View. It has worked fairly well (surprisingly well, even) but Qt Quick has some irresistible advantages:

  • OpenGL acceleration
  • Declarative UI markup language! (QML)
  • Much easier to port to mobile platforms

Since I had never used QML before, I decided to start by porting the playback dialog over first to get some practice. I chose this part because the dialog is fairly self contained and could therefore be rewritten without touching much else (yay, low coupling!)

Thursday, November 28, 2013

DrawPile 0.7.0 is out

After a several year hiatus, DrawPile 0.7.0 is finally out. Get it from Github or Sourceforge. (Source code only release at this time, sorry.)

The major new features in this release are support for layers and the OpenRaster file format. Check out the Roadmap for what’s to come in future releases.

Friday, December 23, 2011

Diagnosing and fixing a misbehaving axis

Here's a story about a learning experience I had with my CNC3040 router. I'm documenting it here in the hope it helps someone else avoid my mistakes.

One day, in the middle of a light routing job, the X axis suddenly went crazy. It started stuttering and wandering about and generally doing anything else than what it was supposed to do. My first thought was that the driver board had fried. After all, that is something cheap Chinese drivers are known to do. A simple test seemed to confirm my hypothesis. I swapped X and Y axis cables and drove the axis back and forth a little and it seemed to work fine. (Mistake #1: I didn't test the axis at different speeds and accelerations)

So I logged on to eBay and ordered a replacement driver for $10. Once it arrived and I finally got around to replacing it, the axis continued to misbehave. I tested the axes more thoroughly this time and, indeed, the X axis didn't work right with any driver of other drivers either. Frustrated that I had replaced a perfectly good driver (at least now I have a spare), I decided the problem must be in the stepper motor. The erratic behavior (stuttering, random direction changes) seemed consistent with a burnt out phase. So it was back to eBay and ordering a new motor. (Mistake #2: jumping to conclusions without testing. Again.)

You can probably guess what happened when I got the new motor. Nope, it didn't fix the problem. So the problem couldn't be in the computer's parallel port, the breakout board or the drivers and now I had checked that the old motor actually worked fine when connected to the other axes. So what's the only thing left? The wiring. A multimeter revealed that one of the four wires in the stepper power cable was broken. After replacing the cable, the machine worked like new again.

In the end, the whole ordeal was cased by me thinking the wiring was the least likeliest part to fail and not testing that at the beginning. On the plus side, I now have an extra motor and an extra driver, so maybe I'll get around to building that 4th axis someday.

Sunday, November 27, 2011

KQueryBrowser

I'm on roll. Just pushed my latest project, KQueryBrowser, to github. KQB is a database query tool for KDE that uses qt-webkit to format the query results nicely. And yes, I know the name is highly unoriginal and follows that annoying K<something> pattern, but at least it's descriptive.

The motivation for this yet another query tool was simply that I did not like any of the other query tools. The command like clients are nice, but awkward when browsing through very large tables. MySQL query browser was great, but was replaced by MySQL Workbench, which is way too cumbersome when I just want to run some SELECTs. Pgadmin suffers from the same problem. And most of the graphical tools use GTK, which makes them look ugly or (in the case of MySQL workbench) simply broken on KDE.

So here's KQB. Looks pretty on KDE, works with multiple databases and lets you get straight to writing queries.

Sunday, November 6, 2011

Piqs

I just created a new repository on github for yet another hobby project I've been working on: piqs. It's a lightweight image gallery program with advanced tagging capabilities.

It's an experiment in alternative categorization; rather than sorting images into albums/folders, they are all shown in a single flat view, but that view can be filtered with tag queries. Of course, lots of gallery software have tagging capabilities nowadays, but piqs takes it a bit further. You can set up tag aliases and implication rules and something I don't think I've seen elsewhere: tag namespaces. For example, the tag string "[cat, orange], [dog, yellow], backyard" might be applied to a photo of an orange cat and a black dog taken in the backyard. The search string "cat, orange" will return all pictures with a cat and something orange, but the more specific "[cat, orange]" will return pictures of orange cats only. Further, boolean operators are supported: "cat, !dog" will return pictures with cats, but not dogs. "cat, (!dog|[dog,black])" will return pictures with cats and no dogs, unless the dog is black.

This sort of tagging only really starts to pay off once the image collection starts getting very large, so I've tried to design piqs to support huge galleries. So far, I've tried it with about 50000 untagged images and it hasn't choked yet. To help tag every image comprehensively, piqs can infer new tags based on a set of rules. E.g. the rules "cat --> mammal, carnivore", "mammal --> animal" will automatically add the tags "animal", "carnivore" and "mammal" to a picture tagged with "cat".

Saturday, April 23, 2011

Limit switches, part 2

In the previous post, I showed how I added limit switch inputs to my CNC driver box. Now its time to attach the actual switches to the machine.