Running Time - moment.js - E2C library

#1
Caspar friends,

I am looking help with creating the following script... I am currently using Seppo's E2C *Edge Animate to Caspar) libraries and I don't know how to approach the following challenge.

Background: I am trying to create a running time for ski racing to display on my CasparCG. The "start time" of the running time comes from an external xml field which I have Casparcg and the E2C library's able to read.
(<Oncourse_Run1StartAssigned1>25:13.000000</Oncourse_Run1StartAssigned1>) this "start time" is from an external electronic ski timing computer which I have software putting it into the xml file.

Seppo has added the moment.js library to his E2C library. What I believe needs to happen is to have the xml field read (<Oncourse_Run1StartAssigned1>) and set as a local var (this would be Zero time). Then have the local var compared to current time on pc via moment.js -- starting at zero - increasing. Format would be minute.sec.x - in a stopwatch type display.

Is anybody able to help with this problem? Do not mind paying for your services. Here is an example of the code Seppo used for a clock if you are not familiar with his work. see video at 1:23.30 -- https://www.youtube.com/watch?v=2HEMLY-N8fk&t=5106s

Thanks
Jon Cuthbertson

Re: Running Time - moment.js - E2C library

#2
You will probably need 1/100 sec precision, which makes it a bit awkward to read a .XML file from disk hundreds a times each second. Are you sure you can't get those times through Ajax from that external time source? Maybe uploading somewhere external timing device manual would be useful?

Re: Running Time - moment.js - E2C library

#3
itod wrote:You will probably need 1/100 sec precision, which makes it a bit awkward to read a .XML file from disk hundreds a times each second. Are you sure you can't get those times through Ajax from that external time source? Maybe uploading somewhere external timing device manual would be useful?
You will read in the XML only once, to get the start-time and every time you get a lap-time and the final time. I would also suggest NOT to use a file, but some kind of a service to read that information from. I normally do such processing in a client and only send the data to the template via standard Caspar comands. You stil can do the calculation of the offset (-> giving you the atheles current time) inside your template, but do the data exchange with the external system in the client. That will keep the template clean from such code.
Didi Kunz
CasparCG Client-Programmer, Template Maker & Live CG-Operator
Media Support, CH-5722 Gränichen, Switzerland http://mediasupport.ch/
Problems? Guide to posting Bug reports & Feature requests

Re: Running Time - moment.js - E2C library

#4
Thanks for your replies... let me clarify.

Ski timing computer sends out rs232 data to my PC program which stores data into xml. There is never a "running" time sent via rs232, just a time when the athlete started the race (<Oncourse_Run1StartAssigned1>25:13.000000</Oncourse_Run1StartAssigned1>.

When the athlete finishes the race a separate field gets updated via rs232 to xml conversion with the official time - which I will display via caspar -- this is not calculated just formatted and converted.

While the athlete is on the ski hill - I would like to take the "25:13.000000" and consider this "time" = zero. And have a running clock based on pc's clock to demonstrate a "running clock". In no way is this an official time, just a graphical representation on how long they have been on the hill for.... when the athlete actually finishes the race -- the xml file gets updated and their official time gets shown in a different area of the screen. While the next person who is on the hill gets a (<Oncourse_Run1StartAssigned1>25:13.000000</Oncourse_Run1StartAssigned1> of their own -- meaning I actually never stop the "running clock" I just have it replaced with the next persons "running clock".

Here is a text example on how my screen looks during a race:

1) At the gate-- name, club
2) On the course -- name, club, running time
3) Finished -- name, club, rank, official time


As #1 starts racing -- they go in to the #2 spot. When they finish their race they go in #3 -- meanwhile 1 gets replaced by next person standing by to race.


If this helps anybody suggest a solution I would be very happy -- as I mentioned, I am willing to pay for this development however I need it to work with the rest of my E2C / caspar playout.

I hope this helps... If someone wants we can arrange a skype, teamviewer or alternative...

Thanks
Jon

Who is online

Users browsing this forum: No registered users and 1 guest

cron