Skip to content

Commit

Permalink
Merge pull request #107 from CMPUT301W21T03/document-final-review
Browse files Browse the repository at this point in the history
docs added
  • Loading branch information
giancarlopernudisegura authored Mar 19, 2021
2 parents 3264f19 + 363e45e commit a47a233
Show file tree
Hide file tree
Showing 19 changed files with 131 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* Known Issue:
*
* 1. Might not be needed!
* 1. No longer in use, to be deleted!
*/
public class IllegalExperimentException extends Exception
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class AddExperimentFragment extends DialogFragment {
* This is an interface for any activity using this fragment
*/
public interface OnFragmentInteractionListener {

void onOkPressed(Experiment newExperiment);
void onOKPressedEdit(String experimentDescription, int experimentTrials,
boolean experimentLocation, boolean experimentNewResults,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
import com.example.experiment_automata.R;
import com.github.mikephil.charting.charts.BarChart;

/**
* Role/Pattern:
*
* This class inflates the histogram fragment.
*
* Known Issue:
*
* 1. None
*/

public class HistogramFragment extends Fragment {
public HistogramFragment() {
// Required empty public constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

public class NavExperimentDetailsFragment extends Fragment {

private String ERROR_LOG_VALUE = "ERROR_LOG-EXPERIMENT-VIEW";
public static final String CURRENT_EXPERIMENT_ID = "FRAGMENT_CURRENT_FRAGMENT-ID";


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@

import com.example.experiment_automata.R;
import com.github.mikephil.charting.charts.LineChart;

/**
* Role/Pattern:
*
* This fragment class inflates the results fragment view.
*
* Known Issue:
*
* 1. None
*/
public class ResultsFragment extends Fragment {
public ResultsFragment() {
// Required empty public constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
import android.view.ViewGroup;

import com.example.experiment_automata.R;

/**
* Role/Pattern:
*
* This fragment class inflates ths stats view for the experiment.
*
* Known Issue:
*
* 1. None
*/
public class StatisticsFragment extends Fragment {
public StatisticsFragment() {
// Required empty public constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
import java.util.UUID;
import java.util.concurrent.Callable;

/**
* Role/Pattern:
*
* This maintains the list for the android system to display the individual inflated views.
*
* Known Issue:
*
* 1. None
*/
public class TrialArrayAdapter extends ArrayAdapter<Trial> {
// Syntax inspired by Abdul Ali Bangash, "Lab 3 Instructions - Custom List",
// 2021-02-04, Public Domain, https://eclass.srv.ualberta.ca/pluginfile.php/6713985/mod_resource/content/1/Lab%203%20instructions%20-%20CustomList.pdf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@

import java.util.ArrayList;

/**
* Role/Pattern:
*
* This fragment class inflates the trial list fragment.
* Also contains the trail array adapter.
* This fragment contains a list of trials which can be ignored or included
* in the stats computation.
*
* Known Issue:
*
* 1. None
*/

public class TrialsFragment extends Fragment {
private ArrayList<Trial> trialsArrayList;
private TrialArrayAdapter trialArrayAdapter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
*
* Known Issue:
*
* 1. None
* 1. stat calculation implementation is not final awaiting input from customer on
* how count experiments should analyzed.
*/
public class CountExperiment extends Experiment {
private Collection<CountTrial> results;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,34 @@ public boolean isActive() {
*/
public void setPublished(boolean p) { published = p; }

/**
* set the description of experiment
* @param description value to be set
*/
public void setDescription(String description) {
this.description = description;
}

/**
* sets the min trials for the experiment
* @param minTrials value to be set
*/
public void setMinTrials(int minTrials) {
this.minTrials = minTrials;
}

/**
* sets the activity for each of the experiments
* @param active value to be set
*/
public void setActive(boolean active) {
this.active = active;
}

/**
* sets if we need a location
* @param requireLocation value to be set
*/
public void setRequireLocation(boolean requireLocation) {
this.requireLocation = requireLocation;
}
Expand All @@ -146,10 +162,18 @@ public ExperimentType getType()
return type;
}

/**
* get the min trials
* @return the int min trial value
*/
public int getMinTrials() {
return minTrials;
}

/**
* check if a location is required by the experiment
* @return the result
*/
public boolean isRequireLocation() {
return requireLocation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

public class ExperimentMaker
{
private String description; // Do we need this to have any attributes? can't we just create an experiment maker when needed?

/**
* Will create a desired experiment type with a description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,9 @@ public Integer getSize(){
return size;
}

/**
* get the trials made about this experiment
* @return the trials
*/
public Collection<MeasurementTrial> getTrials() { return results; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,9 @@ public Integer getSize(){
return size;
}

/**
* get the trials made about this experiment
* @return the trials
*/
public Collection<NaturalCountTrial> getTrials() { return results; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,24 @@
import com.github.mikephil.charting.data.Entry;

import java.util.List;

/**
* Role/Pattern:
* provides contract for graphs
*
* Known Issue:
*
* 1. None
*/
public interface Graphable {
/**
* makes a histogram
* @return a list of bar entry
*/
public List<BarEntry> generateHistogram();

/**
* make a plot
* @return list of entries
*/
public List<Entry> generatePlot();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.example.experiment_automata.QRCode;
//Bitmap conversion from ρяσѕρєя K,https://stackoverflow.com/questions/19337448/generate-qr-code-directly-into-imageview
//Bitmap conversion from Râsẑrêâ K (original name in Cyrilic) K,https://stackoverflow.com/questions/19337448/generate-qr-code-directly-into-imageview

import android.graphics.Bitmap;
import android.graphics.Color;
Expand All @@ -15,7 +15,7 @@
*
* Known Issue:
*
* 1. None
* 1. The constructor is a string but will become uuid
*/
public class QRCodeManager {
//Header for custom QR codes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@

import java.util.ArrayList;
import java.util.Collection;

/**
* Role/Pattern:
* provides contract for stats
*
* Known Issue:
*
* 1. None
*/
public interface StatSummary {
/**
* Gets the mean value of the trials.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Known Issue:
*
* 1. Might be removed
* 1. Not in use might be removed
*/
public class HomeViewModel extends ViewModel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@

import static android.content.Context.MODE_PRIVATE;

/**
* Role/Pattern:
*
* Displays a user profile with contact information
*
* Known Issue:
*
* 1. No ability to edit information
*/
public class ProfileFragment extends Fragment {

private ProfileViewModel profileViewModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.example.experiment_automata.UserInformation.User;

import java.util.UUID;
/**
* Role/Pattern:
* Test fragment that might be removed at some point in the future.
*
* Known Issue:
*
* 1. Not in use might be removed
*/


public class ProfileViewModel extends ViewModel {

Expand Down

0 comments on commit a47a233

Please sign in to comment.