Mercurial > hg > fxanalyse
comparison FXAnalyse.c @ 230:9e240adb3053
Fix N estimate to properly round
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Mon, 27 Oct 2014 18:02:32 +0100 |
parents | 5e69d9abbbf2 |
children | c10236b5a3e9 |
comparison
equal
deleted
inserted
replaced
229:28a56e4c06a4 | 230:9e240adb3053 |
---|---|
54 double utc; | 54 double utc; |
55 double Ch1, Ch2, Ch3, Ch4; | 55 double Ch1, Ch2, Ch3, Ch4; |
56 double Math1, Math2, Math3, Math4, Math5; | 56 double Math1, Math2, Math3, Math4, Math5; |
57 double N1, N2, N3; | 57 double N1, N2, N3; |
58 double Ndiv = 8.0; | 58 double Ndiv = 8.0; |
59 double Sign1 = 1.0, Sign2 = 1.0, Sign3 = 0.0; | 59 double Sign1 = 1, Sign2 = 1, Sign3 = 1; |
60 void *MathParser1, *MathParser2, *MathParser3, *MathParser4, *MathParser5; | 60 void *MathParser1, *MathParser2, *MathParser3, *MathParser4, *MathParser5; |
61 | 61 |
62 | 62 |
63 // panels | 63 // panels |
64 static int MainPanel; | 64 static int MainPanel; |
2282 | 2282 |
2283 int CVICALLBACK cb_onEstimateNSet (int panel, int control, int event, | 2283 int CVICALLBACK cb_onEstimateNSet (int panel, int control, int event, |
2284 void *callbackData, int eventData1, int eventData2) | 2284 void *callbackData, int eventData1, int eventData2) |
2285 { | 2285 { |
2286 void *v; | 2286 void *v; |
2287 double n; | |
2287 int estimate = 0; | 2288 int estimate = 0; |
2288 | 2289 |
2289 switch (event) | 2290 switch (event) |
2290 { | 2291 { |
2291 case EVENT_COMMIT: | 2292 case EVENT_COMMIT: |
2292 GetPanelAttribute(panel, ATTR_CALLBACK_DATA, &v); | 2293 GetPanelAttribute(panel, ATTR_CALLBACK_DATA, &v); |
2293 estimate = PTR_TO_INT(v); | 2294 estimate = PTR_TO_INT(v); |
2294 switch (estimate) { | 2295 switch (estimate) { |
2295 case HG: | 2296 case HG: |
2296 GetCtrlVal(panel, ESTIMATEN_N, &N2); | 2297 GetCtrlVal(panel, ESTIMATEN_N, &n); |
2298 N2 = round(n); | |
2297 SetCtrlVal(MainPanel, PANEL_N2, N2); | 2299 SetCtrlVal(MainPanel, PANEL_N2, N2); |
2298 break; | 2300 break; |
2299 case SR: | 2301 case SR: |
2300 GetCtrlVal(panel, ESTIMATEN_N, &N3); | 2302 GetCtrlVal(panel, ESTIMATEN_N, &n); |
2303 N3 = round(n); | |
2301 SetCtrlVal(MainPanel, PANEL_N3, N3); | 2304 SetCtrlVal(MainPanel, PANEL_N3, N3); |
2302 break; | 2305 break; |
2303 } | 2306 } |
2304 HidePanel(panel); | 2307 HidePanel(panel); |
2305 break; | 2308 break; |