added recoil inner and outter radius

This commit is contained in:
Ryan@fsunuc 2022-12-21 13:38:11 -05:00
parent c59a49cd13
commit 4bc68108d5
2 changed files with 32 additions and 4 deletions

View File

@ -203,6 +203,15 @@
</tr> </tr>
</table> </table>
<table>
<tr>
<td style="text-align:right" > Recoil radius, inner [mm]:</td>
<td><Input type="text" style="width:40px" value="10" id='innerRecoil' enterkeyhint="done"/></td>
<td style="text-align:right" > outter [mm]:</td>
<td><Input type="text" style="width:40px" value="45" id='outterRecoil' enterkeyhint="done"/></td>
</tr>
</table>
<p></p> <p></p>

View File

@ -767,17 +767,20 @@ document.getElementById('posArrayRange').oninput = function(){
function AdjustRecoilPos(){ function AdjustRecoilPos(){
let pos1 = parseInt(document.getElementById('posRecoil').value); let pos1 = parseInt(document.getElementById('posRecoil').value);
let pos2 = pos1+10; let pos2 = pos1+10;
let radius1 = parseInt(document.getElementById('innerRecoil').value);
let radius2 = parseInt(document.getElementById('outterRecoil').value);
//document.getElementById('n0').innerHTML = pos1; //document.getElementById('n0').innerHTML = pos1;
let shapeRecoil = { let shapeRecoil = {
type: 'rect', type: 'rect',
xref: 'x', xref: 'x',
yref: 'y', yref: 'y',
x0 : pos1, x0 : pos1,
x1 : pos2, x1 : pos2,
y0 : 10, y0 : radius1,
y1 : 45, y1 : radius2,
fillcolor : '#FF0000', fillcolor : '#FF0000',
opacity : 0.4, opacity : 0.4,
line : { width : 0} line : { width : 0}
@ -821,6 +824,22 @@ document.getElementById('posRecoilRange').oninput = function(){
AdjustRecoilPos(); AdjustRecoilPos();
} }
document.getElementById('innerRecoil').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
AdjustRecoilPos();
}
}, false
);
document.getElementById('outterRecoil').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
AdjustRecoilPos();
}
}, false
);
function AdjustRangeRZ(){ function AdjustRangeRZ(){
let zmin = parseInt(document.getElementById('zRange1').value); let zmin = parseInt(document.getElementById('zRange1').value);