rlsj
Posts: 36
Joined: Sun May 31, 2015 12:54 am

A New Flowcharting Program

Wed Jan 11, 2017 9:23 pm

A couple of points:

1. I need a flowcharting program for complex design, one with such simple inputs it can be arguably fast as pencil and paper -- but of course far more legible.

2. Dia immediately throws a segmentation fault as soon as I start it up on my Raspberry-Pi 2B, and no one seems interested in finding out why, so I can't determine if it meets my second objective of simplicity.

3. Therefore I wrote my own. It works well on the Pi, outputting to a 1920x1080 display and an HP printer, and demonstrates the Pi's incredible speed (when holding down an arrow key to adjust the position of a large selection). It's called "floch." Yeah, I know, but that name lets you recall what it's supposed to do a few months later.

4. I'd like to offer it gratis to the programming community, especially Pi users. I can supply the binary if you have a Pi, or the C source code plus makefile to anyone else. It needs only standard X-Windows plus the Cairo "toy font."

My problem is that I don't know how to release it. I'll forward it by email attachment to anyone who supplies an address, although I gather this method is frowned upon. Can someone advise me of a more approved way?

--rLsj
Last edited by rlsj on Sat Jan 14, 2017 7:40 pm, edited 1 time in total.

User avatar
dasmanul
Posts: 502
Joined: Wed Sep 30, 2015 10:20 am
Location: Frankfurt, Germany

Re: A New Flowcharting Program

Wed Jan 11, 2017 9:28 pm

Open an account on one of the popular source code hosting sites like Bitbucket or Github and upload your code there.

Oh, and I'd be interested to see a few screenshots of your program.

User avatar
buja
Posts: 496
Joined: Wed Dec 31, 2014 8:21 am
Location: Netherlands

Re: A New Flowcharting Program

Wed Jan 11, 2017 10:13 pm

This is interesting! I would like to have a look at this program.

By the way, I also found Dia having problems on the Pi with Raspbian (Wheezy and Jessie). It must have been a problem with LXDE, because it ran fine with Ubuntu Mate and with the new PIXEL theme (and on a PC I never experienced any problems with it).

rlsj
Posts: 36
Joined: Sun May 31, 2015 12:54 am

Re: A New Flowcharting Program

Wed Jan 11, 2017 10:37 pm

leftmous.png
leftmous.png (49.7 KiB) Viewed 4088 times
catrar.png
catrar.png (40.61 KiB) Viewed 4088 times
Thank you. I'll investigate Bitbucket and Github later. In the meantime here are a couple screenshots.

--rLsj

rlsj
Posts: 36
Joined: Sun May 31, 2015 12:54 am

Re: A New Flowcharting Program

Thu Jan 12, 2017 8:31 pm

Github. Sigh. I have my own version controls and have not been much of a joiner since "object oriented" rituals took over coding in the Eighties. All I want to do is distribute floch to Pi users who want it. After joining Github (nevermind Bitbucket) with an admittedly cursory review, I find no indication of how they can help me distribute it.

So I've created an email account, [email protected], just to distribute floch. If you want a copy, email me there and say whether the Pi binary will do or if you need the whole source. No charge -- although, this being the equivalent of a beta release, I would like notification of bugs.

--rLsj

User avatar
scruss
Posts: 2224
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: A New Flowcharting Program

Thu Jan 12, 2017 8:55 pm

That's rather pretty.

uploading source to github is fairly easy:
  1. register
  2. create a new repository (under the + sign): give it a name, make sure it's public, then click "Create Repository"
  3. Click on the "Upload files" button, then you can drag all of your source files onto the browser.
  4. Click on "Commit changes"
  5. Send out the link.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
ab1jx
Posts: 867
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: A New Flowcharting Program

Mon Jan 30, 2017 11:45 pm

I like floch, not that I've begun to learn all the keystrokes. I printed out the F1 screen and hung it beside me on the wall. I'm impressed that you went to the effort to use C and raw xlib, I was expecting some mess written in Python or something like that. I frequently write C that writes into an array which becomes raster, then output to jpeg or png by calling the libraries, but so far I've never drawn pixels directly on the screen. I have PDF versions of the original X books, just never quite made the connection. A nice working example to study.

I don't suppose you're working on documentation or anything? Keystrokes are one thing, what I've been having to figure out by experiment are concepts like containment and binding objects together. I did manage to crash it once by moving a big convoluted line when I had a bunch of other programs open, just fooling around.

A (probably) simple feature request: I like how the arrow keys can move a selected object a pixel at a time, what if you define shift | ctrl | alt arrows to move 10 or 16 pixels at a time?

I had to build from source, your binary was trying to call an older version of some library than I have installed. I probably could have symlinked my way out of it but just rebuilding worked fine. Static linking a binary might work too.

rlsj
Posts: 36
Joined: Sun May 31, 2015 12:54 am

Re: A New Flowcharting Program

Tue Jan 31, 2017 1:06 am

To ab1jx:

Thank you for the appreciation of floch!

