Protection Plotting Tool

Protection

Faults

Custom Curves

Minimum
A
Maximum
A
Graph at
V
Graph Title

JS to get data out of Schneider web tool
v=[];Highcharts.charts[0].series[0].data.forEach(d=>v.push({x:Number(d.x.toFixed(3)),y:Number(d.y.toFixed(3))}));currents=[];times=[];i=0; interpolateTimes = (timeA,timeB,currentA,currentB,current) => { if(timeA==undefined || timeB==undefined) { return null; } else { var power=Math.log10(timeA/timeB)/(currentA-currentB); var multiplier=timeA/(10**(power*currentA)); if(multiplier<10e10) return multiplier*(10**(power*current)); if(current==currentA) return timeA; return null; } }; /*start at leftmost point on graph*/ while(v[i].x>v[i+1].x){i++};j=i+1; while(i>=0 && j<v.length) { if(v[i].x<=v[j].x) { /*Use lower current*/ currents.push(v[i].x); jtime=Math.max(0.0001,interpolateTimes(v[j].y,v[j-1].y,v[j].x,v[j-1].x,v[i].x)); times.push(Math.min(v[i].y,jtime)+";"+v[i].y+";"+Math.max(v[i].y,jtime)); i--; } else { currents.push(v[j].x); itime=Math.max(0.0001,interpolateTimes(v[i].y,v[i+1].y,v[i].x,v[i+1].x,v[j].x)); times.push(Math.min(v[j].y,itime)+";"+itime+";"+Math.max(v[j].y,itime)); j++; } } console.log("currents",currents.join(",")); console.log("times",times.join(","));