View unanswered posts | View active topics It is currently Wed May 24, 2017 5:17 am



Reply to topic  [ 8 posts ] 
Proper code/class layout diagram before writing any code. 
Author Message
LQFP144 - On Top Of The Game
User avatar

Joined: Mon Feb 11, 2008 10:52 pm
Posts: 549
Location: Arizona
I would like to refine this diagram/note so that I can use it to create a new loader that utilizes a "comms suite". I used dia to create what I like to call a proposed class sheet.
Image

I don’t necessarily want to create all these classes at once, some have higher priorities than others. I also don’t want to work myself back into a corner making it too much work to add/change some of the underlying classes.

I will use loading an s19 file from the GUI to the Device to iterate though the diagram.

1. the user loads the application creating within it an instance of the Communications/Operations class.

2. the user selects properer comms method and protocol(rs232 and serial monitor)- this could be the default

3. The user clicks connect and depending on their settings the Communications/Operations initializes within it self the a Data-I/0 class with the specified parameters. In this example Data-I/O will use the serial monitor over RS232.

4. The user clicks load and chooses an s19 file from the file menu.

5. The Communications/Operations class receives a file name parameter and a "load" command after which it reads out the file and gets/checks the payload data via the functions in this s19 lib.

6. CO class feeds data to the Data-I/O object who checks for proper acks etc depending on the transport protocol and set options.

7. After the operation has completed the user has the option to reset the device state and disconnect etc.

I think what would be a big help is to define what each part should and should not do before writing any new code.

-sean

_________________
You snooze, you lose!


Wed May 04, 2011 11:19 pm
Profile YIM
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14597
Location: Home sweet home!
I've had a bunch of graphviz tabs open in my browser for months, so I'm dumping them here for the time being.

Gallery of examples: http://graphviz.org/Gallery.php
Live online engine: http://graphviz-dev.appspot.com/

The balance were from the gallery page, trying to choose a style.

Fred.

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Tue Jun 28, 2011 12:08 pm
Profile WWW
LQFP144 - On Top Of The Game
User avatar

Joined: Mon Feb 11, 2008 10:52 pm
Posts: 549
Location: Arizona
awesome thx!

_________________
You snooze, you lose!


Tue Jun 28, 2011 2:21 pm
Profile YIM
1N4001 - Signed up

Joined: Thu May 29, 2008 1:23 am
Posts: 307
Location: Long Beach CA
Thanks for the link!


Tue Jun 28, 2011 2:22 pm
Profile
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14597
Location: Home sweet home!
http://plantuml.sourceforge.net/activity.html

Check out the other types of diagram that they offer. It USES graphviz, so it IS a front end to graphviz, just a text based one. Nice stuff.

Code:
@startuml EMS.Purchasing.png
title EMS Purchasing Flow Chart

(*) --> "Looking for an EMS"

if "FreeEMS?" then
  -->[yes] "Run engine beautifully"
  --> "Have money left over for..."
  if "Hungry?" then
    -->[yes] "Pizza!"
    --> "Be very happy!"
  else
    -->[no] "Beer!"
    --> "Be very happy!"
  endif
  --> "Laugh at MS user"
  --> "Still be very happy!"
  --> "Buy second project car"
  --> "Be happier than ever"
  --> "Retire early"
  --> (*)
else
  -->[no] "Which EMS then?"
  if "Rich?" then
    -->[yes] "Motec"
    --> "Not anymore!"
    --> "Run engine well"
    --> "Put on smug face"
    --> "Desire customisation"
  else
    -->[no] "Get a Link"
    --> "Bros like it"
    --> "Run engine ok"
    --> "Bros get one too"
    --> "Desire customisation"
    --> "Be very sad"
  else
    -->[poor] "MegaSquirt"
    --> "Laugh at Motec user"
    --> "Load new code, again"
    --> "Melt coils"
    --> "Replace coils"
    --> "Bad PID idle"
    --> "Use open loop"
    --> "DB37 Problem"
    --> "Melt piston"
    --> "Be very sad"
  endif
  --> "Be very broke"
  --> (*)
endif

@enduml

Build like so:

Code:
fred@cheetah:~$ java -jar plantuml.jar EMS.Purchasing.plantuml
fred@cheetah:~$ eog EMS.Purchasing.png

Image

I hope you have a sense of humour!

Fred.

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Mon Oct 03, 2011 1:13 am
Profile WWW
LQFP112 - Up with the play
User avatar

Joined: Thu Sep 10, 2009 9:23 am
Posts: 244
Location: Dayton, OH
I use this a lot for diagramming state machines: http://www.umlet.com


Fri Oct 07, 2011 6:05 pm
Profile
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14597
Location: Home sweet home!
Sean and I were talking the other day and agreed that he should do a meta summary of the parts required to build an awesome loader. I didn't want to lose what we had discussed into the depths of time, so here it is!

The issue tracker can act as a guide about needed glue logic and the current spec too. Plus, you know the sort of chunks it has in it to do the work, stuff like:

  • low level serial
  • sm commands
  • fw commands
  • s19 parsing/reading/writing
  • etc

And the glue:

  • micro sequences
  • combos of sequences
  • logic on how to handle different states

Once you've thoroughly done that, with feedback, we can talk about how to assemble the pieces :-)

Fred.

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Wed Nov 02, 2011 4:28 pm
Profile WWW
LQFP144 - On Top Of The Game
User avatar

Joined: Mon Feb 11, 2008 10:52 pm
Posts: 549
Location: Arizona
Selecting previously deselected package umlet.
Unpacking umlet (from .../archives/umlet_10.4-1_all.deb) ...
Processing triggers for menu ...
Processing triggers for man-db ...
Setting up libecj-java (3.5.1-3) ...
Setting up libitext-java (2.1.7-2) ...
Setting up libjlibeps-java (0.1+2-1) ...
Setting up umlet (10.4-1) ...
Processing triggers for menu ...

_________________
You snooze, you lose!


Wed Nov 02, 2011 4:50 pm
Profile YIM
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF. ColorizeIt.