Commit b2ac032a authored by Tom Dwelly's avatar Tom Dwelly
Browse files

fix to plate/png naming

parent 027f9ab5
......@@ -668,10 +668,11 @@ function plotData() {
var mjd = parseInt(document.getElementById("pipeParams_MJD").innerHTML);
var fiberid = parseInt(document.getElementById("pipeParams_FIBERID").innerHTML);
var run2d = document.getElementById("pipeParams_RUN2D").innerHTML;
var str_plate = (plate < 10000 ? ("0000" + plate).slice(-4) : ("00000" + plate).slice(-5));
ctx.font = "18px Arial";
ctx.textAlign = "left";
ctx.beginPath();
var str_label = ("0000" + plate).slice(-4) + "-" + mjd + "-" + ("0000" + fiberid).slice(-4) + " (" + run2d + ")";
var str_label = str_plate + "-" + mjd + "-" + ("0000" + fiberid).slice(-4) + " (" + run2d + ")";
ctx.fillText(str_label, 5.0+xsize*0.005, 10.0+ysize*0.01);
ctx.stroke();
ctx.closePath();
......@@ -1344,8 +1345,8 @@ function downloadPng(){
var plate = parseInt(document.getElementById("pipeParams_PLATE").innerHTML);
var mjd = parseInt(document.getElementById("pipeParams_MJD").innerHTML);
var fiberid = parseInt(document.getElementById("pipeParams_FIBERID").innerHTML);
document.getElementById("downloader").download = "spec-" + ("0000" + plate).slice(-4) + "-" + mjd + "-" + ("0000" + fiberid).slice(-4) + ".png";
var str_plate = (plate < 10000 ? ("0000" + plate).slice(-4) : ("00000" + plate).slice(-5));
document.getElementById("downloader").download = "spec-" + str_plate + "-" + mjd + "-" + ("0000" + fiberid).slice(-4) + ".png";
document.getElementById("downloader").href = document.getElementById("myCanvas").toDataURL("image/png").replace(/^data:image\/[^;]/, 'data:application/octet-stream');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment