PICSimLab - Programmable IC Simulator Laboratory 0.9.2
PICSimLab - API
Loading...
Searching...
No Matches
part Class Referenceabstract

PART class. More...

#include <part.h>

Inherited by cpart_7s_display, cpart_7s_display_dec, cpart_ADXL345, cpart_Buzzer, cpart_CPU_DBG, cpart_ETH_w5500, cpart_IO_74xx573, cpart_IO_74xx595, cpart_IO_MCP23017, cpart_IO_MCP23S17, cpart_IO_MM74C922, cpart_IO_PCF8574, cpart_Jumpers, cpart_LCD_hd44780, cpart_LCD_ili9341, cpart_LCD_pcd8544, cpart_LCD_pcf8833, cpart_LCD_ssd1306, cpart_LDR, cpart_MI2C_24CXXX, cpart_MPU6050, cpart_RTC_ds1307, cpart_RTC_pfc8563, cpart_SDCard, cpart_SignalGenerator, cpart_TEXT, cpart_UART, cpart_VCD_Dump, cpart_VCD_Dump_DBG, cpart_VCD_Dump_an, cpart_VCD_Play, cpart_bmp180, cpart_bmp280, cpart_dcmotor, cpart_dht11, cpart_dht22, cpart_ds1621, cpart_ds18b20, cpart_dtfunc, cpart_encoder, cpart_fixedv, cpart_fm50, cpart_gamepad, cpart_gamepad_an, cpart_hcsr04, cpart_hx711, cpart_keypad, cpart_lblock, cpart_led_matrix, cpart_led_ws2812b, cpart_leds, cpart_lm35, cpart_ntc, cpart_pbuttons, cpart_pbuttons_an, cpart_pot, cpart_pot_r, cpart_rgb_led, cpart_servo, cpart_sht3x, cpart_step, cpart_switches, cpart_tempsys, and cpart_vterm.

Collaboration diagram for part:

Public Member Functions

std::string GetName (void)
 Return the name of part.
 
virtual std::string GetHelpURL (void)
 Return the help url of part.
 
virtual std::string GetAboutInfo (void)=0
 Return the about information of part.
 
void Draw (void)
 Called ever 100ms to draw part.
 
virtual void DrawOutput (const unsigned int index)=0
 Called to draw every output.
 
virtual void PreProcess (void)
 Called every start of CPU process.
 
virtual void Process (void)
 Called every CPU step.
 
virtual void PostProcess (void)
 Called every end of CPU process.
 
virtual std::string GetPictureFileName (void)
 Return the filename of part picture.
 
virtual std::string GetMapFile (void)
 Return the filename of part picture map.
 
virtual std::string GetPropertiesWindowFile (void)
 Return the filename of properties window XML file.
 
int GetInputCount (void)
 Get part input count.
 
input_tGetInput (int n)
 Get part input.
 
int GetOutputCount (void)
 Get part output count.
 
output_tGetOutput (int n)
 Get part input.
 
virtual void Reset (void)
 Reset part status.
 
virtual void Stop (void)
 Stop part simulation.
 
void EvMouseButtonPress (unsigned int button, unsigned int x, unsigned int y, unsigned int state)
 Event handler on the part.
 
virtual void OnMouseButtonPress (unsigned int inputId, unsigned int button, unsigned int x, unsigned int y, unsigned int state)
 Event handler on the part.
 
void EvMouseButtonRelease (unsigned int button, unsigned int x, unsigned int y, unsigned int state)
 Event handler on the part.
 
virtual void OnMouseButtonRelease (unsigned int inputId, unsigned int button, unsigned int x, unsigned int y, unsigned int state)
 Event handler on the part.
 
void EvMouseMove (unsigned int button, unsigned int x, unsigned int y, unsigned int state)
 Event handler on the part.
 
virtual void OnMouseMove (unsigned int inputId, unsigned int button, unsigned int x, unsigned int y, unsigned int state)
 Event handler on the part.
 
virtual void EvKeyPress (unsigned int key, unsigned int mask)
 Event handler on the part.
 
virtual void EvKeyRelease (unsigned int key, unsigned int mask)
 Event handler on the part.
 
virtual std::string WritePreferences (void)=0
 Called to save part preferences in configuration file.
 
virtual void ReadPreferences (std::string value)=0
 Called whe configuration file load preferences.
 
