-
Notifications
You must be signed in to change notification settings - Fork 0
/
ParameterCtrl.h
103 lines (68 loc) · 2.72 KB
/
ParameterCtrl.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
#ifndef _MobiView2_ParameterCtrl_h_
#define _MobiView2_ParameterCtrl_h_
constexpr int MAX_INDEX_SETS = 6; //NOTE: This now just a guideline for when the UI may start to look weird if more than this is displayed.
#include <CtrlLib/CtrlLib.h>
#define LAYOUTFILE <MobiView2/ParameterCtrl.lay>
#include <CtrlCore/lay.h>
class MobiView2;
struct Model_Application;
#include "common_types.h"
#include "support/parameter_editing.h"
class
ParameterMapCtrl : public WithParameterMapEditLayout<Upp::TopWindow> {
public :
typedef ParameterMapCtrl CLASSNAME;
ParameterMapCtrl(MobiView2 *parent);
void clean(bool clean_par = false);
void refresh();
void select_par(Indexed_Parameter &par);
void add_pushed();
void remove_pushed();
void pos_update(int row, double value);
void value_update(int row, double value);
private :
MobiView2 *parent;
Entity_Id current_par = invalid_entity_id;
Entity_Id current_par_app = invalid_entity_id;
Indexes current_indexes;
Upp::Array<Upp::EditDoubleNotNull> pos_ctrls;
Upp::Array<Upp::EditDoubleNotNull> value_ctrls;
std::vector<int> data_index;
void propagate_edit();
void show_at_row(int row_idx, int data_idx, Parmap_Entry &entry);
};
class ParameterCtrl : public WithParameterCtrlLayout<Upp::ParentCtrl> {
public:
typedef ParameterCtrl CLASSNAME;
ParameterCtrl(MobiView2* parent);
bool changed_since_last_save = false;
Upp::Array<Upp::Label> index_set_names;
Upp::Array<Upp::DropList> index_lists;
Upp::Array<Upp::ButtonOption> index_locks;
Upp::Array<Upp::ButtonOption> index_expands;
Upp::Array<Upp::Array<Upp::Ctrl>> parameter_controls;
MobiView2 *parent;
void par_group_change();
void refresh_parameter_view(bool values_only = false);
void clean();
void build_index_set_selecters(Model_Application *app);
void expand_index_set_clicked(Entity_Id id);
void list_change(Entity_Id id);
void parameter_edit(Indexed_Parameter par_data, Model_Application *app, Parameter_Value val);
Indexed_Parameter get_selected_parameter();
std::vector<Indexed_Parameter> get_all_parameters();
std::vector<Entity_Id> get_row_parameters();
private :
void set_locks(Indexed_Parameter &par);
void switch_expanded(Entity_Id id, bool on, bool force=false);
void set_single_parameter(Upp::ValueMap &row_data, Indexed_Parameter &par_data, Upp::Id &value_column, int row, int col, bool show_additional, bool values_only, bool can_edit, bool map_form);
Entity_Id par_group_id = invalid_entity_id;
std::vector<Entity_Id> index_sets;
std::vector<std::vector<Indexed_Parameter>> listed_pars;
int focus_row = -1;
int focus_col = -1;
Entity_Id expanded_row = invalid_entity_id;
Entity_Id expanded_col = invalid_entity_id;
ParameterMapCtrl map_edit;
};
#endif