com.altair.hwm.comm.hm
Class HWMCommHM

java.lang.Object
  extended by java.lang.Thread
      extended by com.altair.hwm.comm.HWMClientComm
          extended by com.altair.hwm.comm.hm.HWMCommHM
All Implemented Interfaces:
HWMComm, java.lang.Runnable
Direct Known Subclasses:
HWMCommPM

public class HWMCommHM
extends HWMClientComm

Title: HWMCommHM

Description: The thread that monitors all communication to/from HM. This thread manages the socket between the client app and Hypermesh

Company: Altair Engineering, Inc.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HWMCommHM(HWMCommMgr hwmCommMgr, java.lang.String szSessionName, int nPort)
          Purpose: Constructor.
HWMCommHM(HWMCommMgr hwmCommMgr, java.lang.String szSessionName, int nPort, java.lang.String strAddress)
          Purpose: Constructor.
HWMCommHM(HWMCommMgr hwmCommMgr, java.lang.String szHMPath, java.lang.String[] arrszArgs, java.lang.String szWorkingDir, java.lang.String szSessionName)
          Purpose: Constructor.
HWMCommHM(HWMCommMgr hwmCommMgr, java.lang.String szHMPath, java.lang.String[] arrszArgs, java.lang.String szWorkingDir, java.lang.String szSessionName, int nPort)
          Purpose: Constructor.
HWMCommHM(HWMCommMgr hwmCommMgr, java.lang.String szHMPath, java.lang.String[] arrszArgs, java.lang.String szWorkingDir, java.lang.String szSessionName, int nPort, java.lang.String szCommPath)
          Purpose: Constructor.
HWMCommHM(HWMCommMgr hwmCommMgr, java.lang.String szHMPath, java.lang.String[] arrszArgs, java.lang.String szWorkingDir, java.lang.String szSessionName, java.lang.String szCommPath)
          Purpose: Constructor.
 
Method Summary
 HWMResponseHandle CreateFunction(java.lang.String szFuncCode)
          Purpose: Allows a TCL function to be defined, and passed over the socket to be used by HyperMesh.
 HWMResponseHandle CreateFunction(java.lang.String[] szFuncCode)
          Purpose: Allows a TCL function to be defined, and passed over the socket to be used by HyperMesh.
 void CreateList(java.lang.String szEntityType, int nListID, java.util.Vector vectEntities)
           
 void CreateMark(java.lang.String szEntityType, int nListID, java.lang.String szGroup)
           
 void CreateMark(java.lang.String szEntityType, int nListID, java.util.Vector vectEntities)
           
 void CreateNode(int nX, int nY, int nZ, int nSysID, int nSurfaceId, int nGeomIndex)
          Testing some commands and queries
 void Disconnect()
          Purpose: Exits the application.
 HWMResponseHandle GetMark(java.lang.String szEntityType, int nListID)
           
 void LineCreateFromNodes(int nListID, int nType, float fBreakAngle, float fAspect, float fLinearAngle)
           
 void StartHM()
          Setup the right command line args and start HM
 void StartMotion()
          Setup the right command line args and start Motion View
 
Methods inherited from class com.altair.hwm.comm.HWMClientComm
AddCommListener, Connect, ConnectToApplication, CreateServerSocket, GetSessionName, IsActive, IsPeerAlive, IsTerminated, RemoveCommListener, run, SendCommand, SendMessage, SendQuery, StartApplication, Terminate, WaitForHandShake
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HWMCommHM

public HWMCommHM(HWMCommMgr hwmCommMgr,
                 java.lang.String szHMPath,
                 java.lang.String[] arrszArgs,
                 java.lang.String szWorkingDir,
                 java.lang.String szSessionName,
                 int nPort,
                 java.lang.String szCommPath)
Purpose: Constructor. This version is designed to accept a port, so if a specific TCP/IP port is desired, it will be used.

Parameters:
hwmCommMgr - -- The reference to the manager that manages this thread
String - szHMPath -- The full path to the version of HyperMesh that will be used.
String[] - arrszArgs -- Any arguments that need to be passed to the application, BEYOND those needed for the communications
String - szWorkingDir -- The directory that the application should be started from
int - nPort -- The port that should be used for the ServerSocket
String - szCommPath -- The full path to the comm.tcl script, which is required for HyperMesh
String - szSessionName -- The Session Name that should be used

HWMCommHM

public HWMCommHM(HWMCommMgr hwmCommMgr,
                 java.lang.String szHMPath,
                 java.lang.String[] arrszArgs,
                 java.lang.String szWorkingDir,
                 java.lang.String szSessionName,
                 int nPort)
Purpose: Constructor. This version is designed to specify the TCP/IP port, but use the comm.tcl from the scripts directory

Parameters:
hwmCommMgr - -- The reference to the manager that manages this thread
String - szHMPath -- The full path to the version of HyperMesh that will be used.
String[] - arrszArgs -- Any arguments that need to be passed to the application, BEYOND those needed for the communications
String - szWorkingDir -- The directory that the application should be started from
int - nPort -- The port that should be used for the ServerSocket
String - szSessionName -- The Session Name that should be used

HWMCommHM

public HWMCommHM(HWMCommMgr hwmCommMgr,
                 java.lang.String szHMPath,
                 java.lang.String[] arrszArgs,
                 java.lang.String szWorkingDir,
                 java.lang.String szSessionName,
                 java.lang.String szCommPath)
Purpose: Constructor. This version is designed to force the Client comm thread to request a port from the OS

Parameters:
hwmCommMgr - -- The reference to the manager that manages this thread
String - szHMPath -- The full path to the version of HyperMesh that will be used.
String[] - arrszArgs -- Any arguments that need to be passed to the application, BEYOND those needed for the communications
String - szWorkingDir -- The directory that the application should be started from
String - szCommPath -- The full path to the comm.tcl script, which is required for HyperMesh
String - szSessionName -- The Session Name that should be used

HWMCommHM

public HWMCommHM(HWMCommMgr hwmCommMgr,
                 java.lang.String szHMPath,
                 java.lang.String[] arrszArgs,
                 java.lang.String szWorkingDir,
                 java.lang.String szSessionName)
Purpose: Constructor. This version is designed to force the client comm thread to request a port from the OS, and to use the comm.tcl in the scripts directory

Parameters:
hwmCommMgr - -- The reference to the manager that manages this thread
String - szHMPath -- The full path to the version of HyperMesh that will be used.
String[] - arrszArgs -- Any arguments that need to be passed to the application, BEYOND those needed for the communications
String - szWorkingDir -- The directory that the application should be started from
String - szSessionName -- The Session Name that should be used

HWMCommHM

public HWMCommHM(HWMCommMgr hwmCommMgr,
                 java.lang.String szSessionName,
                 int nPort,
                 java.lang.String strAddress)
Purpose: Constructor. This version is designed to force the client comm thread to connect to an application already started

Parameters:
hwmCommMgr - -- The reference to the manager that manages this thread
String - szSessionName -- The Session Name that should be used
nPort - The port number that the server application is listening to
strAddress - The IP of the server app is listening at

HWMCommHM

public HWMCommHM(HWMCommMgr hwmCommMgr,
                 java.lang.String szSessionName,
                 int nPort)
Purpose: Constructor. This version is designed to force the client comm thread to connect to an application already started

Parameters:
hwmCommMgr - -- The reference to the manager that manages this thread
String - szSessionName -- The Session Name that should be used
nPort - The port number that the server application is listening to
Method Detail

Disconnect

public void Disconnect()
Purpose: Exits the application. a *exit cmd is sent to HM

Specified by:
Disconnect in interface HWMComm
Overrides:
Disconnect in class HWMClientComm

StartHM

public void StartHM()
Setup the right command line args and start HM


StartMotion

public void StartMotion()
Setup the right command line args and start Motion View


CreateFunction

public HWMResponseHandle CreateFunction(java.lang.String szFuncCode)
                                 throws java.io.IOException
Purpose: Allows a TCL function to be defined, and passed over the socket to be used by HyperMesh. For instance, to calculate a bounding box, instead of sending a seperate Query for each node to determine the X, Y and Z for each node, a TCL Proc can be sent to HyperMesh to do the calculations. In order for this function to work, the entire TCL code should be compressed into a single newline seperated String.

Parameters:
String - szFuncCode -- The TCL code, seperated by newline characters
Throws:
java.io.IOException

CreateFunction

public HWMResponseHandle CreateFunction(java.lang.String[] szFuncCode)
                                 throws java.io.IOException
Purpose: Allows a TCL function to be defined, and passed over the socket to be used by HyperMesh. For instance, to calculate a bounding box, instead of sending a seperate Query for each node to determine the X, Y and Z for each node, a TCL Proc can be sent to HyperMesh to do the calculations. In order for this function to work, the entire TCL code should be parsed into a String array, with one line of code per element in the array.

Parameters:
String - szFuncCode -- The TCL code, seperated by newline characters
Throws:
java.io.IOException

CreateNode

public void CreateNode(int nX,
                       int nY,
                       int nZ,
                       int nSysID,
                       int nSurfaceId,
                       int nGeomIndex)
Testing some commands and queries


CreateList

public void CreateList(java.lang.String szEntityType,
                       int nListID,
                       java.util.Vector vectEntities)

LineCreateFromNodes

public void LineCreateFromNodes(int nListID,
                                int nType,
                                float fBreakAngle,
                                float fAspect,
                                float fLinearAngle)

CreateMark

public void CreateMark(java.lang.String szEntityType,
                       int nListID,
                       java.util.Vector vectEntities)

CreateMark

public void CreateMark(java.lang.String szEntityType,
                       int nListID,
                       java.lang.String szGroup)

GetMark

public HWMResponseHandle GetMark(java.lang.String szEntityType,
                                 int nListID)