[Orca-dev] Orcallator.se timestamp patch

Blair Zajac blair at orcaware.com
Sat Jul 3 22:58:36 PDT 2004


[cc'ing orca-dev]

Jon Tankersley wrote:
> Here is the svn diff of my hrule/vrule patch for you to review.  I'm almost
> ready to 'commit', but I can't get the 'h_v_rule.cfg' file to be recognized,
> I guess that is what svn new is for.

Jon,

Thanks for the hrule and vrule patch.

The hrule patch is clean since it's constant.  The vrule patch needs some more 
work because as you said, the time must be updated every time a new vertical 
line is needed and maybe an rrd is needed.  So the hrule is much closer to 
getting checked in.

I'd like the color in the hrule to use the colors in the built in color list or 
the colors specified in the plot {} and not have to have new colors defined.  It 
makes more sense for the user not to have to worry about that if they don't want to.

On the other hand, for hrules, I can see the desire to specify the color, as in 
your case for the warning levels.  So the code could take the default form of

value#rrggbb[legend]

but if it sees this form:

value[legend]

it will pull a color from the color list.  This may be tricky though, as a 
single plot in the configuration file can pull multiple colors.

So the code could be modified to be much smarter about handling colors.

I've attached a modified version of your patch fixing a bug or two.  How about 
working off of this to get the hrule patch in?

Just some comments regarding this patch for future patches

> 
> 
> ungsnd21 % svn diff orca
> Index: orca/lib/Orca/Config.pm
> ===================================================================
> --- orca/lib/Orca/Config.pm     (revision 364)
> +++ orca/lib/Orca/Config.pm     (working copy)
> @@ -114,6 +114,8 @@
>                                      source              => 1,
>                                      summary_format      => 1,
>                                      title               => 1,
> +                                    hrule               => 1,
> +                                    vrule               => 1,
>                                      y_legend            => 1);

Please keep these alphabetically sorted.

> +    # check out the hrule requests
> +
> +    $plot->{'hrule'} = [] unless defined $plot->{'hrule'};

Perl doesn't need the single quotes around the hrule in a hash key.

> +    for (my $k=0; $k<@{$plot->{'hrule'}}; ++$k) {
> +      my $hrule  = $plot->{'hrule'}[$k];
> +      $plot->{'hrule'}[$k] = $hrule;
> +    }

This is unnecessary and resets each hrule back to itself.

> +  for (my $i=0; $i<$data_sources; ++$i) {

This just needs to index the hrule array reference:

+  for (my $i=0; $i<@{$plot_ref->{hrule}}; ++$i) {
+    push(@options, "HRULE:$plot_ref->{hrule}[$i]");
+  }

Regards,
Blair
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: orca-hrule-patch.txt
Url: /pipermail/orca-dev/attachments/20040703/59b019c5/attachment.txt 


More information about the Orca-dev mailing list