1 /***********************************************************************/ 2 /* Open Visualization Data Explorer */ 3 /* (C) Copyright IBM Corp. 1989,1999 */ 4 /* ALL RIGHTS RESERVED */ 5 /* This code licensed under the */ 6 /* "IBM PUBLIC LICENSE - Open Visualization Data Explorer" */ 7 /***********************************************************************/ 8 9 #include <dxconfig.h> 10 #include "../base/defines.h" 11 12 13 #ifndef _DXExecCtl_h 14 #define _DXExecCtl_h 15 16 17 #include "Base.h" 18 19 20 // 21 // Class name definition: 22 // 23 #define ClassDXExecCtl "DXExecCtl" 24 25 // 26 // Referenced classes. 27 class Network; 28 29 // 30 // DXExecCtl class definition: 31 // 32 class DXExecCtl : public Base 33 { 34 private: 35 // 36 // Private member data: 37 // 38 static void BGBeginMessage(void *clientData, int id, void *p); 39 static void BGEndMessage(void *clientData, int id, void *p); 40 static void HWBeginMessage(void *clientData, int id, void *p); 41 static void HWEndMessage(void *clientData, int id, void *p); 42 static void ExecComplete(void *clientData, int id, void *p); 43 static void ResumeExecOnChange(void *clientData, int id, void *p); 44 static void ResetVcrNextFrame(void *clientData, int id, void *p); 45 46 void beginSingleExecution(boolean update_macros); 47 void endLastExecution(boolean resume = FALSE); 48 49 boolean endExecOnChangePending; 50 51 protected: 52 // 53 // Protected member data: 54 // 55 56 // 57 // Execution flag. 58 // 59 boolean isCurrentlyExecuting; 60 boolean vcrIsExecuting; 61 boolean execOnChange; 62 int execOnChangeSuspensions; 63 int hwExecuting; // counter for HW rendering messages 64 boolean hwBusy; // setting of busy cursor for HW rendering 65 boolean forceNetworkResend; 66 boolean forceParameterResend; 67 boolean resumeExecOnChangeAfterExecution; isExecOnChangeSuspended()68 boolean isExecOnChangeSuspended() 69 { return this->execOnChangeSuspensions > 0; } 70 public: 71 // 72 // Constructor: 73 // 74 DXExecCtl(); 75 76 // 77 // Destructor: 78 // ~DXExecCtl()79 ~DXExecCtl(){} 80 81 82 // 83 // Enter/leave execute on change mode. 84 // 85 void newConnection(); 86 void suspendExecOnChange(); 87 void resumeExecOnChange(); 88 89 // 90 // Go out of execution on change mode without terminating the current 91 // graph execution. If not current executing, then we go ahead and 92 // go out of eoc mode, otherwise schedule the exit from eoc mode for 93 // the end of the current graph execution (see endLastExecution()). 94 // We return TRUE if we were able to go out of eoc mode now, FALSE if 95 // we won't be going out until the end of the current execution. 96 // 97 boolean endExecOnChange(); 98 99 void enableExecOnChange(); 100 void updateMacros(boolean force = FALSE); 101 void executeOnce(); 102 inExecOnChange()103 boolean inExecOnChange() { return this->execOnChange;} isExecuting()104 boolean isExecuting() { return this->isCurrentlyExecuting; } isVcrExecuting()105 boolean isVcrExecuting() { return this->vcrIsExecuting; } assignmentRequiresExecution()106 boolean assignmentRequiresExecution() 107 { return !this->isVcrExecuting() && !this->inExecOnChange(); } 108 109 // 110 // Functions called by the Sequencer. 111 // 112 void vcrFrameSet(char* command); 113 void vcrTransmit(); 114 void vcrExecute(int action); 115 void vcrCommand(int action, boolean state); 116 117 // 118 // Will take you out of execute on change if in it, and 119 // terminate the current execution. 120 void terminateExecution(); 121 void updateMacro(Network *n); 122 123 // 124 // This is used to force networks and parameters to be resent 125 // after a reset. 126 // 127 void forceFullResend(); 128 129 // 130 // Returns a pointer to the class name. 131 // getClassName()132 const char* getClassName() 133 { 134 return ClassDXExecCtl; 135 } 136 }; 137 138 139 #endif // _DXExecCtl_h 140