Note that the F1 screen is included in the "sumuser.txt" file, which attempts to be a summary user's guide. I agree that a lot more user documentation could and should be supplied.

As to the choice of C and X-Windows (plus the Cairo "toy text" stuff), I started out planning to use higher level approaches because I needed the floch capability _fast_, but found as usual that turgid language and assumptions made my learning curve worse than writing the whole thing in C, which I've been using since ~1980. And I don't apologize for the goto's! They solve many loop control problems.

floch does not bind objects together. I deliberately invoked the KISS principle in floch design. You can select multiple objects for move, copy or delete functions by means of the "gather" (g) key.

Yes, adding 5 or 10 pixel shifts to the arrow keys could be had simply via Ctrl+arrows. I'll do that with the next iteration, along with multiple undo's. When or if.

I am concerned about bugs and will respond quickly to reports of them, if enough description is supplied to replicate them.

Thank you again for your report.

--rLsj

User avatar
ab1jx
Posts: 867
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: A New Flowcharting Program

Tue Jan 31, 2017 2:47 pm

Hmm, I probably didn't do this correctly but I started a small vertical line in a blank document, deselected it, reselected it again by clicking on it, then tried to move it with a right arrow key. I wasn't near an edge or anything. Crash. I was running it through GDB at a command line so I copied this off my screen:

Code: Select all

Type "apropos word" to search for commands related to "word"...
Reading symbols from floch...done.
/usr/programs/c/tempstuff/flowcharting/test1: No such file or directory.
(gdb) run
Starting program: /usr/local/bin/floch 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00012c14 in mdial (re1=0x1e030 "Okay", re2=0x0, nl=2, 
    labl1=0x1e038 "Must first", labl2=0x1e044 "select segment", labl3=0x0)
    at direxw.c:326
326                     if (i!=(*re2|0x20)) goto geuin;
(gdb) backtrace
#0  0x00012c14 in mdial (re1=0x1e030 "Okay", re2=0x0, nl=2, 
    labl1=0x1e038 "Must first", labl2=0x1e044 "select segment", labl3=0x0)
    at direxw.c:326
#1  0x0001c96c in chapark (ky=65363, ip=0x761bf008) at sctrlis.c:217
#2  0x00017674 in hankey (ky=65363, mx=292, my=175) at keyboard.c:223
#3  0x000117d8 in main (argc=1, argv=0x7efff694) at mfloc.c:97
Sorry, I don't have a coredump file. I haven't done a lot of debugging other than in Borland Delphi but it almost looks like part of the error handler had the segfault, not looking at the code.

Gosubs, I hadn't noticed them. I learned C about 1993, Pascal about 1985, BASIC about 1968. It rarely occurs to me to use one in C, I'd have to look up how. My C professor said never let lines in your flowchart cross each other, maybe that has something to do with it. Or I write C like I used to write Pascal. Flowcharting was required in all the programing courses I took, now I only use it when I write myself into a mess. I think I used to try to use Smartdraw https://www.smartdraw.com/ but mostly pencil and paper (and eraser).

I did this flowchart about a week ago in Libre Office Draw. I'm reading temperature data from an Oregon Scientific outdoor temperature sensor with rtl_433 and redirecting the output into a text file. This parses the file months later. Every few lines there's a time/date line, a few lines later there's a temperature, the rest I ignore but this subroutine only sees a line at a time as read by fgets(). Goodtime is a global flag variable set when strptime() of the incoming ASCII date/time doesn't return a NULL and the temperature sensor model is correct. When I read a temperature and goodtime is set I keep both. Gosubs might have worked.

Anyway the reason I was trying to move stuff in my flowchart is because sometimes you run out of room in one part of a page. I'd make the distinction between production flowcharting and presentation flowcharting. I'm looking for production flowcharting because I'm retired and mostly have no need of presentations. I made LO Draw work even though it does a zillion irrelevant things but I had to move things a few times. This was my 2nd or 3rd version of this subroutine, just trying to write it cold got me a mess.

Documentation, well, it's a work in progress. That's a perfectly good reason, but trying to look quickly at the C spread over several files it's hard to figure out how to run it. The only way I found to open an input file was to do it from the starting command line for instance. It seems from the F1 info that i should do it, but nothing happens. Maybe you haven't written a file select dialog box yet, I'd probably put that off. After I learned C I taught myself 8086 assembly, then I wanted rewrite everything in that, I was building libraries of reusable stuff. File select is a good project unto itself.

Oh, I was thinking maybe 16x as a shifted multiplier because you could shift left 4 bits. Or store choices like that in an rc file. Allocating a fixed megabyte may bite you too, that would make me nervous. These days a whole million bytes is smaller than many web pages. Nice and small, I like that.

You must have cured your gosubs, grepping I can't find one.
Attachments
tempflow.gif
Handle 1 line of incoming ASCII
tempflow.gif (46.08 KiB) Viewed 3340 times

rlsj
Posts: 36
Joined: Sun May 31, 2015 12:54 am

Re: A New Flowcharting Program

Thu Feb 09, 2017 6:06 pm

Here, below, is a another example of floch capability, an actual working flowchart in support of my current project.

