00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef UI_H_INCLUDED
00027 #define UI_H_INCLUDED
00028
00029 #include <map>
00030 #include <sstream>
00031
00032 #include "../systemclocktypes.h"
00033 #include "../simulationmember.h"
00034 #include "mysocket.h"
00035 #include "../pin.h"
00036 #include "../externaltype.h"
00037
00041 class UserInterface: public SimulationMember, private Socket, public ExternalType {
00042 protected:
00043 std::map<std::string, ExternalType*> extMembers;
00044 bool updateOn;
00045 SystemClockOffset pollFreq;
00046 std::string dummy;
00047 std::map<std::string, char> LastState;
00048 int waitOnAckFromTclRequest;
00049 int waitOnAckFromTclDone;
00050
00051
00052 void SetNewValueFromUi(const std::string &);
00053 public:
00054 void AddExternalType(const char *name, ExternalType *p) {
00055 extMembers[name]=p;
00056 }
00057 #ifndef SWIG
00058 void AddExternalType(const std::string& name, ExternalType *p) {
00059 AddExternalType(name.c_str(), p);
00060 }
00061 #endif
00062 UserInterface(int port, bool withUpdateControl=true);
00063 ~UserInterface();
00064 void SendUiNewState(const std::string &s, const char &c);
00065
00066 int Step(bool &, SystemClockOffset *nextStepIn_ns=0);
00067 void SwitchUpdateOnOff(bool PollFreq);
00068 void Write(const std::string &s);
00069 };
00070
00071 #endif