Xmon & XperT teamed up

title says it all

Xmon & XperT teamed up

Postby P3rv3rt B3ar on Fri Aug 03, 2007 1:34 am

As many of u know... i havent been providing much use cases about utilizing xPerT to xlobbyist benefit, mainly because im just damn lazy, but also partly because ive tried to keep xPerT as general as possible, so that ways to use it would be only limited by skinner's/power user's imagination. Tonight im gonna do a little exception and show how i did use xPerT to little enchance the feedback from Badubos excellent Xmon plugin. Heres the relevant part of screenshot from my experimental "Bearskin".

Image

There on image u can see temperature data of usual HTPC parts as numerals, pulled out from Xmon as usual. However same data is also presented on those thermometers, and that is where xPerT enters the picture. To enable us to do what is shown, we'll be needing 3 xPerT features: presentor called progress bar, arithmetics to scale the value for the bar, and smugglers which are used to go around limitation of xlobby's nonexistant interplugin communication interface.

Well let us take a look into smuggling first: we have contraband which is information Xmon provides us which can be accessed in our example with variable
Code: Select all
plugin>XMonitor>Speedfan.Temp.1.value


To get this contraband trough border between Xmon and Xpert, which is guarded by evil Norwegian border patrol :evil: , we'll need our mule. Mule is simply a text field which has given ID "MULE_stash", where stash is the cache where our mule will deliver the precious contraband, stash is actually a regular xlobby variable, which is accessible outside xlobby, including within xPerT. To avoid getting stripped by damn norwegian gaypatrol our mule have to hide himself well. usually he hides trough 100% alpha camouflage or mayby even in dummy screen, but in our case, cause we dont really mind about temperature value showing, he is hiding just under our noses. Yes, u guessed right, in picture above the text field holdin numeric value of temperature is our mule, the first one uses above mentioned code to get the contraband and has following ID
Code: Select all
MULE_cputemp
. This means that contraband will be hidden to xlobby variable named cputemp, when smuggling is executed, smuggling however doesnt happen on its own but xPerT command "Smuggle" is needed for that, version of command used here takes two parameters, separated by usual ">" sign. First parameter is version of command in this case "var" and second is the name of stash, in this case "cputemp".

So our smuggling command is:
Code: Select all
xPerT

Smuggle

var>cputemp



keep in mind that if u want thermometers to update constantly u need to keep on smuggling, running the command on everysecond or so... but if its not so timesensitive for u, u could smuggle once when entering the screen, or have update button to do the smuggle.

Ok now that we know how to access the data lets see how we can use it. Thermometer in picture is sumply background graphics, only red bar within is live xPerT bar... now let us see the variable behind that bar

Code: Select all
plugin>xPerT>!0!present>progress bar>[[variable>cputemp]*10]>vertical>skin:/buttons/red.png>skin:/buttons/empty.png


There... very simple just regular xPerT presentor, first parameter being type (progress bar), second is the value we saw all the trouble to smuggle, trough some xPerT arithmetics, third is simply filename of progress bar graphix our blood red thermosensitive substance, and last one is the background file, which in our case is as c-tru as emperor's clothing.

But lets take a second look of second parameter with all those nested brackets... as u might remember those brackets are delimiters of xPerT variables and process of solving their values starts within the innermost nest, which is variable>cputemp, which is regular xlobby variable, our stash, now holding that contraband which we muled out from Xmon, however it is not ready for presenting cause xPerT's progress bar expects value on range from zero to thou.

So all we need to do is apply simple xPerT arithmetics to the value to make it suitable for the range, scaling it. We chooge to multiply it with scale of ten cause atleast my intel will be up in smoke way before it hits 100 degrees of celsius. Multiplying with ten means our bar can represent temperatures from 0-100, actually if u want thermometers to be more useful, u could select much more thighter scale by using arithmetics for normalization and scaling the value before feeding it to progress bar.

Well i hope this made some sense for somebody... and thank badubo for another great plugin.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Re: Xmon & XperT teamed up

Postby P3rv3rt B3ar on Sun Aug 05, 2007 4:18 pm

I worked a little over the weekend to enchance xPerT with gauges support... here u can see them used together with Badubos Xmon to present RPMs of HTPC fans:

Image

As usual within xPerT gauges are implemented as general as i could think of without getting too much headache, so u can use them for every imaginable purpose... for example as analog clock. Any number of hands is supported and they can be suspended to different point of background gauge image, so single gauges with several indicators are within realm of possibility.

In the partial screenshot above from my experimental "Bearskin" getting the values from Xmon plugin is implemented in same fashion as described for temperatures above. Mule in this time is infront of actual xPerT generated gauge hiding as a digital display.

I implemented gauges mainly to morph xlobby more suitable for carputing, my P3rvette project in mind, but im sure gauges can find some uses in traditional (especially vintage look a like) HTPC systems as well. If theres expressed interest ill release experimental version with gauges shortly... otherwise i put it out later together with other future features and bug fixes.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Re: Xmon & XperT teamed up

Postby defrag on Tue Aug 07, 2007 7:28 am

Impressive! Good work P3rv as always!!
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK