Wind up at one tenth of what its told
rnaleonard at rcn.com
rnaleonard at rcn.com
Thu Mar 1 13:51:10 EST 2018
I would try to do some math manipulation. Not at my XTension machine right now so this is pseudo code:
In the on script for "UnitA"
set x to future value
if x < 10 then
--no change needed - will be a number from 1 to 9
else
set future value to x div 10 -- should be a number from 1 to 9
end if
Then you always have a number from 1 to 9 in the value and can do the appropriate things. Remember this is untested and from memory. But it could work!
Rich
----- Original Message -----
From: James Sentman <james at sentman.com>
To: XTension Discussion List <xtensionlist at machomeautomation.com>
Sent: Thu, 01 Mar 2018 13:11:56 -0500 (EST)
Subject: Re: Wind up at one tenth of what its told
I think this is the best way to do it. XTension can’t know where the value is coming from and therefore what script to apply logic to.
I would create a “raw” value unit that is the outgoing one, and a filtered value unit that is the one that goes from 1-9 and sets the raw value one to the larger value. You can control the filtered one from scripts within XTension.
Or… I might just manage the raw value unit completely by itself and create an attachments handler that I would call instead of setting the value of the unit and let that handle the conversion to the raw value. You can also create handlers in a units ON script so if you created something like:
on setFilteredValue( theValue) filter it based on 1 - 9 here and set the value of the unit itself based on that you could control it locally to xtension via things like:
tell xUnit “name” to setFilteredvalue( 2)
and so forth. Lots of ways to manage it but no clear winner unless we know more about why you’re wanting to separate the two values like that. James
On Mar 1, 2018, at 11:26 AM, John Brumleve <jbrumleve at gmail.com> wrote:
How do I do this? (...Another layer of pseudo?)
Thanks, James
James Sentman http://www.PlanetaryGear.orghttp://MacHomeAutomation.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20180301/c7c13d77/attachment.html>
More information about the XTensionList
mailing list