comparison FXAnalyse.c @ 168:4de7f2c9f328

Minor cleanup
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 14 Feb 2014 16:58:08 +0100
parents fdd2f8fd7714
children 97112b45b838
comparison
equal deleted inserted replaced
167:8a94f1913b4e 168:4de7f2c9f328
49 double Ch1, Ch2, Ch3, Ch4; 49 double Ch1, Ch2, Ch3, Ch4;
50 double Math1, Math2, Math3, Math4, Math5; 50 double Math1, Math2, Math3, Math4, Math5;
51 double N1, N2, N3; 51 double N1, N2, N3;
52 double Ndiv = 8.0; 52 double Ndiv = 8.0;
53 double Sign1 = 1.0, Sign2 = 1.0, Sign3 = 0.0; 53 double Sign1 = 1.0, Sign2 = 1.0, Sign3 = 0.0;
54 typedef void* mathparser_t; 54
55 mathparser_t *MathParser1, *MathParser2, *MathParser3, *MathParser4, *MathParser5; 55
56 void *MathParser1, *MathParser2, *MathParser3, *MathParser4, *MathParser5;
57
56 58
57 // panels 59 // panels
58 static int MainPanel; 60 static int MainPanel;
59 static int LoggingPanel; 61 static int LoggingPanel;
60 static int CalcNPanel; 62 static int CalcNPanel;
276 int control; 278 int control;
277 int write; 279 int write;
278 }; 280 };
279 281
280 #define DATAFILE(__name, __data, __nchan, __control, __write) \ 282 #define DATAFILE(__name, __data, __nchan, __control, __write) \
281 { \ 283 { \
282 .name = __name, \ 284 .name = __name, \
283 .data = __data, \ 285 .data = __data, \
284 .nchan = __nchan, \ 286 .nchan = __nchan, \
285 .control = __control, \ 287 .control = __control, \
286 .write = __write \ 288 .write = __write \
287 } 289 }
288 290
289 struct datafile datafiles[] = { 291 struct datafile datafiles[] = {
290 DATAFILE("Raw", event.data, 4, PANEL_SAVE_RAW, TRUE), 292 DATAFILE("Raw", event.data, 4, PANEL_SAVE_RAW, TRUE),
291 DATAFILE("DDS", DDS4xAD9912.frequency, 4, PANEL_SAVE_DDS, FALSE), 293 DATAFILE("DDS", DDS4xAD9912.frequency, 4, PANEL_SAVE_DDS, FALSE),
292 DATAFILE("Lo", &Math2, 1, PANEL_SAVE_LO, FALSE), 294 DATAFILE("Lo", &Math2, 1, PANEL_SAVE_LO, FALSE),
386 388
387 return 0; 389 return 0;
388 } 390 }
389 391
390 392
391 mathparser_t * mathparser_new() 393 void * muParserNew()
392 { 394 {
393 mathparser_t parser = mupCreate(); 395 void *parser = mupCreate();
394 396
395 mupDefineOprtChars(parser, "abcdefghijklmnopqrstuvwxyzµ" 397 mupDefineOprtChars(parser, "abcdefghijklmnopqrstuvwxyzµ"
396 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 398 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
397 "+-*^/?<>=#!$%&|~'_"); 399 "+-*^/?<>=#!$%&|~'_");
398 400
489 491
490 GetCtrlVal(MainPanel, PANEL_N1CHOICE, &N1); 492 GetCtrlVal(MainPanel, PANEL_N1CHOICE, &N1);
491 GetCtrlVal(MainPanel, PANEL_N2CHOICE, &N2); 493 GetCtrlVal(MainPanel, PANEL_N2CHOICE, &N2);
492 GetCtrlVal(MainPanel, PANEL_N3CHOICE, &N3); 494 GetCtrlVal(MainPanel, PANEL_N3CHOICE, &N3);
493 495
494 MathParser1 = mathparser_new(); 496 MathParser1 = muParserNew();
495 GetCtrlVal(MainPanel, PANEL_MATHSTRING1, expr); 497 GetCtrlVal(MainPanel, PANEL_MATHSTRING1, expr);
496 mupSetExpr(MathParser1, expr); 498 mupSetExpr(MathParser1, expr);
497 499
498 MathParser2 = mathparser_new(); 500 MathParser2 = muParserNew();
499 mupDefineVar(MathParser2, "Math1", &Math1); 501 mupDefineVar(MathParser2, "Math1", &Math1);
500 GetCtrlVal(MainPanel, PANEL_MATHSTRING2, expr); 502 GetCtrlVal(MainPanel, PANEL_MATHSTRING2, expr);
501 mupSetExpr(MathParser2, expr); 503 mupSetExpr(MathParser2, expr);
502 504
503 MathParser3 = mathparser_new(); 505 MathParser3 = muParserNew();
504 mupDefineVar(MathParser3, "Math1", &Math1); 506 mupDefineVar(MathParser3, "Math1", &Math1);
505 mupDefineVar(MathParser3, "Math2", &Math2); 507 mupDefineVar(MathParser3, "Math2", &Math2);
506 GetCtrlVal(MainPanel, PANEL_MATHSTRING3, expr); 508 GetCtrlVal(MainPanel, PANEL_MATHSTRING3, expr);
507 mupSetExpr(MathParser3, expr); 509 mupSetExpr(MathParser3, expr);
508 510
509 MathParser4 = mathparser_new(); 511 MathParser4 = muParserNew();
510 mupDefineVar(MathParser4, "Math1", &Math1); 512 mupDefineVar(MathParser4, "Math1", &Math1);
511 mupDefineVar(MathParser4, "Math2", &Math2); 513 mupDefineVar(MathParser4, "Math2", &Math2);
512 mupDefineVar(MathParser4, "Math3", &Math3); 514 mupDefineVar(MathParser4, "Math3", &Math3);
513 GetCtrlVal(MainPanel, PANEL_MATHSTRING4, expr); 515 GetCtrlVal(MainPanel, PANEL_MATHSTRING4, expr);
514 mupSetExpr(MathParser4, expr); 516 mupSetExpr(MathParser4, expr);
515 517
516 MathParser5 = mathparser_new(); 518 MathParser5 = muParserNew();
517 mupDefineVar(MathParser5, "Math1", &Math1); 519 mupDefineVar(MathParser5, "Math1", &Math1);
518 mupDefineVar(MathParser5, "Math2", &Math2); 520 mupDefineVar(MathParser5, "Math2", &Math2);
519 mupDefineVar(MathParser5, "Math3", &Math3); 521 mupDefineVar(MathParser5, "Math3", &Math3);
520 mupDefineVar(MathParser5, "Math4", &Math4); 522 mupDefineVar(MathParser5, "Math4", &Math4);
521 GetCtrlVal(MainPanel, PANEL_MATHSTRING5, expr); 523 GetCtrlVal(MainPanel, PANEL_MATHSTRING5, expr);