virtual unsigned short GetInputId (char *name)=0
 return the input ids numbers of names used in input map
 
virtual unsigned short GetOutputId (char *name)=0
 return the output ids numbers of names used in output map
 
virtual void ConfigurePropertiesWindow (void)=0
 Called to configure the properties window.
 
virtual void ReadPropertiesWindow (void)=0
 Called when properties window close.
 
virtual void ComboChange (const char *controlname, std::string value)
 Used by properties window combos.
 
virtual void SpinChange (const char *controlname, int value)
 Used by properties window spin.
 
virtual void ButtonEvent (const char *controlname, unsigned int button, unsigned int x, unsigned int y, unsigned int state)
 Used by windows of parts.
 
virtual void KeyEvent (const char *controlname, unsigned int keysym, unsigned int ukeysym, unsigned int state)
 Used by windows of parts.
 
virtual void Event (const char *controlname)
 Used by windows of parts.
 
virtual void filedialog_EvOnClose (int retId)
 Used by properties window filedialogs.
 
 part (const unsigned x, const unsigned y, const char *name, const char *type, board *pboard_, const int id_, const int fsize=8)
 Called once on part creation.
 
void Init (void)
 Called once on part initialization.
 
virtual void PostInit (void)
 Called once on part after initialization.
 
virtual ~part (void)
 Called once on part destruction.
 
int GetBitmap (void)
 Return the Bitmap of part.
 
int GetX (void)
 Return X position of part.
 
int GetY (void)
 Return Y position of part.
 
void SetX (int x)
 Set X position of part.
 
void SetY (int y)
 Set Y position of part.
 
unsigned int GetWidth (void)
 Return width of part.
 
unsigned int GetHeight (void)
 Return height of part.
 
int PointInside (int x, int y)
 Return if point x,y is inside of part.
 
void RotateCoords (unsigned int *x, unsigned int *y)
 Return coords x y rotated by orientation.
 
virtual void LoadPartImage (void)
 Load Part Image.
 
int GetOrientation (void)
 Return the orientation to draw.
 
virtual void SetOrientation (int orientation)
 Set the orientation to draw.
 
float GetScale (void)
 Return the orientation to draw.
 
virtual void SetScale (double scale)
 Set the orientation to draw.
 
int GetId (void)
 Get the part ID.
 
void SetId (int id_)
 Set the part ID.
 
unsigned char GetUpdate (void)
 Return if part need Draw update.
 
void SetUpdate (unsigned char upd)
 Set part to Draw update.
 
int GetAlwaysUpdate (void)
 Return if part need to be update every clock cycle.
 
void SetAlwaysUpdate (int sau)
 Set if part need to be update every clock cycle.
 
const int GetPCWCount (void)
 
const PCWPropGetPCWProperties (void)
 
const int GetPinCount (void)
 
unsigned char * GetPins (void)
 
const int GetPinCtrlCount (void)
 
const unsigned char * GetPinsCtrl (void)
 

Protected Member Functions

virtual void RegisterRemoteControl (void)
 Register remote control variables.
 
void ReadMaps (void)
 read maps
 
int PointInside (int x, int y, input_t input)
 Return if point x,y is inside of input.
 
void SetPCWProperties (const PCWProp *pcwprop)
 
void SetPCWComboWithPinNames (const char *combo_name, const unsigned char pin)
 
unsigned char GetPWCComboSelectedPin (const char *combo_name)
 

Protected Attributes

int id
 part ID
 
input_t input [MAX_IDS]
 input map elements
 
input_tinput_ids [MAX_IDS]
 input map elements by id order
 
output_t output [MAX_IDS]
 output map elements
 
output_toutput_ids [MAX_IDS]
 output map elements by id order
 
int inputc
 input map elements counter
 
int outputc
 output map elements counter
 
unsigned int Height
 Height of part.
 
unsigned int Width
 Width of part.
 
int X
 X position of part.
 
int Y
 Y position of part.
 
int BitmapId
 Internal Bitmap.
 
unsigned int refresh
 redraw is needed
 
int Orientation
 orientation to draw part
 
float Scale
 scale to draw part
 
unsigned int Update
 part need draw Update
 
int always_update
 part need to be update every clock cycle
 
std::string Type
 
int PinCount
 
int PinCtrlCount
 
