XY Plotter
<%!
// /************* start of utility routines ****************/
protected boolean stopRequested = false;
public int qIndex[]=new int[10000];
int BUFFER = 2048;
// compute sample data to be plotted (odd sinusoid harmonics)
public int makeData( Float[] data, String tempFile, int ORDER) {
int count=0;
for (int i=0;i
<%
// /************* start of main routine ****************/
String fName="";
String tempFile="c:/temp/tempFile";
Float floatXBuf[]=new Float[10000];
Float floatYBuf[]=new Float[10000];
String passBuf []=new String[10000];
String[] argSet1;
String[] argSet2;
String fOrder="";
String fState="";
int count=0;
float maxYval=0;
float minYval=0;
float maxXval=0;
float minXval=0;
int ORDER = 17;
int MAX_X=450; // max x axis expanse
int MAX_Y=250; // max y axis expanse
int Y_DIDDLE=25; // tweak the y values down a bit
// get form data if this is an interactive call
boolean formEntry=false;
if (request.getParameterValues("hiddenState")!=null) {
argSet1 = request.getParameterValues("hiddenState");
fState=argSet1[0];
formEntry=true;
}
if (request.getParameterValues("hiddenOrder")!=null) {
argSet2= request.getParameterValues("hiddenOrder");
fOrder=argSet2[0];
formEntry=true;
}
if (formEntry){
Integer fOrderInt=new Integer(fOrder);
// order of the harmonics we are computing
ORDER=fOrderInt.intValue()+2;
if (fState.indexOf("rst")!=-1)
ORDER=1;
}
// compute the sample data to be plotted
count=makeData(floatYBuf,tempFile,ORDER);
// start the scaling to fit the data on the plot surface
// first compute min/max
for (int i=0;imaxYval)
maxYval=floatYBuf[i].floatValue();
if (floatYBuf[i].floatValue()