Page 1 of 1

Vertical Bar

Posted: October 18th, 2009, 4:23 am
by Rafael
Hi...

I am trying to create a Vertical Bar Plugin, but I have a simple question:

How to communicate between lines?

- Using functions that calculate per line your own bar position?
- Using private attributes? But Every call of $dll, is a new object of a plugin.

A simple draw:

Image

100% - 95% - 75% - 35% - 0%

Considering this screen, I have used all custom chars.

Let´s talk about?

:smt006

Re: Vertical Bar

Posted: October 18th, 2009, 9:16 am
by caesar
Winamp plugin (or perf) is a good example.

The top row function (function 1) reads the values and calculates the bar, then the functions for the next rows just fetch data and display it.

eg: $dll(RafaBar1,1,20,0#100#$CPUUsage%#d#3) draws the top line, then to draw the next lines you'd have to use
$dll(RafaBar,2,,,)
$dll(RafaBar,3,,,)
$dll(RafaBar,4,,,)
$dll(RafaBar,5,,,)
$dll(RafaBar,6,,,)
$dll(RafaBar,7,,,)
$dll(RafaBar,8,,,)

I exaggerated a little but if you do it like this, I can use it up to 16 lines :P

Or even better:
$dll(RafaBar1,1,20,0#100#$CPUUsage%#d#3#graph1)$dll(RafaBar1,1,20,0#100#$CPUUsage%#d#3#graph2)
$dll(RafaBar,2,,,#graph1)$dll(RafaBar,2,,,#graph2)
$dll(RafaBar,3,,,#graph1)$dll(RafaBar,3,,,#graph2)
$dll(RafaBar,4,,,#graph1)$dll(RafaBar,4,,,#graph3)
$dll(RafaBar,5,,,#graph1)$dll(RafaBar,5,,,#graph4)

This would allow to display more on a display. On normal LCD's all will have to share the same custom chars, but i would not mind a version that lets you choose your own set :D

Re: Vertical Bar

Posted: October 18th, 2009, 3:13 pm
by Rafael
Hi...

My problem is the communication between functions, considering:

$dll(RafaBar,1,,,) -> New instance of RafaBar, new object
$dll(RafaBar,2,,,) -> New instance of RafaBar, new object

Internally, how can function2 reads data from function1...
I need to make some tests to try understand this...

Thank you...

-------------------------------------------------------------------------------------------

Now I am understand how it works... Another problem is setting GRAPH1, GRAPH2 at the same screen!

I think that each one GRAPH1 has a array of values defined by user, right?

Image

But in this case, using only 8 custom chars, it´s terrible to get some precision in this design.

Re: Vertical Bar

Posted: October 18th, 2009, 6:18 pm
by caesar

Re: Vertical Bar

Posted: October 18th, 2009, 9:34 pm
by limbo
Rafael wrote:Hi...

My problem is the communication between functions, considering:

$dll(RafaBar,1,,,) -> New instance of RafaBar, new object
$dll(RafaBar,2,,,) -> New instance of RafaBar, new object

Internally, how can function2 reads data from function1...
I need to make some tests to try understand this...

Thank you...

-------------------------------------------------------------------------------------------

Now I am understand how it works... Another problem is setting GRAPH1, GRAPH2 at the same screen!

I think that each one GRAPH1 has a array of values defined by user, right?

Image

But in this case, using only 8 custom chars, it´s terrible to get some precision in this design.

Maybe I get the whole situation wrong... but I thing that the function communication can be solved by using Public Variables on the code...
Check how my SnakeText plugin works, I'm using public variables in order to use the same string in up to four lines.

Am I on subject? :smt017

Re: Vertical Bar

Posted: October 19th, 2009, 2:14 am
by Rafael
Hi Nikos..

How long?? :)

So, the function communication is solved. The possibility to work with many bars in a screen is solved! Now I need to get some time to finish some calculations and improvements... Now in Brazil is 23:14 of a sunday... :(

:smt006

Re: Vertical Bar

Posted: October 20th, 2009, 9:04 pm
by limbo
Hi Rafael
:idea:
Keep up the nice work!

Greets from Greece

Re: Vertical Bar

Posted: September 4th, 2012, 7:24 am
by m.asad
YES! Great piece, keep up the terrific work.his is the type of information that should gain recognition for it’s craft. More writers should learn from you.