To those who are trying floch out:
Because I'm working with it, I'm constantly updating floch to fix bugs, relieve awkwardnesses and add desirable features. From now on I'll notify you by email when an update is available but I won't automatically send you the ZIP unless you request it by return email.

--rLsj
[email protected]
wia.png
wia.png (53.43 KiB) Viewed 3091 times

User avatar
ab1jx
Posts: 867
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: A New Flowcharting Program

Thu Mar 14, 2019 1:37 pm

My new idea: make a library of flowchart symbols for gschem and use that.
export1.png
export1.png (12.98 KiB) Viewed 872 times
I was working on this schematic last night and it occurred to me that's what I'm looking for in a flowchart program. The red dots are unused attachment points. Put your mouse cursor over one and hit n (net) and you start drawing a line. Click somewhere else and it becomes a waypoint in the line, hit escape to stop drawing the line. Once the attachment point has been connected to something it isn't red anymore. The N.I. input on pin 5 isn't right, I missed.

The best part is that the program knows about objects and attachment. As a test, I clicked on the lm723 and dragged it up a ways. All the lines stay attached and just do this rubberbanding thing. You can click on something to select it and drag it or change attributes, it becomes the current object just as if it were new. I had used this for schematics a few years ago and it was very quick to pick it up again, almost like a pencil and paper.

And the objects, lines or nets are stored in a file like this:

Code: Select all

v 20130925 2
C 40000 40000 0 0 0 title-B.sym
C 42500 45900 1 0 0 lm723-1.sym
{
T 42800 49300 5 10 0 0 0 0 1
device=LM723
T 42800 48900 5 10 1 1 0 0 1
refdes=U?
T 42800 49700 5 10 0 0 0 0 1
footprint=DIP14
}
C 40900 47700 1 270 0 pot-bourns.sym
{
T 41800 46900 5 10 0 0 270 0 1
device=VARIABLE_RESISTOR
T 41300 47100 5 10 1 1 270 0 1
refdes=R?
}
C 41300 47600 1 0 0 resistor-1.sym
{
T 41600 48000 5 10 0 0 0 0 1
device=RESISTOR
T 41500 47900 5 10 1 1 0 0 1
refdes=R?
}
C 41100 45700 1 90 0 resistor-1.sym
{
T 40700 46000 5 10 0 0 90 0 1
device=RESISTOR
T 40800 45900 5 10 1 1 90 0 1
refdes=R?
}
C 40800 45100 1 0 0 ground.sym
C 43500 45300 1 0 0 ground.sym
C 46200 45300 1 0 0 ground.sym
C 46500 45900 1 90 0 resistor-1.sym
{
T 46100 46200 5 10 0 0 90 0 1
device=RESISTOR
T 46200 46100 5 10 1 1 90 0 1
refdes=R?
T 46500 45900 5 10 1 1 0 0 1
value=0.1 ohm
}
C 46200 48000 1 270 0 led-1.sym
{
T 46800 47200 5 10 0 0 270 0 1
device=LED
T 46600 47200 5 10 1 1 270 0 1
refdes=LED?
T 47000 47200 5 10 0 0 270 0 1
symversion=0.1
}
N 42500 47700 42200 47700 4
N 41300 47700 41000 47700 4
N 41600 47200 41500 47200 4
N 41000 46600 41000 46800 4
N 41000 45400 41000 45700 4
N 43700 45600 43700 45900 4
N 46400 45900 46400 45600 4
N 46400 47100 46400 46800 4
N 42000 45000 45800 45000 4
N 45800 45000 45800 46900 4
N 45800 46900 46400 46900 4
N 42500 46800 42000 46800 4
N 42000 46800 42000 45000 4
N 42400 46500 41600 46500 4
N 41600 46500 41600 47200 4
T 46700 47600 9 10 1 0 0 0 1
10 watt LED, 1 amp current nominal
I exported it to this png file but I could have printed it. And of course it's open source and already in the debs. The people who maintain it might be interested in the idea of using it for flowcharts and make little optimizations. http://www.gpleda.org/

gedasymbols.org is maintained by DJ Delorie (Does that name ring any bells?)

But rather than make a gschem library of flowchart symbols right now I guess I'm going to try doing flowcharts with Xfig which I've used for years on and off. It does do rubberbanding, it just doesn't call it that. In the collection of buttons in the lower right corner click on Move. Then a new button appears under the drawing called Smart Links. If you choose the Move or Slide button next, whatever you move by grabbing a handle and dragging will get rubberbanded. Smart Links stays on until you turn it off. The difference between Move and Slide is tiny. Xfig by Wikkipedia is 34 years old https://en.wikipedia.org/wiki/Xfig Written in C and Xlib.

Also Dia works fine on this Pi 3B, and even Inkscape. Maybe there's a way to make Libre Office Draw work, I'm not terribly interested. If I can draw lines between objects, then drag one of the objects and have the lines stay attached, that's good enough. I'm forever running out of space in one area of the drawing and needing to rearrange things, having everything stay connected is what I'm looking for.

Return to “Graphics programming”