@@ -33,7 +33,8 @@ PhaseCalculatorEditor::PhaseCalculatorEditor(PhaseCalculator* parentNode, bool u
33
33
tabText = " Event Phase Plot" ;
34
34
int filterWidth = 80 ;
35
35
36
- PhaseCalculator* processor = static_cast <PhaseCalculator*>(parentNode);
36
+ // make the canvas now, so that restoring its parameters always works.
37
+ canvas = new PhaseCalculatorCanvas (parentNode);
37
38
38
39
lowCutLabel = new Label (" lowCutL" , " Low cut" );
39
40
lowCutLabel->setBounds (10 , 30 , 80 , 20 );
@@ -45,7 +46,7 @@ PhaseCalculatorEditor::PhaseCalculatorEditor(PhaseCalculator* parentNode, bool u
45
46
lowCutEditable->setEditable (true );
46
47
lowCutEditable->addListener (this );
47
48
lowCutEditable->setBounds (15 , 47 , 60 , 18 );
48
- lowCutEditable->setText (String (processor ->lowCut ), dontSendNotification);
49
+ lowCutEditable->setText (String (parentNode ->lowCut ), dontSendNotification);
49
50
lowCutEditable->setColour (Label::backgroundColourId, Colours::grey);
50
51
lowCutEditable->setColour (Label::textColourId, Colours::white);
51
52
addAndMakeVisible (lowCutEditable);
@@ -60,7 +61,7 @@ PhaseCalculatorEditor::PhaseCalculatorEditor(PhaseCalculator* parentNode, bool u
60
61
highCutEditable->setEditable (true );
61
62
highCutEditable->addListener (this );
62
63
highCutEditable->setBounds (15 , 87 , 60 , 18 );
63
- highCutEditable->setText (String (processor ->highCut ), dontSendNotification);
64
+ highCutEditable->setText (String (parentNode ->highCut ), dontSendNotification);
64
65
highCutEditable->setColour (Label::backgroundColourId, Colours::grey);
65
66
highCutEditable->setColour (Label::textColourId, Colours::white);
66
67
addAndMakeVisible (highCutEditable);
@@ -77,7 +78,7 @@ PhaseCalculatorEditor::PhaseCalculatorEditor(PhaseCalculator* parentNode, bool u
77
78
{
78
79
hilbertLengthBox->addItem (String (1 << pow ), pow );
79
80
}
80
- hilbertLengthBox->setText (String (processor ->hilbertLength ), dontSendNotification);
81
+ hilbertLengthBox->setText (String (parentNode ->hilbertLength ), dontSendNotification);
81
82
hilbertLengthBox->setTooltip (HILB_LENGTH_TOOLTIP);
82
83
hilbertLengthBox->setBounds (filterWidth + 10 , 45 , 80 , 20 );
83
84
hilbertLengthBox->addListener (this );
@@ -106,7 +107,7 @@ PhaseCalculatorEditor::PhaseCalculatorEditor(PhaseCalculator* parentNode, bool u
106
107
pastLengthEditable = new Label (" pastLengthE" );
107
108
pastLengthEditable->setEditable (true );
108
109
pastLengthEditable->addListener (this );
109
- pastLengthEditable->setText (String (processor ->hilbertLength - processor ->predictionLength ), dontSendNotification);
110
+ pastLengthEditable->setText (String (parentNode ->hilbertLength - parentNode ->predictionLength ), dontSendNotification);
110
111
pastLengthEditable->setBounds (filterWidth + 8 , 102 , 60 , 18 );
111
112
pastLengthEditable->setColour (Label::backgroundColourId, Colours::grey);
112
113
pastLengthEditable->setColour (Label::textColourId, Colours::white);
@@ -115,7 +116,7 @@ PhaseCalculatorEditor::PhaseCalculatorEditor(PhaseCalculator* parentNode, bool u
115
116
predLengthEditable = new Label (" predLengthE" );
116
117
predLengthEditable->setEditable (true );
117
118
predLengthEditable->addListener (this );
118
- predLengthEditable->setText (String (processor ->predictionLength ), dontSendNotification);
119
+ predLengthEditable->setText (String (parentNode ->predictionLength ), dontSendNotification);
119
120
predLengthEditable->setBounds (filterWidth + 70 , 102 , 60 , 18 );
120
121
predLengthEditable->setColour (Label::backgroundColourId, Colours::grey);
121
122
predLengthEditable->setColour (Label::textColourId, Colours::white);
@@ -131,8 +132,8 @@ PhaseCalculatorEditor::PhaseCalculatorEditor(PhaseCalculator* parentNode, bool u
131
132
predLengthSlider->setColour (Slider::backgroundColourId, Colour (51 , 102 , 255 ));
132
133
predLengthSlider->setTooltip (PRED_LENGTH_TOOLTIP);
133
134
predLengthSlider->addListener (this );
134
- predLengthSlider->setRange (0 , processor ->hilbertLength , 1 );
135
- predLengthSlider->setValue (processor ->hilbertLength - processor ->predictionLength , dontSendNotification);
135
+ predLengthSlider->setRange (0 , parentNode ->hilbertLength , 1 );
136
+ predLengthSlider->setValue (parentNode ->hilbertLength - parentNode ->predictionLength , dontSendNotification);
136
137
addAndMakeVisible (predLengthSlider);
137
138
138
139
recalcIntervalLabel = new Label (" recalcL" , " AR Refresh:" );
@@ -147,7 +148,7 @@ PhaseCalculatorEditor::PhaseCalculatorEditor(PhaseCalculator* parentNode, bool u
147
148
recalcIntervalEditable->setBounds (filterWidth + 145 , 44 , 55 , 18 );
148
149
recalcIntervalEditable->setColour (Label::backgroundColourId, Colours::grey);
149
150
recalcIntervalEditable->setColour (Label::textColourId, Colours::white);
150
- recalcIntervalEditable->setText (String (processor ->calcInterval ), dontSendNotification);
151
+ recalcIntervalEditable->setText (String (parentNode ->calcInterval ), dontSendNotification);
151
152
recalcIntervalEditable->setTooltip (RECALC_INTERVAL_TOOLTIP);
152
153
addAndMakeVisible (recalcIntervalEditable);
153
154
@@ -169,7 +170,7 @@ PhaseCalculatorEditor::PhaseCalculatorEditor(PhaseCalculator* parentNode, bool u
169
170
arOrderEditable->setBounds (filterWidth + 195 , 66 , 25 , 18 );
170
171
arOrderEditable->setColour (Label::backgroundColourId, Colours::grey);
171
172
arOrderEditable->setColour (Label::textColourId, Colours::white);
172
- arOrderEditable->setText (String (processor ->arOrder ), sendNotificationAsync);
173
+ arOrderEditable->setText (String (parentNode ->arOrder ), sendNotificationAsync);
173
174
arOrderEditable->setTooltip (AR_ORDER_TOOLTIP);
174
175
addAndMakeVisible (arOrderEditable);
175
176
@@ -184,7 +185,7 @@ PhaseCalculatorEditor::PhaseCalculatorEditor(PhaseCalculator* parentNode, bool u
184
185
outputModeBox->addItem (" MAG" , MAG);
185
186
outputModeBox->addItem (" PH+MAG" , PH_AND_MAG);
186
187
outputModeBox->addItem (" IMAG" , IM);
187
- outputModeBox->setSelectedId (processor ->outputMode );
188
+ outputModeBox->setSelectedId (parentNode ->outputMode );
188
189
outputModeBox->setTooltip (OUTPUT_MODE_TOOLTIP);
189
190
outputModeBox->setBounds (filterWidth + 145 , 105 , 76 , 19 );
190
191
outputModeBox->addListener (this );
@@ -369,7 +370,6 @@ void PhaseCalculatorEditor::stopAcquisition()
369
370
370
371
Visualizer* PhaseCalculatorEditor::createNewCanvas ()
371
372
{
372
- canvas = new PhaseCalculatorCanvas (static_cast <PhaseCalculator*>(getProcessor ()));
373
373
return canvas;
374
374
}
375
375
0 commit comments