Mercurial > hg > fxanalyse
comparison FXAnalyse.c @ 60:cd7b5903f168
Display measured slope
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Thu, 18 Oct 2012 12:24:19 +0200 |
parents | d0aa333e6451 |
children | 37075b60408b |
comparison
equal
deleted
inserted
replaced
59:d0aa333e6451 | 60:cd7b5903f168 |
---|---|
1228 frequency = DDSFox_ReadFreq(&DDS1xAD9956); | 1228 frequency = DDSFox_ReadFreq(&DDS1xAD9956); |
1229 | 1229 |
1230 if (! KeepSlope) | 1230 if (! KeepSlope) |
1231 SlopeMath2 = 0.0; | 1231 SlopeMath2 = 0.0; |
1232 | 1232 |
1233 SetCtrlVal(MainPanel, PANEL_SLOPETOCANCEL, SlopeMath2); | 1233 SetCtrlVal(MainPanel, PANEL_SLOPE_APPLIED, SlopeMath2); |
1234 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); | 1234 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); |
1235 | 1235 |
1236 Slope_Math2slope = 0.0; | 1236 Slope_Math2slope = 0.0; |
1237 SlopeMeasuring = FALSE; | 1237 SlopeMeasuring = FALSE; |
1238 SetCtrlVal(MainPanel, PANEL_MEASURE_SLOPE, 0); | 1238 SetCtrlVal(MainPanel, PANEL_MEASURE_SLOPE, 0); |
1241 // update slope measurement | 1241 // update slope measurement |
1242 N_Math2slope = N_Math2slope + 1; | 1242 N_Math2slope = N_Math2slope + 1; |
1243 Math2_slope = currentFreq; | 1243 Math2_slope = currentFreq; |
1244 Moy_Math2slope = ((N_Math2slope-1)*Moy_Math2slope + Math2_slope)/N_Math2slope; | 1244 Moy_Math2slope = ((N_Math2slope-1)*Moy_Math2slope + Math2_slope)/N_Math2slope; |
1245 Slope_Math2slope = (Slope_Math2slope*(N_Math2slope-2) + 6*(Math2_slope-Moy_Math2slope)/N_Math2slope)/(N_Math2slope+1); | 1245 Slope_Math2slope = (Slope_Math2slope*(N_Math2slope-2) + 6*(Math2_slope-Moy_Math2slope)/N_Math2slope)/(N_Math2slope+1); |
1246 // update indicator | |
1247 SetCtrlVal(MainPanel, PANEL_SLOPE_MEASURED, 0); | |
1246 | 1248 |
1247 // update applied slope | 1249 // update applied slope |
1248 if ((utc - SlopeMeasuringTimeBegin) > TimetoSlope) { | 1250 if ((utc - SlopeMeasuringTimeBegin) > TimetoSlope) { |
1249 | 1251 |
1250 if (invertSlopeSign) | 1252 if (invertSlopeSign) |
1270 MoyMath2 = 0.0; | 1272 MoyMath2 = 0.0; |
1271 } | 1273 } |
1272 } | 1274 } |
1273 | 1275 |
1274 double frequency = DDSFox_ReadFreq(&DDS1xAD9956); | 1276 double frequency = DDSFox_ReadFreq(&DDS1xAD9956); |
1275 SetCtrlVal(MainPanel, PANEL_SLOPETOCANCEL, SlopeMath2); | 1277 SetCtrlVal(MainPanel, PANEL_SLOPE_APPLIED, SlopeMath2); |
1276 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); | 1278 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); |
1277 | 1279 |
1278 N_Math2slope = 0.0; | 1280 N_Math2slope = 0.0; |
1279 Math2_slope = 0.0; | 1281 Math2_slope = 0.0; |
1280 Moy_Math2slope = 0.0; | 1282 Moy_Math2slope = 0.0; |
2211 | 2213 |
2212 SlopeMeasuringTimeBegin = utc; | 2214 SlopeMeasuringTimeBegin = utc; |
2213 SlopeMeasuring = TRUE; | 2215 SlopeMeasuring = TRUE; |
2214 | 2216 |
2215 frequency = DDSFox_ReadFreq(&DDS1xAD9956); | 2217 frequency = DDSFox_ReadFreq(&DDS1xAD9956); |
2216 GetCtrlVal(panel, PANEL_SLOPETOCANCEL, &SlopeMath2); | 2218 GetCtrlVal(panel, PANEL_SLOPE_APPLIED, &SlopeMath2); |
2217 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); | 2219 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); |
2218 | 2220 |
2219 Nratio = -1; | 2221 Nratio = -1; |
2220 CenterFrequencyCh2ToDetermine = TRUE ; | 2222 CenterFrequencyCh2ToDetermine = TRUE ; |
2221 CenterFrequencyCh2 = 0.0; | 2223 CenterFrequencyCh2 = 0.0; |
2227 frequency = DDSFox_ReadFreq(&DDS1xAD9956); | 2229 frequency = DDSFox_ReadFreq(&DDS1xAD9956); |
2228 | 2230 |
2229 if (! KeepSlope) | 2231 if (! KeepSlope) |
2230 SlopeMath2 = 0.0; | 2232 SlopeMath2 = 0.0; |
2231 | 2233 |
2232 SetCtrlVal(panel, PANEL_SLOPETOCANCEL, SlopeMath2); | 2234 SetCtrlVal(panel, PANEL_SLOPE_APPLIED, SlopeMath2); |
2233 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); | 2235 DDSFox_Set(&DDS1xAD9956, frequency, SlopeMath2); |
2234 | 2236 |
2235 SlopeMeasuring = FALSE; | 2237 SlopeMeasuring = FALSE; |
2236 N_Math2slope = 0.0; | 2238 N_Math2slope = 0.0; |
2237 Math2_slope = 0.0; | 2239 Math2_slope = 0.0; |
2257 CenterFrequencyCh2 = 0.0; | 2259 CenterFrequencyCh2 = 0.0; |
2258 MoyMath2 = 0.0; | 2260 MoyMath2 = 0.0; |
2259 Nratio = -1; | 2261 Nratio = -1; |
2260 CenterFrequencyCh2ToDetermine = TRUE ; | 2262 CenterFrequencyCh2ToDetermine = TRUE ; |
2261 SlopeMath2 = 0.0; | 2263 SlopeMath2 = 0.0; |
2262 SetCtrlVal(panel, PANEL_SLOPETOCANCEL, SlopeMath2); | 2264 SetCtrlVal(panel, PANEL_SLOPE_APPLIED, SlopeMath2); |
2263 DDSFox_Set(&DDS1xAD9956, DEDRIFT_DDS_FREQUENCY, SlopeMath2); | 2265 DDSFox_Set(&DDS1xAD9956, DEDRIFT_DDS_FREQUENCY, SlopeMath2); |
2264 break; | 2266 break; |
2265 } | 2267 } |
2266 return 0; | 2268 return 0; |
2267 } | 2269 } |