comparison Allan.c @ 134:bd28161e5ac2

Major code cleanup
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Wed, 22 Jan 2014 12:29:28 +0100
parents 0e9f95525a8f
children 77539f2597b1
comparison
equal deleted inserted replaced
133:7540703b8473 134:bd28161e5ac2
8 8
9 9
10 10
11 // ******************* Member functions : constructor and destructor ************************* 11 // ******************* Member functions : constructor and destructor *************************
12 12
13 int Allan_InitPanel(Allan_Data * Instance, char * title, double Normalizer, void (*OnCloseFunc)(int)) { 13 int Allan_InitPanel(Allan_Data * Instance, const char * title, double Normalizer, int parent, int control) {
14 14
15 int i ; 15 int i ;
16 16
17 if ((Instance->AllanPanel = LoadPanel (0, "FXAllan.uir", ALLANPANEL)) < 0) 17 if ((Instance->AllanPanel = LoadPanel (0, "FXAllan.uir", ALLANPANEL)) < 0)
18 return -1; 18 return -1;
19 SetPanelAttribute(Instance->AllanPanel, ATTR_TITLE, title) ; 19 SetPanelAttribute(Instance->AllanPanel, ATTR_TITLE, title) ;
20 SetPanelAttribute (Instance->AllanPanel, ATTR_CALLBACK_DATA, (void *)Instance); // the panel callback therefore knows which data structure it is associated to 20 SetPanelAttribute (Instance->AllanPanel, ATTR_CALLBACK_DATA, (void *)Instance); // the panel callback therefore knows which data structure it is associated to
21 Instance->OnClosePanel = OnCloseFunc ; 21 Instance->active = TRUE;
22 Instance->parent = parent;
23 Instance->control = control;
22 for (i=0 ; i<ALLAN_MAXPOINTSNUMBER ; i++) { 24 for (i=0 ; i<ALLAN_MAXPOINTSNUMBER ; i++) {
23 Instance->AllanVar[i] = 0 ; 25 Instance->AllanVar[i] = 0 ;
24 Instance->LastMean[i] = 0 ; 26 Instance->LastMean[i] = 0 ;
25 Instance->BlocksNumber[i] = 0 ; 27 Instance->BlocksNumber[i] = 0 ;
26 Instance->CurrentAverage[i] = 0 ; 28 Instance->CurrentAverage[i] = 0 ;
33 } 35 }
34 36
35 37
36 38
37 int Allan_ClosePanel(Allan_Data * Instance) { 39 int Allan_ClosePanel(Allan_Data * Instance) {
38 Instance->OnClosePanel(Instance->AllanPanel) ; 40 Instance->active = FALSE;
41 SetCtrlVal(Instance->parent, Instance->control, FALSE);
39 DiscardPanel (Instance->AllanPanel); 42 DiscardPanel (Instance->AllanPanel);
40 return 0; 43 return 0;
41 } 44 }
42 45
43 46