commit 8973e5531dfa09280bb952ab8afdfd14e4f1bfe7 Author: William Henderson Date: Fri Nov 7 15:43:11 2025 +0000 initial diff --git a/ScoreboardXML.py b/ScoreboardXML.py new file mode 100644 index 0000000..2dfb3df --- /dev/null +++ b/ScoreboardXML.py @@ -0,0 +1,60 @@ +import os +import time +import requests +import xml.etree.ElementTree as ET +from datetime import datetime + +# Function to parse the 'speed.xml' file and extract the speed value +def parse_speed_from_xml(xml_file): + try: + tree = ET.parse(xml_file) + root = tree.getroot() + for elem in root.iter('Serve'): + if 'Speed' in elem.attrib: + speed_str = elem.attrib['Speed'] + return float(speed_str), ET.tostring(elem, encoding="unicode") + except Exception as e: + print(f"Error parsing XML: {e}") + return None, None + +# Function to send HTTP POST request +def send_http_post(speed_value, xml_content): + hawkeye_time_raw = int((datetime.now() - datetime(2000, 1, 1)).total_seconds()) + + data = { + "Hawkeye Time (Date String)": datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"), + "Hawkeye Time (Raw)": hawkeye_time_raw, + "Speed": speed_value, + "Unit": "KPH", + "XML_Content": xml_content # Add XML content to the data + } + + try: + response = requests.post("http://10.10.1.201:40000/api/data", json=data) + response.raise_for_status() + print(f"HTTP POST Request Successful. Speed: {speed_value}, Raw Time: {hawkeye_time_raw}") + except requests.exceptions.RequestException as e: + print(f"HTTP POST Request Failed: {e}") + +# Function to check for file modification +def check_file_modification(xml_file, last_modification_time): + current_modification_time = os.path.getmtime(xml_file) + return current_modification_time != last_modification_time, current_modification_time + +if __name__ == "__main__": + # Define the 'speed.xml' file + xml_file = "\\\\10.10.1.51\RealTimeTennis\DataBridge1\SpeedforIDS\speed.xml" + + # Initialize the last modification time + last_modification_time = os.path.getmtime(xml_file) + + while True: + file_changed, last_modification_time = check_file_modification(xml_file, last_modification_time) + if file_changed: + speed_value, xml_content = parse_speed_from_xml(xml_file) + if speed_value is not None: + print("XML Content:") + print(xml_content) + send_http_post(speed_value, xml_content) + + time.sleep(0.5) # Check for changes every 0.5 seconds diff --git a/The Palace 2025/shells.zip b/The Palace 2025/shells.zip new file mode 100644 index 0000000..bd12ae8 Binary files /dev/null and b/The Palace 2025/shells.zip differ diff --git a/The Palace 2025/speedboard.html b/The Palace 2025/speedboard.html new file mode 100644 index 0000000..13a3f9e --- /dev/null +++ b/The Palace 2025/speedboard.html @@ -0,0 +1,90 @@ + + + + + +speedboard + +
+ + + +
+ + + + + + + + + + +
+ +
+
+
+ + \ No newline at end of file diff --git a/The Palace 2025/speedboard.js b/The Palace 2025/speedboard.js new file mode 100644 index 0000000..afb0b96 --- /dev/null +++ b/The Palace 2025/speedboard.js @@ -0,0 +1,352 @@ +(function (cjs, an) { + +var p; // shortcut to reference prototypes +var lib={};var ss={};var img={}; +lib.ssMetadata = []; + + +(lib.AnMovieClip = function(){ + this.actionFrames = []; + this.ignorePause = false; + this.gotoAndPlay = function(positionOrLabel){ + cjs.MovieClip.prototype.gotoAndPlay.call(this,positionOrLabel); + } + this.play = function(){ + cjs.MovieClip.prototype.play.call(this); + } + this.gotoAndStop = function(positionOrLabel){ + cjs.MovieClip.prototype.gotoAndStop.call(this,positionOrLabel); + } + this.stop = function(){ + cjs.MovieClip.prototype.stop.call(this); + } +}).prototype = p = new cjs.MovieClip(); +// symbols: +// helper functions: + +function mc_symbol_clone() { + var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop, this.reversed)); + clone.gotoAndStop(this.currentFrame); + clone.paused = this.paused; + clone.framerate = this.framerate; + return clone; +} + +function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) { + var prototype = cjs.extend(symbol, cjs.MovieClip); + prototype.clone = mc_symbol_clone; + prototype.nominalBounds = nominalBounds; + prototype.frameBounds = frameBounds; + return prototype; + } + + +(lib.unit = function(mode,startPosition,loop,reversed) { +if (loop == null) { loop = false; } +if (reversed == null) { reversed = false; } + var props = new Object(); + props.mode = mode; + props.startPosition = startPosition; + props.labels = {}; + props.loop = loop; + props.reversed = reversed; + cjs.MovieClip.apply(this,[props]); + + this.isSingleFrame = false; + // timeline functions: + this.frame_0 = function() { + if(this.isSingleFrame) { + return; + } + if(this.totalFrames == 1) { + this.isSingleFrame = true; + } + var data = SMARTGfxLink.data || {}; + + this.unitStyle.maxWidth = 1800; + this.unitStyle.lineWidth = null; + + this.unitStyle.text = data.unitText; + } + + // actions tween: + this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1)); + + // Layer_1 + this.text = new cjs.Text("", "80px 'CodecPro-Bold'", "#2AB41F"); + this.text.textAlign = "center"; + this.text.lineHeight = 101; + this.text.lineWidth = 100; + this.text.parent = this; + this.text.setTransform(-1033.65,739.25); + + this.unitStyle = new cjs.Text("km/h", "bold 50px 'Consolas'", "#FFFFFF"); + this.unitStyle.name = "unitStyle"; + this.unitStyle.textAlign = "center"; + this.unitStyle.lineHeight = 61; + this.unitStyle.lineWidth = 280; + this.unitStyle.parent = this; + this.unitStyle.setTransform(-0.05,-135.9); + + this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.unitStyle},{t:this.text}]}).wait(1)); + + this._renderFirstFrame(); + +}).prototype = getMCSymbolPrototype(lib.unit, new cjs.Rectangle(-1085.6,-137.9,1227.5,977.8), null); + + +(lib.speed_clip = function(mode,startPosition,loop,reversed) { +if (loop == null) { loop = false; } +if (reversed == null) { reversed = false; } + var props = new Object(); + props.mode = mode; + props.startPosition = startPosition; + props.labels = {}; + props.loop = loop; + props.reversed = reversed; + cjs.MovieClip.apply(this,[props]); + + // timeline functions: + this.frame_0 = function() { + var data = SMARTGfxLink.data || {}; + + var unit = data.unitType; + + //var animationLength = 42; + //var startFrame = this.currentFrame; + + if (unit == "KPH") { + + var serveSpeed = data.serveSpeed; + + this.speed.text = parseFloat(serveSpeed).toFixed(0) || ""; + + /*const countUpAnimation = () => { + var frameDifference = this.currentFrame - startFrame; + var progress = EasingFunctions.easeOutCubic(frameDifference/animationLength); + this.speed.text = Math.max(Math.min( (serveSpeed * (progress) ), serveSpeed), 0).toFixed(0); + } + + this.addEventListener('tick', countUpAnimation);*/ + } else if (unit == "MPH") { + + var serveSpeed = KPHtoMPH(data.serveSpeed); + + this.speed.text = parseFloat(serveSpeed).toFixed(0) || ""; + + /*const countUpAnimation = () => { + var frameDifference = this.currentFrame - startFrame; + var progress = EasingFunctions.easeOutCubic(frameDifference/animationLength); + this.speed.text = Math.max(Math.min( (serveSpeed * (progress) ), serveSpeed), 0).toFixed(0); + } + + this.addEventListener('tick', countUpAnimation);*/ + } + } + this.frame_1 = function() { + this.gotoAndPlay(0); + } + + // actions tween: + this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1).call(this.frame_1).wait(1)); + + // Layer 1 + this.speed = new cjs.Text("134", "bold 75px 'Consolas'", "#FFFFFF"); + this.speed.name = "speed"; + this.speed.textAlign = "center"; + this.speed.lineHeight = 90; + this.speed.lineWidth = 354; + this.speed.parent = this; + this.speed.setTransform(-74.6,-100.35); + + this.timeline.addTween(cjs.Tween.get(this.speed).wait(1).to({x:178,y:-138.65,font:"bold 200px 'Sharp Sans Display No1'",textAlign:NaN,lineHeight:265},0).wait(1)); + + this._renderFirstFrame(); + +}).prototype = p = new cjs.MovieClip(); +p.nominalBounds = new cjs.Rectangle(-253.5,-140.6,433.5,305.29999999999995); + + +// stage content: +(lib.speedboard = function(mode,startPosition,loop,reversed) { +if (loop == null) { loop = true; } +if (reversed == null) { reversed = false; } + var props = new Object(); + props.mode = mode; + props.startPosition = startPosition; + props.labels = {}; + props.loop = loop; + props.reversed = reversed; + cjs.MovieClip.apply(this,[props]); + + this.actionFrames = [5,13]; + // timeline functions: + this.frame_5 = function() { + this.stop(); + SMARTGfxLink.incrementKeyframe(); + } + this.frame_13 = function() { + SMARTGfxLink.reset(); + } + + // actions tween: + this.timeline.addTween(cjs.Tween.get(this).wait(5).call(this.frame_5).wait(8).call(this.frame_13).wait(2)); + + // speed + this.speedClip = new lib.speed_clip(); + this.speedClip.name = "speedClip"; + this.speedClip.setTransform(882.25,1254.25,0.9387,0.9385,0,0,0,703.5,382.9); + this.speedClip._off = true; + + this.timeline.addTween(cjs.Tween.get(this.speedClip).wait(1).to({_off:false},0).to({_off:true},12).wait(2)); + + // unit + this.unitClip = new lib.unit(); + this.unitClip.name = "unitClip"; + this.unitClip.setTransform(1170.65,1446.4,1.2363,1.2336,0,0,0,703.5,382.7); + this.unitClip._off = true; + + this.timeline.addTween(cjs.Tween.get(this.unitClip).wait(1).to({_off:false},0).to({_off:true},12).wait(2)); + + // Layer_1 + this.text = new cjs.Text("", "50px 'Consolas-Bold'", "#FFFFFF"); + this.text.textAlign = "center"; + this.text.lineHeight = 61; + this.text.lineWidth = 100; + this.text.parent = this; + this.text.setTransform(240.2,1227.05); + + this.timeline.addTween(cjs.Tween.get(this.text).wait(15)); + + this._renderFirstFrame(); + +}).prototype = p = new lib.AnMovieClip(); +p.nominalBounds = new cjs.Rectangle(-81.3,1338.9,557.6999999999999,671.5); +// library properties: +lib.properties = { + id: '36D6E8BDDCB50B4D9681420AF6CA779E', + width: 1920, + height: 1080, + fps: 50, + color: "#323232", + opacity: 0.00, + manifest: [], + preloads: [] +}; + + + +// bootstrap callback support: + +(lib.Stage = function(canvas) { + createjs.Stage.call(this, canvas); +}).prototype = p = new createjs.Stage(); + +p.setAutoPlay = function(autoPlay) { + this.tickEnabled = autoPlay; +} +p.play = function() { this.tickEnabled = true; this.getChildAt(0).gotoAndPlay(this.getTimelinePosition()) } +p.stop = function(ms) { if(ms) this.seek(ms); this.tickEnabled = false; } +p.seek = function(ms) { this.tickEnabled = true; this.getChildAt(0).gotoAndStop(lib.properties.fps * ms / 1000); } +p.getDuration = function() { return this.getChildAt(0).totalFrames / lib.properties.fps * 1000; } + +p.getTimelinePosition = function() { return this.getChildAt(0).currentFrame / lib.properties.fps * 1000; } + +an.bootcompsLoaded = an.bootcompsLoaded || []; +if(!an.bootstrapListeners) { + an.bootstrapListeners=[]; +} + +an.bootstrapCallback=function(fnCallback) { + an.bootstrapListeners.push(fnCallback); + if(an.bootcompsLoaded.length > 0) { + for(var i=0; i