comparison FXAnalyse.c @ 28:1e4ecf64b485

Remove references to unused DDSBes
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Tue, 02 Oct 2012 17:51:27 +0200
parents 419db63a9949
children 585c60175bd5
comparison
equal deleted inserted replaced
27:419db63a9949 28:1e4ecf64b485
55 double N1, N2, N3, N4 ; 55 double N1, N2, N3, N4 ;
56 56
57 Plot_Data PlotCh1, PlotCh2, PlotCh3, PlotCh4, PlotMath1, PlotMath2, PlotMath3, PlotMath4, PlotMath5 ; 57 Plot_Data PlotCh1, PlotCh2, PlotCh3, PlotCh4, PlotMath1, PlotMath2, PlotMath3, PlotMath4, PlotMath5 ;
58 Allan_Data AllanCh1, AllanCh2, AllanCh3, AllanCh4, AllanMath1, AllanMath2, AllanMath3, AllanMath4, AllanMath5 ; 58 Allan_Data AllanCh1, AllanCh2, AllanCh3, AllanCh4, AllanMath1, AllanMath2, AllanMath3, AllanMath4, AllanMath5 ;
59 59
60 DDSBes_Data DDSBes ;
61 DDS4xAD9912_Data DDS4xAD9912 ; 60 DDS4xAD9912_Data DDS4xAD9912 ;
62 61
63 muParserHandle_t MathParser1, MathParser2, MathParser3, MathParser4, MathParser5 ; 62 muParserHandle_t MathParser1, MathParser2, MathParser3, MathParser4, MathParser5 ;
64 63
65 volatile bool Acquiring = FALSE ; 64 volatile bool Acquiring = FALSE ;
209 mupDefineVar( * pMathParser, "MJD", &mjd); 208 mupDefineVar( * pMathParser, "MJD", &mjd);
210 mupDefineVar( * pMathParser, "Ch1", &Ch1); 209 mupDefineVar( * pMathParser, "Ch1", &Ch1);
211 mupDefineVar( * pMathParser, "Ch2", &Ch2); 210 mupDefineVar( * pMathParser, "Ch2", &Ch2);
212 mupDefineVar( * pMathParser, "Ch3", &Ch3); 211 mupDefineVar( * pMathParser, "Ch3", &Ch3);
213 mupDefineVar( * pMathParser, "Ch4", &Ch4); 212 mupDefineVar( * pMathParser, "Ch4", &Ch4);
214 mupDefineVar( * pMathParser, "DDS_Frep", &(DDSBes.Frequency));
215 mupDefineVar( * pMathParser, "DDS1", &(DDS4xAD9912.Frequency1)); 213 mupDefineVar( * pMathParser, "DDS1", &(DDS4xAD9912.Frequency1));
216 mupDefineVar( * pMathParser, "DDS2", &(DDS4xAD9912.Frequency2)); 214 mupDefineVar( * pMathParser, "DDS2", &(DDS4xAD9912.Frequency2));
217 mupDefineVar( * pMathParser, "DDS3", &(DDS4xAD9912.Frequency3)); 215 mupDefineVar( * pMathParser, "DDS3", &(DDS4xAD9912.Frequency3));
218 mupDefineVar( * pMathParser, "DDS4", &(DDS4xAD9912.Frequency4)); 216 mupDefineVar( * pMathParser, "DDS4", &(DDS4xAD9912.Frequency4));
219 mupDefineVar( * pMathParser, "N1", &N1); 217 mupDefineVar( * pMathParser, "N1", &N1);
262 if ((EstimateN3Panel = LoadPanel (MainPanel, "FXAnalyse.uir", ESTIMATEN3)) < 0) 260 if ((EstimateN3Panel = LoadPanel (MainPanel, "FXAnalyse.uir", ESTIMATEN3)) < 0)
263 return -1; 261 return -1;
264 262
265 DisplayPanel (MainPanel); 263 DisplayPanel (MainPanel);
266 264
267 // Initialyze the DDS Besancon Output
268
269 DDSBes_Initialize(&DDSBes) ;
270 DDSBes_SetClockFrequency(&DDSBes, DDSBESCLOCK) ; // Peut etre passer tout ca dans DDSBes-Initialize ?
271 DDSBes_SetAmplitude(&DDSBes, 4095) ;
272 GetCtrlVal(MainPanel, PANEL_DDSFREPOUT,&initfreqDDS) ;
273 DDSBes_SetFrequency(&DDSBes, initfreqDDS) ;
274
275 // Initialize the quadruple AD9959 DDS (Fox board interface) 265 // Initialize the quadruple AD9959 DDS (Fox board interface)
276 266
277 DDS4xAD9912_Reset(&DDS4xAD9912) ; 267 DDS4xAD9912_Reset(&DDS4xAD9912) ;
278 GetCtrlVal(MainPanel, PANEL_DDS1, &initfreqDDS) ; 268 GetCtrlVal(MainPanel, PANEL_DDS1, &initfreqDDS) ;
279 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, initfreqDDS) ; 269 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, initfreqDDS) ;
294 GetCtrlVal(MainPanel, PANEL_N1CHOICE, &N1) ; 284 GetCtrlVal(MainPanel, PANEL_N1CHOICE, &N1) ;
295 GetCtrlVal(MainPanel, PANEL_N2CHOICE, &N2) ; 285 GetCtrlVal(MainPanel, PANEL_N2CHOICE, &N2) ;
296 286
297 GetCtrlVal(MainPanel, PANEL_N3CHOICE, &N3) ; 287 GetCtrlVal(MainPanel, PANEL_N3CHOICE, &N3) ;
298 288
299 initMathParser(&MathParser1) ; 289 initMathParser(&MathParser1);
300 mupDefineVar(MathParser1, "DDS", &(DDSBes.Frequency)); 290 GetCtrlVal(MainPanel, PANEL_MATHSTRING1, MathString1);
301 GetCtrlVal(MainPanel, PANEL_MATHSTRING1, MathString1) ;
302 mupSetExpr(MathParser1, MathString1); 291 mupSetExpr(MathParser1, MathString1);
303 292
304 initMathParser(&MathParser2) ; 293 initMathParser(&MathParser2) ;
305 mupDefineVar( MathParser2, "Math1", &Math1); 294 mupDefineVar( MathParser2, "Math1", &Math1);
306 mupDefineVar( MathParser2, "DDS", &(DDS4xAD9912.Frequency1)); 295 mupDefineVar( MathParser2, "DDS", &(DDS4xAD9912.Frequency1));
373 { 362 {
374 switch (event) 363 switch (event)
375 { 364 {
376 case EVENT_COMMIT: 365 case EVENT_COMMIT:
377 QuitUserInterface (0); 366 QuitUserInterface (0);
378 DDSBes_Close(&DDSBes);
379 mupRelease(MathParser1); 367 mupRelease(MathParser1);
380 mupRelease(MathParser2); 368 mupRelease(MathParser2);
381 mupRelease(MathParser3); 369 mupRelease(MathParser3);
382 mupRelease(MathParser4); 370 mupRelease(MathParser4);
383 mupRelease(MathParser5); 371 mupRelease(MathParser5);
396 double Step ; 384 double Step ;
397 385
398 switch (event) { 386 switch (event) {
399 case EVENT_CLOSE: 387 case EVENT_CLOSE:
400 QuitUserInterface (0); 388 QuitUserInterface (0);
401 DDSBes_Close(&DDSBes);
402 mupRelease(MathParser1); 389 mupRelease(MathParser1);
403 mupRelease(MathParser2); 390 mupRelease(MathParser2);
404 mupRelease(MathParser3); 391 mupRelease(MathParser3);
405 break; 392 break;
406 case EVENT_KEYPRESS: 393 case EVENT_KEYPRESS:
407 switch (eventData1) // ie the code of the key which has been stroke 394 switch (eventData1) // ie the code of the key which has been stroke
408 { 395 {
409 case VAL_RIGHT_ARROW_VKEY : 396 case VAL_RIGHT_ARROW_VKEY :
410 ActiveControl = GetActiveCtrl(panel); 397 ActiveControl = GetActiveCtrl(panel);
411 if (ActiveControl==PANEL_DDSFREPOUT || ActiveControl==PANEL_DDSFREPSTEP) {
412 GetCtrlIndex(MainPanel, PANEL_DDSFREPSTEP, &StepIndex);
413 if (StepIndex<14){
414 SetCtrlIndex(MainPanel, PANEL_DDSFREPSTEP, ++StepIndex) ;
415 GetCtrlVal(MainPanel, PANEL_DDSFREPSTEP, &Step);
416 SetCtrlAttribute(MainPanel, PANEL_DDSFREPOUT, ATTR_INCR_VALUE, Step) ;
417 };
418 };
419 if (ActiveControl==PANEL_DDS1 || ActiveControl==PANEL_DDS1STEP) { 398 if (ActiveControl==PANEL_DDS1 || ActiveControl==PANEL_DDS1STEP) {
420 GetCtrlIndex(MainPanel, PANEL_DDS1STEP, &StepIndex); 399 GetCtrlIndex(MainPanel, PANEL_DDS1STEP, &StepIndex);
421 if (StepIndex<14){ 400 if (StepIndex<14){
422 SetCtrlIndex(MainPanel, PANEL_DDS1STEP, ++StepIndex) ; 401 SetCtrlIndex(MainPanel, PANEL_DDS1STEP, ++StepIndex) ;
423 GetCtrlVal(MainPanel, PANEL_DDS1STEP, &Step); 402 GetCtrlVal(MainPanel, PANEL_DDS1STEP, &Step);
449 }; 428 };
450 }; 429 };
451 break; 430 break;
452 case VAL_LEFT_ARROW_VKEY : 431 case VAL_LEFT_ARROW_VKEY :
453 ActiveControl = GetActiveCtrl(panel); 432 ActiveControl = GetActiveCtrl(panel);
454 if (ActiveControl==PANEL_DDSFREPOUT || ActiveControl==PANEL_DDSFREPSTEP) {
455 GetCtrlIndex(MainPanel, PANEL_DDSFREPSTEP, &StepIndex);
456 if (StepIndex>0){
457 SetCtrlIndex(MainPanel, PANEL_DDSFREPSTEP, --StepIndex) ;
458 GetCtrlVal(MainPanel, PANEL_DDSFREPSTEP, &Step);
459 SetCtrlAttribute(MainPanel, PANEL_DDSFREPOUT, ATTR_INCR_VALUE, Step) ;
460 };
461 };
462 if (ActiveControl==PANEL_DDS1 || ActiveControl==PANEL_DDS1STEP) { 433 if (ActiveControl==PANEL_DDS1 || ActiveControl==PANEL_DDS1STEP) {
463 GetCtrlIndex(MainPanel, PANEL_DDS1STEP, &StepIndex); 434 GetCtrlIndex(MainPanel, PANEL_DDS1STEP, &StepIndex);
464 if (StepIndex>0){ 435 if (StepIndex>0){
465 SetCtrlIndex(MainPanel, PANEL_DDS1STEP, --StepIndex) ; 436 SetCtrlIndex(MainPanel, PANEL_DDS1STEP, --StepIndex) ;
466 GetCtrlVal(MainPanel, PANEL_DDS1STEP, &Step); 437 GetCtrlVal(MainPanel, PANEL_DDS1STEP, &Step);
489 SetCtrlIndex(MainPanel, PANEL_DDS4STEP, --StepIndex) ; 460 SetCtrlIndex(MainPanel, PANEL_DDS4STEP, --StepIndex) ;
490 GetCtrlVal(MainPanel, PANEL_DDS4STEP, &Step); 461 GetCtrlVal(MainPanel, PANEL_DDS4STEP, &Step);
491 SetCtrlAttribute(MainPanel, PANEL_DDS4, ATTR_INCR_VALUE, Step) ; 462 SetCtrlAttribute(MainPanel, PANEL_DDS4, ATTR_INCR_VALUE, Step) ;
492 }; 463 };
493 }; 464 };
494 break;
495 case VAL_F1_VKEY :
496 SetActiveCtrl(MainPanel, PANEL_DDSFREPOUT);
497 break; 465 break;
498 case VAL_F2_VKEY : 466 case VAL_F2_VKEY :
499 SetActiveCtrl(MainPanel, PANEL_DDS1); 467 SetActiveCtrl(MainPanel, PANEL_DDS1);
500 break; 468 break;
501 case VAL_F3_VKEY : 469 case VAL_F3_VKEY :
1703 } 1671 }
1704 1672
1705 int CVICALLBACK CB_ChangeDDSOut (int panel, int control, int event, 1673 int CVICALLBACK CB_ChangeDDSOut (int panel, int control, int event,
1706 void *callbackData, int eventData1, int eventData2) 1674 void *callbackData, int eventData1, int eventData2)
1707 { 1675 {
1708 double Frequency ; 1676 double frequency ;
1709 1677
1710 switch (event) 1678 switch (event) {
1711 { 1679 case EVENT_COMMIT:
1712 case EVENT_COMMIT: 1680 GetCtrlVal(MainPanel, control, &frequency);
1713 GetCtrlVal(MainPanel, control, &Frequency) ; 1681
1714 if (control==PANEL_DDSFREPOUT) { DDSBes_SetFrequency(&DDSBes, Frequency) ;} 1682 switch (control) {
1715 if (control==PANEL_DDS1) { DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, Frequency);} 1683 case PANEL_DDS1:
1716 if (control==PANEL_DDS2) { DDS4xAD9912_SetFrequency(&DDS4xAD9912, 2, Frequency);} 1684 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 1, frequency);
1717 if (control==PANEL_DDS3) { DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, Frequency);} 1685 break;
1718 if (control==PANEL_DDS4) { DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, Frequency);} 1686 case PANEL_DDS2:
1719 case EVENT_RIGHT_CLICK: 1687 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 2, frequency);
1720 1688 break;
1721 break; 1689 case PANEL_DDS3:
1722 1690 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, frequency);
1723 } 1691 break;
1692 case PANEL_DDS4:
1693 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, frequency);
1694 break;
1695 }
1696 }
1724 return 0; 1697 return 0;
1725 } 1698 }
1726 1699
1727 int CVICALLBACK CB_ChangeDDSStep (int panel, int control, int event, 1700 int CVICALLBACK CB_ChangeDDSStep (int panel, int control, int event,
1728 void *callbackData, int eventData1, int eventData2) 1701 void *callbackData, int eventData1, int eventData2)
1730 double Step ; 1703 double Step ;
1731 1704
1732 switch (event) 1705 switch (event)
1733 { 1706 {
1734 case EVENT_COMMIT: 1707 case EVENT_COMMIT:
1735 GetCtrlVal(MainPanel, control, &Step) ; 1708 GetCtrlVal(MainPanel, control, &Step);
1736 if (control==PANEL_DDSFREPSTEP) { SetCtrlAttribute(panel, PANEL_DDSFREPOUT, ATTR_INCR_VALUE, Step) ;} 1709 if (control==PANEL_DDS1STEP) { SetCtrlAttribute(panel, PANEL_DDS1, ATTR_INCR_VALUE, Step); }
1737 if (control==PANEL_DDS1STEP) { SetCtrlAttribute(panel, PANEL_DDS1, ATTR_INCR_VALUE, Step) ;} 1710 if (control==PANEL_DDS2STEP) { SetCtrlAttribute(panel, PANEL_DDS2, ATTR_INCR_VALUE, Step); }
1738 if (control==PANEL_DDS2STEP) { SetCtrlAttribute(panel, PANEL_DDS2, ATTR_INCR_VALUE, Step) ;} 1711 if (control==PANEL_DDS3STEP) { SetCtrlAttribute(panel, PANEL_DDS3, ATTR_INCR_VALUE, Step); }
1739 if (control==PANEL_DDS3STEP) { SetCtrlAttribute(panel, PANEL_DDS3, ATTR_INCR_VALUE, Step) ;} 1712 if (control==PANEL_DDS4STEP) { SetCtrlAttribute(panel, PANEL_DDS4, ATTR_INCR_VALUE, Step); }
1740 if (control==PANEL_DDS4STEP) { SetCtrlAttribute(panel, PANEL_DDS4, ATTR_INCR_VALUE, Step) ;} 1713 break;
1741 break;
1742 case EVENT_RIGHT_CLICK:
1743
1744 break;
1745
1746 }
1747 return 0;
1748 }
1749
1750 int CVICALLBACK CB_ChangeDDSAmpli (int panel, int control, int event,
1751 void *callbackData, int eventData1, int eventData2)
1752 {
1753 unsigned short int Amplitude ;
1754
1755 switch (event)
1756 {
1757 case EVENT_COMMIT:
1758 GetCtrlVal(MainPanel, control, &Amplitude) ;
1759 if (control==PANEL_DDSFREPAMP) { DDSBes_SetAmplitude(&DDSBes, Amplitude) ;}
1760 case EVENT_RIGHT_CLICK: 1714 case EVENT_RIGHT_CLICK:
1761 1715
1762 break; 1716 break;
1763 1717
1764 } 1718 }
1812 if (control==PANEL_N3CHOICE) GetCtrlVal(MainPanel, control, &N3) ; 1766 if (control==PANEL_N3CHOICE) GetCtrlVal(MainPanel, control, &N3) ;
1813 break; 1767 break;
1814 } 1768 }
1815 return 0; 1769 return 0;
1816 } 1770 }
1817
1818
1819 int CVICALLBACK CB_OnPlus275k (int panel, int control, int event,
1820 void *callbackData, int eventData1, int eventData2)
1821 {
1822 double Frequency ;
1823
1824 switch (event)
1825 {
1826 case EVENT_COMMIT:
1827 GetCtrlVal(MainPanel, PANEL_DDSFREPOUT, &Frequency);
1828 Frequency += 275000.0;
1829 DDSBes_SetFrequency(&DDSBes, Frequency);
1830 SetCtrlVal(MainPanel, PANEL_DDSFREPOUT, Frequency);
1831 break;
1832 }
1833 return 0;
1834 }
1835
1836
1837 int CVICALLBACK CB_OnMinus275k (int panel, int control, int event,
1838 void *callbackData, int eventData1, int eventData2)
1839 {
1840 double Frequency ;
1841
1842 switch (event)
1843 {
1844 case EVENT_COMMIT:
1845 GetCtrlVal(MainPanel, PANEL_DDSFREPOUT, &Frequency);
1846 Frequency -= 275000.0;
1847 DDSBes_SetFrequency(&DDSBes, Frequency);
1848 SetCtrlVal(MainPanel, PANEL_DDSFREPOUT, Frequency);
1849 break;
1850 }
1851 return 0;
1852 }
1853
1854 1771
1855 int CVICALLBACK CB_OnPlus10k (int panel, int control, int event, 1772 int CVICALLBACK CB_OnPlus10k (int panel, int control, int event,
1856 void *callbackData, int eventData1, int eventData2) 1773 void *callbackData, int eventData1, int eventData2)
1857 { 1774 {
1858 double Frequency ; 1775 double Frequency ;