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

nmm_microscope_simulator:
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
nmm_microscope.C:
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
nmm_Microscope_Simulator.C:
 report_latest_data_sets: 
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
spm_report_latest_point_sets:
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
spm_report_latest_region:
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
 spm_report_point_datasets:
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
spm_report_point_set:
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
spm_report_window_line_data:
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
nmm_Microscope.C:
encode_windowLineData:
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