📄 controls_cam.js
字号:
st.className="statusArmed"; st.value="ARMED"; document.getElementById('idArm').value="DISARM" } else if (document.lastStatus==2) { st.className="statusAcquired"; st.value="ACQUIRED"; document.getElementById('idArm').value=" ARM " } if((document.previousStatus!=2) &&(document.lastStatus==2)) getPicture(); document.previousStatus = document.lastStatus;}// ===================================================================================function setArm() { var g; var t=new Date(); var str= parent.document.cameraMCP+"?";//validate parameters here... document.previousStatus=0; if (document.lastStatus==1) str+="a=0"; // disarm else str+="a=1&e="+document.getElementById('idExposure').value;// arm if (document.getElementById('idDecimation1').checked) str+="&id=1"; if (document.getElementById('idDecimation2').checked) str+="&id=2"; if (document.getElementById('idDecimation4').checked) str+="&id=4"; str+="&iw="+document.getElementById('idImageWidth').value; str+="&ih="+document.getElementById('idImageHeight').value; str+="&it="+document.getElementById('idImageTop').value; str+="&il="+document.getElementById('idImageLeft').value;// str+="&ig="+document.getElementById('idGain').value; g=(document.getElementById('idGain').value-1)*63/4; if (g<0) g=0; if (g>63) g=63; str+="&ig="+g; str+="&iz="+document.getElementById('idDMABurst').value; str+=(document.getElementById('idFlipHor').checked) ? "&ix=1" : "&ix=0"; str+=(document.getElementById('idFlipVert').checked)? "&iy=1" : "&iy=0"; str+=(document.getElementById('idTestMode').checked)? "&ip=1" : "&ip=0"; str+="&s=1"; // update sequencer status str+='&l="'+escape("parent.frames[1].updateStatusAndLoop(document.sfResult)")+'"'; // onLoad str+="&_time="+t.getTime();// alert(str); parent.frames[0].location=str;}// ===================================================================================function condGetPicture () { // get picture if status is "Acquired" (2) if (document.previousStatus==2) getPicture();}function getPicture() { var t=new Date(); var str= parent.document.cameraImage+"?"; str+="r=1"; // just reload str+="&q="+document.getElementById('idQuality').value; str+="&c="+document.getElementById('idg').value; str+="&_time="+t.getTime();// alert(str); parent.frames[2].location=str; setReReadSensor();}// ===================================================================================function softTrigger() { var t=new Date(); var str= parent.document.cameraMCP+"?"; str+="s=2"; // software trigger str+='&l="'+escape("parent.frames[1].setUpdateStatus()")+'"'; // onLoad str+="&_time="+t.getTime();// alert(str); parent.frames[0].location=str;}// ===================================================================================function setUpdateStatus() { // setup default auto-reloadable page to refresh status and voltages var t=new Date(); var str= parent.document.cameraMCP+"?"; str+="r=04000004"; // read first four words (bits+voltages) str+="&n="+escape("parent.frames[1].document.camReadData"); // array name str+='&l="'+escape("parent.frames[1].updateStatus(document.sfResult)")+'"'; // onLoad str+="&s=1"; // update sequencer status str+="&x=2"; // refresh rate - set to 1 later? str+="&_time="+t.getTime(); parent.frames[0].location=str;}// ===================================================================================function updateStatusAndLoop(s) { updateStatus(s); setUpdateStatus();}function updateStatus(s) { // will be called periodically after mcprw.sgi reloads var Vref=10.2; var VMCP,VAnode;// update camera status if (s==5) setStatus(2); // image ready else if (s>0) setStatus(1); // armed else setStatus(0); // reset// update voltages and some other info?// will add more intelligence later: if (document.MCPpresent > 0) { document.getElementById('idVoltMCP').value=document.camReadData[1]; document.getElementById('idVoltAnode').value=document.camReadData[2]; document.getElementById('idVolt10V').value=document.camReadData[3]; VMCP=(document.camReadData[1]/document.camReadData[3])*1000/10*Vref; VAnode=(document.camReadData[2]/document.camReadData[3])*3000/4.3*Vref; VMCP=Math.round(VMCP); VAnode=Math.round(VAnode/10)*10; if ((document.camReadData[3]>3800) || (document.camReadData[3]<1000)) { document.getElementById('idMCPV').value="---"; document.getElementById('idAnodeKV').value="---"; } else { document.getElementById('idMCPV').value=VMCP; document.getElementById('idAnodeKV').value=VAnode/1000; } } }// ===================================================================================/*<input type="text" name="nMCPV" id="idMCPV" size="4" class="statusVoltage" readOnly="true"><td><input type="text" name="nAnodeKV" id="idAnodeKV" size="4" class="statusVoltage" readOnly="true"> kV</td>function seqSendCompiled() { var t=new Date(); var str= parent.document.cameraMCP+"?"; var i,d; str+="w=0200"; // start of for (i=0;i<document.camSeqData.length;i++) { d=document.camSeqData[i].toString(16); while (d.length<4) d="0"+d; str+=d; } str+='&l="'+escape("parent.frames[1].setUpdateStatus()")+'"'; str+="&_time="+t.getTime();// alert (str); parent.frames[0].location=str;} function seqGetData() { var t=new Date(); var str= parent.document.cameraMCP+"?"; var i,d;// alert("parent.frames[1].seqDeCompile="+parent.frames[1].seqDeCompile); str+="r=02000100"; // read all 256 words from sequencer str+="&n="+escape("parent.frames[1].document.camSeqData"); // array name str+='&l="'+escape("parent.frames[1].seqDeCompile()")+'"';// str+='&l="'+escape("parent.frames[1].justTest()")+'"';// str+='&l="'+escape("a()")+'"';// str+="&c="+escape('function a(){alert("asadfg");parent.frames[1].justTest();}'); str+="&_time="+t.getTime();// alert (str); parent.frames[0].location=str; }*/// ===================================================================================function setInitAll() { // will add/modify later var t=new Date(); parent.document.cameraURL= ".."; parent.document.cameraImage=parent.document.cameraURL+"/admin-bin/ccam.cgi"; parent.document.cameraMCP= parent.document.cameraURL+"/admin-bin/mcprw.cgi"; //alert ("parent.document.cameraMCP="+parent.document.cameraMCP); var str= parent.document.cameraMCP+"?"; var i,d;// alert("parent.frames[1].seqDeCompile="+parent.frames[1].seqDeCompile);// str+="r=02000100"; // read all 256 words from sequencer str+="r=00000400"; // read all 1024 words from camera shadow mwemory// str+="&n="+escape("parent.frames[1].document.camSeqData"); // array name str+="&n="+escape("parent.frames[1].document.camShadowData"); // array name str+='&l="'+escape("parent.frames[1].initAll()")+'"'; str+='&ir=1'; // report sensor settings str+="&_time="+t.getTime();// alert (str); parent.frames[0].location=str;}function initAll() { initSensor(); if (document.MCPpresent>0) { readInverterSequence(); getPWMSettings(); getTiming(); showTurnInverter((document.camShadowData[13]>0) && (document.camShadowData[13]<65535)); seqDeCompile(); } setUpdateStatus(); // will periodically update// setUpdateStatus(); // will periodically update }function setReReadSensor() { // var t=new Date(); var str= parent.document.cameraMCP+"?"; var i,d; str+='l="'+escape("parent.frames[1].reReadSensor()")+'"'; str+='&ir=1'; // report sensor settings str+="&_time="+t.getTime();// alert (str); parent.frames[0].location=str;}function reReadSensor() { initSensor(); setUpdateStatus(); // will periodically update}function initSensor() { // read sensor parameters and fill form elements switch (parent.frames[0].document.Sensor_id_par) { case 1:{document.getElementById('idDecimation1').checked= true ;break;} case 2:{document.getElementById('idDecimation2').checked= true; break;} case 4:{document.getElementById('idDecimation4').checked= true; break;} } document.getElementById('idImageWidth').value=parent.frames[0].document.Sensor_iw_par; document.getElementById('idImageHeight').value=parent.frames[0].document.Sensor_ih_par; document.getElementById('idImageTop').value=parent.frames[0].document.Sensor_it_par; document.getElementById('idImageLeft').value=parent.frames[0].document.Sensor_il_par; document.getElementById('idFlipHor').checked=(parent.frames[0].document.Sensor_ix_par>0); document.getElementById('idFlipVert').checked=(parent.frames[0].document.Sensor_iy_par>0);// document.getElementById('idGain').value=parent.frames[0].document.Sensor_ig_par; document.getElementById('idGain').value=parent.frames[0].document.Sensor_ig_par*4/63+1; document.getElementById('idTestMode').checked= (parent.frames[0].document.Sensor_ip_par>0); document.getElementById('idDMABurst').value=parent.frames[0].document.Sensor_iz_par; }function restart() { var t=new Date();// parent.frames[0].location="blank.html";// alert ("parent.frames[0].location="+parent.frames[0].location);// alert ("parent.frames[0].location="+parent.frames[0].location); parent.location= "camera.html"+"?time="+t.getTime();;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -