ETS2/ATS Telemetry Web Server + Mobile Dashboard

mich.chr
Posts: 2
Joined: 07 Aug 2017 10:21

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#911 Post by mich.chr » 07 Aug 2017 12:03

Trying to code a specific function for Funbits HTML5 telemetry dashboard for Eurotruck simulator 2. The function should go like: <> an integer value for a variable provided by a coremodule is larger than 0 <> an image should be displayed <> it should remain hidden. The Coremodule is constructed so if I in my *.JS file write: data.truck.retarderBrake (which is an integer) Then the coremodule will return the current integervalue.

So my "pseudo code" will look something like this:

Code: Select all

if (data.truck.retarderBrake>0) {
    show.image ('images/RetarderON.png');
    } else {
    hide.image ('images/RetarderON.png');
}
In my html code I have a statement for the image:

    <div class="RetarderOn"></div>
and the CSS looks like this:

.RetarderOn {
  background-image: url("images/RetarderON.png");
  position: absolute;
  left: 851px;
  top: 13px;
  width: 92px;
  height: 71px;
  visibility: hidden;
}
Can I do it this way ? - and what would the correct syntax for the JS if statement be. Maybe I can define all the properties of the image in the JS file instead of the CSS file??

As you can tell I have no coding background - so any help would be appeciated.
User avatar
airbus_sai
Posts: 605
Joined: 14 Jan 2013 17:15

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#912 Post by airbus_sai » 07 Aug 2017 17:15

mich.chr, one good way to learn coding is to look for examples. And "volvo-fh" skin in the default pack has retarder indication. According to it, you can completely remove retarder from JS code.

But your pseudo-code should work, too. You can remove path to image in JS code, because you have it in CSS as background anyway. If you want to go all-JS, you can use document.getElementByID('sometext').visibility = "hidden"; to hide stuff, and ...= "visible"; to show stuff. :) (Of course you should google that before using. I'm just giving you search queries.)
"Now, I am become Death, the destroyer of squirrels."
- J. Robert Oppenheimer, when asked about Trinity tests, as heard in Lost Years song.
mich.chr
Posts: 2
Joined: 07 Aug 2017 10:21

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#913 Post by mich.chr » 07 Aug 2017 18:47

airbus_sai... Thanks a lot. I took your advise and started to look around for code examples to "plank" - Got one and solved it in a different way.

In the JS file I introduced:
data.retarderICON = data.truck.retarderBrake > 0 ? true : false;

Then I use the CSS file to set the image file (default to hidden) however if data.retarderICON is true then an image is displayed :-)
sketch
Posts: 79
Joined: 07 Mar 2015 01:16
Location: New Orleans, Louisiana

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#914 Post by sketch » 12 Aug 2017 17:29

https://youtu.be/-r7nXXhZOB0

Looks awesome!!!!!!!
Rybak04
Posts: 12
Joined: 24 Feb 2015 16:25

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#915 Post by Rybak04 » 19 Aug 2017 19:59

Any update coming for the ATS map? Downloaded the latest version of the route adviser now just says map not available.
User avatar
rockandrole18
Posts: 79
Joined: 08 Apr 2017 22:28
Contact:

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#916 Post by rockandrole18 » 20 Aug 2017 13:28

@Rybak04

You may get a better answer in the actual skin mod thread: viewtopic.php?t=178742
User avatar
mkoch227
Posts: 147
Joined: 13 Feb 2015 16:05
Location: Ohio, USA
Contact:

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#917 Post by mkoch227 » 20 Aug 2017 19:18

@ Rybak04

Read the "NOTICE" at viewtopic.php?p=787410#p787296.
Last edited by ohaha on 07 Oct 2017 18:22, edited 1 time in total.
Reason: Quote removed. Do not quote entire messages. Use direct addressing.
Wound3dTV
Posts: 1
Joined: 26 Aug 2017 12:10

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#918 Post by Wound3dTV » 26 Aug 2017 12:14

[ external image ]


@Elderado704 Hi man is there any way that you could upload this skin?
Last edited by Reef on 26 Aug 2017 12:32, edited 2 times in total.
SuperMaic
Posts: 14
Joined: 17 Apr 2016 09:12

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#919 Post by SuperMaic » 28 Aug 2017 20:01

Hey Sketch, thanks for the great skin! I really like it! :D But: Could you do me favor? I use your skin with both ETS2 and ATS, but for ETS2 it would be better to have european info's like "km/h" and "km" instead of "mp/h" and "mi" in the infoscreens. Also it would be nice when there is an additional "km/h"-scale below the "mp/h"-scale on the speedometer (don't know the right english word for it...).

Do you think you can do it for me? That would be very nice!!!
Last edited by ohaha on 07 Oct 2017 18:22, edited 1 time in total.
Reason: Quote removed. Do not quote entire messages. Use direct addressing.
User avatar
Elderado704
Posts: 37
Joined: 03 Feb 2016 03:31

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#920 Post by Elderado704 » 29 Aug 2017 00:01

@ Wound3dTV

Its here for 30days.

https://ufile.io/6yrvf
NEVER SHOW FEAR, SQUIDS CAN SENSE FEAR.
Post Reply

Return to “General discussion about the game”

Who is online

Users browsing this forum: Aziz, explosion65, vmfrlt and 11 guests