data being over-written. Android
I am reading data from a sensor into two static double []'s called Gain
and Phase. Then depending on what button the user pressed to start
collecting data from the sensor, I save this data to another double [].
Ex:
if (What_Button == 1){
oGain = gain;
oPhase = phase;
output.setText("OPEN saved");
}
if (What_Button == 2){
sGain = gain;
sPhase = phase;
output.setText("SHORT saved");
}
if (What_Button == 3){
lGain = gain;
lPhase = phase;
output.setText("LOAD saved");
}
I then wish to plot the original Gain and Phase data. Before I do this I
convert the gain into dB and the phase into degrees.
i.e.
for (int i=0; i<_steps; i++) {
phase[i]=Math.toDegrees(phase[i]);
gain[i]=20*Math.log10(gain[i]);
}
This plotting works fine but after gain and phase have been converted my
saved data "lgain" "lphase", etc are changed. It is as if they have been
reassigned to the new Gain and Phase values instantly. I surrounded the
code above with System.out.pritln commands to view the lgain, lphase, etc.
values before and after and this is certainly where they are being changed
at. I used ctrl-f to find all instances of lgain, lphase, etc and they are
not being reassigned anywhere else. Any ideas how to fix this?
C
No comments:
Post a Comment