forked from GeoDaCenter/geoda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CorrelParamsDlg.h
138 lines (119 loc) · 4.28 KB
/
CorrelParamsDlg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/**
* GeoDa TM, Copyright (C) 2011-2015 by Luc Anselin - all rights reserved
*
* This file is part of GeoDa.
*
* GeoDa is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GeoDa is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GEODA_CENTER_CORREL_PARAMS_DLG_H__
#define __GEODA_CENTER_CORREL_PARAMS_DLG_H__
#include <map>
#include <vector>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/choice.h>
#include <wx/dialog.h>
#include <wx/frame.h>
#include <wx/listbox.h>
#include <wx/listctrl.h>
#include <wx/msgdlg.h>
#include <wx/panel.h>
#include <wx/radiobut.h>
#include <wx/sizer.h>
#include <wx/slider.h>
#include <wx/spinctrl.h>
#include <wx/statbmp.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include "../GenUtils.h"
#include "../GdaConst.h"
#include "CorrelParamsObservable.h"
#include "CorrelogramAlgs.h"
class Project;
class CorrelParamsFrame : public wxFrame, public CorrelParamsObservable
{
public:
CorrelParamsFrame(const CorrelParams& correl_params,
GdaVarTools::Manager& var_man,
Project* project);
virtual ~CorrelParamsFrame();
void OnHelpBtn(wxCommandEvent& ev);
void OnApplyBtn(wxCommandEvent& ev);
void OnVarChoiceSelected(wxCommandEvent& ev);
void OnAllPairsRadioSelected(wxCommandEvent& ev);
void OnRandSampRadioSelected(wxCommandEvent& ev);
void OnBinsTextCtrl(wxCommandEvent& ev);
void OnBinsSpinEvent(wxSpinEvent& ev);
void OnDistanceChoiceSelected(wxCommandEvent& ev);
void OnThreshCheckBox(wxCommandEvent& ev);
void OnThreshTextCtrl(wxCommandEvent& ev);
void OnThreshTctrlKillFocus(wxFocusEvent& ev);
void OnThreshSlider(wxCommandEvent& ev);
void OnMaxIterTextCtrl(wxCommandEvent& ev);
void OnMaxIterTctrlKillFocus(wxFocusEvent& ev);
void OnSeedCheck(wxCommandEvent& ev);
void OnChangeSeed(wxCommandEvent& ev);
void OnTime1(wxCommandEvent& event);
/** Validates variable list against table.
New variables are added, order is updated, and missing variables are removed.
If any changes to GdaVarTools::Manager are made, a notify event is
generated. */
void UpdateFromTable();
/** Override CorrelParamsObservable::closeAndDeleteWhenEmpty */
virtual void closeAndDeleteWhenEmpty();
private:
bool IsArc();
bool IsMi();
/** min according to current arc/euc and units */
double GetThreshMin();
/** max according to current arc/euc and units */
double GetThreshMax();
void UpdateVarChoiceFromTable(const wxString& default_var);
void UpdateApplyState();
/** update threshold text control value according
to current position of threshold slider, or according to
default slider position if slider not yet initialized */
void UpdateThreshTctrlVal();
void UpdateEstPairs();
wxString GetHelpPageHtml() const;
int num_bins;
bool is_time;
int time_steps;
int v1_time;
std::map<wxString, wxString> name_to_nm;
Project* project;
wxStaticText* var_txt; // ID_VAR_TXT
wxChoice* var_choice; // ID_VAR_CHOICE
wxStaticText* var_time_txt; // ID_VAR_TXT
wxChoice* var_time_choice; // ID_VAR_CHOICE
wxStaticText* dist_txt; // ID_DIST_TXT
wxChoice* dist_choice; // ID_DIST_CHOICE
wxStaticText* bins_txt; // ID_BINS_TXT
wxSpinCtrl* bins_spn_ctrl; // ID_BINS_SPN_CTRL
wxCheckBox* thresh_cbx; // ID_THRESH_CBX
wxTextCtrl* thresh_tctrl; // ID_THRESH_TCTRL
wxSlider* thresh_slider; // ID_THRESH_SLDR
wxRadioButton* all_pairs_rad; // ID_ALL_PAIRS_RAD
wxStaticText* est_pairs_txt; // ID_EST_PAIRS_TXT
wxStaticText* est_pairs_num_txt; // ID_EST_PAIRS_NUM_TXT
wxRadioButton* rand_samp_rad; // ID_RAND_SAMP_RAD
wxStaticText* max_iter_txt; // ID_MAX_ITER_TXT
wxTextCtrl* max_iter_tctrl; // ID_MAX_ITER_TCTRL
wxButton* help_btn; // ID_HELP_BTN
wxButton* apply_btn; // ID_APPLY_BTN
wxCheckBox* chk_seed;
wxButton* seedButton;
static const long sldr_tcks = 1000;
};
#endif