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