diff --git a/README.md b/README.md
index 7591dfec5..839213f70 100644
--- a/README.md
+++ b/README.md
@@ -23,37 +23,51 @@ Please join us on the following channels:
## Screenshots
+
+
+
+
+
+
+
diff --git a/app/build.gradle b/app/build.gradle
index 8e9b69430..20b5c0cba 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,8 +8,8 @@ android {
applicationId "io.pslab"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 9
- versionName "2.0.8"
+ versionCode 10
+ versionName "2.0.9"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
diff --git a/app/src/main/java/io/pslab/activity/MainActivity.java b/app/src/main/java/io/pslab/activity/MainActivity.java
index 0104bb156..d8e53d5d0 100644
--- a/app/src/main/java/io/pslab/activity/MainActivity.java
+++ b/app/src/main/java/io/pslab/activity/MainActivity.java
@@ -358,8 +358,14 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.menu_pslab_disconnected:
attemptToConnectPSLab();
break;
- case R.id.menu_pslab_layout:
+ case R.id.menu_pslab_layout_front:
+ PSLabPinLayoutFragment.frontSide = true;
displayPSLabPinLayout();
+ break;
+ case R.id.menu_pslab_layout_back:
+ PSLabPinLayoutFragment.frontSide = false;
+ displayPSLabPinLayout();
+ break;
default:
break;
}
diff --git a/app/src/main/java/io/pslab/activity/OscilloscopeActivity.java b/app/src/main/java/io/pslab/activity/OscilloscopeActivity.java
index c38443ab1..baa7a3f79 100644
--- a/app/src/main/java/io/pslab/activity/OscilloscopeActivity.java
+++ b/app/src/main/java/io/pslab/activity/OscilloscopeActivity.java
@@ -20,7 +20,6 @@
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
-import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
@@ -37,11 +36,15 @@
import com.github.mikephil.charting.data.LineDataSet;
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
import io.pslab.R;
import io.pslab.communication.AnalyticsClass;
import io.pslab.communication.ScienceLab;
-import io.pslab.experimentsetup.Oscilloscope.OscillatorExperimentFragment;
-import io.pslab.experimentsetup.Sensors.SpeedOfSoundFragment;
import io.pslab.fragment.ChannelParametersFragment;
import io.pslab.fragment.DataAnalysisFragment;
import io.pslab.fragment.TimebaseTriggerFragment;
@@ -52,15 +55,6 @@
import io.pslab.others.ScienceLabCommon;
import io.pslab.others.SwipeGestureDetector;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import butterknife.BindView;
-import butterknife.ButterKnife;
-
import static io.pslab.others.MathUtils.map;
/**
@@ -70,31 +64,9 @@
public class OscilloscopeActivity extends AppCompatActivity implements View.OnClickListener {
private static final String PREF_NAME = "OscilloscopeActivity";
- private ScienceLab scienceLab;
+ private final Object lock = new Object();
@BindView(R.id.chart_os)
public LineChart mChart;
- @BindView(R.id.layout_dock_os1)
- LinearLayout linearLayout;
- @BindView(R.id.layout_dock_os2)
- FrameLayout frameLayout;
- @BindView(R.id.layout_chart_os)
- RelativeLayout mChartLayout;
- @BindView(R.id.button_channel_parameters_os)
- ImageButton channelParametersButton;
- @BindView(R.id.button_timebase_os)
- ImageButton timebaseButton;
- @BindView(R.id.button_data_analysis_os)
- ImageButton dataAnalysisButton;
- @BindView(R.id.button_xy_plot_os)
- ImageButton xyPlotButton;
- @BindView(R.id.tv_channel_parameters_os)
- TextView channelParametersTextView;
- @BindView(R.id.tv_timebase_tigger_os)
- TextView timebaseTiggerTextView;
- @BindView(R.id.tv_data_analysis_os)
- TextView dataAnalysisTextView;
- @BindView(R.id.tv_xy_plot_os)
- TextView xyPlotTextView;
@BindView(R.id.tv_label_left_yaxis_os)
public TextView leftYAxisLabel;
@BindView(R.id.tv_unit_left_yaxis_os)
@@ -107,22 +79,9 @@ public class OscilloscopeActivity extends AppCompatActivity implements View.OnCl
public TextView xAxisLabel;
@BindView(R.id.tv_unit_xaxis_os)
public TextView xAxisLabelUnit;
- @BindView(R.id.img_arrow_oscilloscope)
- ImageView arrowUpDown;
- @BindView(R.id.sheet_slide_text_oscilloscope)
- TextView bottomSheetSlideText;
- @BindView(R.id.parent_layout)
- View parentLayout;
- @BindView(R.id.bottom_sheet_oscilloscope)
- LinearLayout bottomSheet;
- private int height;
- private int width;
public int samples;
public double timeGap;
public double timebase;
- private XAxis x1;
- private YAxis y1;
- private YAxis y2;
public boolean isCH1Selected;
public boolean isCH2Selected;
public boolean isCH3Selected;
@@ -134,45 +93,61 @@ public class OscilloscopeActivity extends AppCompatActivity implements View.OnCl
public boolean sineFit;
public boolean squareFit;
public boolean viewIsClicked;
- public boolean isHalfWaveRectifierExperiment;
- public boolean isFullWaveRectifierExperiment;
- public boolean isDiodeClippingClampingExperiment;
- public boolean isAstableMultivibratorExperiment;
- public boolean isColpittsOscillatorExperiment;
- public boolean isPhaseShiftOscillatorExperiment;
- public boolean isWienBridgeOscillatorExperiment;
- public boolean isMonostableMultivibratorExperiment;
- public boolean runMonostableMultivibratorExperiment;
public boolean isCH1FrequencyRequired;
public boolean isCH2FrequencyRequired;
- public boolean runSpeedOfSoundExperiment;
- public boolean isSpeedOfSoundExperiment;
- private String leftYAxisInput;
public String triggerChannel;
public String curveFittingChannel1;
public String curveFittingChannel2;
public String xyPlotXAxisChannel;
public String xyPlotYAxisChannel;
public double trigger;
+ public Plot2D graph;
+ @BindView(R.id.layout_dock_os1)
+ LinearLayout linearLayout;
+ @BindView(R.id.layout_dock_os2)
+ FrameLayout frameLayout;
+ @BindView(R.id.layout_chart_os)
+ RelativeLayout mChartLayout;
+ @BindView(R.id.button_channel_parameters_os)
+ ImageButton channelParametersButton;
+ @BindView(R.id.button_timebase_os)
+ ImageButton timebaseButton;
+ @BindView(R.id.button_data_analysis_os)
+ ImageButton dataAnalysisButton;
+ @BindView(R.id.button_xy_plot_os)
+ ImageButton xyPlotButton;
+ @BindView(R.id.tv_channel_parameters_os)
+ TextView channelParametersTextView;
+ @BindView(R.id.tv_timebase_tigger_os)
+ TextView timebaseTiggerTextView;
+ @BindView(R.id.tv_data_analysis_os)
+ TextView dataAnalysisTextView;
+ @BindView(R.id.tv_xy_plot_os)
+ TextView xyPlotTextView;
+ @BindView(R.id.img_arrow_oscilloscope)
+ ImageView arrowUpDown;
+ @BindView(R.id.sheet_slide_text_oscilloscope)
+ TextView bottomSheetSlideText;
+ @BindView(R.id.parent_layout)
+ View parentLayout;
+ @BindView(R.id.bottom_sheet_oscilloscope)
+ LinearLayout bottomSheet;
Fragment channelParametersFragment;
Fragment timebaseTriggerFragment;
Fragment dataAnalysisFragment;
Fragment xyPlotFragment;
- Fragment halfWaveRectifierFragment;
- Fragment fullWaveRectifierFragment;
- Fragment oscillatorExperimentFragment;
- Fragment diodeClippingClampingFragment;
- Fragment speedOfSoundFragment;
- private final Object lock = new Object();
+ @BindView(R.id.imageView_led_os)
+ ImageView ledImageView;
+ private ScienceLab scienceLab;
+ private int height;
+ private int width;
+ private XAxis x1;
+ private YAxis y1;
+ private YAxis y2;
private CaptureTask captureTask;
private CaptureTaskTwo captureTask2;
private CaptureTaskThree captureTask3;
private XYPlotTask xyPlotTask;
- private OscillatorTask oscillatorTask;
- private SpeedOfSoundTask speedOfSoundTask;
- @BindView(R.id.imageView_led_os)
- ImageView ledImageView;
- public Plot2D graph;
private AudioJack audioJack = null;
private AnalyticsClass analyticsClass;
private CaptureAudioBuffer captureAudioBuffer;
@@ -181,19 +156,17 @@ public class OscilloscopeActivity extends AppCompatActivity implements View.OnCl
private BottomSheetBehavior bottomSheetBehavior;
private GestureDetector gestureDetector;
+ private enum CHANNEL {CH1, CH2, CH3, MIC}
+
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_oscilloscope);
ButterKnife.bind(this);
- if (Build.VERSION.SDK_INT < 16) {
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }
- else {
- View decorView = getWindow().getDecorView();
+ View decorView = getWindow().getDecorView();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
decorView.setSystemUiVisibility((View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
@@ -201,13 +174,20 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY));
+ } else {
+ decorView.setSystemUiVisibility((View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_FULLSCREEN));
}
setUpBottomSheet();
parentLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- if(bottomSheetBehavior.getState()==BottomSheetBehavior.STATE_EXPANDED)
+ if (bottomSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED)
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
parentLayout.setVisibility(View.GONE);
}
@@ -217,7 +197,7 @@ public void onClick(View v) {
x1 = mChart.getXAxis();
y1 = mChart.getAxisLeft();
y2 = mChart.getAxisRight();
- triggerChannel = "CH1";
+ triggerChannel = CHANNEL.CH1.toString();
trigger = 0;
timebase = 875;
samples = 512;
@@ -227,27 +207,12 @@ public void onClick(View v) {
graph = new Plot2D(this, new float[]{}, new float[]{}, 1);
curveFittingChannel1 = "None";
curveFittingChannel2 = "None";
- xyPlotXAxisChannel = "CH1";
- xyPlotYAxisChannel = "CH2";
+ xyPlotXAxisChannel = CHANNEL.CH1.toString();
+ xyPlotYAxisChannel = CHANNEL.CH2.toString();
viewIsClicked = false;
- isHalfWaveRectifierExperiment = false;
- isFullWaveRectifierExperiment = false;
- isAstableMultivibratorExperiment = false;
analyticsClass = new AnalyticsClass();
isCH1FrequencyRequired = false;
isCH2FrequencyRequired = false;
- isColpittsOscillatorExperiment = false;
- isPhaseShiftOscillatorExperiment = false;
- isWienBridgeOscillatorExperiment = false;
- isMonostableMultivibratorExperiment = false;
- runMonostableMultivibratorExperiment = false;
- isSpeedOfSoundExperiment = false;
- runSpeedOfSoundExperiment = false;
-
- //int freq = scienceLab.setSine1(3000);
- //Log.v("SIN Fre", "" + freq);
- //scienceLab.setW1(3000, "sine");
-
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
@@ -263,7 +228,7 @@ public void onClick(View v) {
xyPlotFragment = new XYPlotFragment();
if (findViewById(R.id.layout_dock_os2) != null) {
- addFragment(R.id.layout_dock_os2, channelParametersFragment, "ChannelParametersFragment");
+ addFragment(R.id.layout_dock_os2, channelParametersFragment);
}
channelParametersButton.setOnClickListener(this);
@@ -285,7 +250,7 @@ public void run() {
while (monitor) {
if (scienceLab.isConnected() && isCH1Selected && !isCH2Selected && !isCH3Selected && !isMICSelected && !isXYPlotSelected) {
captureTask = new CaptureTask();
- captureTask.execute("CH1");
+ captureTask.execute(CHANNEL.CH1.toString());
synchronized (lock) {
try {
lock.wait();
@@ -293,12 +258,11 @@ public void run() {
e.printStackTrace();
}
}
-
}
if (scienceLab.isConnected() && isCH2Selected && !isCH1Selected && !isCH3Selected && !isMICSelected && !isXYPlotSelected) {
captureTask = new CaptureTask();
- captureTask.execute("CH2");
+ captureTask.execute(CHANNEL.CH2.toString());
synchronized (lock) {
try {
lock.wait();
@@ -306,26 +270,23 @@ public void run() {
e.printStackTrace();
}
}
-
}
if (scienceLab.isConnected() && isCH3Selected && !isCH1Selected && !isCH2Selected && !isMICSelected && !isXYPlotSelected) {
- {
- captureTask = new CaptureTask();
- captureTask.execute("CH3");
- synchronized (lock) {
- try {
- lock.wait();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ captureTask = new CaptureTask();
+ captureTask.execute(CHANNEL.CH3.toString());
+ synchronized (lock) {
+ try {
+ lock.wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
}
}
}
if (scienceLab.isConnected() && isMICSelected && !isCH1Selected && !isCH2Selected && !isCH3Selected && !isXYPlotSelected) {
captureTask = new CaptureTask();
- captureTask.execute("MIC");
+ captureTask.execute(CHANNEL.MIC.toString());
synchronized (lock) {
try {
lock.wait();
@@ -333,12 +294,11 @@ public void run() {
e.printStackTrace();
}
}
-
}
if (scienceLab.isConnected() && isCH1Selected && isCH2Selected && !isCH3Selected && !isMICSelected && !isXYPlotSelected) {
captureTask2 = new CaptureTaskTwo();
- captureTask2.execute("CH1");
+ captureTask2.execute(CHANNEL.CH1.toString());
synchronized (lock) {
try {
lock.wait();
@@ -350,7 +310,7 @@ public void run() {
if (scienceLab.isConnected() && isCH3Selected && isCH2Selected && !isCH1Selected && !isMICSelected && !isXYPlotSelected) {
captureTask2 = new CaptureTaskTwo();
- captureTask2.execute("CH3");
+ captureTask2.execute(CHANNEL.CH3.toString());
synchronized (lock) {
try {
lock.wait();
@@ -362,7 +322,7 @@ public void run() {
if (scienceLab.isConnected() && isMICSelected && isCH2Selected && !isCH3Selected && !isCH1Selected && !isXYPlotSelected) {
captureTask2 = new CaptureTaskTwo();
- captureTask2.execute("MIC");
+ captureTask2.execute(CHANNEL.MIC.toString());
synchronized (lock) {
try {
lock.wait();
@@ -374,43 +334,7 @@ public void run() {
if (scienceLab.isConnected() && isCH1Selected && isCH2Selected && isCH3Selected && isMICSelected && !isXYPlotSelected) {
captureTask3 = new CaptureTaskThree();
- captureTask3.execute("CH1");
- synchronized (lock) {
- try {
- lock.wait();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- if (scienceLab.isConnected() && (isHalfWaveRectifierExperiment || isFullWaveRectifierExperiment || isDiodeClippingClampingExperiment)) {
- captureTask2 = new CaptureTaskTwo();
- captureTask2.execute("CH1");
- synchronized (lock) {
- try {
- lock.wait();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- if (scienceLab.isConnected() && (isAstableMultivibratorExperiment || isColpittsOscillatorExperiment || isPhaseShiftOscillatorExperiment || isWienBridgeOscillatorExperiment)) {
- oscillatorTask = new OscillatorTask();
- oscillatorTask.execute("CH1");
- synchronized (lock) {
- try {
- lock.wait();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- if (scienceLab.isConnected() && isMonostableMultivibratorExperiment && runMonostableMultivibratorExperiment) {
- oscillatorTask = new OscillatorTask();
- oscillatorTask.execute("CH1");
+ captureTask3.execute(CHANNEL.CH1.toString());
synchronized (lock) {
try {
lock.wait();
@@ -434,7 +358,7 @@ public void run() {
if (scienceLab.isConnected() && viewIsClicked && isXYPlotSelected) {
xyPlotTask = new XYPlotTask();
- if (xyPlotXAxisChannel.equals("CH2"))
+ if (xyPlotXAxisChannel.equals(CHANNEL.CH2.toString()))
xyPlotTask.execute(xyPlotYAxisChannel);
else
xyPlotTask.execute(xyPlotXAxisChannel);
@@ -465,38 +389,17 @@ public void run() {
audioJack = null;
}
}
-
- if (scienceLab.isConnected() && isSpeedOfSoundExperiment && runSpeedOfSoundExperiment) {
- speedOfSoundTask = new SpeedOfSoundTask();
- speedOfSoundTask.execute();
- synchronized (lock) {
- try {
- lock.wait();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
}
}
};
-
- // if (scienceLab.isConnected())
monitorThread = new Thread(runnable);
monitorThread.start();
}
@Override
public void onClick(View v) {
-
switch (v.getId()) {
case R.id.button_channel_parameters_os:
- replaceFragment(R.id.layout_dock_os2, channelParametersFragment, "ChannelParametersFragment");
- clearTextBackgroundColor();
- channelParametersTextView.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
- break;
-
case R.id.tv_channel_parameters_os:
replaceFragment(R.id.layout_dock_os2, channelParametersFragment, "ChannelParametersFragment");
clearTextBackgroundColor();
@@ -504,11 +407,6 @@ public void onClick(View v) {
break;
case R.id.button_timebase_os:
- replaceFragment(R.id.layout_dock_os2, timebaseTriggerFragment, "TimebaseTiggerFragment");
- clearTextBackgroundColor();
- timebaseTiggerTextView.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
- break;
-
case R.id.tv_timebase_tigger_os:
replaceFragment(R.id.layout_dock_os2, timebaseTriggerFragment, "TimebaseTiggerFragment");
clearTextBackgroundColor();
@@ -516,11 +414,6 @@ public void onClick(View v) {
break;
case R.id.button_data_analysis_os:
- replaceFragment(R.id.layout_dock_os2, dataAnalysisFragment, "DataAnalysisFragment");
- clearTextBackgroundColor();
- dataAnalysisTextView.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
- break;
-
case R.id.tv_data_analysis_os:
replaceFragment(R.id.layout_dock_os2, dataAnalysisFragment, "DataAnalysisFragment");
clearTextBackgroundColor();
@@ -528,15 +421,13 @@ public void onClick(View v) {
break;
case R.id.button_xy_plot_os:
+ case R.id.tv_xy_plot_os:
replaceFragment(R.id.layout_dock_os2, xyPlotFragment, "XYPlotFragment");
clearTextBackgroundColor();
xyPlotTextView.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
break;
- case R.id.tv_xy_plot_os:
- replaceFragment(R.id.layout_dock_os2, xyPlotFragment, "XYPlotFragment");
- clearTextBackgroundColor();
- xyPlotTextView.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
+ default:
break;
}
}
@@ -550,64 +441,36 @@ private void clearTextBackgroundColor() {
}
public void onWindowFocusChanged() {
- boolean tabletSize = getResources().getBoolean(R.bool.isTablet);
- //dynamic placing the layouts
- if (isHalfWaveRectifierExperiment || isDiodeClippingClampingExperiment || isAstableMultivibratorExperiment || isSpeedOfSoundExperiment) {
- linearLayout.setVisibility(View.INVISIBLE);
- RelativeLayout.LayoutParams lineChartParams = (RelativeLayout.LayoutParams) mChartLayout.getLayoutParams();
+ RelativeLayout.LayoutParams lineChartParams = (RelativeLayout.LayoutParams) mChartLayout.getLayoutParams();
+ RelativeLayout.LayoutParams frameLayoutParams = (RelativeLayout.LayoutParams) frameLayout.getLayoutParams();
+ if (getResources().getBoolean(R.bool.isTablet)) {
lineChartParams.height = height * 3 / 4;
- lineChartParams.width = width;
- RelativeLayout.LayoutParams frameLayoutParams = (RelativeLayout.LayoutParams) frameLayout.getLayoutParams();
+ lineChartParams.width = width * 7 / 8;
+ mChartLayout.setLayoutParams(lineChartParams);
frameLayoutParams.height = height / 4;
- frameLayoutParams.width = width;
- } else if (isFullWaveRectifierExperiment || isColpittsOscillatorExperiment || isPhaseShiftOscillatorExperiment || isWienBridgeOscillatorExperiment || isMonostableMultivibratorExperiment) {
- linearLayout.setVisibility(View.INVISIBLE);
- RelativeLayout.LayoutParams lineChartParams = (RelativeLayout.LayoutParams) mChartLayout.getLayoutParams();
- lineChartParams.height = height * 5 / 6;
- lineChartParams.width = width;
- RelativeLayout.LayoutParams frameLayoutParams = (RelativeLayout.LayoutParams) frameLayout.getLayoutParams();
- frameLayoutParams.height = height / 6;
- frameLayoutParams.width = width;
+ frameLayoutParams.width = width * 7 / 8;
+ frameLayout.setLayoutParams(frameLayoutParams);
} else {
-
- if (tabletSize) {
- RelativeLayout.LayoutParams lineChartParams = (RelativeLayout.LayoutParams) mChartLayout.getLayoutParams();
- lineChartParams.height = height * 3 / 4;
- lineChartParams.width = width * 7 / 8;
- mChartLayout.setLayoutParams(lineChartParams);
- RelativeLayout.LayoutParams frameLayoutParams = (RelativeLayout.LayoutParams) frameLayout.getLayoutParams();
- frameLayoutParams.height = height / 4;
- frameLayoutParams.width = width * 7 / 8;
- frameLayout.setLayoutParams(frameLayoutParams);
- } else {
- RelativeLayout.LayoutParams lineChartParams = (RelativeLayout.LayoutParams) mChartLayout.getLayoutParams();
- lineChartParams.height = height * 2 / 3;
- lineChartParams.width = width * 5 / 6;
- mChartLayout.setLayoutParams(lineChartParams);
- RelativeLayout.LayoutParams frameLayoutParams = (RelativeLayout.LayoutParams) frameLayout.getLayoutParams();
- frameLayoutParams.height = height / 3;
- frameLayoutParams.width = width * 5 / 6;
- frameLayout.setLayoutParams(frameLayoutParams);
- }
+ lineChartParams.height = height * 2 / 3;
+ lineChartParams.width = width * 5 / 6;
+ mChartLayout.setLayoutParams(lineChartParams);
+ frameLayoutParams.height = height / 3;
+ frameLayoutParams.width = width * 5 / 6;
+ frameLayout.setLayoutParams(frameLayoutParams);
}
}
protected void addFragment(@IdRes int containerViewId,
- @NonNull Fragment fragment,
- @NonNull String fragmentTag) {
- getSupportFragmentManager()
- .beginTransaction()
- .add(containerViewId, fragment, fragmentTag)
- .commit();
+ @NonNull Fragment fragment) {
+ getSupportFragmentManager().beginTransaction()
+ .add(containerViewId, fragment, "ChannelParametersFragment").commit();
}
protected void replaceFragment(@IdRes int containerViewId,
@NonNull Fragment fragment,
@NonNull String fragmentTag) {
- getSupportFragmentManager()
- .beginTransaction()
- .replace(containerViewId, fragment, fragmentTag)
- .commit();
+ getSupportFragmentManager().beginTransaction()
+ .replace(containerViewId, fragment, fragmentTag).commit();
}
@Override
@@ -627,9 +490,6 @@ protected void onDestroy() {
if (captureTask3 != null) {
captureTask3.cancel(true);
}
- if (oscillatorTask != null) {
- oscillatorTask.cancel(true);
- }
if (captureAudioBuffer != null) {
captureAudioBuffer.cancel(true);
if (audioJack != null) {
@@ -714,10 +574,6 @@ public void setLeftYAxisLabel(String leftYAxisInput) {
leftYAxisLabel.setText(leftYAxisInput);
}
- public void setRightYAxisLabel(String rightYAxisInput) {
- rightYAxisLabel.setText(rightYAxisInput);
- }
-
public void setXAxisLabel(String xAxisInput) {
xAxisLabel.setText(xAxisInput);
}
@@ -794,31 +650,22 @@ public class CaptureTask extends AsyncTask {
protected Void doInBackground(String... params) {
try {
analogInput = params[0];
- //no. of samples and timeGap still need to be determined
if (isTriggerSelected) {
scienceLab.configureTrigger(0, analogInput, trigger, null, null);
- scienceLab.captureTraces(1, samples, timeGap, analogInput, true, null);
- } else {
- scienceLab.captureTraces(1, samples, timeGap, analogInput, false, null);
}
+ // number of samples and timeGap still need to be determined
+ scienceLab.captureTraces(1, samples, timeGap, analogInput, isTriggerSelected, null);
Log.v("Sleep Time", "" + (1024 * 10 * 1e-3));
Thread.sleep((long) (1000 * 10 * 1e-3));
HashMap data = scienceLab.fetchTrace(1); //fetching data
double[] xData = data.get("x");
double[] yData = data.get("y");
- //Log.v("XDATA", Arrays.toString(xData));
- //Log.v("YDATA", Arrays.toString(yData));
entries = new ArrayList<>();
- if (timebase == 875) {
- for (int i = 0; i < xData.length; i++) {
- entries.add(new Entry((float) xData[i], (float) yData[i]));
- }
- } else {
- for (int i = 0; i < xData.length; i++) {
- entries.add(new Entry((float) xData[i] / 1000, (float) yData[i]));
- }
+
+ for (int i = 0; i < xData.length; i++) {
+ entries.add(new Entry((float) xData[i] / ((timebase == 875) ? 1 : 1000), (float) yData[i]));
}
} catch (NullPointerException e) {
cancel(true);
@@ -859,7 +706,7 @@ public class CaptureTaskTwo extends AsyncTask {
protected Void doInBackground(String... params) {
try {
analogInput = params[0];
- //no. of samples and timeGap still need to be determined
+ // number of samples and timeGap still need to be determined
HashMap data;
if (isTriggerSelected && (triggerChannel.equals("CH1") || triggerChannel.equals("CH2"))) {
if (triggerChannel.equals("CH1"))
@@ -876,16 +723,11 @@ else if (triggerChannel.equals("CH2"))
entries1 = new ArrayList<>();
entries2 = new ArrayList<>();
- if (timebase == 875) {
- for (int i = 0; i < xData.length; i++) {
- entries1.add(new Entry((float) xData[i], (float) y1Data[i]));
- entries2.add(new Entry((float) xData[i], (float) y2Data[i]));
- }
- } else {
- for (int i = 0; i < xData.length; i++) {
- entries1.add(new Entry((float) xData[i] / 1000, (float) y1Data[i]));
- entries2.add(new Entry((float) xData[i] / 1000, (float) y2Data[i]));
- }
+
+ for (int i = 0; i < xData.length; i++) {
+ float xi = (float) xData[i] / ((timebase == 875) ? 1 : 1000);
+ entries1.add(new Entry(xi, (float) y1Data[i]));
+ entries2.add(new Entry(xi, (float) y2Data[i]));
}
} catch (NullPointerException e) {
cancel(true);
@@ -903,19 +745,9 @@ protected void onPostExecute(Void aVoid) {
LineDataSet dataSet1;
LineDataSet dataSet2;
-
- if (isHalfWaveRectifierExperiment || isFullWaveRectifierExperiment || isDiodeClippingClampingExperiment) {
- dataSet1 = new LineDataSet(entries1, analogInput + " INPUT");
- dataSet2 = new LineDataSet(entries2, "CH2" + " OUTPUT");
- dataSet1.setColor(Color.GREEN);
- dataSet2.setColor(Color.RED);
-
- } else {
- dataSet1 = new LineDataSet(entries1, analogInput);
- dataSet2 = new LineDataSet(entries2, "CH2");
- dataSet2.setColor(Color.GREEN);
- }
-
+ dataSet1 = new LineDataSet(entries1, analogInput);
+ dataSet2 = new LineDataSet(entries2, CHANNEL.CH2.toString());
+ dataSet2.setColor(Color.GREEN);
dataSet1.setDrawCircles(false);
dataSet2.setDrawCircles(false);
@@ -944,30 +776,15 @@ public class CaptureTaskThree extends AsyncTask {
@Override
protected Void doInBackground(String... params) {
try {
- //no. of samples and timeGap still need to be determined
+ // number of samples and timeGap still need to be determined
analogInput = params[0];
HashMap data;
if (isTriggerSelected) {
- switch (triggerChannel) {
- case "CH1":
- scienceLab.configureTrigger(0, analogInput, trigger, null, null);
- break;
- case "CH2":
- scienceLab.configureTrigger(1, analogInput, trigger, null, null);
- break;
- case "CH3":
- scienceLab.configureTrigger(2, analogInput, trigger, null, null);
- break;
- case "MIC":
- scienceLab.configureTrigger(3, analogInput, trigger, null, null);
- break;
- }
-
- data = scienceLab.captureFour(samples, timeGap, analogInput, true);
- } else {
- data = scienceLab.captureFour(samples, timeGap, analogInput, false);
+ scienceLab.configureTrigger(CHANNEL.valueOf(triggerChannel).ordinal(), analogInput, trigger, null, null);
}
+ data = scienceLab.captureFour(samples, timeGap, analogInput, isTriggerSelected);
+
double[] xData = data.get("x");
double[] y1Data = data.get("y");
double[] y2Data = data.get("y2");
@@ -978,20 +795,13 @@ protected Void doInBackground(String... params) {
entries2 = new ArrayList<>();
entries3 = new ArrayList<>();
entries4 = new ArrayList<>();
- if (timebase == 875) {
- for (int i = 0; i < xData.length; i++) {
- entries1.add(new Entry((float) xData[i], (float) y1Data[i]));
- entries2.add(new Entry((float) xData[i], (float) y2Data[i]));
- entries3.add(new Entry((float) xData[i], (float) y3Data[i]));
- entries4.add(new Entry((float) xData[i], (float) y4Data[i]));
- }
- } else {
- for (int i = 0; i < xData.length; i++) {
- entries1.add(new Entry((float) xData[i] / 1000, (float) y1Data[i]));
- entries2.add(new Entry((float) xData[i] / 1000, (float) y2Data[i]));
- entries3.add(new Entry((float) xData[i] / 1000, (float) y3Data[i]));
- entries4.add(new Entry((float) xData[i] / 1000, (float) y4Data[i]));
- }
+
+ for (int i = 0; i < xData.length; i++) {
+ float xi = (float) xData[i] / ((timebase == 875) ? 1 : 1000);
+ entries1.add(new Entry(xi, (float) y1Data[i]));
+ entries2.add(new Entry(xi, (float) y2Data[i]));
+ entries3.add(new Entry(xi, (float) y3Data[i]));
+ entries4.add(new Entry(xi, (float) y4Data[i]));
}
} catch (NullPointerException e) {
cancel(true);
@@ -1007,10 +817,10 @@ protected void onPostExecute(Void aVoid) {
ledImageView.setTag("green");
}
- LineDataSet dataSet1 = new LineDataSet(entries1, "CH1");
- LineDataSet dataSet2 = new LineDataSet(entries2, "CH2");
- LineDataSet dataSet3 = new LineDataSet(entries3, "CH3");
- LineDataSet dataSet4 = new LineDataSet(entries4, "MIC");
+ LineDataSet dataSet1 = new LineDataSet(entries1, CHANNEL.CH1.toString());
+ LineDataSet dataSet2 = new LineDataSet(entries2, CHANNEL.CH2.toString());
+ LineDataSet dataSet3 = new LineDataSet(entries3, CHANNEL.CH3.toString());
+ LineDataSet dataSet4 = new LineDataSet(entries4, CHANNEL.MIC.toString());
dataSet1.setColor(Color.BLUE);
dataSet2.setColor(Color.GREEN);
@@ -1129,7 +939,6 @@ protected Void doInBackground(Void... params) {
for (int i = 0; i < buffer.length; i++) {
entries.add(new Entry(i, (float) map(buffer[i], -32768, 32767, -3, 3)));
}
- //Log.v("AudioBuffer", Arrays.toString(buffer));
return null;
}
@@ -1148,190 +957,4 @@ protected void onPostExecute(Void aVoid) {
}
}
}
-
- public class OscillatorTask extends AsyncTask {
- ArrayList entries1;
- ArrayList entries2;
- ArrayList entries3;
- String analogInput;
- double[] xData;
- double[] y1Data;
- double[] y2Data;
- double[] y3Data;
- double frequencyCH1;
- double frequencyCH2;
- OscillatorExperimentFragment fragment;
-
- @Override
- protected Void doInBackground(String... params) {
- try {
- analogInput = params[0];
- HashMap data;
- if (isAstableMultivibratorExperiment || isMonostableMultivibratorExperiment) {
- data = scienceLab.captureTwo(128, 10, analogInput, false);
- xData = data.get("x");
- y1Data = data.get("y1");
- y2Data = data.get("y2");
-
- entries1 = new ArrayList<>();
- entries2 = new ArrayList<>();
- for (int i = 0; i < xData.length; i++) {
- entries1.add(new Entry((float) xData[i], (float) y1Data[i]));
- entries2.add(new Entry((float) xData[i], (float) y2Data[i]));
- }
- if (runMonostableMultivibratorExperiment)
- runMonostableMultivibratorExperiment = false;
-
- } else if (isColpittsOscillatorExperiment || isPhaseShiftOscillatorExperiment) {
- scienceLab.captureTraces(1, 128, 10, analogInput, false, null);
- Thread.sleep((long) (128 * 10 * 1e-3));
- data = scienceLab.fetchTrace(1); //fetching data
- xData = data.get("x");
- y1Data = data.get("y");
- entries1 = new ArrayList<>();
- for (int i = 0; i < xData.length; i++) {
- entries1.add(new Entry((float) xData[i], (float) y1Data[i]));
- }
- } else if (isWienBridgeOscillatorExperiment) {
- data = scienceLab.captureFour(128, 10, "CH1", false);
- xData = data.get("x");
- y1Data = data.get("y");
- y2Data = data.get("y2");
- y3Data = data.get("y3");
- entries1 = new ArrayList<>();
- entries2 = new ArrayList<>();
- entries3 = new ArrayList<>();
- for (int i = 0; i < xData.length; i++) {
- entries1.add(new Entry((float) xData[i], (float) y1Data[i]));
- entries2.add(new Entry((float) xData[i], (float) y2Data[i]));
- entries3.add(new Entry((float) xData[i], (float) y3Data[i]));
- }
- }
- if (isCH1FrequencyRequired)
- frequencyCH1 = analyticsClass.sineFit(xData, y1Data)[1];
-
- if (isCH2FrequencyRequired)
- frequencyCH2 = analyticsClass.sineFit(xData, y2Data)[1];
-
- } catch (NullPointerException e) {
- cancel(true);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- @Override
- protected void onPostExecute(Void aVoid) {
- super.onPostExecute(aVoid);
- fragment = (OscillatorExperimentFragment) getSupportFragmentManager().findFragmentById(oscillatorExperimentFragment.getId());
- List dataSets = new ArrayList<>();
- if (isCH1FrequencyRequired) {
- if (frequencyCH1 >= 0)
- fragment.resultCH1Frequency.setText(String.format("%sHz", new DecimalFormat("#.##").format(frequencyCH1)));
- else
- fragment.resultCH1Frequency.setText(R.string.fit_failed);
- isCH1FrequencyRequired = false;
- }
- if (isCH2FrequencyRequired) {
- if (frequencyCH1 >= 0)
- fragment.resultCH2Frequency.setText(new DecimalFormat("#.##").format(frequencyCH2));
- else
- fragment.resultCH2Frequency.setText(R.string.fit_failed);
- isCH2FrequencyRequired = false;
- }
- if (isAstableMultivibratorExperiment || isMonostableMultivibratorExperiment) {
- LineDataSet dataSet1;
- LineDataSet dataSet2;
- if (isMonostableMultivibratorExperiment) {
- dataSet1 = new LineDataSet(entries1, "Pulse Output (CH2)");
- dataSet2 = new LineDataSet(entries2, "Trigger Pulse (CH1)");
- fragment.resultCH1Frequency.setText(R.string.done);
- } else {
- dataSet1 = new LineDataSet(entries1, "CH1 INPUT");
- dataSet2 = new LineDataSet(entries2, "CH2 OUTPUT");
- }
- dataSet1.setColor(Color.GREEN);
- dataSet2.setColor(Color.RED);
- dataSet1.setDrawCircles(false);
- dataSet2.setDrawCircles(false);
- dataSets.add(dataSet1);
- dataSets.add(dataSet2);
- } else if (isColpittsOscillatorExperiment || isPhaseShiftOscillatorExperiment) {
- LineDataSet dataSet1;
- dataSet1 = new LineDataSet(entries1, "CH1 INPUT");
- dataSet1.setColor(Color.GREEN);
- dataSet1.setDrawCircles(false);
- dataSets.add(dataSet1);
- } else if (isWienBridgeOscillatorExperiment) {
- LineDataSet dataSet1;
- LineDataSet dataSet2;
- LineDataSet dataSet3;
- dataSet1 = new LineDataSet(entries1, "Oscillator Output(CH1)");
- dataSet2 = new LineDataSet(entries2, "Monitor #1(CH2)");
- dataSet3 = new LineDataSet(entries3, "Monitor #2(CH3)");
- dataSet1.setColor(Color.GREEN);
- dataSet2.setColor(Color.RED);
- dataSet3.setColor(Color.YELLOW);
- dataSet1.setDrawCircles(false);
- dataSet2.setDrawCircles(false);
- dataSet3.setDrawCircles(false);
- dataSets.add(dataSet1);
- dataSets.add(dataSet2);
- dataSets.add(dataSet3);
- }
-
- LineData data = new LineData(dataSets);
- mChart.setData(data);
- mChart.notifyDataSetChanged();
- mChart.invalidate();
- synchronized (lock) {
- lock.notify();
- }
- }
- }
-
- public class SpeedOfSoundTask extends AsyncTask {
- ArrayList entries;
- SpeedOfSoundFragment fragment;
-
- @Override
- protected Void doInBackground(Void... params) {
- scienceLab.captureFullSpeed("CH1", 128, 10, new ArrayList<>(Collections.singletonList("FIRE_PULSES")), 50);
- HashMap data = scienceLab.fetchTrace(1); //fetching data
-
- double[] xData = data.get("x");
- double[] yData = data.get("y");
- //Log.v("XDATA", Arrays.toString(xData));
- //Log.v("YDATA", Arrays.toString(yData));
- entries = new ArrayList<>();
- for (int i = 0; i < xData.length; i++) {
- entries.add(new Entry((float) xData[i], (float) yData[i]));
- }
- runSpeedOfSoundExperiment = false;
- return null;
- }
-
- @Override
- protected void onPostExecute(Void aVoid) {
- super.onPostExecute(aVoid);
- if (!String.valueOf(ledImageView.getTag()).equals("green")) {
- ledImageView.setImageResource(R.drawable.green_led);
- ledImageView.setTag("green");
- }
-
- fragment = (SpeedOfSoundFragment) getSupportFragmentManager().findFragmentById(speedOfSoundFragment.getId());
- fragment.resultTextView.setText(R.string.done);
- LineDataSet dataSet = new LineDataSet(entries, "RAMP in CH1");
- LineData lineData = new LineData(dataSet);
- dataSet.setDrawCircles(false);
- mChart.setData(lineData);
- mChart.notifyDataSetChanged();
- mChart.invalidate();
-
- synchronized (lock) {
- lock.notify();
- }
- }
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/io/pslab/experimentsetup/Oscilloscope/OscillatorExperimentFragment.java b/app/src/main/java/io/pslab/experimentsetup/Oscilloscope/OscillatorExperimentFragment.java
deleted file mode 100644
index dba982765..000000000
--- a/app/src/main/java/io/pslab/experimentsetup/Oscilloscope/OscillatorExperimentFragment.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package io.pslab.experimentsetup.Oscilloscope;
-
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.Spinner;
-import android.widget.TextView;
-
-import io.pslab.R;
-import io.pslab.activity.OscilloscopeActivity;
-
-public class OscillatorExperimentFragment extends Fragment {
-
- public TextView resultCH1Frequency;
- public TextView resultCH2Frequency;
- public TextView analyseCH2Label;
- public TextView analyseCH1Label;
- public double frequency;
-
- public OscillatorExperimentFragment() {
-
- }
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View v = inflater.inflate(R.layout.fragment_oscillator_experiment, container, false);
- Spinner spinnerRangeCh1 = v.findViewById(R.id.spinner_range_astable_multivibrator);
- Button buttonCH1Frequency = v.findViewById(R.id.button_read_ch1_astable_multivibrator);
- Button buttonCH2Frequency = v.findViewById(R.id.button_read_ch2_astable_multivibrator);
- resultCH1Frequency = v.findViewById(R.id.tv_result_ch1_astable_multivibrator);
- resultCH2Frequency = v.findViewById(R.id.tv_result_ch2_astable_multivibrator);
- analyseCH2Label = v.findViewById(R.id.tv_abalyse_ch2_astable_multivibrator);
- analyseCH1Label = v.findViewById(R.id.tv_analyse_ch1_astable_multivibrator);
-
- if (((OscilloscopeActivity) getActivity()).isColpittsOscillatorExperiment ||
- ((OscilloscopeActivity) getActivity()).isPhaseShiftOscillatorExperiment ||
- ((OscilloscopeActivity) getActivity()).isWienBridgeOscillatorExperiment ||
- ((OscilloscopeActivity) getActivity()).isMonostableMultivibratorExperiment) {
- buttonCH2Frequency.setVisibility(View.INVISIBLE);
- resultCH2Frequency.setVisibility(View.INVISIBLE);
- analyseCH2Label.setVisibility(View.INVISIBLE);
- }
- if (((OscilloscopeActivity) getActivity()).isMonostableMultivibratorExperiment)
- analyseCH1Label.setText(R.string.acquire_data);
-
- final String[] ranges = {"+/-16V", "+/-8V", "+/-4V", "+/-3V", "+/-2V", "+/-1.5V", "+/-1V", "+/-500mV", "+/-160V"};
-
- ArrayAdapter rangesAdapter;
- rangesAdapter = new ArrayAdapter<>(this.getActivity(), R.layout.custom_spinner, ranges);
- rangesAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
-
- spinnerRangeCh1.setAdapter(rangesAdapter);
- spinnerRangeCh1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
- @Override
- public void onItemSelected(AdapterView> parent, View view, int position, long id) {
- switch (position) {
- case 0:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(16, -16);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(16, -16);
- break;
- case 1:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(8, -8);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(8, -8);
- break;
- case 2:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(4, -4);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(4, -4);
- break;
- case 3:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(3, -3);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(3, -3);
- break;
- case 4:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(2, -2);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(2, -2);
- break;
- case 5:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(1.5, -1.5);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(1.5, -1.5);
- break;
- case 6:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(1, -1);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(1, -1);
- break;
- case 7:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(500, -500);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(500, -500);
- break;
- case 8:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(160, -160);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(160, -160);
- break;
- }
- }
-
- @Override
- public void onNothingSelected(AdapterView> parent) {
-
- }
- });
-
- buttonCH1Frequency.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- ((OscilloscopeActivity) getActivity()).runMonostableMultivibratorExperiment = true;
- if (!((OscilloscopeActivity) getActivity()).isMonostableMultivibratorExperiment)
- ((OscilloscopeActivity) getActivity()).isCH1FrequencyRequired = true;
- }
- });
-
- buttonCH2Frequency.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- ((OscilloscopeActivity) getActivity()).isCH2FrequencyRequired = true;
- }
- });
- return v;
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/io/pslab/experimentsetup/Sensors/SpeedOfSoundFragment.java b/app/src/main/java/io/pslab/experimentsetup/Sensors/SpeedOfSoundFragment.java
deleted file mode 100644
index af176483a..000000000
--- a/app/src/main/java/io/pslab/experimentsetup/Sensors/SpeedOfSoundFragment.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package io.pslab.experimentsetup.Sensors;
-
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.SeekBar;
-import android.widget.Spinner;
-import android.widget.TextView;
-
-import io.pslab.R;
-import io.pslab.activity.OscilloscopeActivity;
-import io.pslab.communication.ScienceLab;
-import io.pslab.others.FloatSeekBar;
-import io.pslab.others.ScienceLabCommon;
-
-import java.text.DecimalFormat;
-
-public class SpeedOfSoundFragment extends Fragment {
- Button readButton;
- public TextView resultTextView;
- Spinner rangeSpinner;
- TextView sqr1ProgressTextView;
- ScienceLab scienceLab;
- FloatSeekBar sqr1SeekBar;
- double sqr1Value;
-
- public SpeedOfSoundFragment() {
-
- }
-
- public static SpeedOfSoundFragment newInstance() {
- return new SpeedOfSoundFragment();
- }
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View v = inflater.inflate(R.layout.fragment_speed_of_sound, container, false);
- readButton = v.findViewById(R.id.button_read_sos);
- resultTextView = v.findViewById(R.id.tv_result_sos);
- rangeSpinner = v.findViewById(R.id.spinner_range_sos);
- sqr1SeekBar = v.findViewById(R.id.seekBar_sqr1_sos);
- sqr1ProgressTextView = v.findViewById(R.id.tv_sqr1_sos);
- scienceLab = ScienceLabCommon.scienceLab;
- final String[] ranges = {"+/-16V", "+/-8V", "+/-4V", "+/-3V", "+/-2V", "+/-1.5V", "+/-1V", "+/-500mV", "+/-160V"};
-
- sqr1SeekBar.setters(10, 100000);
- sqr1SeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
- @Override
- public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- if(scienceLab.isConnected()) {
- sqr1Value = scienceLab.setSqr1(sqr1SeekBar.getValue(), -1, false);
- sqr1ProgressTextView.setText(String.format("%sHz", new DecimalFormat("#.##").format(sqr1Value)));
- }
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) {
-
- }
-
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) {
-
- }
- });
-
- ArrayAdapter rangesAdapter;
- rangesAdapter = new ArrayAdapter<>(this.getActivity(), R.layout.custom_spinner, ranges);
- rangesAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
-
- rangeSpinner.setAdapter(rangesAdapter);
- rangeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
- @Override
- public void onItemSelected(AdapterView> parent, View view, int position, long id) {
- switch (position) {
- case 0:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(16, -16);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(16, -16);
- break;
- case 1:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(8, -8);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(8, -8);
- break;
- case 2:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(4, -4);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(4, -4);
- break;
- case 3:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(3, -3);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(3, -3);
- break;
- case 4:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(2, -2);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(2, -2);
- break;
- case 5:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(1.5, -1.5);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(1.5, -1.5);
- break;
- case 6:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(1, -1);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(1, -1);
- break;
- case 7:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(500, -500);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(500, -500);
- break;
- case 8:
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(160, -160);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(160, -160);
- break;
- }
- }
-
- @Override
- public void onNothingSelected(AdapterView> parent) {
-
- }
- });
-
- readButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- ((OscilloscopeActivity)getActivity()).isSpeedOfSoundExperiment = true;
- ((OscilloscopeActivity)getActivity()).runSpeedOfSoundExperiment = true;
-
- }
- });
-
- ((OscilloscopeActivity) getActivity()).setLeftYAxisScale(8, -8);
- ((OscilloscopeActivity) getActivity()).setRightYAxisScale(8, -8);
-
- return v;
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/io/pslab/fragment/HomeFragment.java b/app/src/main/java/io/pslab/fragment/HomeFragment.java
index 9dc8ab2e1..18a73cd53 100644
--- a/app/src/main/java/io/pslab/fragment/HomeFragment.java
+++ b/app/src/main/java/io/pslab/fragment/HomeFragment.java
@@ -101,7 +101,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
deviceDescription.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- webView.loadUrl("https://pslab.fossasia.org");
+ webView.loadUrl("https://pslab.io");
svHomeContent.setVisibility(View.GONE);
webView.setWebViewClient(new WebViewClient() {
@Override
diff --git a/app/src/main/java/io/pslab/fragment/PSLabPinLayoutFragment.java b/app/src/main/java/io/pslab/fragment/PSLabPinLayoutFragment.java
index 06e871a76..a3006f4d9 100644
--- a/app/src/main/java/io/pslab/fragment/PSLabPinLayoutFragment.java
+++ b/app/src/main/java/io/pslab/fragment/PSLabPinLayoutFragment.java
@@ -8,6 +8,7 @@
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
+import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -17,11 +18,11 @@
import android.widget.ImageView;
import android.widget.TextView;
+import java.util.ArrayList;
+
import io.pslab.R;
import io.pslab.items.PinDetails;
-import java.util.ArrayList;
-
/**
* Created by Padmal on 5/22/18.
*/
@@ -33,6 +34,8 @@ public class PSLabPinLayoutFragment extends Fragment implements View.OnTouchList
private Matrix matrix = new Matrix();
private Matrix savedMatrix = new Matrix();
+ public static boolean frontSide = true;
+
private static final int NONE = 0;
private static final int DRAG = 1;
private static final int ZOOM = 2;
@@ -52,9 +55,12 @@ public static PSLabPinLayoutFragment newInstance() {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_pin_layout, container, false);
-
ImageView imgLayout = view.findViewById(R.id.img_pslab_pin_layout);
- colorMap = view.findViewById(R.id.img_pslab_pin_layout2);
+ colorMap = view.findViewById(R.id.img_pslab_color_map);
+ imgLayout.setImageDrawable(ResourcesCompat.getDrawable(getResources(),
+ frontSide ? R.drawable.pslab_v5_front_layout : R.drawable.pslab_v5_back_layout, null));
+ colorMap.setImageDrawable(ResourcesCompat.getDrawable(getResources(),
+ frontSide ? R.drawable.pslab_v5_front_colormap : R.drawable.pslab_v5_back_colormap, null));
imgLayout.setOnTouchListener(this);
populatePinDetails();
@@ -72,20 +78,20 @@ private void populatePinDetails() {
pinDetails.add(new PinDetails("SQ2", "PWM generator pin 2", Color.parseColor("#406743"), Color.parseColor("#22ba6d")));
pinDetails.add(new PinDetails("SQ3", "PWM generator pin 3", Color.parseColor("#406743"), Color.parseColor("#aa44aa")));
pinDetails.add(new PinDetails("SQ4", "PWM generator pin 4", Color.parseColor("#406743"), Color.parseColor("#d28080")));
- pinDetails.add(new PinDetails("ID1", "Logic analyzer pin 1", Color.parseColor("#406743"), Color.parseColor("#e7a41a")));
- pinDetails.add(new PinDetails("ID2", "Logic analyzer pin 2", Color.parseColor("#406743"), Color.parseColor("#e7a4ff")));
- pinDetails.add(new PinDetails("ID3", "Logic analyzer pin 3", Color.parseColor("#406743"), Color.parseColor("#ad2d00")));
- pinDetails.add(new PinDetails("ID4", "Logic analyzer pin 4", Color.parseColor("#406743"), Color.parseColor("#0053ad")));
+ pinDetails.add(new PinDetails("LA1", "Logic analyzer pin 1", Color.parseColor("#406743"), Color.parseColor("#e7a41a")));
+ pinDetails.add(new PinDetails("LA2", "Logic analyzer pin 2", Color.parseColor("#406743"), Color.parseColor("#e7a4ff")));
+ pinDetails.add(new PinDetails("LA3", "Logic analyzer pin 3", Color.parseColor("#406743"), Color.parseColor("#ad2d00")));
+ pinDetails.add(new PinDetails("LA4", "Logic analyzer pin 4", Color.parseColor("#406743"), Color.parseColor("#0053ad")));
pinDetails.add(new PinDetails("AC1", "Alternative channel input", Color.parseColor("#ffe040"), Color.parseColor("#b01498")));
pinDetails.add(new PinDetails("CH1", "Oscilloscope channel input 1", Color.parseColor("#ffe040"), Color.parseColor("#0b4189")));
pinDetails.add(new PinDetails("CH2", "Oscilloscope channel input 2", Color.parseColor("#ffe040"), Color.parseColor("#410b89")));
pinDetails.add(new PinDetails("CH3", "Oscilloscope channel input 3", Color.parseColor("#ffe040"), Color.parseColor("#41890b")));
- pinDetails.add(new PinDetails("CHG", "Oscilloscope channel input 4", Color.parseColor("#ffe040"), Color.parseColor("#89410b")));
+ pinDetails.add(new PinDetails("CHG", "Oscilloscope channel 3 gain set", Color.parseColor("#ffe040"), Color.parseColor("#89410b")));
pinDetails.add(new PinDetails("MIC", "External microphone input", Color.parseColor("#7d5840"), Color.parseColor("#890b41")));
- pinDetails.add(new PinDetails("FCi", "Frequency counter pin", Color.parseColor("#7d5840"), Color.parseColor("#ff0b41")));
+ pinDetails.add(new PinDetails("FRQ", "Frequency counter pin", Color.parseColor("#7d5840"), Color.parseColor("#ff0b41")));
pinDetails.add(new PinDetails("CAP", "Capacitance measurement pin", Color.parseColor("#7d5840"), Color.parseColor("#ff410b")));
- pinDetails.add(new PinDetails("SEN", "Resistance measurement pin", Color.parseColor("#7d5840"), Color.parseColor("#41ff0b")));
- pinDetails.add(new PinDetails("AN8", "Voltage measurement pin", Color.parseColor("#7d5840"), Color.parseColor("#410bff")));
+ pinDetails.add(new PinDetails("RES", "Resistance measurement pin", Color.parseColor("#7d5840"), Color.parseColor("#41ff0b")));
+ pinDetails.add(new PinDetails("VOL", "Voltage measurement pin", Color.parseColor("#7d5840"), Color.parseColor("#410bff")));
pinDetails.add(new PinDetails("PCS", "Programmable current source (3.3 mA)", Color.parseColor("#c3007c"), Color.parseColor("#3fa96f")));
pinDetails.add(new PinDetails("PV3", "Programmable voltage source 3 (0-3.3 V)", Color.parseColor("#c3007c"), Color.parseColor("#a93f6f")));
pinDetails.add(new PinDetails("PV2", "Programmable voltage source 2 (-+3.3 V)", Color.parseColor("#c3007c"), Color.parseColor("#a96f3f")));
@@ -93,17 +99,20 @@ private void populatePinDetails() {
pinDetails.add(new PinDetails("SCL", "Serial clock pin for I2C", Color.parseColor("#4372a2"), Color.parseColor("#6e4472")));
pinDetails.add(new PinDetails("SDA", "Serial data pin for I2C", Color.parseColor("#4372a2"), Color.parseColor("#6e7244")));
pinDetails.add(new PinDetails("VDD", "Voltage supply pin (3.3 V)", Color.parseColor("#ff4040"), Color.parseColor("#d25c3c")));
- pinDetails.add(new PinDetails("VR+", "Voltage test pin (+6.8 V)", Color.parseColor("#ff4040"), Color.parseColor("#5c5c3c")));
- pinDetails.add(new PinDetails("V+", "Voltage test pin (+10.0 V)", Color.parseColor("#ff4040"), Color.parseColor("#5cd23c")));
- pinDetails.add(new PinDetails("VR-", "Voltage test pin (-6.8 V)", Color.parseColor("#ff4040"), Color.parseColor("#5c143c")));
- pinDetails.add(new PinDetails("V-", "Voltage test pin (-10.0 V)", Color.parseColor("#ff4040"), Color.parseColor("#5c3c14")));
+ pinDetails.add(new PinDetails("STA", "Bluetooth device state output pin", Color.parseColor("#4372a2"), Color.parseColor("#5c5c3c")));
+ pinDetails.add(new PinDetails("V+", "Voltage test pin (+8.0 V)", Color.parseColor("#ff4040"), Color.parseColor("#5cd23c")));
+ pinDetails.add(new PinDetails("ENA", "Bluetooth device enable/disable pin", Color.parseColor("#4372a2"), Color.parseColor("#5c143c")));
+ pinDetails.add(new PinDetails("V-", "Voltage test pin (-8.0 V)", Color.parseColor("#ff4040"), Color.parseColor("#5c3c14")));
pinDetails.add(new PinDetails("MCL", "Master clear pin for programmer", Color.parseColor("#4372a2"), Color.parseColor("#143c14")));
- pinDetails.add(new PinDetails("R41", "Test pin for programmer", Color.parseColor("#7d5840"), Color.parseColor("#b73cf1")));
+ pinDetails.add(new PinDetails("PGM", "Mode pin for programmer", Color.parseColor("#4372a2"), Color.parseColor("#b73cf1")));
pinDetails.add(new PinDetails("PGC", "Clock pin for programmer", Color.parseColor("#4372a2"), Color.parseColor("#fff724")));
pinDetails.add(new PinDetails("PGD", "Data pin for programmer", Color.parseColor("#4372a2"), Color.parseColor("#724fff")));
pinDetails.add(new PinDetails("NRF", "Radio communication module using nRF24", Color.parseColor("#6b40a9"), Color.parseColor("#ffa64f")));
pinDetails.add(new PinDetails("USB", "Micro B type USB socket", Color.parseColor("#6b40a9"), Color.parseColor("#ff2b4f")));
- pinDetails.add(new PinDetails("SI1 Knob", "Amplitude controller for SI1 waves", Color.parseColor("#6b40a9"), Color.parseColor("#6b6500")));
+ pinDetails.add(new PinDetails("VCC", "Voltage supply pin (+5.0 V)", Color.parseColor("#ff4040"), Color.parseColor("#6b6500")));
+ pinDetails.add(new PinDetails("+5V", "Test pin +5.0 V", Color.parseColor("#ff4040"), Color.parseColor("#765f40")));
+ pinDetails.add(new PinDetails("D+", "Test pin for USB Data +", Color.parseColor("#6b40a9"), Color.parseColor("#681654")));
+ pinDetails.add(new PinDetails("D-", "Test pin for USB Data -", Color.parseColor("#6b40a9"), Color.parseColor("#a68b47")));
}
@SuppressLint("ClickableViewAccessibility")
diff --git a/app/src/main/res/drawable/ic_pslab_pin_layout.xml b/app/src/main/res/drawable/ic_pslab_pin_layout.xml
deleted file mode 100644
index 69370566a..000000000
--- a/app/src/main/res/drawable/ic_pslab_pin_layout.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/ic_save_black_24dp.xml b/app/src/main/res/drawable/ic_save_black_24dp.xml
deleted file mode 100644
index a561d632a..000000000
--- a/app/src/main/res/drawable/ic_save_black_24dp.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
diff --git a/app/src/main/res/drawable/pslab_v4_colormap.png b/app/src/main/res/drawable/pslab_v4_colormap.png
deleted file mode 100644
index bca8f664c..000000000
Binary files a/app/src/main/res/drawable/pslab_v4_colormap.png and /dev/null differ
diff --git a/app/src/main/res/drawable/pslab_v4_layout.png b/app/src/main/res/drawable/pslab_v4_layout.png
deleted file mode 100644
index 6b09972bb..000000000
Binary files a/app/src/main/res/drawable/pslab_v4_layout.png and /dev/null differ
diff --git a/app/src/main/res/drawable/pslab_v5_back_colormap.png b/app/src/main/res/drawable/pslab_v5_back_colormap.png
new file mode 100644
index 000000000..4a9eeddbb
Binary files /dev/null and b/app/src/main/res/drawable/pslab_v5_back_colormap.png differ
diff --git a/app/src/main/res/drawable/pslab_v5_back_layout.png b/app/src/main/res/drawable/pslab_v5_back_layout.png
new file mode 100644
index 000000000..ab7510231
Binary files /dev/null and b/app/src/main/res/drawable/pslab_v5_back_layout.png differ
diff --git a/app/src/main/res/drawable/pslab_v5_front_colormap.png b/app/src/main/res/drawable/pslab_v5_front_colormap.png
new file mode 100644
index 000000000..32957eecc
Binary files /dev/null and b/app/src/main/res/drawable/pslab_v5_front_colormap.png differ
diff --git a/app/src/main/res/drawable/pslab_v5_front_layout.png b/app/src/main/res/drawable/pslab_v5_front_layout.png
new file mode 100644
index 000000000..aabb61fe5
Binary files /dev/null and b/app/src/main/res/drawable/pslab_v5_front_layout.png differ
diff --git a/app/src/main/res/layout/fragment_oscillator_experiment.xml b/app/src/main/res/layout/fragment_oscillator_experiment.xml
deleted file mode 100644
index a4607cbce..000000000
--- a/app/src/main/res/layout/fragment_oscillator_experiment.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/fragment_pin_layout.xml b/app/src/main/res/layout/fragment_pin_layout.xml
index d9fcfbebc..0daaf6281 100644
--- a/app/src/main/res/layout/fragment_pin_layout.xml
+++ b/app/src/main/res/layout/fragment_pin_layout.xml
@@ -10,15 +10,13 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"
- android:src="@drawable/pslab_v4_layout"
tools:ignore="ContentDescription" />
diff --git a/app/src/main/res/layout/fragment_speed_of_sound.xml b/app/src/main/res/layout/fragment_speed_of_sound.xml
deleted file mode 100644
index 2214a3bae..000000000
--- a/app/src/main/res/layout/fragment_speed_of_sound.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/menu/pslab_connectivity_menu.xml b/app/src/main/res/menu/pslab_connectivity_menu.xml
index 85bbb80cc..4d1a4ebc7 100644
--- a/app/src/main/res/menu/pslab_connectivity_menu.xml
+++ b/app/src/main/res/menu/pslab_connectivity_menu.xml
@@ -12,10 +12,13 @@
android:title="@string/text_disconnected"
app:showAsAction="ifRoom|withText"/>
+ android:id="@+id/menu_pslab_layout_front"
+ android:title="@string/pslab_pinlayout_front"
+ app:showAsAction="never"/>
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 5cc807d23..6506da28d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -15,6 +15,8 @@
FAQs
Pin Layout
+ Pin Layout Front
+ Pin Layout Back
Oscilloscope
Multimeter
diff --git a/docs/Lux meter.md b/docs/Lux meter.md
index 7a5ec9fc9..1079a56f1 100644
--- a/docs/Lux meter.md
+++ b/docs/Lux meter.md
@@ -19,14 +19,14 @@ The layout of the oscilloscope graphical user interface contains two main parts.
diff --git a/docs/Oscilloscope.md b/docs/Oscilloscope.md
index b67995eb5..66d9aeed4 100644
--- a/docs/Oscilloscope.md
+++ b/docs/Oscilloscope.md
@@ -22,14 +22,14 @@ The layout of the oscilloscope graphical user interface contains three main part
diff --git a/docs/images/instrument_accelerometer_guide.png b/docs/images/instrument_accelerometer_guide.png
new file mode 100644
index 000000000..5bbf7088b
Binary files /dev/null and b/docs/images/instrument_accelerometer_guide.png differ
diff --git a/docs/images/instrument_accelerometer_view.png b/docs/images/instrument_accelerometer_view.png
new file mode 100644
index 000000000..be6c6052c
Binary files /dev/null and b/docs/images/instrument_accelerometer_view.png differ
diff --git a/docs/images/instrument_barometer_config.png b/docs/images/instrument_barometer_config.png
new file mode 100644
index 000000000..06643c495
Binary files /dev/null and b/docs/images/instrument_barometer_config.png differ
diff --git a/docs/images/instrument_barometer_guide.png b/docs/images/instrument_barometer_guide.png
new file mode 100644
index 000000000..86855f1a9
Binary files /dev/null and b/docs/images/instrument_barometer_guide.png differ
diff --git a/docs/images/instrument_barometer_view.png b/docs/images/instrument_barometer_view.png
new file mode 100644
index 000000000..bb34b04af
Binary files /dev/null and b/docs/images/instrument_barometer_view.png differ
diff --git a/docs/images/instrument_compass_guide.png b/docs/images/instrument_compass_guide.png
new file mode 100644
index 000000000..e292137db
Binary files /dev/null and b/docs/images/instrument_compass_guide.png differ
diff --git a/docs/images/instrument_compass_view.png b/docs/images/instrument_compass_view.png
new file mode 100644
index 000000000..d15b96eb2
Binary files /dev/null and b/docs/images/instrument_compass_view.png differ
diff --git a/docs/images/instrument_logic_analyzer_guide.png b/docs/images/instrument_logic_analyzer_guide.png
new file mode 100644
index 000000000..dc8ee26d9
Binary files /dev/null and b/docs/images/instrument_logic_analyzer_guide.png differ
diff --git a/docs/images/instrument_logic_analyzer_view.png b/docs/images/instrument_logic_analyzer_view.png
new file mode 100644
index 000000000..e183f5aa4
Binary files /dev/null and b/docs/images/instrument_logic_analyzer_view.png differ
diff --git a/docs/images/instrument_luxmeter_config.png b/docs/images/instrument_luxmeter_config.png
new file mode 100644
index 000000000..405b10d88
Binary files /dev/null and b/docs/images/instrument_luxmeter_config.png differ
diff --git a/docs/images/instrument_luxmeter_guide.png b/docs/images/instrument_luxmeter_guide.png
new file mode 100644
index 000000000..7af2d7723
Binary files /dev/null and b/docs/images/instrument_luxmeter_guide.png differ
diff --git a/docs/images/instrument_luxmeter_view.png b/docs/images/instrument_luxmeter_view.png
new file mode 100644
index 000000000..9f2d1cbd0
Binary files /dev/null and b/docs/images/instrument_luxmeter_view.png differ
diff --git a/docs/images/instrument_multimeter_guide.png b/docs/images/instrument_multimeter_guide.png
new file mode 100644
index 000000000..6ffbecfb3
Binary files /dev/null and b/docs/images/instrument_multimeter_guide.png differ
diff --git a/docs/images/instrument_multimeter_view.png b/docs/images/instrument_multimeter_view.png
new file mode 100644
index 000000000..fc3f0afe7
Binary files /dev/null and b/docs/images/instrument_multimeter_view.png differ
diff --git a/docs/images/instrument_oscilloscope_audiojack.png b/docs/images/instrument_oscilloscope_audiojack.png
new file mode 100644
index 000000000..b7c5b4188
Binary files /dev/null and b/docs/images/instrument_oscilloscope_audiojack.png differ
diff --git a/docs/images/instrument_oscilloscope_channelparam.png b/docs/images/instrument_oscilloscope_channelparam.png
new file mode 100644
index 000000000..3a820d74b
Binary files /dev/null and b/docs/images/instrument_oscilloscope_channelparam.png differ
diff --git a/docs/images/instrument_oscilloscope_dataanalysis.png b/docs/images/instrument_oscilloscope_dataanalysis.png
new file mode 100644
index 000000000..6feb3424e
Binary files /dev/null and b/docs/images/instrument_oscilloscope_dataanalysis.png differ
diff --git a/docs/images/instrument_oscilloscope_guide.png b/docs/images/instrument_oscilloscope_guide.png
new file mode 100644
index 000000000..d1de2392c
Binary files /dev/null and b/docs/images/instrument_oscilloscope_guide.png differ
diff --git a/docs/images/instrument_oscilloscope_timebase.png b/docs/images/instrument_oscilloscope_timebase.png
new file mode 100644
index 000000000..0f8e7bf47
Binary files /dev/null and b/docs/images/instrument_oscilloscope_timebase.png differ
diff --git a/docs/images/instrument_oscilloscope_xyplot.png b/docs/images/instrument_oscilloscope_xyplot.png
new file mode 100644
index 000000000..35eba8ea3
Binary files /dev/null and b/docs/images/instrument_oscilloscope_xyplot.png differ
diff --git a/docs/images/instrument_power_source_guide.png b/docs/images/instrument_power_source_guide.png
new file mode 100644
index 000000000..84f822b64
Binary files /dev/null and b/docs/images/instrument_power_source_guide.png differ
diff --git a/docs/images/instrument_power_source_view.png b/docs/images/instrument_power_source_view.png
new file mode 100644
index 000000000..3b55fe523
Binary files /dev/null and b/docs/images/instrument_power_source_view.png differ
diff --git a/docs/images/instrument_wavegenerator_guide.png b/docs/images/instrument_wavegenerator_guide.png
new file mode 100644
index 000000000..7992c2206
Binary files /dev/null and b/docs/images/instrument_wavegenerator_guide.png differ
diff --git a/docs/images/instrument_wavegenerator_view.png b/docs/images/instrument_wavegenerator_view.png
new file mode 100644
index 000000000..d4909b5a7
Binary files /dev/null and b/docs/images/instrument_wavegenerator_view.png differ
diff --git a/docs/images/lux_meter_configure.png b/docs/images/lux_meter_configure.png
deleted file mode 100755
index 3dac0ba1a..000000000
Binary files a/docs/images/lux_meter_configure.png and /dev/null differ
diff --git a/docs/images/lux_meter_data_1.png b/docs/images/lux_meter_data_1.png
deleted file mode 100755
index ea7b90f35..000000000
Binary files a/docs/images/lux_meter_data_1.png and /dev/null differ
diff --git a/docs/images/lux_meter_data_2.png b/docs/images/lux_meter_data_2.png
deleted file mode 100755
index 3e2ec2a4f..000000000
Binary files a/docs/images/lux_meter_data_2.png and /dev/null differ
diff --git a/docs/images/lux_meter_dialog_box.png b/docs/images/lux_meter_dialog_box.png
deleted file mode 100755
index 201ea7ae5..000000000
Binary files a/docs/images/lux_meter_dialog_box.png and /dev/null differ
diff --git a/docs/images/oscilloscope_timebase_and_trigger.png b/docs/images/oscilloscope_timebase_and_trigger.png
deleted file mode 100755
index 683b484bf..000000000
Binary files a/docs/images/oscilloscope_timebase_and_trigger.png and /dev/null differ
diff --git a/docs/images/oscilloscope_xy_plot.png b/docs/images/oscilloscope_xy_plot.png
deleted file mode 100755
index 8846d10fa..000000000
Binary files a/docs/images/oscilloscope_xy_plot.png and /dev/null differ
diff --git a/docs/images/screenshot_1.png b/docs/images/screenshot_1.png
deleted file mode 100755
index 378c3614a..000000000
Binary files a/docs/images/screenshot_1.png and /dev/null differ
diff --git a/docs/images/screenshot_2.png b/docs/images/screenshot_2.png
deleted file mode 100644
index 3bfc094c5..000000000
Binary files a/docs/images/screenshot_2.png and /dev/null differ
diff --git a/docs/images/screenshot_3.png b/docs/images/screenshot_3.png
deleted file mode 100755
index 6f1d3f1d8..000000000
Binary files a/docs/images/screenshot_3.png and /dev/null differ
diff --git a/docs/images/screenshot_audio_jack.png b/docs/images/screenshot_audio_jack.png
deleted file mode 100644
index 21239be2a..000000000
Binary files a/docs/images/screenshot_audio_jack.png and /dev/null differ
diff --git a/docs/images/screenshot_control_main.png b/docs/images/screenshot_control_main.png
deleted file mode 100644
index a196c1b90..000000000
Binary files a/docs/images/screenshot_control_main.png and /dev/null differ
diff --git a/docs/images/screenshot_experiment_doc.png b/docs/images/screenshot_experiment_doc.png
deleted file mode 100644
index b63fb4810..000000000
Binary files a/docs/images/screenshot_experiment_doc.png and /dev/null differ
diff --git a/docs/images/screenshot_experiment_setup.png b/docs/images/screenshot_experiment_setup.png
deleted file mode 100644
index b905ad43f..000000000
Binary files a/docs/images/screenshot_experiment_setup.png and /dev/null differ
diff --git a/docs/images/screenshot_initialization.png b/docs/images/screenshot_initialization.png
deleted file mode 100755
index f56eb8cbb..000000000
Binary files a/docs/images/screenshot_initialization.png and /dev/null differ
diff --git a/docs/images/screenshot_logical_analyzer.png b/docs/images/screenshot_logical_analyzer.png
deleted file mode 100755
index 8b2029d48..000000000
Binary files a/docs/images/screenshot_logical_analyzer.png and /dev/null differ
diff --git a/docs/images/screenshot_multilevel_experimentlist.png b/docs/images/screenshot_multilevel_experimentlist.png
deleted file mode 100755
index e83ddc02b..000000000
Binary files a/docs/images/screenshot_multilevel_experimentlist.png and /dev/null differ
diff --git a/docs/images/view_about_us.png b/docs/images/view_about_us.png
new file mode 100644
index 000000000..268609c0e
Binary files /dev/null and b/docs/images/view_about_us.png differ
diff --git a/docs/images/view_app_settings.png b/docs/images/view_app_settings.png
new file mode 100644
index 000000000..e0b542b58
Binary files /dev/null and b/docs/images/view_app_settings.png differ
diff --git a/docs/images/view_barometer.png b/docs/images/view_barometer.png
deleted file mode 100644
index cb11660d9..000000000
Binary files a/docs/images/view_barometer.png and /dev/null differ
diff --git a/docs/images/view_data_logger.png b/docs/images/view_data_logger.png
index 600d34cb4..ad36df3ae 100644
Binary files a/docs/images/view_data_logger.png and b/docs/images/view_data_logger.png differ
diff --git a/docs/images/view_data_logger2.png b/docs/images/view_data_logger2.png
deleted file mode 100644
index ceed93fee..000000000
Binary files a/docs/images/view_data_logger2.png and /dev/null differ
diff --git a/docs/images/view_datalogger_play.png b/docs/images/view_datalogger_play.png
new file mode 100644
index 000000000..dbcbd0123
Binary files /dev/null and b/docs/images/view_datalogger_play.png differ
diff --git a/docs/images/view_device_not_found.png b/docs/images/view_device_not_found.png
new file mode 100644
index 000000000..edf20c08b
Binary files /dev/null and b/docs/images/view_device_not_found.png differ
diff --git a/docs/images/view_faq.png b/docs/images/view_faq.png
new file mode 100644
index 000000000..7d5b5e5af
Binary files /dev/null and b/docs/images/view_faq.png differ
diff --git a/docs/images/view_guide_box.png b/docs/images/view_guide_box.png
deleted file mode 100644
index c55c7b068..000000000
Binary files a/docs/images/view_guide_box.png and /dev/null differ
diff --git a/docs/images/view_home_screen.png b/docs/images/view_home_screen.png
index 4619e5588..ccc0fccac 100644
Binary files a/docs/images/view_home_screen.png and b/docs/images/view_home_screen.png differ
diff --git a/docs/images/view_initialization.png b/docs/images/view_initialization.png
new file mode 100644
index 000000000..915776f94
Binary files /dev/null and b/docs/images/view_initialization.png differ
diff --git a/docs/images/view_instruement_panel.png b/docs/images/view_instrument_panel.png
similarity index 100%
rename from docs/images/view_instruement_panel.png
rename to docs/images/view_instrument_panel.png
diff --git a/docs/images/view_log_map_location.png b/docs/images/view_log_map_location.png
index db0f3d907..def11f50f 100644
Binary files a/docs/images/view_log_map_location.png and b/docs/images/view_log_map_location.png differ
diff --git a/docs/images/view_logic_analyzer.png b/docs/images/view_logic_analyzer.png
deleted file mode 100644
index 81b6ff560..000000000
Binary files a/docs/images/view_logic_analyzer.png and /dev/null differ
diff --git a/docs/images/view_lux_meter.png b/docs/images/view_lux_meter.png
deleted file mode 100644
index ef09f4a8c..000000000
Binary files a/docs/images/view_lux_meter.png and /dev/null differ
diff --git a/docs/images/view_navigation_drawer.png b/docs/images/view_navigation_drawer.png
index 0932b96e6..2e7108d48 100644
Binary files a/docs/images/view_navigation_drawer.png and b/docs/images/view_navigation_drawer.png differ
diff --git a/docs/images/view_not_connected_nav_menu.png b/docs/images/view_not_connected_nav_menu.png
new file mode 100644
index 000000000..c0b13993d
Binary files /dev/null and b/docs/images/view_not_connected_nav_menu.png differ
diff --git a/docs/images/view_pin_detail_dialog.png b/docs/images/view_pin_detail_dialog.png
new file mode 100644
index 000000000..c1042f25a
Binary files /dev/null and b/docs/images/view_pin_detail_dialog.png differ
diff --git a/docs/images/view_pin_layout.png b/docs/images/view_pin_layout.png
index 27b7be2f7..3fc48a778 100644
Binary files a/docs/images/view_pin_layout.png and b/docs/images/view_pin_layout.png differ
diff --git a/docs/images/view_power_source.png b/docs/images/view_power_source.png
deleted file mode 100644
index 578244e93..000000000
Binary files a/docs/images/view_power_source.png and /dev/null differ
diff --git a/docs/images/wave_generator_view.png b/docs/images/wave_generator_view.png
deleted file mode 100644
index c1f4978cf..000000000
Binary files a/docs/images/wave_generator_view.png and /dev/null differ