com.altair.hwm.toolkit.hwpm
Class HWPMInteraction

java.lang.Object
  extended by com.altair.hwm.toolkit.hwpm.HWPMInteraction
All Implemented Interfaces:
IHWInteraction

public class HWPMInteraction
extends java.lang.Object
implements IHWInteraction

Title: HWPMInteraction

Description: The class which interacts with HW's process manager

Company: Altair Engineering, Inc.


Field Summary
static java.lang.String CURSOR_NORNAL
           
static java.lang.String CURSOR_WAIT
           
static java.lang.String UI_DISABLED
          The various UI states PM can be in
static java.lang.String UI_PMI_OPENED
           
static java.lang.String UI_PMT_CLOSED
           
static java.lang.String UI_PMT_OPENED
           
static java.lang.String UI_RUN
           
 
Constructor Summary
HWPMInteraction()
          Constructor
 
Method Summary
 void AddItemToJScriptContext(java.lang.String strContKey, java.lang.Object objContValue)
          Add scope to the java script interpreter
 java.util.Vector ConvertListToVector(java.lang.String strList)
          Convert a vector to a string (list) in a format Tcl wants it
 java.lang.String ConvertVectorToList(java.util.Vector vector)
          Convert a vector to a string (list) in a format Tcl wants it
 void DisplayMsgBox(java.lang.String strMsg)
          Display debug messages
 java.lang.String EvalTCLCmd(java.lang.String strCmd)
          Send the command(query) through the socket to the Tcl side.
 java.lang.Object ExecuteJavaScript(java.lang.String strCmd)
          Execute a command as a java script on this class
 void Exit(java.lang.String strMessageID)
          This function is called by the TCL code when HW/HM is exiting.
 java.lang.String GetDataList(java.util.Vector vectVarNames)
          A vector of names and values to get from the datamodel
 IHWMFrame GetFrame()
          Get the IFrame interface.
 IHWMFrameWork GetFrameWork()
          Get the currently active model instance
 HWMAppFrameModel GetHWMAppFrameModel()
          Gets the Hyperworks Manager application model.
 HWMJavaScript GetJavaScriptInterpreter()
          Get the java script interpreter
 void Initialize(java.lang.String[] arrstrArgs)
          Pseudo Constructor that creates the AppFrameView, Sets the HWPM in them, initializes their view, etc.
static void main(java.lang.String[] arrstrArgs)
          The main method for the app mode of EPIC
 java.lang.String PmgrEvalTCLCmd(java.lang.String strCmd)
          Send the command(query) through the socket to the Tcl side.
 void PmgrSetupHWConnection()
          Create the comm class that will interact with the native library.
 void ReadProjectFrom(java.lang.String strPrjFile)
          Read the project from the given file
 void RemoveAllJavaScriptContexts()
          Removes all javascript context scopes
 java.lang.Object RemoveItemFromJScriptContext(java.lang.String strContKey)
          Remove the scope from the javascript interpreter
 void Run(int nPort)
          Connect to the socket and wait for messages.
 java.lang.String SendPmgrTclCmd(java.lang.String strCmd)
          Execute a command as a java script on this class
 java.lang.String SendPmgrTclCmdWOException(java.lang.String strCmd)
          Execute a command as a java script on this class
 java.lang.String SetDataList(java.util.Vector vectVarNames, java.util.Vector vectVarValues)
          A vector of names and values to set in the datamodel
 void SetFrameWork(IHWMFrameWork iHWMFrameWork)
          Set the framework
 java.lang.String SetPmgrTCLCursor(java.lang.String strCursor)
          Set the cursor state
 java.lang.String SetPmgrTCLState()
          Set the pmgr UI state depending on whether a tpl has been set/a pmi has been opened etc.
 java.lang.String SetPmgrTCLState(java.lang.String strState)
          Set the pmgr tcl UI state to the given state
 void WriteProjectTo(java.lang.String strPrjFile)
          Write the project to the given file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UI_DISABLED

public static final java.lang.String UI_DISABLED
The various UI states PM can be in

See Also:
Constant Field Values

UI_PMT_OPENED

public static final java.lang.String UI_PMT_OPENED
See Also:
Constant Field Values

UI_PMT_CLOSED

public static final java.lang.String UI_PMT_CLOSED
See Also:
Constant Field Values

UI_PMI_OPENED

public static final java.lang.String UI_PMI_OPENED
See Also:
Constant Field Values

UI_RUN

public static final java.lang.String UI_RUN
See Also:
Constant Field Values

CURSOR_WAIT

public static final java.lang.String CURSOR_WAIT
See Also:
Constant Field Values

CURSOR_NORNAL

public static final java.lang.String CURSOR_NORNAL
See Also:
Constant Field Values
Constructor Detail

HWPMInteraction

public HWPMInteraction()
Constructor

Parameters:
The - communication manager for this instance
Method Detail

GetJavaScriptInterpreter

public HWMJavaScript GetJavaScriptInterpreter()
Get the java script interpreter

Returns:
HWMJavaScript The java script interpreter

Initialize

public void Initialize(java.lang.String[] arrstrArgs)
                throws java.lang.Exception
Pseudo Constructor that creates the AppFrameView, Sets the HWPM in them, initializes their view, etc.

Specified by:
Initialize in interface IHWInteraction
Parameters:
-
Throws:
java.lang.Exception

WriteProjectTo

public void WriteProjectTo(java.lang.String strPrjFile)
                    throws java.lang.Exception
Write the project to the given file

Parameters:
strPrjFileName -
Throws:
java.lang.Exception

ReadProjectFrom

public void ReadProjectFrom(java.lang.String strPrjFile)
                     throws java.lang.Exception
Read the project from the given file

Parameters:
strPrjFileName -
Throws:
java.lang.Exception

SetDataList

public java.lang.String SetDataList(java.util.Vector vectVarNames,
                                    java.util.Vector vectVarValues)
                             throws java.lang.Exception
A vector of names and values to set in the datamodel

Parameters:
vectVarNames - The vector of names
vectVarValues - The vector of values
Returns:
String Returns "" if successful
Throws:
java.lang.Exception

SetFrameWork

public void SetFrameWork(IHWMFrameWork iHWMFrameWork)
Set the framework

Parameters:
iHWMFrameWork - The framework for the instance

RemoveAllJavaScriptContexts

public void RemoveAllJavaScriptContexts()
Removes all javascript context scopes


AddItemToJScriptContext

public void AddItemToJScriptContext(java.lang.String strContKey,
                                    java.lang.Object objContValue)
Add scope to the java script interpreter

Specified by:
AddItemToJScriptContext in interface IHWInteraction
Parameters:
String - strContKey - The javascript context to be added
Object - objContValue - The javascript context object to be added

RemoveItemFromJScriptContext

public java.lang.Object RemoveItemFromJScriptContext(java.lang.String strContKey)
Remove the scope from the javascript interpreter

Specified by:
RemoveItemFromJScriptContext in interface IHWInteraction
Parameters:
String - strContKey - The javascript context to be added
Returns:

GetDataList

public java.lang.String GetDataList(java.util.Vector vectVarNames)
                             throws java.lang.Exception
A vector of names and values to get from the datamodel

Parameters:
vectVarNames - The vector of names
Returns:
String Returns the list of values if successful
Throws:
java.lang.Exception

Exit

public void Exit(java.lang.String strMessageID)
This function is called by the TCL code when HW/HM is exiting. Save and exit


SetPmgrTCLCursor

public java.lang.String SetPmgrTCLCursor(java.lang.String strCursor)
Set the cursor state

Parameters:
strCursor - The cursor to set
Returns:
String The old cursor

SetPmgrTCLState

public java.lang.String SetPmgrTCLState(java.lang.String strState)
Set the pmgr tcl UI state to the given state

Parameters:
strState - The state to set to
Returns:
String The old state

SetPmgrTCLState

public java.lang.String SetPmgrTCLState()
Set the pmgr UI state depending on whether a tpl has been set/a pmi has been opened etc.

Returns:
String The old state

SendPmgrTclCmdWOException

public java.lang.String SendPmgrTclCmdWOException(java.lang.String strCmd)
Execute a command as a java script on this class

Parameters:
strCmd - The command to execute
bEncloseInCatch - If true, enclose the command in a catch statement

SendPmgrTclCmd

public java.lang.String SendPmgrTclCmd(java.lang.String strCmd)
                                throws java.lang.Exception
Execute a command as a java script on this class

Parameters:
strCmd - The command to execute
bEncloseInCatch - If true, enclose the command in a catch statement
Throws:
java.lang.Exception

ExecuteJavaScript

public java.lang.Object ExecuteJavaScript(java.lang.String strCmd)
                                   throws java.lang.Exception
Execute a command as a java script on this class

Specified by:
ExecuteJavaScript in interface IHWInteraction
Parameters:
strCmd - The command to execute
Throws:
java.lang.Exception

ConvertVectorToList

public java.lang.String ConvertVectorToList(java.util.Vector vector)
Convert a vector to a string (list) in a format Tcl wants it


ConvertListToVector

public java.util.Vector ConvertListToVector(java.lang.String strList)
Convert a vector to a string (list) in a format Tcl wants it


GetFrame

public IHWMFrame GetFrame()
Get the IFrame interface.

Returns:
IHWMFrame interface

PmgrSetupHWConnection

public void PmgrSetupHWConnection()
Create the comm class that will interact with the native library.


PmgrEvalTCLCmd

public java.lang.String PmgrEvalTCLCmd(java.lang.String strCmd)
Send the command(query) through the socket to the Tcl side. Wait for return queries, and process them till an ack is received for this. This method may be called by either


EvalTCLCmd

public java.lang.String EvalTCLCmd(java.lang.String strCmd)
Send the command(query) through the socket to the Tcl side. Wait for return queries, and process them till an ack is received for this. This method may be called by either

Specified by:
EvalTCLCmd in interface IHWInteraction

Run

public void Run(int nPort)
         throws java.lang.Exception
Connect to the socket and wait for messages. The Main Thread will now listen, receive and process any message NOTE: This function is executed in the main thread!!!

Throws:
java.lang.Exception

DisplayMsgBox

public void DisplayMsgBox(java.lang.String strMsg)
Display debug messages

Parameters:
strMsg - The message to display

GetFrameWork

public IHWMFrameWork GetFrameWork()
Get the currently active model instance


GetHWMAppFrameModel

public HWMAppFrameModel GetHWMAppFrameModel()
Gets the Hyperworks Manager application model.

Returns:
An instance of the model behind Hyperworks Manager.

main

public static void main(java.lang.String[] arrstrArgs)
The main method for the app mode of EPIC

Parameters:
arrstrArgs - The cmd line args