Informal Specifications

The Simulator server is made up of three files; simulator_server, nmm_Miccroscope_Simulator, and nmm_Microscope. simulator_server runs the program by receiving and sending VRPN encoded messages. It calls functions in nmm_Microscope_Simulator to open up and close a simulator connection and to preform appropriate actions.

The two modules for simulator_server are the nmm_Microscope_Simulator module and the nmm_Microscope module.

Module Summaries for the Simulator Server:

nmm_Microscope_Simulator module: The nmm_Microscope_Simulator module contains functions to make and break a Microscape connection, to preform appropriate actions to the data, and to send the appropriate data values back depending on the received message.
nmm_Microscope: The nmm_Microscope module encodes data value sets from the simulator into VRPN to Microscape and decodes VRPN messages from Microscape.

Module Details

Input: microscope formatted files surface area data, commands from Microscape
Output: data values from surface area
Preconditions: Lines of communication setup between Microscape and simulator, Microscape running on a graphics machine
Postconditons: correct manipulation of data and correct data values received and Sent
Input: VRPN messages from Microscape or type of simulator messages for data to be encoded into and the data values
Output: decoded VRPN message from Microscape or encoded VRPN message to be sent to Microscape
Preconditions: nmm_Microscope_Simulator and simulator_server running properly
Postconditions: correctly encoded and decoded messages
Description:  This function is an interrupt handler.  Called to reinitialize the scanned data set. 
Input:  SET_OF_DATA_SETS * set
Output:  Reports the latest data set of the surface
Preconditions:  True
Post conditions: True
Description: This function is an interrupt handler.  Called to reinitialize a scanned point.
Input:  SET_OF_POINT_SETS point
Output: Reports the latest data point of the surface
Preconditions: True
Postconditions: True
Description:  This function is an interrupt handler.  Microscape needs to know what region it is looking at and this function sends it to nmm_microscope.C.
Input:  no input
Output:  returns the region that is being looked at
Preconditions: True
Postconditions: True
Description:  Tells nmm_microscope.C what type of data point it will be receiving.
Input: const char *bufptr
Output:  encodes the point data set that is being looked at
Preconditions: True
Postconditions: True
Description:  This function gets data out of our data structure and passes it to spm_report_point_data
Input:  Two floats
Output:  send data about the point set
Preconditions: True
Postconditions: True
Description:  This function takes a data line in every data set and buffer without transforming the raw data at all and sends it to nmm_microscope.C.
Input:  An integer that keeps tract of what line of data is being looked at. 
Output:  A line of data is sent to nmm_microscope.C
Preconditions:  there is a line of data to send
Postconditions: new line of data to send
Description:  packs a message to send to Microscape
Input: many parameters such as longs and pointers
Output: sends out a packed message to Microscape
Preconditions: connected to Microscape and the simulator server is running.
Postconditions: Microscape displays image