simulavr  1.1.0
ui.h
Go to the documentation of this file.
1 /*
2  ****************************************************************************
3  *
4  * simulavr - A simulator for the Atmel AVR family of microcontrollers.
5  * Copyright (C) 2001, 2002, 2003 Klaus Rudolph
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  ****************************************************************************
22  *
23  * $Id$
24  */
25 
26 #ifndef UI_H_INCLUDED
27 #define UI_H_INCLUDED
28 
29 #include <map>
30 #include <sstream>
31 
32 #include "../systemclocktypes.h"
33 #include "../simulationmember.h"
34 #include "mysocket.h"
35 #include "../pin.h"
36 #include "../externaltype.h"
37 
41 class UserInterface: public SimulationMember, private Socket, public ExternalType {
42  protected:
43  std::map<std::string, ExternalType*> extMembers;
44  bool updateOn;
46  std::string dummy; //replaces old dummy in Step which was static :-(
47  std::map<std::string, char> LastState;
50 
51  //this is mainly for controlling the ui interface itself from the gui
52  void SetNewValueFromUi(const std::string &);
53  public:
54  void AddExternalType(const char *name, ExternalType *p) {
55  extMembers[name]=p;
56  }
57 #ifndef SWIG
58  void AddExternalType(const std::string& name, ExternalType *p) {
59  AddExternalType(name.c_str(), p);
60  }
61 #endif
62  UserInterface(int port, bool withUpdateControl=true);
64  void SendUiNewState(const std::string &s, const char &c);
65 
66  int Step(bool &, SystemClockOffset *nextStepIn_ns=0);
67  void SwitchUpdateOnOff(bool PollFreq);
68  void Write(const std::string &s);
69 };
70 
71 #endif
SystemClockOffset pollFreq
Definition: ui.h:45
bool updateOn
Definition: ui.h:44
std::map< std::string, ExternalType * > extMembers
Definition: ui.h:43
int Step(bool &, SystemClockOffset *nextStepIn_ns=0)
Return nonzero if a breakpoint was hit.
std::string dummy
Definition: ui.h:46
void SetNewValueFromUi(const std::string &)
std::map< std::string, char > LastState
Definition: ui.h:47
void AddExternalType(const std::string &name, ExternalType *p)
Definition: ui.h:58
void SwitchUpdateOnOff(bool PollFreq)
UserInterface(int port, bool withUpdateControl=true)
void SendUiNewState(const std::string &s, const char &c)
int waitOnAckFromTclRequest
Definition: ui.h:48
long long SystemClockOffset
int waitOnAckFromTclDone
Definition: ui.h:49
void AddExternalType(const char *name, ExternalType *p)
Definition: ui.h:54
void Write(const std::string &s)