Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Vertical Bar

Discussing issues that occur during plugin development.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
Rafael
Plugin Author
Posts: 71
Joined: November 22nd, 2005, 7:12 pm
Location: Curitiba, Paran?, Brazil

Vertical Bar

Post 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

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Re: Vertical Bar

Post 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

Rafael
Plugin Author
Posts: 71
Joined: November 22nd, 2005, 7:12 pm
Location: Curitiba, Paran?, Brazil

Re: Vertical Bar

Post 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.

caesar
Forum Supporter
Posts: 734
Joined: October 15th, 2005, 10:39 am
Location: Romania
Contact:

Re: Vertical Bar

Post by caesar »


limbo
Plugin Author
Posts: 1604
Joined: February 13th, 2005, 7:38 pm
Location: Athens - Greece
Contact:

Re: Vertical Bar

Post 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

Rafael
Plugin Author
Posts: 71
Joined: November 22nd, 2005, 7:12 pm
Location: Curitiba, Paran?, Brazil

Re: Vertical Bar

Post 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

limbo
Plugin Author
Posts: 1604
Joined: February 13th, 2005, 7:38 pm
Location: Athens - Greece
Contact:

Re: Vertical Bar

Post by limbo »

Hi Rafael
:idea:
Keep up the nice work!

Greets from Greece

m.asad
Posts: 1
Joined: September 4th, 2012, 2:43 am

Re: Vertical Bar

Post 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.

Post Reply