Professional Web Applications Themes

New module to generate ladder diagrams - PERL Modules

I've just finished the first iteration of a module (LD.pm) which generates lader diagrams (aka callflow diagram, call sequence diagram, message sequence diagram, etc.). The module's synopsis is below. I'm just wondering if any interest exists for it, and if the synopsis/featureset is adequate. If so, I'll freshmeat it in the next few days. At present it only generates ascii diagrams, but i'm working on adding graphical output capabilities (via postscript::simple). The input is currently either tethereal text output (either brief or fully expanded trees), or an internal text representation, which is pretty simple. I figured i should first test ...

  1. #1

    Default New module to generate ladder diagrams

    I've just finished the first iteration of a module (LD.pm) which
    generates lader diagrams (aka callflow diagram, call sequence diagram,
    message sequence diagram, etc.). The module's synopsis is below. I'm
    just wondering if any interest exists for it, and if the
    synopsis/featureset is adequate. If so, I'll freshmeat it in the next
    few days. At present it only generates ascii diagrams, but i'm working
    on adding graphical output capabilities (via postscript::simple). The
    input is currently either tethereal text output (either brief or fully
    expanded trees), or an internal text representation, which is pretty
    simple.

    I figured i should first test the waters before posting the entire
    module.

    Thanks much for any feedback.

    SYNOPSIS
    my $ld = new LD ( ConfigFile => "./ld.conf",
    DebugLevel => 1,
    Graphical => 1,
    );
    # OR things can be specified explicitly
    $ld->ConfigFile("./ld.conf"); # by default
    $ld->DebugLevel(1);
    $ld->Graphical(1);

    # Configuration options may be set programmatically:
    $ld->SetConfig ( GutterWidth => 10, ColWidth=>60 );

    # .. also, configurations can be read back:
    print "gutter width is: " . $ld->GetConfig ( "GutterWidth" );

    # There are 2 ways to specify a dataset
    # A) using a file as input.
    # The file must be of a recognized format:
    # a) tethereal brief dump
    # b) tethereal full dump (fully expanded tree)
    # c) internal text doent format
    $ld->DataFile("./callflow.2")

    # .. OR ..
    # B) using a defined dataset, passed via an array
    %elementHash = { Id => 1, Time => 123,
    InArrowText => Text‐In‐Arrow,
    Source => node1, Dest => node2,
    Note => "Full Text, with any chars user wants"
    DeadNodes => nodelist,
    }
    push elements \%elementHash;
    $ld->DataSet(\elements);

    # And finally, the diagram needs to be created
    $ld->BuildDiagram()

    # By default the output is ASCII. Other formats will be
    # supported by sending BuildDiagram a list. A compressed
    # calling format is:
    $ld->BuildDiagram( outputformat => [ "png", "ascii", "gif" ],
    input => "./callflow.2" )
    sundar Guest

  2. #2

    Default Re: New module to generate ladder diagrams



    On 6/3/2004 1:37 PM sundar wrote:
    > I've just finished the first iteration of a module (LD.pm) which
    > generates lader diagrams (aka callflow diagram, call sequence diagram,
    > message sequence diagram, etc.).
    You shouldn't release it with a top-level namespace. Call it something
    like Chart::LadderDiagram.

    There are already a few sequence diagram modules. How does yours differ?
    > The module's synopsis is below. I'm
    > just wondering if any interest exists for it, and if the
    > synopsis/featureset is adequate. If so, I'll freshmeat it in the next
    > few days. At present it only generates ascii diagrams, but i'm working
    Maybe Text::LadderDiagram as a name?
    > on adding graphical output capabilities (via postscript::simple). The
    > input is currently either tethereal text output (either brief or fully
    > expanded trees), or an internal text representation, which is pretty
    > simple.
    >
    > I figured i should first test the waters before posting the entire
    > module.
    Robert Rothenberg Guest

  3. #3

    Default Re: New module to generate ladder diagrams

    > You shouldn't release it with a top-level namespace. Call it something
    > like Chart::LadderDiagram.
    Good idea. I'll do so.
    >
    > There are already a few sequence diagram modules. How does yours differ?
    I have not found any others (except the flowchart, and uml stuff, but
    their purpose is different). Maybe i missed them - please could you
    give me the name. don't want to re-invent wheels. i'd rather
    contribute the differences to an existing project.
    > Maybe Text::LadderDiagram as a name?
    Chart::LadderDiagram seems better since i should have graphical
    support in there pretty soon (testing it out right now).

    BTW, an example of the code and output is below, just for grins (and
    for feedback on whether this is different from existing
    implementations that I'm unaware of):

    #---------- EXAMPLE CODE --------------
    use strict;
    require 'Chart::LadderDiagram.pm';

    # Object instantiation
    my $ld = new LD (ConfigFile => "./callflow.conf" );
    my elements;
    printf ("No filename specified. Will internally generate data.\n");
    for (1..2) {
    push elements,
    { ID=>$_, TIME=>$_, SOURCE=>"A", DEST=>"B",
    INARROWTEXT=>"($_) A to B", NOTE=>"Note above a to b" };
    push elements,
    { TIME=>"$_.$_", SOURCE=>"B", DEST=>"A",
    INARROWTEXT=>"B to A", NOTE=>"Note above b to a" };
    }
    $ld->DataFile(\elements);
    $ld->BuildDiagram();


    # PROGRAM OUTPUT (to stdout)

    Title: TITLE HAS NOT BEEN SPECIFIED

    PKTNO TIME A B
    -----------------------------------------
    1 1 | Note above a to b |
    |---[ (1) A to B ]->|
    | |
    2 1.1 | Note above b to a |
    |<---[ B to A ]-----|
    | |
    3 2 | Note above a to b |
    |---[ (2) A to B ]->|
    | |
    4 2.2 | Note above b to a |
    |<---[ B to A ]-----|
    | |

    Thanks for the feedback
    sundar Guest

Similar Threads

  1. Q: What's a good module for making node diagrams?
    By Robert Rothenberg in forum PERL Modules
    Replies: 1
    Last Post: June 22nd, 11:42 AM
  2. [New Module] Quickly Generate Monthly Calendars
    By Mohammd M. Hussain in forum PERL Modules
    Replies: 0
    Last Post: June 13th, 03:32 PM
  3. Perl module to generate Excel XML
    By Ravi Krishna in forum PERL Modules
    Replies: 3
    Last Post: January 23rd, 06:27 PM
  4. DTS and Diagrams Backup
    By LJ in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 1st, 06:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139