Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ia7 floorplan slider #716

Closed
tobser opened this issue Jul 21, 2017 · 8 comments
Closed

ia7 floorplan slider #716

tobser opened this issue Jul 21, 2017 · 8 comments

Comments

@tobser
Copy link
Contributor

tobser commented Jul 21, 2017

Hi,
this is the content of my testfile:

#noloop=start
$sliderTest = new Generic_Item;
$sliderTest->set_states(qw | 1 2 3 4 5 6 7 9 10| );
$Grundriss->add($sliderTest);
#noloop=stop

if (my $num = said $sliderTest){
    print_log("SLIDER: $num");
}

if i use this item on my floor plan and play around a bit (switching between simply clicking and long click) it starts to behave weird. I've not yet figured out a pattern on how it starts...

here es a sample of my misterhouse log while playing with the item:

2017-07-21 20:23:45 SLIDER: 7
2017-07-21 20:23:52 SLIDER: 9
SET eval error.  cmd=($undefined and ref($undefined) ne '' and ref($undefined) ne'SCALAR' and $undefined->can('set')) ?
                                      ($undefined->set("9%", "web [10.121.117.15]")) : ($undefined = "9%")  error=Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 8168) line 1, <GEN216> line 12.
Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 8168) line 1, <GEN216> line 12.
Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 8168) line 1, <GEN216> line 12.
Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 8168) line 1, <GEN216> line 12.
Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 8168) line 2, <GEN216> line 12.
Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 8168) line 2, <GEN216> line 12.

2017-07-21 20:24:33 SLIDER: undefined
2017-07-21 20:25:09 SLIDER: undefined
2017-07-21 20:25:11 SLIDER: undefined
2017-07-21 20:25:17 SLIDER: undefined
2017-07-21 20:25:32 SLIDER: 5
2017-07-21 20:25:40 SLIDER: 6
SET eval error.  cmd=($undefined and ref($undefined) ne '' and ref($undefined) ne'SCALAR' and $undefined->can('set')) ?
                                      ($undefined->set("5%", "web [10.121.117.15]")) : ($undefined = "5%")  error=Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 11232) line 1, <GEN366> line 12.
Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 11232) line 1, <GEN366> line 12.
Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 11232) line 1, <GEN366> line 12.
Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 11232) line 1, <GEN366> line 12.
Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 11232) line 2, <GEN366> line 12.
Global symbol "$undefined" requires explicit package name (did you forget to declare "my $undefined"?) at (eval 11232) line 2, <GEN366> line 12.

2017-07-21 20:25:48 SLIDER: 6
2017-07-21 20:25:52 SLIDER: undefined
2017-07-21 20:25:53 SLIDER: undefined
2017-07-21 20:25:59 SLIDER: 5

Sometimes the item also gets a seemingly random value assigned even without clicking either the slider nor a value button.

@hplato
Copy link
Collaborator

hplato commented Jul 21, 2017 via email

@tobser
Copy link
Contributor Author

tobser commented Jul 21, 2017

I pulled this morning (Fri Jul 21 09:39:05 2017 +0200)
the version of web/ia7/include/javascript.js is v1.5.560

@tobser tobser closed this as completed Jul 21, 2017
@tobser tobser reopened this Jul 21, 2017
@hplato
Copy link
Collaborator

hplato commented Jul 21, 2017 via email

@tobser
Copy link
Contributor Author

tobser commented Jul 22, 2017

Yes i tested on the floorplan.
Maybe ui.touch-punch changed this behavior too... I can test again when I get home tonight.

@hplato
Copy link
Collaborator

hplato commented Jul 23, 2017

Can you test the latest master, I updated the popover sliders so that they will any numeric values if the object has them in it's state list. Good to get any other feedback, and thoughts if this mode should be made the default like the modal.

@tobser
Copy link
Contributor Author

tobser commented Jul 23, 2017

with latest master i don't get the error message any more and there are no longer undefined values set. But there are still one issues I noticed: If i longclick the item the slider is always positioned on the left most position (but the title of the slider dialog shows the correct value)

I'm not sure if having the sliders by default is good in all cases. I personally do not really like to fiddel with sliders on touch devices with my clumsy fingers but at a real PC with a mouse its fine to use. I also think it really depends on the values you may set. If the range is 0..100 in steps of 1 a slider is the natural choice. If you go by steps of 25 a list of 5 buttons is IMHO easier to grasp and faster to tap...
So i really can't say what a good default... maybe it could be configurable?

@hplato
Copy link
Collaborator

hplato commented Jul 23, 2017

OK, can you try my IA7 branch, I put up a version that I think fixes the problem (1.5.610). I'll remove the debug statements before pushing to master. I used the same div names for the sliders for floorplans and modals which I think caused the problem.

Right now sliders have to be enabled as an ia7_config.json option floorplan_sliders: yes. I'm not sure yet, I was going to run with the sliders for a while to see how well they work. I'm tempted to make them a default for 4.3 so there's consistency.

I really appreciate the testing and feedback.

@tobser
Copy link
Contributor Author

tobser commented Aug 1, 2017

Sorry, totally forgot to report back. It's working now.
Thanks.

@tobser tobser closed this as completed Aug 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants