You are not logged in - Log in
Sign up for our newsletter! 
Home Dashboards Forum Tools Help Contact Us

Author Topic: Reset button  (Read 13693 times)

Offline Yoitstmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Reset button
« on: September 04, 2015, 11:16:34 pm »
I've downloaded other gauges and I can't figure out how to reset the parameter for anything, more specifically a trip value (Fuel used in trip A). How do I do this? In some I see scripts but to my understanding you can't use scripts in DashXL. I've tried a few combinations of object properties but none seem to work. Can anyone help?

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #1 on: September 05, 2015, 12:48:17 am »
You can reset the entire trip. Look at any dashboard that has a reset feature. Here's my current dashboard. Tapping "A MPG" resets the trip that is associated with. Tapping the trip odometer resets that trip.

Offline Yoitstmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Reset button
« Reply #2 on: September 05, 2015, 01:46:23 am »
You can reset the entire trip. Look at any dashboard that has a reset feature. Here's my current dashboard. Tapping "A MPG" resets the trip that is associated with. Tapping the trip odometer resets that trip.

I'm studying your gauge intensively and I don't understand how they reset. I'm looking at the button commands and they seem like scripts. I don't understand how these work and I can't find any information on them. How do I reword the commands to reset different PID's?

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #3 on: September 05, 2015, 05:58:02 am »
Unfortunately, I haven't found too much documentation either. First thing you need to do is go over all of the information in the "Help" tab at the top of this page. Then you need to study a specific part of an existing dashboard to figure out how to do things.

The way the reset buttons work is this: First you create the button object on the main page. Then use a "State Tracker" to define the button inside of your dashboard. If you look at my dashboard, before you edit the dashboard, you'll see the button objects defined on that main page near the bottom. Then edit the dashboard, and look in the "Buttons" container in the foreground. (I've grouped all of the buttons in one container.) Note that the Object IDs have to match from the button definition on the main page and where you define the button in the foreground.

As far as resetting different PIDs, I don't know where that documentation can be found. What I do is look at a variety of dashboards to find what I need. The Tuxedo dashboards have a bit of everything. If you can't find it there, post a question about the specific PID you need. The mods are pretty busy, so you need to already understand how to structure what you need. If you post a general question like "How do I do this?" they aren't likely to be able to help, as it would take too much time. If, on the other hand you've already created the basics and just need a specific command to make a button or such work, then they are pretty helpful.

Offline Yoitstmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Reset button
« Reply #4 on: September 06, 2015, 09:38:27 am »
I may head to admins then. I've spent hours and hours trying to make this gauge reset. I can't even use your commands from your gauge because my ScanXL application just instantly resets the "ClearScriptPidStateDataValues" to "ClearPidStateDataValues." I'm not sure what the difference is entirely, but it's enough to make my button not work. If a moderator won't respond, then I'll have to give up.

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #5 on: September 07, 2015, 02:09:41 am »
If you post your dashboard here and tell me exactly what you're trying to do and which object you're unable to modify, I'll take a look at it. I'm not promising anything, but I can look anyways...

Offline Yoitstmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Reset button
« Reply #6 on: September 07, 2015, 07:28:54 pm »
This is my gauge without all it's flashiness. I'm trying to make it so the fuel gauge can reset, but I'd to know what you do with it so I can do it on my own with other PID's in the future

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #7 on: September 08, 2015, 01:35:03 am »
I'll look at this tomorrow for sure. So, you don't want fuel level remaining, you want fuel used on your gas gauge?

Offline Yoitstmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Reset button
« Reply #8 on: September 08, 2015, 01:39:19 am »
Yes. I already have the PID set on the gauge the reset button is attached to. My BMW E46 doesn't support any fuel reading PIDS whatsoever. My workaround is knowing I how much gas I put in my tank, and then seeing how much I burn, and then reset it as I get close to burning the amount I've put in my car in trip A. I want to reset trip A so I can add a odometer in the future.

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #9 on: September 08, 2015, 06:34:41 am »
You've got a few issues here. Right off the bat your Object IDs don't match. First you create the button; you've done that. Then the state tracker in the dashboard must have the same object ID. That's how DashCommand knows which button it is. That's the big thing missing here. I haven't tried to run this dashboard; there really should be some errors pop up due to the object IDs.

I haven't looked in depth at the rest; I'll do that tomorrow. There's a bit I'd change and clean up. I'll do the one button and clean it up, then tell you what I did. I'll attach my revision. That should get you on the right track.


Offline Yoitstmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Reset button
« Reply #10 on: September 08, 2015, 04:34:06 pm »
oh okay. Yeah, there may be some bigger issues then, because I use a state tracker to cycle through multiple gauges on the side, so therefore the fuel button would reset all of the needles under that state tracker? That wouldn't be a bad thing, every other PID comes from the car, and therefore a reset wouldn't disrupt anything

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #11 on: September 10, 2015, 02:59:54 am »
No, you need a separate state tracker to activate the button. You can then use another state tracker to cycle through gauges and hide/unhide buttons. You define a button on the main page, before you edit the dash. You then use a state tracker inside the dash to activate and locate the button. The state tracker and the defined button MUST have the same object ID.

I did some work on your dash, but couldn't really take the time to fully clean it up. You have offsets on different things which makes it very difficult to move one object to another layer. It also makes creating needles and such more difficult. Take a round gauge. If you have consistent position definition you can create a circle in the background and then give the needle in the foreground the same center. Now the needle is centered in your round gauge. Easy. I cleaned it up a bit to show you what could be done. Here's my observations, take them for what it's worth.

I disabled your background and foreground dashboards. They're unused, so leaving them enabled just slows things down.

I changed the organization of your dashboard. Numerous layers like you were using will slow things down, at least I believe that is the case. I organized things in to two layers, Background and Foreground. The background is where you want things that don't change, or only change with user action. Stuff you don't want redrawn constantly. (The more you redraw, the slower the dash.) Never put anything PID based in the background. Pictures, tickmarks, gauge faces, button graphics, these all go in the background.The foreground is where you want things that move or change: needles, PID based text... The more you have in the foreground, the slower the dash.

I moved the center circle of your tach needle to the background. This way it doesn't have to be redrawn constantly. I got rid of most of your needle rectangles and used lines. Much easier and quicker. Rectangles are positioned by their center. Lines are positioned by their ends. Define the start of the line as the same position as the center of the gauge. If you've used consistent positioning definition, you just type in the same coordinates as your gauge center. Then place the end of the line wherever your gauge zeroes out. If you want to shorten the line, just re-position the start wherever you want, you'll have the original line to guide you. Easy and quick. Your method of putting the components of a needle in to a container was good if you're going to go with a complicated needle. That way you can move the container if you need to move the needle around.

Using the "Pen" feature of an object in the foreground slows down your dash. I took it off your rounded rectangle in your tach needle just to show what it would be like cleaned up. If you like the look you can always use it, but check to see how much it's slowing you down.

Your reset button needed a complete re-do. Look at what I've done with it. The elements are there that you need. I put the button graphic in the background. You can use a state tracker in the background to make it visible/invisible. You can do the same with the button I put in the foreground. Note the button in the foreground is a state tracker. The "Not depressed" state has a transparent ellipse over your button graphic. It is the transparent ellipse that defines the position of the button. The button graphic is merely a way for the user to see where to press. You don't even need the button graphic. The "Depressed" State has an identical ellipse, except has an opacity of 128. This gives a visual confirmation that the button has been depressed. (Don't use opacity in the foreground except for stuff like this. Opacity slows down the dashboard if it is in the foreground.)

I didn't test this dashboard, it still needs work. Your original button could not have worked, this is a functional button. You still need to make sure the commands work though. I'm not sure what difference the word "Script" makes in the command. It changes easily though. I'm not sure why you were having problems with that? Maybe the file was read only, or you didn't hit "Enter" after typing the command?

Anyways, this should get you on the right track. No need to incorporate anything I did, other than the button. I was just playing around with it to see what could be done to clean it up.

Offline Yoitstmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Reset button
« Reply #12 on: September 11, 2015, 05:08:00 pm »
Sorry for the long gap in replies, I've been busy with school. Wow, you've been a wealth of information and I appreciate everything more than I can even tell you. A few things. First, I had the top of my needle in a third layer due to the way the final design is. From what I know, the gauge will only slow down if the extra layers have to be re-rendered due to new data coming up like a needle. As in I could have 5 background gauges that won't slow down my gauge as long as only one has to refresh needles and such.
As for the rounded rectangle, you'll see why I use it in my final design which I'll post here in the next couple days. If you think having my entire needle could be more efficient as an image, let me know! All my gauge designs originally start as Photoshop documents.
The reset button I fully understand now. You were telling me earlier about state trackers but I just didn't understand their true purpose since I used them to just cycle through gauges or backgrounds and stuff like that. The version you uploaded didn't include the word "script," and it worked, so I think the program just uses them interchangeably to do the same thing. And yes, the reason it wouldn't add the word is because I didn't hit enter. I know, the price I pay for being a mac user d:
Other than that, I think this puts me in a place where I can upload the first version of my gauge I've been so excited to bring to others. All my gauges up to this point have been mimicked, and this one is all my own design, very exciting!

My only question for you is how did you know that ppe_trip_a is the command to reset trip A? If it were me, I'd think CALC.TRIP.A, but that isn't the case.

Again, thanks for everything, can't wait to show you the final product I'll have to offer

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #13 on: September 12, 2015, 07:39:46 pm »
No, the only reason I guess to use just two layers is organization, but whatever makes sense to you is what works. I thought more layers was slower, but I looked in the Tuxedo dashboard, and it has multiple layers. Just remember, any time anything in a layer changes, the entire layer has to redraw. Keeping all of the PID driven things in the foreground and all the static stuff behind that is best.

Yeah, as far as speed, if you get the response you need then you're good. I was just pointing out possible changes if your dash ended up needing to speed up later.

I found all of the commands by looking at other dashboards, particularly the Tuxedo dashboard. (The DashCommand guys write that one, so I figure it's a pretty good source...)

Glad I could help! It helped me too, as I learned a bit more playing around with your dash. :)

Offline Yoitstmac

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Reset button
« Reply #14 on: September 13, 2015, 05:37:12 pm »
No I appreciate it all, truly :) If you'd like to see the final product, it can be found here: http://www.dashxl.net/dashboard.php?dashboard=1268

I'm pretty sure I've gotten all the kinks out!!! Always nice when I can get things right the first time

Offline Weston@PPE

  • Administrator
  • Sr. Member
  • *****
  • Posts: 466
    • View Profile
Re: Reset button
« Reply #15 on: September 14, 2015, 05:27:06 pm »
When a layer has something change that requires an redraw, every layer lower than it in the list also has to redraw (because if there is any alpha bending, it needs to be re-blended against the new background). Individual layers that are not at the very bottom (foreground) of the layer list can not be redrawn on their own.

I haven't looked at the design of your dashboard in the editor, but using extra layers does still increase render time even if they aren't changing, especially on newer high resolution devices. Tuxedo used to have 3 or 4 layers per page, and when the iPad 3 with Retina came it the cache for each layer was so large that the framerates dropped to the point of being unusable. Since then we've reworked Tuxedo to use only 2 layers on as many dashboards as possible, only a few dashboards still use more than 2. We also moved the menu into each dashboard so we could remove the foreground/background dashboards, which removed 2-4 more layers.

It still has to draw a whole screen cache for each layer to the screen, even if it isn't rendering new content to the cache first. In the case of a Retina iPad, thats 3.1 million pixels per layer that is not avoidable.

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #16 on: September 15, 2015, 06:00:19 pm »
Thanks for the info Weston!

Hey, I have a couple of questions about speed. When you have different objects in the back ground activated by changing states, say multiple gauge backgrounds in the same spot selected by button press, does that slow down the dash? Also, the needles for those gauges in the foreground: when the gauge isn't active because of state, is it still using that PID and slowing it down that way? In other words, say I cycle through 5 different gauges by cycling state, Is it as slow as a dash with all of those gauges visible, is it as fast as a dash with just the one gauge since that is what is active, or is it somewhere in between?

Thanks!

Offline Weston@PPE

  • Administrator
  • Sr. Member
  • *****
  • Posts: 466
    • View Profile
Re: Reset button
« Reply #17 on: September 15, 2015, 10:41:18 pm »
An object that is hidden, by a state tracker or other means, is skipped when we are checking for changes. A state tracker in the background will only slow down on the one frame when it changes, and after that we will know that the layer hasn't changed since its previous render.

If you have 5 gauges in the foreground and 4 are hidden, the entire layer still gets re-rendered if that one gauge changes. If the rendered objects are actually hidden completely they won't be rendered which will speed things up, but just disabling the needle and leaving things visible won't help much.

If a needle is hidden it is also skipped when we search for the PID list. However, you will need to check the box "Refresh PID List" on your DashXL objects that hide/unhide needles in order for this change to take effect. We do not routinely scan and update the PID list, its done one time on the first render and then only when a DashXL object requests it after that.

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #18 on: September 16, 2015, 02:27:21 am »
Great info! Thanks! That really clears a bunch up for me. One last thing: Can you cycle a state via a condition? I know how to do it with a button, but can it be done with a condition? I was thinking putting a button set up under a condition, but with no object that would define the button press area. Instead, each condition--true and false--would set the "depressed" or "not depressed" state. Would this work?

Thanks!

Offline Weston@PPE

  • Administrator
  • Sr. Member
  • *****
  • Posts: 466
    • View Profile
Re: Reset button
« Reply #19 on: September 16, 2015, 06:57:52 pm »
Conditions are based off of PID data, there would be no way to get the depressed/not depressed data into the condition. You could use a condition to display different buttons at different times though. If there is no object defining the not depressed touchable area of a button, it is impossible to click that button. The touchable area can be an object with no pen and no fill however, to make it invisible.

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #20 on: September 16, 2015, 09:10:02 pm »
I get that the condition is set by a PID. What I'd like to do is set a state if the condition is true, and set a different state if the condition is false. My question was not so clear!  :)  Anyways, is this possible?

Thanks!!

Offline Weston@PPE

  • Administrator
  • Sr. Member
  • *****
  • Posts: 466
    • View Profile
Re: Reset button
« Reply #21 on: September 16, 2015, 09:52:00 pm »
Thats essentially what a condition does, it is its own state tracker and sets the true or false containers inside depending on the condition. It is not possible to set an external state tracker based on a condition, you'll need to re-create the condition in every place you want to use it.

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #22 on: September 16, 2015, 10:17:46 pm »
OK, Got it. What I'm trying to do is put warning lights in the background so they don't slow up the dash once they light up. Will it slow down the dash much if I put a condition in the background? The condition would only change rarely, but there would be a condition tracking a PID in the background.

Offline Weston@PPE

  • Administrator
  • Sr. Member
  • *****
  • Posts: 466
    • View Profile
Re: Reset button
« Reply #23 on: September 16, 2015, 10:27:47 pm »
If your background is a solid color, you can easily put the lights in the lit up state in the background, and then cover them with conditions that are in the foreground with a simple solid color ellipse. This is much much faster to draw a single solid object per light than drawing a complicated light each frame. I've done this numerous times.

I also like to do a similar thing with my buttons to keep them responsive, I'll draw the button itself in the background and use an invisible rect in the foreground for the state tracker. The depressed state of the state tracker will draw the down state of the button momentarily but it keeps a lot of objects in the background this way. I do this for the Tuxedo navigation buttons if you'd like an example.

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #24 on: September 16, 2015, 11:07:01 pm »
Thanks Weston!! I'll work on that setup. The issue is my warning light is the face of the gauge itself, so I have to redraw the gauge background--tickmarks and such. If I put the warning light in the background then the redraw would only happen when the warning symptom changed. But then I'm tracking a PID in the background. The condition would only change in the case of an overheat or under voltage, so hopefully never, but at most once anyways.

I already stole your button design for my buttons! :) It works great!

Thanks!

Offline Weston@PPE

  • Administrator
  • Sr. Member
  • *****
  • Posts: 466
    • View Profile
Re: Reset button
« Reply #25 on: September 17, 2015, 05:07:59 pm »
In that case it'd probably be the fastest to just draw your light in the foreground only when the condition is set. I did that on a custom user's dashboard here:
http://www.dashxl.net/dashboard.php?dashboard=382

You can play with the needle tester on that dashboard and see how slow it makes everything go, but that is what the user wanted. Doing it this way makes it so nothing is drawn when the light is off, but it is drawn when the light is on. Putting it in the background will make it very very slow anytime the light changes, which would make it a worse position if the light ever changes on/off with any kind of speed at all.

I did do the solid ellipse method for the staging lights on the Performance page. You have to push the Start button to see them, but they are all drawn in the background and then covered up when I don't want them.

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #26 on: September 17, 2015, 07:03:16 pm »
I'm not worried about the dash slowing when the light changes, I just don't want it slow when the light is either on or off. If I put a condition in the background layer, it changes my redraw times from 7 - 8 ms to 60 -70 ms--even when the light isn't changing. My assumption was that if I'm monitoring a PID in the background layer--even if nothing changes-- the background must start redrawing every frame. If it's really only going to slow it down when the light actually changes if I put it in the background, then that's a different story. For instance, If I put in a low fuel warning at 4 gallons, the condition will activate once at four gallons and stay there. The light won't go out until I refill the tank. I'd like to put a yellow hatched background behind the tickmarks and arcs, but then I'd be drawing the yellow hatch pattern, the tickmarks, the arcs, etc, every frame. If i put it in the background that would be great, as long as it only redraws the background once. But it seems to be redrawing the background every frame, at least that's what it looks like from my redraw times in the upper left corner. I haven't actually tried it live.

Here's my dash with an example Low Fuel warning. It's in the background under the "Fuel & DTE" container.

Offline Weston@PPE

  • Administrator
  • Sr. Member
  • *****
  • Posts: 466
    • View Profile
Re: Reset button
« Reply #27 on: September 18, 2015, 09:06:36 pm »
The needle tester is not a complete replacement for the real PID system in the software. There are many cases where the needle tester will force a redraw that the software itself would not. The Tuxedo dashboard uses conditions in the background to control tick marks based on the user's unit & format settings, it only slows down for the frame when the condition changes.

Offline Nak

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Reset button
« Reply #28 on: September 19, 2015, 07:14:58 pm »
Thanks! You're right, I ran that dash live and it works fine. :)

Offline bosseric

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • thanh phú thịnh land
Re: Reset button
« Reply #29 on: November 21, 2017, 08:38:11 am »
You can reset the entire trip. Look at any dashboard that has a reset feature. Here's my current dashboard. Tapping "A MPG" resets the trip that is associated with. Tapping the trip odometer resets that trip. ;D ;D khac dau ten
Chuyên nhà đất long an có sổ hồng riêng, phân phối đất long an vị trí đẹp, dễ mua đầu tư.

 

Home | Dashboards | Forum | Help | Contact Us | Terms of Service
Powered by Palmer Performance
Copyright © 2021 Palmer Performance Engineering, Inc. All Rights Reserved.