This is the documentation to explain the use of picsimlab internal classes.
The main objective of this domentation is to enable the expansion of the simulator with the creation of new boards (board) and parts (part).
#define _USE_MATH_DEFINES
#include "output_step.h"
#include "../lib/oscilloscope.h"
#include "../lib/picsimlab.h"
#include "../lib/spareparts.h"
#include "math.h"
enum { O_P1, O_P2, O_P3, O_P4, O_P5, O_L1, O_L2, O_L3, O_L4, O_ROT, O_STEPS };
static PCWProp pcwprop[6] = {{PCW_COMBO,
"Pin 1"}, {PCW_COMBO,
"Pin 2"}, {PCW_COMBO,
"Pin 3"},
{PCW_COMBO, "Pin 4"}, {PCW_COMBO, "Home"}, {PCW_END, ""}};
const int id_)
:
part(x, y, name, type, pboard_, id_) {
angle = 0;
steps = 0;
input_pins[0] = 0;
input_pins[1] = 0;
input_pins[2] = 0;
input_pins[3] = 0;
output_pins[0] = 0;
input[0] = 0;
input[1] = 0;
turns = 0;
SetPCWProperties(pcwprop);
PinCount = 4;
Pins = input_pins;
}
SpareParts.SetPartOnDraw(id);
SpareParts.CanvasCmd({.cmd = CC_FREEBITMAP, .FreeBitmap{
BitmapId}});
SpareParts.CanvasCmd({.cmd = CC_DESTROY});
}
float x2, y2;
const picpin* ppins = SpareParts.GetPinsValues();
case O_P1:
case O_P2:
case O_P3:
case O_P4:
SpareParts.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{49, 61, 99}});
SpareParts.CanvasCmd(
{.cmd = CC_RECTANGLE,
SpareParts.CanvasCmd({.cmd = CC_SETFGCOLOR, .SetFgColor{255, 255, 255}});
SpareParts.CanvasCmd({.cmd = CC_ROTATEDTEXT, .RotatedText{
"NC",
output[i].
x1,
output[i].
y1, 0}});
else
SpareParts.CanvasCmd({.cmd = CC_ROTATEDTEXT,
break;
case O_P5:
SpareParts.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{49, 61, 99}});
SpareParts.CanvasCmd(
{.cmd = CC_RECTANGLE,
SpareParts.CanvasCmd({.cmd = CC_SETFGCOLOR, .SetFgColor{255, 255, 255}});
SpareParts.CanvasCmd({.cmd = CC_ROTATEDTEXT, .RotatedText{
"NC",
output[i].
x1,
output[i].
y1, 0}});
else
SpareParts.CanvasCmd({.cmd = CC_ROTATEDTEXT,
break;
case O_STEPS: {
SpareParts.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{49, 61, 99}});
SpareParts.CanvasCmd(
{.cmd = CC_RECTANGLE,
SpareParts.CanvasCmd({.cmd = CC_SETFGCOLOR, .SetFgColor{255, 255, 255}});
char text[100];
snprintf(text, 100, "S=%5.1f", steps);
SpareParts.CanvasCmd({.cmd = CC_ROTATEDTEXT, .RotatedText{text,
output[i].
x1,
output[i].
y1, 0}});
snprintf(text, 100, "T=%3i", turns);
SpareParts.CanvasCmd({.cmd = CC_ROTATEDTEXT, .RotatedText{text,
output[i].
x1,
output[i].
y1 + 12, 0}});
} break;
case O_ROT:
SpareParts.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{77, 77, 77}});
SpareParts.CanvasCmd({.cmd = CC_SETFGCOLOR, .SetFgColor{0, 0, 0}});
SpareParts.CanvasCmd({.cmd = CC_SETBGCOLOR, .SetBgColor{250, 250, 250}});
SpareParts.CanvasCmd({.cmd = CC_SETBGCOLOR, .SetBgColor{55, 55, 55}});
SpareParts.CanvasCmd({.cmd = CC_SETLINEWIDTH, .SetLineWidth{8}});
SpareParts.CanvasCmd({.cmd = CC_LINE, .Line{
output[i].
x1,
output[i].
y1, x2, y2}});
SpareParts.CanvasCmd({.cmd = CC_SETLINEWIDTH, .SetLineWidth{6}});
SpareParts.CanvasCmd({.cmd = CC_SETFGCOLOR, .SetFgColor{77, 77, 77}});
SpareParts.CanvasCmd({.cmd = CC_LINE, .Line{
output[i].
x1,
output[i].
y1, x2, y2}});
SpareParts.CanvasCmd({.cmd = CC_SETLINEWIDTH, .SetLineWidth{1}});
break;
case O_L1:
case O_L2:
case O_L3:
case O_L4:
SpareParts.CanvasCmd({.cmd = CC_SETFGCOLOR, .SetFgColor{0, 0, 0}});
SpareParts.CanvasCmd(
{.cmd = CC_SETBGCOLOR,
.SetBgColor{(
unsigned int)ppins[
input_pins[
output[i].
id - O_L1] - 1].oavalue, 0, 0}});
} else {
SpareParts.CanvasCmd({.cmd = CC_SETBGCOLOR, .SetBgColor{55, 0, 0}});
}
DrawLED(SpareParts.CanvasCmd, &
output[i]);
break;
}
}
if ((steps == 0) && (turns == 0)) {
} else {
}
}
}
#define STEP (1.8 * M_PI / 180.0)
#define HSTEP (STEP / 2.0)
#define NSTEP 200
#define S1 1
#define S12 3
#define S2 2
#define S23 6
#define S3 4
#define S34 12
#define S4 8
#define S41 9
const picpin* ppins = SpareParts.GetPinsValues();
input[1] = input[0];
if (input[0] ^ input[1]) {
switch (input[0]) {
case S1:
switch (input[1]) {
case S4:
steps += 1;
break;
case S2:
steps -= 1;
break;
case S41:
steps += 0.5;
break;
case S12:
steps -= 0.5;
break;
}
break;
case S2:
switch (input[1]) {
case S1:
steps += 1;
break;
case S3:
steps -= 1;
break;
case S12:
steps += 0.5;
break;
case S23:
steps -= 0.5;
break;
}
break;
case S3:
switch (input[1]) {
case S2:
steps += 1;
break;
case S4:
steps -= 1;
break;
case S23:
steps += 0.5;
break;
case S34:
steps -= 0.5;
break;
}
break;
case S4:
switch (input[1]) {
case S3:
steps += 1;
break;
case S1:
steps -= 1;
break;
case S34:
steps += 0.5;
break;
case S41:
steps -= 0.5;
break;
}
break;
case S12:
switch (input[1]) {
case S41:
steps += 1;
break;
case S23:
steps -= 1;
break;
case S1:
steps += 0.5;
break;
case S2:
steps -= 0.5;
break;
}
break;
case S23:
switch (input[1]) {
case S12:
steps += 1;
break;
case S34:
steps -= 1;
break;
case S2:
steps += 0.5;
break;
case S3:
steps -= 0.5;
break;
}
break;
case S34:
switch (input[1]) {
case S23:
steps += 1;
break;
case S41:
steps -= 1;
break;
case S3:
steps += 0.5;
break;
case S4:
steps -= 0.5;
break;
}
break;
case S41:
switch (input[1]) {
case S34:
steps += 1;
break;
case S12:
steps -= 1;
break;
case S4:
steps += 0.5;
break;
case S1:
steps -= 0.5;
break;
}
break;
default:
input[0] = input[1];
return;
break;
}
if (steps >= NSTEP) {
steps -= NSTEP;
turns++;
}
if (steps < 0) {
steps += NSTEP;
turns--;
}
angle = STEP * steps;
if ((steps == 0) && (turns == 0)) {
} else {
}
}
}
}
}
const picpin* ppins = SpareParts.GetPinsValues();
for (int i = 0; i < 4; i++) {
}
}
}
}
printf("Error input '%s' don't have a valid id! \n", name);
return INVALID_ID;
}
if (strcmp(name, "PN_1") == 0)
return O_P1;
if (strcmp(name, "PN_2") == 0)
return O_P2;
if (strcmp(name, "PN_3") == 0)
return O_P3;
if (strcmp(name, "PN_4") == 0)
return O_P4;
if (strcmp(name, "PN_5") == 0)
return O_P5;
if (strcmp(name, "LD_1") == 0)
return O_L1;
if (strcmp(name, "LD_2") == 0)
return O_L2;
if (strcmp(name, "LD_3") == 0)
return O_L3;
if (strcmp(name, "LD_4") == 0)
return O_L4;
if (strcmp(name, "DG_ROT") == 0)
return O_ROT;
if (strcmp(name, "DI_STEPS") == 0)
return O_STEPS;
printf("Error output '%s' don't have a valid id! \n", name);
return INVALID_ID;
}
char prefs[256];
sprintf(prefs,
"%hhu,%hhu,%hhu,%hhu,%hhu",
input_pins[0],
input_pins[1],
input_pins[2],
input_pins[3],
return prefs;
}
sscanf(value.c_str(),
"%hhu,%hhu,%hhu,%hhu,%hhu", &
input_pins[0], &
input_pins[1], &
input_pins[2], &
input_pins[3],
}
}
}
}
std::string GetPinName(unsigned char pin)
Return the name of one pin.
Definition spareparts.cc:146
cpart_step(const unsigned x, const unsigned y, const char *name, const char *type, board *pboard_, const int id_)
constructor called once on part creation
Definition output_step.cc:40
output_t output[MAX_IDS]
output map elements
Definition part.h:378
output_t * output_ids[MAX_IDS]
output map elements by id order
Definition part.h:379
int BitmapId
Internal Bitmap.
Definition part.h:386
float r
radius
Definition board.h:75
float x2
x2 position
Definition board.h:70
unsigned char value
updated value
Definition board.h:81
float y2
y2 position
Definition board.h:72
float y1
y1 position
Definition board.h:71
void * status
rcontrol status
Definition board.h:78
float x1
x1 position
Definition board.h:69
float value_f
updated value float
Definition board.h:83
unsigned char update
need draw update
Definition board.h:79
#include "board_x.h"
#include <math.h>
#include "../lib/oscilloscope.h"
#include "../lib/picsimlab.h"
#include "../lib/spareparts.h"
enum {
I_POT1,
I_ICSP,
I_PWR,
I_RST,
I_BD0,
I_SD1
};
enum {
O_POT1,
O_RST,
O_SD1,
O_LD0,
O_LD1,
O_LPWR,
O_RB0,
O_RB1,
O_BD0,
O_CPU
};
enum { PWM0 = 1, PWM1 };
if (strcmp(name, "PG_ICSP") == 0)
return I_ICSP;
if (strcmp(name, "SW_PWR") == 0)
return I_PWR;
if (strcmp(name, "PB_RST") == 0)
return I_RST;
if (strcmp(name, "PB_D0") == 0)
return I_BD0;
if (strcmp(name, "SW_D1") == 0)
return I_SD1;
if (strcmp(name, "PO_1") == 0)
return I_POT1;
printf("Error input '%s' don't have a valid id! \n", name);
return INVALID_ID;
}
if (strcmp(name, "SW_D1") == 0)
return O_SD1;
if (strcmp(name, "LD_LD0") == 0)
return O_LD0;
if (strcmp(name, "LD_LD1") == 0)
return O_LD1;
if (strcmp(name, "LD_LPWR") == 0)
return O_LPWR;
if (strcmp(name, "LD_RB1") == 0)
return O_RB1;
if (strcmp(name, "LD_RB0") == 0)
return O_RB0;
if (strcmp(name, "PB_D0") == 0)
return O_BD0;
if (strcmp(name, "PO_1") == 0)
return O_POT1;
if (strcmp(name, "PB_RST") == 0)
return O_RST;
if (strcmp(name, "IC_CPU") == 0)
return O_CPU;
printf("Error output '%s' don't have a valid id! \n", name);
return INVALID_ID;
}
cboard_x::cboard_x(void) {
pot1 = 100;
active = 0;
PICSimLab.UpdateGUI(PWM0, GT_GAUGE, GA_ADD, (void*)"*RB0");
PICSimLab.UpdateGUI(PWM1, GT_GAUGE, GA_ADD, (void*)"*RB1");
SWBounce_init(&bounce, 2);
}
cboard_x::~cboard_x(void) {
PICSimLab.UpdateGUI(PWM0, GT_GAUGE, GA_DEL, NULL);
PICSimLab.UpdateGUI(PWM1, GT_GAUGE, GA_DEL, NULL);
SWBounce_end(&bounce);
}
pic_reset(&pic, 1);
p_BT1 = 1;
pic_set_pin(&pic, 19, p_BT1);
pic_set_pin(&pic, 20, p_BT2);
if (pic.serial[0].serialfd != INVALID_SERIAL)
PICSimLab.UpdateStatus(
PS_SERIAL,
"Serial: " + std::string(SERIALDEVICE) + ":" + std::to_string(pic.serial[0].serialbaud) + "(" +
FloatStrFormat("%4.1f", fabs((100.0 * pic.serial[0].serialexbaud - 100.0 * pic.serial[0].serialbaud) /
pic.serial[0].serialexbaud)) +
"%)");
else
PICSimLab.UpdateStatus(PS_SERIAL, "Serial: " + std::string(SERIALDEVICE) + " (ERROR)");
SpareParts.Reset();
}
}
if (pic.serial[0].serialfd != INVALID_SERIAL)
PICSimLab.UpdateStatus(
PS_SERIAL,
"Serial: " + std::string(SERIALDEVICE) + ":" + std::to_string(pic.serial[0].serialbaud) + "(" +
FloatStrFormat("%4.1f", fabs((100.0 * pic.serial[0].serialexbaud - 100.0 * pic.serial[0].serialbaud) /
pic.serial[0].serialexbaud)) +
"%)");
else
PICSimLab.UpdateStatus(PS_SERIAL, "Serial: " + std::string(SERIALDEVICE) + " (ERROR)");
}
PICSimLab.
SavePrefs(
"X_bt2", std::to_string(p_BT2));
PICSimLab.
SavePrefs(
"X_clock", FloatStrFormat(
"%2.1f", PICSimLab.GetClock()));
PICSimLab.
SavePrefs(
"X_pot1", std::to_string(pot1));
}
if (!strcmp(name, "X_bt2")) {
if (value[0] == '0')
p_BT2 = 0;
else
p_BT2 = 1;
}
if (!strcmp(name, "X_proc")) {
}
if (!strcmp(name, "X_clock")) {
PICSimLab.SetClock(atof(value));
}
if (!strcmp(name, "X_pot1")) {
pot1 = atoi(value);
}
}
if (key == '1') {
p_BT1 = 0;
}
if (key == '2') {
p_BT2 ^= 1;
}
}
if (key == '1') {
p_BT1 = 1;
}
}
int i;
for (i = 0; i <
inputc; i++) {
case I_ICSP:
PICSimLab.OpenLoadHexFileDialog();
;
break;
case I_PWR:
{
p_BT1 = 1;
} else
{
}
break;
case I_RST:
if (PICSimLab.
GetMcuPwr() && pic_reset(&pic, -1))
{
}
break;
case I_BD0:
p_BT1 = 0;
break;
case I_SD1:
p_BT2 ^= 1;
break;
case I_POT1: {
active = 1;
if (pot1 > 199)
pot1 = 199;
} break;
}
}
}
}
int i;
for (i = 0; i <
inputc; i++) {
case I_POT1:
if (active) {
if (pot1 > 199)
pot1 = 199;
}
} else {
active = 0;
}
break;
}
}
}
int i;
for (i = 0; i <
inputc; i++) {
case I_RST:
{
if (pic_reset(&pic, -1)) {
}
}
break;
case I_BD0:
p_BT1 = 1;
break;
case I_POT1: {
active = 0;
} break;
}
}
}
}
int update = 0;
int i;
{
{
if (!update) {
PICSimLab.CanvasCmd({.cmd = CC_INIT, .Init{Scale, Scale, 0}});
PICSimLab.CanvasCmd({.cmd = CC_SETFONTWEIGHT, .SetFontWeight{CC_FONTWEIGHT_BOLD}});
}
update++;
{
{
PICSimLab.CanvasCmd({.cmd = CC_SETBGCOLOR, .SetBgColor{255, 255, 255}});
PICSimLab.CanvasCmd({.cmd = CC_RECTANGLE,
if (!p_BT2)
{
PICSimLab.CanvasCmd({.cmd = CC_SETBGCOLOR, .SetBgColor{70, 70, 70}});
PICSimLab.CanvasCmd(
{.cmd = CC_RECTANGLE,
} else
{
PICSimLab.CanvasCmd({.cmd = CC_SETBGCOLOR, .SetBgColor{70, 70, 70}});
PICSimLab.CanvasCmd({.cmd = CC_RECTANGLE,
}
}
else if (
output[i].
id == O_BD0) {
PICSimLab.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{102, 102, 102}});
PICSimLab.CanvasCmd({.cmd = CC_CIRCLE, .Circle{1,
output[i].
cx,
output[i].
cy, 10}});
if (p_BT1) {
PICSimLab.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{15, 15, 15}});
} else {
PICSimLab.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{55, 55, 55}});
}
PICSimLab.CanvasCmd({.cmd = CC_CIRCLE, .Circle{1,
output[i].
cx,
output[i].
cy, 8}});
}
else if (
output[i].
id == O_RST) {
PICSimLab.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{102, 102, 102}});
PICSimLab.CanvasCmd({.cmd = CC_CIRCLE, .Circle{1,
output[i].
cx,
output[i].
cy, 10}});
PICSimLab.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{15, 15, 15}});
} else {
PICSimLab.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{55, 55, 55}});
}
PICSimLab.CanvasCmd({.cmd = CC_CIRCLE, .Circle{1,
output[i].
cx,
output[i].
cy, 8}});
}
else if (
output[i].
id == O_POT1) {
PICSimLab.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{0, 50, 215}});
PICSimLab.CanvasCmd({.cmd = CC_RECTANGLE,
PICSimLab.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{250, 250, 250}});
PICSimLab.CanvasCmd(
{.cmd = CC_RECTANGLE, .Rectangle{1,
output[i].
x1 + pot1 / 2.77f,
output[i].
y1 + 2, 10, 15}});
}
else if (
output[i].
id == O_CPU) {
PICSimLab.CanvasCmd({.cmd = CC_SETFONTSIZE, .SetFontSize{10}});
float x, y;
int w, h;
PICSimLab.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{26, 26, 26}});
PICSimLab.CanvasCmd({.cmd = CC_RECTANGLE,
PICSimLab.CanvasCmd({.cmd = CC_SETCOLOR, .SetColor{230, 230, 230}});
PICSimLab.CanvasCmd({.cmd = CC_ROTATEDTEXT, .RotatedText{
Proc.c_str(), x, y, 270}});
}
} else
{
PICSimLab.CanvasCmd({.cmd = CC_SETFGCOLOR, .SetFgColor{0, 0, 0}});
{
case O_LD0:
PICSimLab.CanvasCmd(
{.cmd = CC_SETBGCOLOR,
.SetBgColor{(unsigned int)pic.pins[18].oavalue, (unsigned int)pic.pins[18].oavalue,
(unsigned int)pic.pins[18].oavalue}});
break;
case O_LD1:
PICSimLab.CanvasCmd(
{.cmd = CC_SETBGCOLOR,
.SetBgColor{(unsigned int)pic.pins[19].oavalue, (unsigned int)pic.pins[19].oavalue, 0}});
break;
case O_LPWR:
PICSimLab.CanvasCmd({.cmd = CC_SETBGCOLOR,
.SetBgColor{0, 0, (
unsigned int)(200 * PICSimLab.
GetMcuPwr() + 55)}});
break;
case O_RB0:
PICSimLab.CanvasCmd(
{.cmd = CC_SETBGCOLOR, .SetBgColor{0, (unsigned int)pic.pins[32].oavalue, 0}});
break;
case O_RB1:
PICSimLab.CanvasCmd(
{.cmd = CC_SETBGCOLOR, .SetBgColor{(unsigned int)pic.pins[33].oavalue, 0, 0}});
break;
}
DrawLED(PICSimLab.CanvasCmd, &
output[i]);
}
}
}
if (update) {
PICSimLab.CanvasCmd({.cmd = CC_END});
}
int value = (pic.pins[33].oavalue - 55) / 2;
PICSimLab.UpdateGUI(PWM0, GT_GAUGE, GA_SET, (void*)&value);
value = (pic.pins[32].oavalue - 55) / 2;
PICSimLab.UpdateGUI(PWM1, GT_GAUGE, GA_SET, (void*)&value);
}
int i;
int j;
unsigned char pi;
const picpin* pins;
unsigned int alm[40];
int bret;
const long int NSTEP = PICSimLab.GetNSTEP();
const float RNSTEP = 200.0 * pic.PINCOUNT / NSTEP;
memset(alm, 0, 40 * sizeof(unsigned int));
pins = pic.pins;
unsigned char p_BT1_ = p_BT1;
unsigned char p_BT2_ = p_BT2;
if ((pins[19 - 1].dir == PD_IN) && (pins[19 - 1].value != p_BT1_)) {
SWBounce_bounce(&bounce, 0);
}
if ((pins[20 - 1].dir == PD_IN) && (pins[20 - 1].value != p_BT2_)) {
SWBounce_bounce(&bounce, 1);
}
j = JUMPSTEPS;
pi = 0;
for (i = 0; i < NSTEP; i++)
{
if (j >= JUMPSTEPS)
{
pic_set_pin(&pic, pic.mclr,
p_RST);
if (!bounce.do_bounce) {
pic_set_pin(&pic, 19,
p_BT1_);
pic_set_pin(&pic, 20,
p_BT2_);
}
}
if (bounce.do_bounce) {
bret = SWBounce_process(&bounce);
if (bret) {
if (bounce.bounce[0]) {
if (bret == 1) {
pic_set_pin(&pic, 19, !pins[19 - 1].value);
} else {
pic_set_pin(&pic, 19, p_BT1_);
}
}
if (bounce.bounce[1]) {
if (bret == 1) {
pic_set_pin(&pic, 20, !pins[20 - 1].value);
} else {
pic_set_pin(&pic, 20, p_BT2_);
}
}
}
}
if (!mplabxd_testbp())
pic_step(&pic);
ioupdated = pic.ioupdated;
alm[pi] += pins[pi].value;
pi++;
if (pi == pic.PINCOUNT)
pi = 0;
if (j >= JUMPSTEPS)
{
pic_set_apin(&pic, 2, (5.0 * pot1 / 199));
j = -1;
}
j++;
pic.ioupdated = 0;
}
for (pi = 0; pi < pic.PINCOUNT; pi++) {
pic.pins[pi].oavalue = (int)((alm[pi] * RNSTEP) + 55);
}
if (
output_ids[O_LD0]->value != pic.pins[18].oavalue) {
}
if (
output_ids[O_LD1]->value != pic.pins[19].oavalue) {
}
if (
output_ids[O_RB0]->value != pic.pins[32].oavalue) {
}
if (
output_ids[O_RB1]->value != pic.pins[33].oavalue) {
}
}
void SetSample(void)
Sample and update oscilloscope data aquisition.
Definition oscilloscope.cc:63
void SetMcuRst(int pr)
Set mcu rst flag (inform simulator about mcu reset state)
Definition picsimlab.h:122
int GetMcuRst(void)
Retunr if microcontroller reset pin is enabled.
Definition picsimlab.h:102
void SetMcuPwr(int pp)
Set the power status of microcontroller ON/OFF.
Definition picsimlab.h:109
int GetMcuPwr(void)
Return actual power status of microcontroller ON/OFF.
Definition picsimlab.h:97
int GetJUMPSTEPS(void)
Get the number of steps to be skipped in board update.
Definition picsimlab.h:84
board * GetBoard(void)
Return a pointer to board object.
Definition picsimlab.h:90
void SavePrefs(std::string name, std::string value)
Save the preferences.
Definition picsimlab.cc:253
void Process(void)
Execute the process code of spare parts N times (where N is the number of steps in 100ms)
Definition spareparts.cc:548
void PostProcess(void)
Execute the post process code of spare parts one time per 100ms.
Definition spareparts.cc:568
void PreProcess(void)
Execute the pre process code of spare parts one time per 100ms.
Definition spareparts.cc:523
output_t output[MAX_IDS]
output map elements
Definition board.h:664
input_t * input_ids[MAX_IDS]
input map elements by id order
Definition board.h:663
int use_oscope
use oscilloscope window
Definition board.h:668
virtual float MGetInstClockFreq(void)=0
board microcontroller get cpu internal clock (in PIC frequency/4)
void InstCounterInc(void)
Increment the Intructions Counter.
Definition board.cc:402
int outputc
output map elements counter
Definition board.h:667
output_t * output_ids[MAX_IDS]
output map elements by id order
Definition board.h:665
unsigned char p_RST
board /RESET pin state
Definition board.h:670
input_t input[MAX_IDS]
input map elements
Definition board.h:662
int use_spare
use spare parts window
Definition board.h:669
int inputc
input map elements counter
Definition board.h:666
void ReadMaps(void)
Read maps.
Definition board.cc:61
std::string Proc
Name of processor in use.
Definition board.h:660
float cx
center x position
Definition board.h:73
float cy
center y position
Definition board.h:74