@@ -29,6 +29,9 @@ function GraphConfigurationDialog(dialog, onSave) {
29
29
elem = $ (
30
30
'<li class="config-graph-field">'
31
31
+ '<select class="form-control"><option value="">(choose a field)</option></select>'
32
+ + '<input name="smoothing" class="form-control" type="text"></input>'
33
+ + '<input name="power" class="form-control" type="text"></input>'
34
+ + '<input name="scale" class="form-control" type="text"></input>'
32
35
+ '<button type="button" class="btn btn-default btn-sm">Remove</button>'
33
36
+ '</li>'
34
37
) ,
@@ -40,6 +43,17 @@ function GraphConfigurationDialog(dialog, onSave) {
40
43
select . append ( renderFieldOption ( offeredFieldNames [ i ] , selectedFieldName ) ) ;
41
44
}
42
45
46
+ // the smoothing is in uS rather than %, scale the value somewhere between 0 and 10000uS
47
+ $ ( 'input[name=smoothing]' , elem ) . val ( ( field . smoothing != null ) ?( field . smoothing / 100 ) + '%' :'30%' ) ;
48
+ if ( field . curve != null ) {
49
+ $ ( 'input[name=power]' , elem ) . val ( ( field . curve . power != null ) ?( field . curve . power * 100 ) + '%' :'100%' ) ;
50
+ $ ( 'input[name=scale]' , elem ) . val ( ( field . curve . outputRange != null ) ?( field . curve . outputRange * 100 ) + '%' :'100%' ) ;
51
+ } else
52
+ {
53
+ $ ( 'input[name=power]' , elem ) . val ( '100%' ) ;
54
+ $ ( 'input[name=scale]' , elem ) . val ( '100%' ) ;
55
+ }
56
+
43
57
return elem ;
44
58
}
45
59
@@ -57,6 +71,18 @@ function GraphConfigurationDialog(dialog, onSave) {
57
71
+ '<input class="form-control" type="text" placeholder="Axis label">'
58
72
+ '</div>'
59
73
+ '</div>'
74
+ + '<div class="form-group form-group-sm">'
75
+ + '<div class="col-sm-10">'
76
+ + '<table>'
77
+ + '<tr>'
78
+ + '<th name="field"></th>'
79
+ + '<th name="smoothing">Smooth</th>'
80
+ + '<th name="expo">Expo</th>'
81
+ + '<th name="zoom">Zoom</th>'
82
+ + '</tr>'
83
+ + '</table>'
84
+ + '</div>'
85
+ + '</div>'
60
86
+ '<div class="form-group form-group-sm">'
61
87
+ '<label class="col-sm-2 control-label">Fields</label>'
62
88
+ '<div class="col-sm-10">'
@@ -162,8 +188,13 @@ function GraphConfigurationDialog(dialog, onSave) {
162
188
163
189
$ ( ".config-graph-field" , this ) . each ( function ( ) {
164
190
field = {
165
- name : $ ( "select" , this ) . val ( )
166
- } ;
191
+ name : $ ( "select" , this ) . val ( ) ,
192
+ smoothing : parseInt ( $ ( "input[name=smoothing]" , this ) . val ( ) ) * 100 , // Value 0-100% = 0-10000uS (higher values are more smooth, 30% is typical)
193
+ curve : {
194
+ power : parseInt ( $ ( "input[name=power]" , this ) . val ( ) ) / 100.0 , // Value 0-100% = 0-1.0 (lower values exagerate center values - expo)
195
+ outputRange : parseInt ( $ ( "input[name=scale]" , this ) . val ( ) ) / 100.0 // Value 0-100% = 0-1.0 (higher values > 100% zoom in graph vertically)
196
+ }
197
+ }
167
198
168
199
if ( field . name . length > 0 ) {
169
200
graph . fields . push ( field ) ;
0 commit comments