40 void UpdateAll(
const int force = 0);
41 int GetCount(
void) {
return partsc; };
42 part* GetPart(
const int partn);
43 void DeleteParts(
void);
44 void ResetPullupBus(
unsigned char pin);
45 void SetPullupBus(
unsigned char pin,
unsigned char value);
46 unsigned char GetPullupBus(
unsigned char pin);
73 const picpin* GetPinsValues(
void);
74 void SetPin(
unsigned char pin,
unsigned char value);
75 void SetAPin(
unsigned char pin,
float value);
76 void SetPinDOV(
unsigned char pin,
unsigned char ovalue);
77 void SetPinDir(
unsigned char pin,
unsigned char dir);
78 void WritePin(
unsigned char pin,
unsigned char value);
79 void WritePinA(
unsigned char pin,
unsigned char avalue);
80 void WritePinOA(
unsigned char pin,
unsigned short oavalue);
81 unsigned char RegisterIOpin(std::string pname,
unsigned char pin = 0,
unsigned char dir = PD_OUT);
82 unsigned char UnregisterIOpin(
unsigned char pin);
83 part* AddPart(
const char* partname,
const int x,
const int y,
const float scale);
84 void DeletePart(
const int partn);
85 void SetUseAlias(
const int use) { useAlias = use; };
86 unsigned char GetUseAlias(
void) {
return useAlias; };
87 bool SavePinAlias(std::string fname);
88 bool LoadPinAlias(std::string fname,
unsigned char show_error_msg = 0);
89 bool LoadConfig(std::string fname,
const int disable_debug = 0);
90 void ClearPinAlias(
void);
91 std::string GetAliasFname(
void) {
return alias_fname; };
92 float GetScale(
void) {
return scale; };
93 void SetScale(
float s) { scale = s; };
96 void Setfdtype(
int value);
98 int Getfdtype(
void) {
return fdtype; };
100 void ReadPreferences(
char* name,
char* value);
101 void WritePreferences(
void);
103 bool SaveConfig(std::string fname);
105 std::string GetLoadConfigFile(
void) {
return LoadConfigFile; };
107 void SetfdOldFilename(
const std::string ofn);
109 std::string GetOldFilename(
void) {
return oldfname; };
111 void SetPartOnDraw(
int pod) { PartOnDraw = pod; };
112 int GetPartOnDraw(
void) {
return PartOnDraw; };
116 static int WPropCmd(
const char* ControlName,
const PICSimLabWindowAction action,
const char* Value,
117 void* ReturnBuff = NULL);
119 static int WindowCmd(
const int id,
const char* ControlName,
const PICSimLabWindowAction action,
const char* Value,
120 void* ReturnBuff = NULL);
124 int (*OnWindowCmd)(
const int id,
const char* ControlName,
const PICSimLabWindowAction action,
const char* Value,
130 std::string PinNames[MAX_PIN_COUNT];
131 std::string PinAlias[MAX_PIN_COUNT];
132 std::string alias_fname;
133 std::string LoadConfigFile;
135 unsigned char PinsCount;
136 unsigned char useAlias;
137 std::atomic<int> partsc;
138 part* parts[MAX_PARTS];
140 part* parts_aup[MAX_PARTS];
141 unsigned char pullup_bus[IOINIT];
142 int pullup_bus_count;
143 unsigned char pullup_bus_ptr[IOINIT];
145 std::string oldfname;