comparison FXAnalyse.c @ 132:fbd72d87b4dc

Support graceful intrerruption of N3 measurement. Minor user interface fixes
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Tue, 17 Dec 2013 17:21:17 +0100
parents 934843ee4434
children 7540703b8473
comparison
equal deleted inserted replaced
131:183acefb8a96 132:fbd72d87b4dc
218 // MJD functiom used by the Sr programs 218 // MJD functiom used by the Sr programs
219 static inline double utc2mjd(double utc) 219 static inline double utc2mjd(double utc)
220 { 220 {
221 return 15020.0 + utc / 86400.0; 221 return 15020.0 + utc / 86400.0;
222 } 222 }
223
223 224
224 void logmsg(const char *frmt, ...) 225 void logmsg(const char *frmt, ...)
225 { 226 {
226 char msg[1024]; 227 char msg[1024];
227 int len = 0; 228 int len = 0;
1838 if (! visible) { 1839 if (! visible) {
1839 measuring = MEASURING_N_Lo; 1840 measuring = MEASURING_N_Lo;
1840 SetCtrlVal(CalcNPanel, CALCN_INTEGRATIONTIME, DeltaT_1); 1841 SetCtrlVal(CalcNPanel, CALCN_INTEGRATIONTIME, DeltaT_1);
1841 SetCtrlVal(CalcNPanel, CALCN_SLOPETIME, SlopeTime1); 1842 SetCtrlVal(CalcNPanel, CALCN_SLOPETIME, SlopeTime1);
1842 SetCtrlVal(CalcNPanel, CALCN_DELTAFREQ, DeltakHz_1); 1843 SetCtrlVal(CalcNPanel, CALCN_DELTAFREQ, DeltakHz_1);
1843 SetPanelAttribute(CalcNPanel, ATTR_TITLE, "Calculate N_Lo"); 1844 SetPanelAttribute(CalcNPanel, ATTR_TITLE, "Measure N_Lo");
1845 SetCtrlVal(CalcNPanel, CALCN_SLOPE, 0.0);
1846 SetCtrlVal(CalcNPanel, CALCN_N, 0.0);
1844 DisplayPanel(CalcNPanel); 1847 DisplayPanel(CalcNPanel);
1845 } 1848 }
1846 break; 1849 break;
1847 case PANEL_N2CALCULUS: 1850 case PANEL_N2CALCULUS:
1848 GetPanelAttribute(CalcNPanel, ATTR_VISIBLE, &visible); 1851 GetPanelAttribute(CalcNPanel, ATTR_VISIBLE, &visible);
1849 if (! visible) { 1852 if (! visible) {
1850 measuring = MEASURING_N_Hg; 1853 measuring = MEASURING_N_Hg;
1851 SetCtrlVal(CalcNPanel, CALCN_INTEGRATIONTIME, DeltaT_2); 1854 SetCtrlVal(CalcNPanel, CALCN_INTEGRATIONTIME, DeltaT_2);
1852 SetCtrlVal(CalcNPanel, CALCN_SLOPETIME, SlopeTime2); 1855 SetCtrlVal(CalcNPanel, CALCN_SLOPETIME, SlopeTime2);
1853 SetCtrlVal(CalcNPanel, CALCN_DELTAFREQ, DeltakHz_2); 1856 SetCtrlVal(CalcNPanel, CALCN_DELTAFREQ, DeltakHz_2);
1854 SetPanelAttribute(CalcNPanel, ATTR_TITLE, "Calculate N_Hg"); 1857 SetPanelAttribute(CalcNPanel, ATTR_TITLE, "Measure N_Hg");
1858 SetCtrlVal(CalcNPanel, CALCN_SLOPE, 0.0);
1859 SetCtrlVal(CalcNPanel, CALCN_N, 0.0);
1855 DisplayPanel(CalcNPanel); 1860 DisplayPanel(CalcNPanel);
1856 } 1861 }
1857 break; 1862 break;
1858 case PANEL_N3CALCULUS: 1863 case PANEL_N3CALCULUS:
1859 GetPanelAttribute(CalcNPanel, ATTR_VISIBLE, &visible); 1864 GetPanelAttribute(CalcNPanel, ATTR_VISIBLE, &visible);
1860 if (! visible) { 1865 if (! visible) {
1861 measuring = MEASURING_N_Sr; 1866 measuring = MEASURING_N_Sr;
1862 SetCtrlVal(CalcNPanel, CALCN_INTEGRATIONTIME, DeltaT_3); 1867 SetCtrlVal(CalcNPanel, CALCN_INTEGRATIONTIME, DeltaT_3);
1863 SetCtrlVal(CalcNPanel, CALCN_SLOPETIME, SlopeTime3); 1868 SetCtrlVal(CalcNPanel, CALCN_SLOPETIME, SlopeTime3);
1864 SetCtrlVal(CalcNPanel, CALCN_DELTAFREQ, DeltakHz_3); 1869 SetCtrlVal(CalcNPanel, CALCN_DELTAFREQ, DeltakHz_3);
1865 SetPanelAttribute(CalcNPanel, ATTR_TITLE, "Calculate N_Sr"); 1870 SetPanelAttribute(CalcNPanel, ATTR_TITLE, "Measure N_Sr");
1871 SetCtrlVal(CalcNPanel, CALCN_SLOPE, 0.0);
1872 SetCtrlVal(CalcNPanel, CALCN_N, 0.0);
1866 DisplayPanel(CalcNPanel); 1873 DisplayPanel(CalcNPanel);
1867 } 1874 }
1868 break; 1875 break;
1869 } 1876 }
1870 break; 1877 break;
1928 SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyDDS3Init); 1935 SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyDDS3Init);
1929 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequencyDDS3Init); 1936 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequencyDDS3Init);
1930 break; 1937 break;
1931 case MEASURING_N_Sr: 1938 case MEASURING_N_Sr:
1932 Measuring_3 = FALSE; 1939 Measuring_3 = FALSE;
1940 SetCtrlVal(MainPanel, PANEL_DDS1, FrequDDS1);
1941 DDS4xAD9912_RampFrequency(&DDS4xAD9912, 1, FrequDDS1, FREP_STEP_SIZE);
1942 SetCtrlVal(MainPanel, PANEL_DDS2, FrequencyDDSBesInit);
1943 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 2, FrequencyDDSBesInit);
1944 SetCtrlVal(MainPanel, PANEL_DDS3, FrequencyDDS3Init);
1945 DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, FrequencyDDS3Init);
1933 break; 1946 break;
1934 } 1947 }
1935 break; 1948 break;
1936 } 1949 }
1937 return 0; 1950 return 0;