Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Slider with a float field
#1
I am trying to use a slider with a field that is a float (setpoint temp on AC). It actually works OK, but the slider will only increment in interger values. I would like it to increalse in 0.1 increments or at worst 0.5 increments.

Is this possible?

Thanks

Mick
Reply
#2
No, it only works in terms of integral values, because it's the same code no matter what type of field, and there are an infinite number of offset values for floating point values that could possibly be used. So it just sticks to integral values.
Dean Roddey
Software Geek Extraordinaire
Reply
#3
This is probably one of the few places english units have an advantage over SI. There is a way to do this kind of thing indirectly, but you need to use a dummy field in either your driver if you want to add it or using the variables driver. As an example say you wanted a setpoint range from 15-30 C at 0.1 intervals. Create a dummy Card4 variable in the variables driver and set its limits to Range:150,300. For the slider set its field to the dummy variable. Looking at the meat of the code it would look like

Code:
OnPress
// Get current dummy sp value
GlobalVars::SetVariable(GVar:TempSP, %(StdRTV:CurValue))
// Insert decimal point
GlobalVars::Insert(GVar:TempSP, ., 2)
// write to static text widget as usual for slider setup

OnDrag
// Get current dummy sp value
GlobalVars::SetVariable(GVar:TempSP, %(StdRTV:CurValue))
// Insert decimal point
GlobalVars::Insert(GVar:TempSP, ., 2)
// write to static text widget as usual for slider setup

OnSet
Devices:FieldWrite(YourSP Field,%(GVar:TempSP))

OnRelease
GlobalVars:DeleteVariable(GVar:TempSP)
Edit: I changed the code and simplified it. This would be the whole shebang.

The caveat with this method is if you change the temperature setpoint in any other fashion than through the slider it won't stay in synch with the actual setpoint.
Reply
#4
Dean Roddey Wrote:No, it only works in terms of integral values, because it's the same code no matter what type of field, and there are an infinite number of offset values for floating point values that could possibly be used. So it just sticks to integral values.

I guessed this would be the answer but had to ask anyway.

Would it be possible to add a setp size option to the slider. Thay way the user can decide what the increments should be with a default of 1 for those that dont selet anything.

Thanks jrlewis, you confirmed what I thought I was going to have to do.

Mick
Reply
#5
Dean

Any comment on the suggestion of step size. I dont think the above is suitable due to the sync issue.

Mick
Reply
#6
I could only comment that it's a potential solution, but it woudln't likely happen soon, so it's not something that you would want to wait for as a solution, unless you don't need this to work in the near future.
Dean Roddey
Software Geek Extraordinaire
Reply
#7
Please add it to the wish list. I want it for my A/C control which has 0.1deg increments and the integer value is too coarse. I'll just have to wait and use both the touchscreen for the A/C and CQC

Mick
Reply
#8
znelbok Wrote:Please add it to the wish list. I want it for my A/C control which has 0.1deg increments and the integer value is too coarse. I'll just have to wait and use both the touchscreen for the A/C and CQC

Mick

Just off the top of my head, couldn't you scale the value inside the driver?

Perhaps adding another field that was an integer and was multiplied by a factor of 10.

Cheers

Rohan
HAMFIELD
Software & Hardware Solutions
Makers of the Translink C-Bus Gateway
for the Apple iPad, iPhone and iPod Touch.
Reply
#9
Without thinking about it, there are up to 32 zones that need to be catered for. If I need one for every zone, then there is substantially more fields to the driver. Its not pretty that way either and does not sit well for me.

Thanks for the input - its always appreciated

Mick
Reply
#10
Ok, last attempt :-)

How about a manifest file option that tells the driver to scale the existing fields.

Then if the fields are R/W you can translate them to display correctly on the Xlat tab i.e xxx/10 (granted there would be a few entries in the Xlat list)

Or if there are seperate input fields to the display fields, it will just work.

Does that sound any better? ;-) (probably not, but it was worth a shot)

Cheers

Rohan
HAMFIELD
Software & Hardware Solutions
Makers of the Translink C-Bus Gateway
for the Apple iPad, iPhone and iPod Touch.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Logic Server Field Limit zra 6 393 07-10-2018, 12:44 PM
Last Post: zra
  Has there been changes to Slider Widget? pjgregory 11 1,436 03-10-2018, 10:32 AM
Last Post: Dean Roddey
  Changing Field Values in Devices Tab TurboSam 3 503 01-01-2018, 02:47 PM
Last Post: Dean Roddey
  If Field Exist? znelbok 5 1,362 11-18-2017, 01:03 PM
Last Post: Dean Roddey
  Simple field change trigger action Bugman 15 3,263 10-23-2017, 11:55 AM
Last Post: Dean Roddey
  Field Boolean Text Widget issue greymatter 5 1,755 08-26-2017, 04:45 PM
Last Post: greymatter
  Field Logo Image depending on another condition lleo 6 1,478 07-27-2017, 09:45 AM
Last Post: Dean Roddey
  Graph Widget - There is no editor for data type float zra 4 1,401 07-06-2017, 02:25 PM
Last Post: Dean Roddey
  Concatenated field text widgets? dlmorgan999 6 2,140 03-09-2017, 02:54 PM
Last Post: dlmorgan999
  Slider for IR tom 2 925 03-06-2017, 02:17 PM
Last Post: tom

Forum Jump:


Users browsing this thread: 1 Guest(s)