Classes for the Tcpclient applet:
-
Tcpclient
-
Clientwin
-
Chart
-
PlotterGraph
-
Data storage classes
-
Dialog classes
-
Tcpclient: Creates the Java applet on
the web page
-
Data members:
-
Clientwin window; The client window
-
Button start; The button on the web page. The
client window will be poped up when it is pressed.
-
Functions:
-
void init(); Create the start button on the web site, and
initialize the layout of the client window
-
boolean handleEvent(Event evt) Event handler. Handles the
following event:
-
The button "start" on the web site is pressed--create and pop up the client
window
-
Clientwin: The client window that acts as a
Graphic User Interface (GUI)
-
Data members:
-
final int HP4145A; The constant value that stands for the
instrument HP4145A
-
final int HP4142B; The constant value that stands for the
instrument HP4142B
-
int equipment; The instrument type
-
final int exp_num; The constant value that is the total
number of possible experiment groups
-
boolean[] experiments; Indicates which of the experiment groups
are available from the server. It can be changed and informed by server
during a session
-
Tcpclient Owner; The Tcpclient object that
owns this client window
-
Thread thread; The clientwin thread
-
URL base; Contains the internet address
-
Socket to_server; The socket that communicates with the server
-
DataInputStream is; Receives information from the server
-
PrintStream os; Sends information to the server
-
boolean is_connected; Indicates if the connection to the server
is established
-
IDR_MainMENU menu; The menu of the client window
-
Chart aCanvas; The canvas object on which to draw graphs
-
TextArea txtResp; The area in which data and other information are
displayed
-
Panel choose_graph; For the user to choose the experiment
whose data is to be plotter on the canvas
-
Button prevl, next, go; Press these buttons to choose the experiment
whose data is to be plotter on the canvas
-
TextField pagenum; The serial number entered by the
user, of the experiment whose data is to be plotter on the canvas
-
boolean canvas_added; Indicates if the canvas is added to the client
window. It will be true after the client window received the first stream
of data of the session
-
boolean display_added; Indicates if the text area is added to the
client window. It will be true after the client window received the first
stream of data of the session
-
boolean instruction_added; Indicates if the instruction dialog is
poped up
-
PlotterGraph aGraph Represents the data set for one sweeping measurement
o one continuous curve to be plotted
-
GridBagLayout gridbag; The layout of the client window
-
ChannelDialog Panel0; The pop-up dialog for selecting experiment
-
PanelDialog MosPanel1; The pop-up dialog for setting up measurements
for MOSFET Id-Vd characteristics
-
PanelDialog MosPanel2; The pop-up dialog for setting up measurements
for MOSFET Id-Vg characteristics
-
DiodeDialog DiodePanel; The pop-up dialog for setting up measurements
for Diode and CMOS characteristics
-
String Parameters_store; The commands to be sent to the server
boolean is_pair; The MOSFET parameter extraction experiment
is actually two measurements and hence there are two pop-up dialogs for
setting up the parameters and there will be two data sets from the server.
This value being true indicates the data set just received is the first
data set of a pair and that the data needs to be re-organized for parameter
extraction
-
boolean data_pair_waiting; The MOSFET parameter extraction experiment
is actually two measurements and hence there are two pop-up dialogs for
setting up the parameters and there will be two data sets from the server.
This value being true indicates the data set just received is the second
data set of a pair and that the data needs to be re-organized for parameter
extraction
-
int experiment_num; The number of experiments that has been sent
to the server
-
int result_num; The number of experiments whose data has been
received from the server
-
queue_node tmp_node; Records the parameters for the current experiment
to be sent to the server
-
task_queue tasks; A queue that contains the parameters for
all the experiments that has been sent to the server
-
MosExtract extract; The data processor for MOSFET parameter extraction
-
MEASURED_DATA Idvd_data=null, Idvg_data; //The data to be passed
to the MOSFET parameter extraction
-
Functions:
-
Clientwin(URL cb, Tcpclient owner); Constructor of the Clientwin
object, create the components of the client window, set up the layout,
initialize the data structures, and displays the instructions at the pop-up
of the client window
-
void start(); Start the Clientwin thread
-
void send_experiment(String Parameters); Send the experiment commands
to the server and display the notice with the experiment serial number
in the text area
-
void run(); Reads and handles all information form the server when
it is available. The kind of informations and the corresponding actions
are as follows.
-
The experiment was failed--display this information with the experiment
serial number in the text area and pop up a node from the task queue
-
The available groups of experiments are changed by the server--update data
member "experiments"
-
User message from the server--display it directly in the text area
-
Equitment type--update the data member "equipment"
-
The experiment data--If this is the first data set in the session, add
the GUI components, e.g. the text area and the canvas. Pass the data to
the canvas object so that it will parsed, displayed and plotted. If the
data set is the second of a pair for parameter extraction, re-organize
and pass the data to the MosExtract object
-
boolean handleEvent(Event evt) Event handler. Handles the
following event from the GUI:
-
The window is to be destroyed--destroy the client window; If connected
to the server, close connection.
-
The menu item "clear" is activated--set the string for the text area empty
-
The menu item "Start experiment" is activated--pop up the channel dialog
and disable this menu item
-
The menu item "Connect" is activated--if already connected, display the
information in the text area; Else, try to create the socket to the server.
If successful, create the input and output objects. In cases of both success
and failure, display the corresponding information in the text area
-
The menu item "Show instruction" is activated--pop up the instruction dialog
and disable this menu item
-
boolean action(Event evt, Object arg) Action event handler. Handles
the following action event from the GUI:
-
The menu item "Exit" is activated--destroy the client window; If connected
to the server, close connection.
-
The button "previous" is pressed--call the canvas object to plot the data
for the previous experiment
-
The button "next" is pressed--call the canvas object to plot the data for
the next experiment
-
The button "go" is pressed--call the canvas object to plot the data for
the experiment whose serial number is the same as in the text field "pagenum"
-
Chart The canvas object
-
data members
-
int xSize, ySize; The size of the canvas
-
Color bgColor, fgColor; The background and foreground color of the
canvas
-
Thread runner; The thread for this object
-
Tcpclient myOwner; The Tcpclient object that owns this canvas
-
String xAxisLabel, yAxisLabel; The x and y lables
-
PlotSetList myPlotSetList; The current data set (page) to be plotted
-
PlotPageList myPlotPageList; Contains the data sets (pages) of all
the experiments that has been done
-
int current_page; The data set being plotted
-
int type; The type of the experiment
-
functions
-
Chart (Tcpclient owner, Color bGround, Color fGround) The constructor
-
void start() Starts the thread
-
void stop() Ends the thread
-
String format_data(float t, float separ) Format the float number
t so that the last digit value equals to separ
-
String format_data(float t, int k) Format the float number t so
that it's last digit is the k'th digit after the decimal point
-
void paint(Graphics g) The drawing function called by the system.
It plot the current data sets for the experiment that has being done and
is selected. If the data set is empty, which mean that is a failed experiment,
the cavas will be blank except a title for the page.Otherwise, the grid
lines and the units are drawn. The data set will be plotted graph by graph
(or curve by curve) by calling the plot function of the graph objects.
-
addGraphs(PlotterGraph g) Add a data group (graph or curve) to the
current data set
-
setplotcolor(PlotterGraph aGraph, int cindex) Set the color for
the graph as desired
-
void new_page(String data_buffer, queue_node parnode, int pagenum) This
function processes the data buffer passed by the client window containg
the raw data received from the server. It parses the raw data into data
points, according to the experiment parameters contained in the queue_node,
and groups the data points into graphs (curves). A new data set (page)
PlotSetList is then created, with the graphs stored into it. The
new page is then pushed into the PlotPageList, where all the data sets
are stored. The function calles the function vertlist() to displayed the
data in the text area, and calls repaint(), which in turn calles paint(),
to plot the new data set on the canvas
-
void show_page(int pagenum) Calls the onpaint() function to plot
the selected page (data set). It checks if the pagenum is valid, and if
it is just the current page before that.
-
void vertlist() Displays the current data set in the Aim-spice format
and in the text area of the client window
-
MEASURED_DATA get_data() Return the current data set in the Aim-spice
format
-
and point by point, using linear interpolation, with automatic scaling
to the full size of the canvas.
-
PlotterGraph The graph object
-
data members
-
Chart owner; The canvas object that owns the graph
-
Color plotColor; The plot color
-
PlotList myPlotList; The plotlist that contains the data for the
graph
-
float xsize, ysize; The size of the canvas object on which the graph
is to be plotted
-
float xmin,max; The mininum and maximum values of the x coordinates
-
PlotListNode cursor_node; The node used to iterate the PlotList
-
String datalist; T
-
int cursor; T
-
functions
-
PlotterGraph(Chart ow,float min,float max); The constructor
-
void setPlotColor(Color c); Set the plot color
-
void addPoint(float x, double y ); Add a data point to the graph
-
int getNumberOfPoints(); Returns the numbof data points in the graph
-
void begin_data_onebyone(); Resets the cursor to begin to traverse
the list
-
PlotListNode get_next_data(); Returns the next data point
-
void begin_string_onebyone(); Reset the cursor to begin to traverse
the list in the string format
-
String get_next_string(); Returns the next data point in the string
format
-
void xyplot(Graphics g, double ymin,double ymax); Plots the graph
point by point, using linear interpolation, with automatic scaling to the
full size of the canvas.
-
double getMaxVal(); Returns the maximum measurement value in the
graph
-
double getMinVal(); Returns the minimum measurement value in the
graph
-
double getXMaxVal(); Returns the maximum x value in the list
-
double getXMinVal(); Returns the minimum x value in the list
-
Queue_node Stores the parameters for a measurement
-
data members
-
float xstart,xstop,xstep; The start, stop and step voltages for
the sweeping
-
float gstart,gstep; The start and the step voltage of the constant
voltage source
-
int gn; The number of steps of the constant voltage source
-
int type; The type of the experiment
-
boolean is_pair; Indicates if this is one of the two measurements
of the parameter extraction
-
public queue_node next; The next node
-
task_queue Contains the queue_nodes that stores
the parmeters for the measurements
-
data members
-
queue_node head,tail; The head and the tail of the queue
-
int num; The number of nodes in the queue
-
functions
-
void push(float start, float stop,float step, float g_start, float g_step,int
n, int the_type,boolean is_pair); Creates a new queue_node and store
the parameters
-
queue_node pop() Pop up a queue_node and retrieve the parameters
-
MEASURED_DATA Stores the data in the Aim-spice
format to be passed to MosExtract for parameter extraction
-
data members
-
int NumberOfRows;
-
int NumberOfColumns;
-
boolean idvd=true;
-
double [] pVar1;
-
double [] pVar2;
-
double [][] ppId;
-
functions
-
MEASURED_DATA(int numRows, int numCols, double [] var1, double [] var2,
double [][] id) the constructor
-
PlotListNode Stores a data point
-
data members
-
float x; The input data
-
double y; The measurement data
-
PlotListNode next; The next node
-
PlotList Stores data points for a graph (curve)
-
data members
-
PlotListNode head, tail; Head and tail of the list
-
int num; The number of data points
-
double maxValue, minValue; The maximum and minimum value of the
measurement data
-
functions
-
void add(float x, double y); Creates a new PlotListNode in the list
to store the data
-
int getNumElements(); Returns the number of nodes in the list
-
PlotListNode getHead(); Returns the head of the list
-
double getMaxVal(); Returns the maximum value in the list
-
double getMinVal(); Returns the minimum value in the list
-
PlotSetListNode Stores a graph object
-
data members
-
PlotterGraph graph; The stored graph object
-
PlotSetListNode next; The next node
-
PlotSetList Stores all the data set (page)
for a measurement
-
data members
-
PlotSetListNode head, tail; Head and tail of the list
-
int num; The number of graphs
-
functions
-
void add(PlotterGraph setNode); Creates a new PlotSetNode in the
list to store the graph
-
int getNum(); Returns the number of nodes in the list
-
PlotSetListNode getHead(); Returns the head of the list
-
void clear(); Clear the list
-
PlotPageNode Stores a PlotSetList
-
data members
-
PlotSetList list; The stored PlotSetlist
-
PlotSetListNode next; The next node
-
PlotPageList Stores the data sets(page) for
all the measurements
-
data members
-
PlotPageNode head, tail; Head and tail of the list
-
int num; The number of pages
-
int type; The type of the measurement
-
int pagenum; The page number
-
functions
-
void add(PlotSetList list, int the_type,int pagenum); Creates a
new PlotPageNode in the list to store the data set
-
int getNum(); Returns the number of nodes in the list
-
PlotPageNode getHead(); Returns the head of the list
-
void clear(); Clear the list
-
ChannelDialog The dialog for choosing
the type of experiment
-
data members
-
Clientwin Owner; The client window that owns the dialog
-
IDD_CHANNEL ctrls; The graphical componets on this dialog
-
functions
-
ChannelDialog( Clientwin dw, String title); The constructor. It
creates the graphical controls on this dialog. It checks the "experiments"
data member of the client window object for the availability of the experiment
groups and according enable or disable the check boxes for the experiments
-
boolean handleEvent(Event evt); The event handler. Handles the following
event:
-
The dialog is to be destroyed--close the dialog and enable the menu item
"Start experiment" in the client window
-
boolean action(Event evt, Object arg) Action event handler. Handles
the following action event:
-
The cancel button is pressed--close the dialog and enable the menu item
"Start experiment" in the client window
-
The ok button is pressed--according to the type of selected experiment,
pop up the dialog for the parameter setup
-
PanelDialog The dialog for parameter
setup for the MOSFET measurements
-
data members
-
Clientwin Owner; The client window that owns the dialog
-
IDD_PanelDIALOG ctrls; The graphical componets on this dialog
-
int type; The type of selected experiment for which this dialog
is poped up
-
functions
-
PanelDialog( Clientwin dw, String title, int the_type); The constructor.
It creates the graphical controls on this dialog. It enabls and disables
the graphical controls and set the default values of the text fields, according
to the type of the selected experiment
-
boolean handleEvent(Event evt); The event handler. Handles the following
event:
-
The dialog is to be destroyed--close the dialog and enable the menu item
"Start experiment" in the client window
-
boolean action(Event evt, Object arg) Action event handler. Handles
the following action event:
-
The cancel button is pressed--close the dialog and enable the menu item
"Start experiment" in the client window
-
The ok button is pressed--Fisrt, it validates the parameter values in the
text fields, and, if any of them is not legal, it displays the specific
error message in the messge text field. If all the parameters are
valid, the experiment commands are generated incorporating these parameters
and the type of measurements. The parameters and the type of experiment
are stored into the task_queue of the client window object by calling the
function push() of the client window. If the measurement is not the first
component of a parameter extraction experiment, the commands will be sent
to the server by calling the function send_experiment() of the client window,
and the menu item "Start experiment" in the client window" is enabled.
Otherwise, the commands will be temporarily stored and the second panel
dialog will be poped up. This dialog is closed in both cases
-
DiodeDialog The dialog for parameter
setup for the diode and CMOS measurements
-
data members
-
Clientwin Owner; The client window that owns the dialog
-
IDD_IVDIALOG ctrls; The graphical componets on this dialog
-
int type; The type of selected experiment for which this dialog
is poped up
-
functions
-
PanelDialog( Clientwin dw, String title, int the_type); The constructor.
It creates the graphical controls on this dialog. It enabls and disables
the graphical controls and set the default values of the text fields, according
to the type of the selected experiment
-
boolean handleEvent(Event evt); The event handler. Handles the following
event:
-
The dialog is to be destroyed--close the dialog and enable the menu item
"Start experiment" in the client window
-
boolean action(Event evt, Object arg) Action event handler. Handles
the following action event:
-
The cancel button is pressed--close the dialog and enable the menu item
"Start experiment" in the client window
-
The ok button is pressed--Fisrt, it validates the parameter values in the
text fields, and, if any of them is not legal, it displays the specific
error message in the messge text field. If all the parameters are
valid, the experiment commands are generated incorporating these parameters
and the type of measurements. The parameters and the type of experiment
are stored into the task_queue of the client window object by calling the
function push() of the client window. The commands will be sent to the
server by calling the function send_experiment() of the client window,
and the menu item "Start experiment" in the client window" is enabled.
-
instruct_dialog The dialog to show the
instructions
-
data members
-
Clientwin Owner; The client window that owns the dialog
-
String instruction; The instruction string
-
IDD_INSTRUCT ctrls; The graphical componets on this dialog
-
functions
-
instruct_dialog(Clientwin window); The constructor. It creates the
graphical controls on this dialog.
-
boolean handleEvent(Event evt); The event handler. Handles the following
event:
-
The dialog is to be destroyed--close the dialog and enable the menu item
"Show instructions" in the client window
-
boolean action(Event evt, Object arg) Action event handler. Handles
the following action event:
-
The ok button is pressed--close the dialog and enable the menu item "Show
instructions" in the client window