-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmcu2660TP.js
304 lines (263 loc) · 7.36 KB
/
mcu2660TP.js
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
/**
* @author h
*/
var myLogoName = "";
var ipt_str = new Array();
document.getElementById("idVol").output = function() {
//alert("this is it"+this.value);
if(this.checked)
{
//ipt_str[0] = "#define " + this.value;
ipt_str.push("#define " + this.value);
}
else
{
ipt_str.push("//#define " + this.value);
}
};
document.getElementById("idMd3001").output = function() {
if(this.checked)
{
//ipt_str[0] = "#define " + this.value;
ipt_str.push("#define " + this.value);
}
else
{
ipt_str.push("//#define " + this.value);
}
};
document.getElementById("idMd701").output = function() {
if(this.checked)
{
//ipt_str[0] = "#define " + this.value;
ipt_str.push("#define " + this.value);
}
else
{
ipt_str.push("//#define " + this.value);
}
};
document.getElementById("idMd1004").output = function() {
if(this.checked)
{
//ipt_str[0] = "#define " + this.value;
ipt_str.push("#define " + this.value);
}
else
{
ipt_str.push("//#define " + this.value);
}
};
document.getElementById("id55Key").output = function() {
if(this.checked)
{
ipt_str.push("#define _REMOTE_CONTROLLER _IR_FZ_55KEYS");
}
};
document.getElementById("id44Key").output = function() {
//#define _REMOTE_CONTROLLER _IR_FZ_44KEYS
if(this.checked)
{
ipt_str.push("#define _REMOTE_CONTROLLER _IR_FZ_44KEYS");
}
};
document.getElementById("idEnglish").output = function() {
//如果选择,只需要 #define _LANGUAGE 0x00
if(this.checked)
{
ipt_str.push("#define _LANGUAGE 0x00");
}
};
document.getElementById("idSpanish").output = function() {
//如果选择,只需要 #define _LANGUAGE 0x00
//0:Eng 1:Schi 2:Fra 3:Ita 4:Deu 5:Esp 6:Tchi 7:Jap 8:Kor 9:Rus/Turky
if(this.checked)
{
ipt_str.push("#define _LANGUAGE 0x05");
}
};
document.getElementById("idTurkish").output = function() {
//如果选择,只需要 #define _LANGUAGE 0x00
if(this.checked)
{
ipt_str.push("#define _LANGUAGE 0x09");
}
};
document.getElementById("idItalian").output = function() {
//如果选择,只需要 #define _LANGUAGE 0x00
if(this.checked)
{
ipt_str.push("#define _LANGUAGE 0x03");
}
};
document.getElementById("idJapanese").output = function() {
//如果选择,只需要 #define _LANGUAGE 0x00
//0:Eng 1:Schi 2:Fra 3:Ita 4:Deu 5:Esp 6:Tchi 7:Jap 8:Kor 9:Rus/Turky
if(this.checked)
{
ipt_str.push("#define _LANGUAGE 0x07");
}
};
document.getElementById("idRussian").output = function() {
//如果选择,只需要 #define _LANGUAGE 0x00
//0:Eng 1:Schi 2:Fra 3:Ita 4:Deu 5:Esp 6:Tchi 7:Jap 8:Kor 9:Rus/Turky
if(this.checked)
{
ipt_str.push("#define SUPPORT_RUSSIAN_OSD"); //只有俄文才要定义这个
ipt_str.push("#define _LANGUAGE 0x09");
}
};
document.getElementById("idKorean").output = function() {
//如果选择,只需要 #define _LANGUAGE 0x00
//0:Eng 1:Schi 2:Fra 3:Ita 4:Deu 5:Esp 6:Tchi 7:Jap 8:Kor 9:Rus/Turky
if(this.checked)
{
ipt_str.push("#define _LANGUAGE 0x08");
}
};
document.getElementById("idTchinese").output = function() {
//如果选择,只需要 #define _LANGUAGE 0x00
//0:Eng 1:Schi 2:Fra 3:Ita 4:Deu 5:Esp 6:Tchi 7:Jap 8:Kor 9:Rus/Turky
if(this.checked)
{
ipt_str.push("#define _LANGUAGE 0x06");
}
};
document.getElementById("idChinese").output = function() {
//如果选择,只需要 #define _LANGUAGE 0x00
//0:Eng 1:Schi 2:Fra 3:Ita 4:Deu 5:Esp 6:Tchi 7:Jap 8:Kor 9:Rus/Turky
if(this.checked)
{
ipt_str.push("#define _LANGUAGE 0x01");
}
};
document.getElementById("idGermany").output = function() {
//如果选择,只需要 #define _LANGUAGE 0x00
//0:Eng 1:Schi 2:Fra 3:Ita 4:Deu 5:Esp 6:Tchi 7:Jap 8:Kor 9:Rus/Turky
if(this.checked)
{
ipt_str.push("#define _LANGUAGE 0x04");
}
};
document.getElementById("idVolType1").output = function() {
if(this.checked)
{
ipt_str.push("#define "+this.value);
}
};
document.getElementById("idVolType2").output = function() {
if(this.checked)
{
ipt_str.push("#define "+this.value);
}
};
document.getElementById("idVolType3").output = function() {
if(this.checked)
{
ipt_str.push("#define "+this.value);
}
};
document.getElementById("idVolType4").output = function() {
if(this.checked)
{
ipt_str.push("#define "+this.value);
}
};
document.getElementById("idVolType5").output = function() {
if(this.checked)
{
ipt_str.push("#define "+this.value);
}
};
document.getElementById("idVolType6").output = function() {
if(this.checked)
{
ipt_str.push("#define "+this.value);
}
};
document.getElementById("selTvType").output = function(){
//列表元素,输出#define A B
if(this.selectedIndex == 0)
{
ipt_str.push("#define "+this.name+" 0");
ipt_str.push("#define _VIDEO_TV_SUPPORT _ON");
ipt_str.push("#define _CMMB_DIGITAL_TV_SUPPORT _OFF");
}
if(this.selectedIndex == 1)
{
ipt_str.push("#define "+this.name+" 1");
ipt_str.push("#define _VIDEO_TV_SUPPORT _ON");
ipt_str.push("#define _CMMB_DIGITAL_TV_SUPPORT _ON");
}
if(this.selectedIndex == 2)
{
ipt_str.push("#define "+this.name+" 1");
ipt_str.push("#define _VIDEO_TV_SUPPORT _OFF");
ipt_str.push("#define _CMMB_DIGITAL_TV_SUPPORT _OFF");
}
};
document.getElementById("selHdmiEn").output = function(){
//列表元素,输出#define A B
if(this.selectedIndex == 0)
{
ipt_str.push("#define "+this.name+" 0");
}
if(this.selectedIndex == 1)
{
ipt_str.push("#define "+this.name+" 1");
}
};
function print_text() {
var my_string;
var fso, file;
var ipt = document.getElementsByTagName("input");
var len = ipt.length;
var sel;
//= document.getElementsByTagName("select");
//var sel_len = sel.length;
//var sel_str = new Array(sel_len);
len -= 3; //最后有1个text和2个按钮
document.getElementById("idVol").output();
document.getElementById("idMd3001").output();
document.getElementById("idMd701").output();
document.getElementById("idMd1004").output();
document.getElementById("id55Key").output();
document.getElementById("id44Key").output();
document.getElementById("idEnglish").output();
document.getElementById("idSpanish").output();
document.getElementById("idTurkish").output();
document.getElementById("idItalian").output();
document.getElementById("idJapanese").output();
document.getElementById("idRussian").output();
document.getElementById("idKorean").output();
document.getElementById("idTchinese").output();
document.getElementById("idChinese").output();
document.getElementById("idGermany").output();
document.getElementById("idVolType1").output();
document.getElementById("idVolType2").output();
document.getElementById("idVolType3").output();
document.getElementById("idVolType4").output();
document.getElementById("idVolType5").output();
document.getElementById("idVolType6").output();
document.getElementById("selTvType").output();
document.getElementById("selHdmiEn").output();
for ( i = 0; i < ipt_str.length; i++) {
document.write(ipt_str[i]);
document.write("<br />");
}
fso = new ActiveXObject("Scripting.FileSystemObject");
if (fso.FolderExists("d:\\javascript") == false) {
fso.CreateFolder("d:\\javascript");
}
file = fso.CreateTextFile("d:\\javascript\\cfg_js_mcu2660.h", true);
for ( i = 0; i < ipt_str.length; i++) {
file.WriteLine(ipt_str[i]);
}
file.Close();
}
function resetall() {
var myFrLen = document.forms.length;
for (var i = 0; i < myFrLen; i++) {
document.forms[i].reset();
}
}