Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 14 additions & 19 deletions Sources/AutoAdj.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


/** AutoAdj.java
*
* A207: eliminated groups
* class LMadj is at the bottom of this file.
* A190, Nov 2015: introducing weights.
* @author: M.Lampton (c) 2003..2006 STELLAR SOFTWARE all rights reserved.
Expand All @@ -22,7 +22,7 @@ class AdjHost implements B4constants
//----------parallel with InOut-------------
private OEJIF optEditor = null;
private REJIF rayEditor = null;
private int nsurfs=0, ngroups=0, nrays=0, onfields=0, rnfields=0;
private int nsurfs=0, nrays=0, onfields=0, rnfields=0;
private int npts, nadj=0, onadj=0, rnadj=0, ngood=0, autongoals=0;
private boolean bWFE=false;

Expand Down Expand Up @@ -58,11 +58,10 @@ class AdjHost implements B4constants
rayEditor.doStashForUndo();

nsurfs = DMF.giFlags[ONSURFS];
ngroups = DMF.giFlags[ONGROUPS];
onfields = DMF.giFlags[ONFIELDS]; // fields per optic.
nrays = DMF.giFlags[RNRAYS];
rnfields = DMF.giFlags[RNFIELDS]; // fields per ray.
if ((ngroups<1) || (onfields<1) || (nrays<1) || (rnfields<1))
if ((onfields<1) || (nrays<1) || (rnfields<1))
return; // SNH graying.

bWFE = DMF.giFlags[RWFEFIELD] > RABSENT;
Expand Down Expand Up @@ -173,17 +172,13 @@ private double getDelta(int iadj)
int j = optEditor.getAdjSurf(iadj);
if ((j>0) && (j<=nsurfs))
{
int g = RT13.group[j];
if ((g>0) && (g<=ngroups))
{
for (int kray=1; kray<=nrays; kray++)
if (RT13.bGoodRay[kray])
{
double rx = RT13.dGetRay(kray, g, RTXL);
double ry = RT13.dGetRay(kray, g, RTYL);
r = Math.max(r, Math.sqrt(rx*rx+ry*ry));
}
}
for (int kray=1; kray<=nrays; kray++)
if (RT13.isRayOK[kray])
{
double rx = RT13.dGetRay(kray, j, RTXL);
double ry = RT13.dGetRay(kray, j, RTYL);
r = Math.max(r, Math.sqrt(rx*rx+ry*ry));
}
}
if (r < 1E-6)
r = 0.5*dOsize;
Expand Down Expand Up @@ -299,7 +294,7 @@ else if (autongoals==2)
if (istatus==BADITER)
{
if (DMF.sAutoErr.equals("")) // no previous message
jL[7].setText("Ray risk. Stopping.");
jL[7].setText("Stopping: " + sResults[RT13.getFailCode()] + " " + RT13.getFailSurf());
else // retain previous message
jL[7].setText(DMF.sAutoErr);
}
Expand Down Expand Up @@ -361,19 +356,19 @@ private void vUpdateRayTable()
}

if (op == RDEBUG) // debugger message here....
rayEditor.putField(f, row, RT13.bGoodRay[kray] ? "OK" : "NG");
rayEditor.putField(f, row, RT13.isRayOK[kray] ? "OK" : "NG");


if (op >= RGOAL) // Comparo updates floating goals, not Auto.
continue;

if (op >= 100) // output table data are wanted here...
{
int jsurf = RT13.getGroupNum(op); // handles "final"
int jsurf = RT13.getSurfNum(op); // handles "final"
int iattr = RT13.getAttrNum(op);
if ((iattr>=0) && (iattr<RNATTRIBS) && (jsurf>0))
{
if (RT13.bGoodRay[kray])
if (RT13.isRayOK[kray])
{
double d = RT13.dGetRay(kray, jsurf, iattr);
rayEditor.putFieldDouble(f, row, d);
Expand Down
Loading