List of available functions

Component Development Kit for THRSim11

© Alex van Rooijen, Bart Grootendorst, and Harry Broeders.


Previous page Index

ImpComponent class

void SetCompWinIcon(HICON hicon)

With this function it's possible to change the icon of your component window.

void SetCompWinTitle(LPCSTR str)

With this function it's possible to change the title of your component window.

void ConnectDialog()

Calls a connect dialogbox for your component. Can be used in a right mouse button click popup menu.

void Expose(Connection connection, const char* name, const char* prefcon=0)

This function is obligatory for every pin of the component and must be used in the Component constructor.
This function makes a connection pin, connection, available for the THRSim11. name is a user friendly name for this pin that is used in the connection dialogbox. connection is the pin you want to make available for the THRSim11 and can be made with any xxxxxConnection class type. With the optional third parameter prefcon it's possible to ask the THRSim11 to connect this pin to the name pin of the component. The possible names are the same ones that are used in the simulator. For example: if you prefer that a pin connects to pin 2 of port B you use "PB2" as name.

void SetComponentName(const char* new_name)

This function is obligatory for every component and must be used in the Component constructor.
Set the name used in the pulldown menu of the THRSim11 and as default window title.

void SetGroupName(const char* group_name)

This function can be used in the Component constructor. Set the submenu name used in the pulldown menu of the THRSim11. This is a new feature in CDK version 3.0 and you need THRSim11 version 3.30 or higher to use it.

virtual HWND CreateComponentWindow(HWND parent)

It's only necessary to override this function when you want to create a component with a window. Within this function you need to create your window using the parent HWND. You need to return the HWND of the newly made window. If you don't override this function, a minimized window will be created which represents the component.

BoolConnection class (a connection pin)

void set(BOOL state);

Set connectionpin to new state.

BOOL get();

Get current state of connection pin.

ByteConnection class (a connection pin)

void set(BYTE state);

Set connectionpin to new state.

BYTE get();

Get current state of connection pin.

WordConnection class (a connection pin)

void set(WORD state);

Set connectionpin to new state.

WORD get();

Get current state of connectionpin.

LongConnecion class (a connection pin)

void set(LONG state);

Set connectionpin to new state.

LONG get();

Get current state of connection pin.

CallOnChange template

template<class T, class C>
CallOnChange(const Model<T>& m, C* po, PF pmf)

Notifies when pin m is changed. m is the pin to be monitored. po is the pointer to the object that contains the function you want to call when the pin changes (in most cases this). pmf is the member function you want to call when the pin changes.

CallOnRise template

template<class T, class C>
CallOnRise(const Model<T>& m, C* po, PF pmf)

Notifies when pin m rises. m is the pin to be monitored. po is the pointer to the object that contains the function you want to call when the signal on the pin rises (in most cases this). pmf is the member function you want to call when the when the signal of the pin rises.

CallOnFall template

template<class T, class C>
CallOnFall(const Model<T>& m, C* po, PF pmf)

Notifies when pin m falls. m is the pin to be monitored. po is the pointer to the object that contains the function you want to call when the the signal on the pin falls (in most cases this). pmf is the member function you want to call when the signal on the pin falls.

CallOnWrite template

template<class T, class C>
CallOnWrite(const Model<T>& m, C* po, PF pmf)

Notifies whenever is written to the pin even when this means the state isn't changed. m is the pin to be monitored. po is the pointer to the object that contains the function you want to call when the pin is written (in most cases this). pmf is the member function you want to call when the pin is written.


For comments and/or suggestions: cdk@hc11.demon.nl