unsigned char * Pins
 
unsigned char * PinsCtrl
 
boardpboard
 
int Fsize
 

Private Member Functions

void ReadInputMap (std::string fname)
 Read the Input Map.
 
void ReadOutputMap (std::string fname)
 Read the Output Map.
 

Private Attributes

const PCWPropPCWProperties
 
int PCWCount
 
std::string Name
 

Detailed Description

PART class.

class definition of parts used in picsimlab spare parts window.

Member Function Documentation

◆ ButtonEvent()

virtual void part::ButtonEvent ( const char *  controlname,
unsigned int  button,
unsigned int  x,
unsigned int  y,
unsigned int  state 
)
inlinevirtual

Used by windows of parts.

Reimplemented in cpart_vterm.

◆ ComboChange()

virtual void part::ComboChange ( const char *  controlname,
std::string  value 
)
inlinevirtual

Used by properties window combos.

Reimplemented in cpart_keypad, cpart_Jumpers, cpart_lblock, cpart_7s_display, and cpart_LCD_ili9341.

◆ ConfigurePropertiesWindow()

◆ DrawOutput()

◆ Event()

virtual void part::Event ( const char *  controlname)
inlinevirtual

Used by windows of parts.

Reimplemented in cpart_vterm.

◆ EvKeyPress()

virtual void part::EvKeyPress ( unsigned int  key,
unsigned int  mask 
)
inlinevirtual

Event handler on the part.

Reimplemented in cpart_CPU_DBG, cpart_gamepad, cpart_gamepad_an, and cpart_dtfunc.

◆ EvKeyRelease()

virtual void part::EvKeyRelease ( unsigned int  key,
unsigned int  mask 
)
inlinevirtual

Event handler on the part.

Reimplemented in cpart_gamepad, cpart_gamepad_an, and cpart_dtfunc.

◆ filedialog_EvOnClose()

virtual void part::filedialog_EvOnClose ( int  retId)
inlinevirtual

Used by properties window filedialogs.

Reimplemented in cpart_MI2C_24CXXX, cpart_SDCard, and cpart_VCD_Play.

◆ GetAboutInfo()

◆ GetInputId()

◆ GetMapFile()

std::string part::GetMapFile ( void  )
virtual

◆ GetOutputId()

◆ GetPictureFileName()

std::string part::GetPictureFileName ( void  )
virtual

◆ GetPropertiesWindowFile()

std::string part::GetPropertiesWindowFile ( void  )
virtual

Return the filename of properties window XML file.

Reimplemented in cpart_VCD_Dump_DBG, and cpart_VCD_Dump_an.

◆ KeyEvent()

virtual void part::KeyEvent ( const char *  controlname,
unsigned int  keysym,
unsigned int  ukeysym,
unsigned int  state 
)
inlinevirtual

Used by windows of parts.

Reimplemented in cpart_vterm.

◆ LoadPartImage()

void part::LoadPartImage ( void  )
virtual

◆ OnMouseButtonPress()

◆ OnMouseButtonRelease()

virtual void part::OnMouseButtonRelease ( unsigned int  inputId,
unsigned int  button,
unsigned int  x,
unsigned int  y,
unsigned int  state 
)
inlinevirtual

◆ OnMouseMove()

virtual void part::OnMouseMove ( unsigned int  inputId,
unsigned int  button,
unsigned int  x,
unsigned int  y,
unsigned int  state 
)
inlinevirtual

◆ PostInit()

virtual void part::PostInit ( void  )
inlinevirtual

Called once on part after initialization.

Reimplemented in cpart_gamepad, and cpart_TEXT.

◆ PostProcess()

◆ PreProcess()

◆ Process()

◆ ReadPreferences()

◆ ReadPropertiesWindow()

◆ RegisterRemoteControl()

◆ Reset()

◆ SpinChange()

virtual void part::SpinChange ( const char *  controlname,
int  value 
)
inlinevirtual

Used by properties window spin.

Reimplemented in cpart_pot, cpart_pot_r, cpart_pbuttons, cpart_switches, cpart_lblock, and cpart_leds.

◆ Stop()

virtual void part::Stop ( void  )
inlinevirtual

Stop part simulation.

Reimplemented in cpart_Buzzer.

◆ WritePreferences()


The documentation for this class was generated from the following files: