1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
#ifndef _ADVANCED_DIALOG_H
#define _ADVANCED_DIALOG_H
#define MAX_PIN_NAME 128
/*Advanced Dialog Menus*/
#define MNU_ADV_NEW 0x01
#define MNU_ADV_OPEN 0x02
#define MNU_ADV_SAVE 0x03
#define MNU_ADV_SAVE_AS 0x04
#define MNU_ADV_EXIT 0x05
#define MNU_ADV_UNDO 0x10
#define MNU_ADV_REDO 0x11
#define MNU_ADV_CUT 0x12
#define MNU_ADV_COPY 0x13
#define MNU_ADV_PASTE 0x14
#define MNU_ADV_DEL 0x15
#define MNU_ADV_SIMULATION_MODE 0x20
#define MNU_ADV_START_SIMULATION 0x21
#define MNU_ADV_STOP_SIMULATION 0x22
#define MNU_ADV_SINGLE_CYCLE 0x23
#define MNU_ADV_MANUAL 0x30
#define MNU_ADV_ABOUT 0x31
#define MAX_NAME_LENGTH 128
#define MAX_SCREEN_ITEMS 512
#define MAX_PINS 4000
#define MCU_PIN_FLAG 4000
#define MAX_MCU_PINS 128
#define TIMER_ADV_SIMULATE 101
typedef struct ImageStructTag {
int selectedState;
HIMAGELIST Images;
int ComponentId;
} ImageStruct;
typedef struct ImageLocationTag{
int Id;
ImageStruct* Image;
int Index;
int x;
int y;
void* Properties;
void* PinId;
void* PinName;
}ImageLocation;
typedef struct PinInfoTag{
double Volt;
double OperatingVolt;
void** ImageId;
int* Index;
int* ImageType; //To compare with imagelocation array
int LinkCount; //No of valid entries in array
double ProgVolt;
void* ProgComponent;
}PinInfo;
typedef struct PinMcuTag{
UINT PinId;
UINT state;
int type;
BOOL InternalPullup;
}PinMcu;
typedef struct PinNameTag{
UINT PinId; //Need to generate unique pinid every time user saves a name
TCHAR Name[MAX_NAME_LENGTH];
PinInfo PinData;
}PinName;
typedef struct PinComponentTag{
UINT PinId;
void** ComponentAddress;
int Count;
void* Next;
}PinComponent;
extern HANDLE ImageHeap;
extern HFONT AdvNiceFont;
extern HFONT AdvFixedFont;
extern UINT NameCount;
extern ImageLocation ImageStack[MAX_SCREEN_ITEMS];
// extern PinInfo PinData[MAX_PINS];
extern PinMcu McuPin[MAX_MCU_PINS];
extern PinName NameId[MAX_PINS];
extern HWND AdvancedDialog;
extern PinComponent ComponentPin;
/*Advanced Dialog Functions*/
void MakeAdvancedDialogControls(void);
void AdvancedDialogResized(void);
void MakeAdvancedWindowMenus(void);
void ProcessEvent(int x, int y, int Event);
void AdvancedWindowClosing(void);
void ToggleAdvancedSimulationMode(void);
void SimulateOneAdvCycle(BOOL ForceRefresh);
int IsMCUPin(int PinId);
// void CreateVoltRequest(int PinId, int Index, double VoltReq);
// Heap Functions
void* AllocImageHeap(size_t n);
void* ReallocImageHeap(LPVOID lpMem, size_t n);
void FreeImageHeap(void *p);
// Component Functions
void InitComponents(void);
double GetGlobalVoltage(int PinId, void* ComponentAddress);
double RefreshVolt(int PinId, int Index, UINT Id, void* ComponentAddress, double volt);
double RefreshProcessorStat(int PinId, UINT Id);
int RegisterPinName(LPCTSTR Name);
int SetPinImage(int PinId,void* ImageId,int ImageType, int Index);
int FlushPinNames(void); //Clear Pins which are deleted from MainWindow
int DeRegisterPinName(LPCTSTR Name, void* ImageId);
int DeletePinImage(LPCTSTR Name, void* ImageId, int Index);
int DeletePinName(UINT Index);
void SetMcu(int PinId, int Type);
void RefreshNamingList(void);
void PopulateNamingList(void);
double RequestVoltChange(int PinId, int Index, void *ComponentAddress, double volt);
int DeleteComponentPin(int PinId, void* ComponentAddress);
int AddComponentPin(int PinId, void* ComponentAddress);
// int RegisterPinState(int Index, double Volt);
//NamingList functions
void ToggleInternalPullup(int PinId);
extern BOOL SimulationStarted;
#endif
|