-
Notifications
You must be signed in to change notification settings - Fork 1
/
celiang.c
279 lines (227 loc) · 4.84 KB
/
celiang.c
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
#include<stdio.h>
#include "headfile.h"
#include "runmain.h"
#include "MyFont.h"
unsigned int key;
int mode,index,need_redraw;
COMMONDATA common_data={0,0,0,0,{0,0,0,0},0,0};
double *value = common_data.value;
void ShowTitle (char *title)
{
//PrintChStrV(title,1,0);
Bdisp_AreaReverseVRAM(1,0,13,50);
}
int InputDefProc (double *value,int index_max,int px,int py,int next_mode,int pre_mode)
{
char ch;
if (key==KEY_CTRL_UP)
{
if(--index<0)index = index_max-1;
need_redraw = REDRAW_PART;
}
else if(key==KEY_CTRL_DOWN)
{
if(++index>index_max-1)index = 0;
need_redraw = REDRAW_PART;
}
if (key==KEY_CTRL_EXIT)
{
mode = pre_mode;
}
if ((ch=GetPressNumChar(key))!=0
/*|| key==KEY_CTRL_LEFT || key==KEY_CTRL_RIGHT*/
|| key==KEY_CTRL_DEL || key==KEY_CTRL_AC)
{
int suc;
char str[30];
/*if(key==KEY_CTRL_LEFT || key==KEY_CTRL_RIGHT)
{
ftoa(str,value[index],4);
}*/
if (key==KEY_CTRL_DEL || key==KEY_CTRL_AC)
{
str[0] = 0;
}
else
{
str[0] = ch;str[1] = 0;
}
suc = InputString(px,py+index*12,str,0,12);
if(suc != KEY_CTRL_EXIT)
{
if(strlen(str)>0)value[index] = atof(str);
switch(suc)
{
case KEY_CTRL_DOWN:
case KEY_CTRL_EXE:
if(++index>index_max-1)
{
mode = next_mode;
index = 0;
}
break;
case KEY_CTRL_UP:
if(--index<0)index = index_max-1;
break;
}
}
else
{
mode = pre_mode;
}
need_redraw = 1;
}
return 0;
}
struct list l_pqx;
s_sqx l_sqx[19];
QXYS qxys[2];
HPYS hpys[50];
ZFSET zfset = {0.0,0.0,0.0,0.0};
SETUP setup = {0,0,0,0,0,0.0,0.0,0.0};
YSCS yscs = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
int LoadInit()
{
int i;
SetMyFont(&stHz14x14,&stAsc6x12);
DispStr(22,4,"\xB2\xE2\xBC\xC6\xCA\xA6\xCC\xE5\xD1\xE9\xB0\xE6");
for (i=10;i<118;++i){
Bdisp_SetPoint_DD (i,55,1);
Bdisp_SetPoint_DD (i,56,1);
Bdisp_SetPoint_DD (i,57,1);
Bdisp_SetPoint_DD (i,58,1);
Bdisp_SetPoint_DD (i,59,1);
Bdisp_SetPoint_DD (i,60,1);
Bdisp_SetPoint_DD (i,61,1);
Bdisp_SetPoint_DD (i,62,1);
Bdisp_SetPoint_DD (i,63,1);
Bdisp_SetPoint_DD (i,64,1);
Bdisp_DrawLineVRAM(0,31,127,31);
Bdisp_DrawLineVRAM(63,0,63,63);
Sleep(10);
}
}
int AddIn_main(int isAppli, unsigned short OptionNum)
{
uint refresh = 1,key;
int nMenuIdx=-1;
Bdisp_AllClr_DDVRAM();
//while (CheckReg() != TRUE) ;
Bdisp_AllClr_DDVRAM();
JDFNewFolder();
XYNewFolder();
ZDMNewFolder();
PMNewFolder();
route_initial(&route);
route_push_back(&route);
jdfroute_initial(&jdfroute);
jdfroute_push_back(&jdfroute);
zdmroute_initial(&zdmroute);
zdmroute_push_back(&zdmroute);
pmroute_initial(&pmroute);
pmroute_push_back(&pmroute);
LoadInit(); //加载测计师注册版
//LoadLastDataFile(); //加载要素表格
LoadLastDataJDFFile();
LoadLastDataSRDFile();
LoadLastDataSRDFile3();
MenuInit();
Bdisp_AllClr_DDVRAM();
while(1){
Bdisp_AllClr_VRAM();
ListMenu();
nMenuIdx=DoMyMenu();
switch(nMenuIdx){
case 1:
refresh = 1;
computeZS();
break;
case 2:
refresh = 1;
computeFS();
break;
//case 3:
//refresh = 1;
//SD();
//break;
case 5:
refresh = 1;
ChangeSetup ();
break;
case 7:
refresh = 1;
JDF_parameter();
break;
case 8:
refresh = 1;
XY_parameter();
break;
case 9:
refresh = 1;
ZDM_parameter();
break;
case 17:
refresh = 1;
PM_parameter();
break;
case 22:
refresh = 1;
BinMain_1();
break;
case 23:
refresh = 1;
BinMain_2();
break;
case -1:
refresh = 1;
About();
break;
}
}
return 1;
}
int JDFNewFolder()
{
# ifdef RELEASE
FONTCHARACTER pt_folder[] = { '\\','\\','f','l','s','0','\\','J','D','F','\0'} ;
# else
FONTCHARACTER pt_folder[] = { '\\','\\','c','r','d','0','\\','J','D','F','\0'} ;
# endif
Bfile_CreateDirectory(pt_folder) ;
}
int XYNewFolder()
{
# ifdef RELEASE
FONTCHARACTER pt_folder[] = { '\\','\\','f','l','s','0','\\','S','R','D','\0'} ;
# else
FONTCHARACTER pt_folder[] = { '\\','\\','c','r','d','0','\\','S','R','D','\0'} ;
# endif
Bfile_CreateDirectory(pt_folder) ;
}
int ZDMNewFolder()
{
# ifdef RELEASE
FONTCHARACTER pt_folder[] = { '\\','\\','f','l','s','0','\\','Z','D','M','\0'} ;
# else
FONTCHARACTER pt_folder[] = { '\\','\\','c','r','d','0','\\','Z','D','M','\0'} ;
# endif
Bfile_CreateDirectory(pt_folder) ;
}
int PMNewFolder()
{
# ifdef RELEASE
FONTCHARACTER pt_folder[] = { '\\','\\','f','l','s','0','\\','P','M','\0'} ;
# else
FONTCHARACTER pt_folder[] = { '\\','\\','c','r','d','0','\\','P','M','\0'} ;
# endif
Bfile_CreateDirectory(pt_folder) ;
}
#pragma section _BR_Size
unsigned long BR_Size;
#pragma section
#pragma section _TOP
int InitializeSystem(int isAppli, unsigned short OptionNum)
{
return INIT_ADDIN_APPLICATION(isAppli, OptionNum);
}
#pragma section