Skip to content

Commit

Permalink
Merge branch 'master' into Samuel2
Browse files Browse the repository at this point in the history
  • Loading branch information
seford authored Mar 23, 2021
2 parents 0bdce9b + 066edea commit bed5bfc
Show file tree
Hide file tree
Showing 15 changed files with 318 additions and 54 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
</activity>
<activity
android:name=".WaterWay.WaterWayNav"
>
>
</activity>
<activity android:name=".Construction.ConstructionNav">

</activity>
<activity android:name=".Reset_password" />
<activity android:name=".SampleFordm" />
<activity android:name=".InspectionForm" />
<activity android:name=".Login" />
<activity android:name=".SignUp" />
</application>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,49 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.RecyclerView;

import com.google.firebase.Timestamp;
import com.google.type.DateTime;
import com.sf.stormwaterutilityandroid.R;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import me.riddhimanadib.formmaster.FormBuilder;
import me.riddhimanadib.formmaster.model.BaseFormElement;
import me.riddhimanadib.formmaster.model.FormElementPickerDate;
import me.riddhimanadib.formmaster.model.FormElementPickerMulti;
import me.riddhimanadib.formmaster.model.FormElementPickerSingle;
import me.riddhimanadib.formmaster.model.FormElementSwitch;
import me.riddhimanadib.formmaster.model.FormElementTextMultiLine;
import me.riddhimanadib.formmaster.model.FormElementTextSingleLine;
import me.riddhimanadib.formmaster.model.FormHeader;

public class ConstructionFormFragment extends Fragment {
private FormBuilder formBuilder;
private RecyclerView recyclerView;
private Button submitButton;

public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.activity_sample_fordm, container, false);

View root = inflater.inflate(R.layout.fragment_home, container, false);
recyclerView = root.findViewById(R.id.recyclerView2);

return root;
recyclerView.addView(submitButton);

return root;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ public class DryWeatherScreening extends AppCompatActivity{

private FormBuilder formBuilder;
private RecyclerView recyclerView;

String flowVal = "";
String odorVal = "";
String colorVal = "";
String polutantsVal = "";
String obstructionVal = "";
String maintenanceVal = "";
String screenVal = "";

FormElementTextEmail element11;
//I assume onCreate is important so I will leave it unchanged
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -43,24 +52,31 @@ private void setupForm() {
//Outfall --> Question: How do you do a subheading?
FormElementTextSingleLine flow = new FormElementTextSingleLine().setTitle("Presence of Flow");
FormElementTextNumber flowData = FormElementTextNumber.createInstance(); //what data type is this?
flowVal = flowData.getValue();

FormElementTextSingleLine odor = new FormElementTextSingleLine().setTitle("Unusual Odor");
FormElementTextNumber odorData = FormElementTextNumber.createInstance();
odorVal = odorData.getValue();

FormElementTextSingleLine color = new FormElementTextSingleLine().setTitle("Unusual Color");
FormElementTextNumber colorData = FormElementTextNumber.createInstance();
colorVal = colorData.getValue();

FormElementTextSingleLine polutants = new FormElementTextSingleLine().setTitle("Polutants Nearby");
FormElementTextNumber polutantsData = FormElementTextNumber.createInstance();
polutantsVal = polutantsData.getValue();

FormElementTextSingleLine obstruction = new FormElementTextSingleLine().setTitle("Obstruction");
FormElementTextNumber obstructionData = FormElementTextNumber.createInstance();
obstructionVal = obstructionData.getValue();

FormElementTextSingleLine maintenance = new FormElementTextSingleLine().setTitle("Needs Maintenance");
FormElementTextNumber maintenanceData = FormElementTextNumber.createInstance();
maintenanceVal = maintenanceData.getValue();

FormElementTextSingleLine screen = new FormElementTextSingleLine().setTitle("Screen OK");
FormElementTextNumber screenData = FormElementTextNumber.createInstance();
screenVal = screenData.getValue();

List<BaseFormElement> formItems = new ArrayList<>();

Expand Down
9 changes: 7 additions & 2 deletions app/src/main/java/com/sf/stormwaterutilityandroid/HEI.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ public class HEI {

//constructor
HEI(double QHEI_substrate_size, double QHEI_smothering, double QHEI_silting, double QHEI_rootwads, double QHEI_overhanging_veg,
double QHEI_oxbowsblack_waters, double QHEI_downed_treeslogs, double QHEI_shallows, double QHEI_water_plants, double QHEI_logswoody_debris,


double QHEI_oxbowsblack_waters, double QHEI_downed_treeslogs, double QHEI_shallows, double QHEI_water_plants, double QHEI_logswoody_debris,

double QHEI_boulders, double QHEI_undercut_banks, double QHEI_sinuosity, double QHEI_natural, double QHEI_riparian_width,
double QHEI_land_use, double QHEI_bank_erosion, double QHEI_stream_shading, double QHEI_deepest_pool, double QHEI_velocity,
double QHEI_rifflerun_depth, double QHEI_rifflerun_substrate, double QHEI_deep_pools) {
Expand Down Expand Up @@ -79,4 +82,6 @@ public static double get_HEI(double QHEI_substrate_size, double QHEI_smothering,
QHEI_velocity + QHEI_rifflerun_depth + QHEI_rifflerun_substrate;
}

}

}

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected void onCreate(Bundle savedInstanceState) {

// submitButton = findViewById(R.id.submitButton);


setupForm();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,22 @@
public class ChemicalTesting extends AppCompatActivity{
private FormBuilder formBuilder;
private RecyclerView recyclerView;

double tempVal = 0.0;
double turbidityVal = 0.0;
double phVal = 0.0;
double nitrateVal = 0.0;
double phosphateVal = 0.0;
double oxygenVal = 0.0;
double coliVal = 0.0;
double other1Val = 0.0;
double other2Val = 0.0;

FormElementTextEmail element11;
@Override
//I assume onCreate is important so I will leave it unchanged


protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_fordm);
Expand All @@ -45,30 +58,39 @@ private void setupForm() {
FormElementTextSingleLine temperature = new FormElementTextSingleLine().setTitle("Temperature (C) Change");
//FormHeader temp = FormHeader.createInstance("Temperature (C) Change");
FormElementTextNumber tempData = FormElementTextNumber.createInstance(); //what data type is this?
tempVal = Double.parseDouble(tempData.getValue());

FormElementTextSingleLine tubidity = new FormElementTextSingleLine().setTitle("Tubidity (NTU)");
FormElementTextNumber tubidityData = FormElementTextNumber.createInstance();
turbidityVal = Double.parseDouble(tubidityData.getValue());

FormElementTextSingleLine pH = new FormElementTextSingleLine().setTitle("pH");
FormElementTextNumber pHData = FormElementTextNumber.createInstance();
phVal = Double.parseDouble(pHData.getValue());

FormElementTextSingleLine nitrate = new FormElementTextSingleLine().setTitle("Nitrate (mg/L)");
FormElementTextNumber nitrateData = FormElementTextNumber.createInstance();
nitrateVal = Double.parseDouble(nitrateData.getValue());

FormElementTextSingleLine phosphate = new FormElementTextSingleLine().setTitle("Total Phosphate (mg/L)");
FormElementTextNumber phosphateData = FormElementTextNumber.createInstance();
phosphateVal = Double.parseDouble(nitrateData.getValue());

FormElementTextSingleLine oxygen = new FormElementTextSingleLine().setTitle("Dissolved Oxygen (mg/L)");
FormElementTextNumber oxygenData = FormElementTextNumber.createInstance();
oxygenVal = Double.parseDouble(oxygenData.getValue());

FormElementTextSingleLine coli = new FormElementTextSingleLine().setTitle("E Coli (col/100mL)");
FormElementTextNumber coliData = FormElementTextNumber.createInstance();
coliVal = Double.parseDouble(coliData.getValue());

FormElementTextSingleLine other1 = new FormElementTextSingleLine().setTitle("Other 1");
FormElementTextNumber other1Data = FormElementTextNumber.createInstance();
other1Val = Double.parseDouble(other1Data.getValue());

FormElementTextSingleLine other2 = new FormElementTextSingleLine().setTitle("Other 2");
FormElementTextNumber other2Data = FormElementTextNumber.createInstance();
other2Val = Double.parseDouble(other2.getValue());

List<BaseFormElement> formItems = new ArrayList<>();

Expand All @@ -93,6 +115,5 @@ private void setupForm() {
formItems.add(other2Data);

formBuilder.addFormElements(formItems);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ public double calculatePTI() {
public static double getPTI(double intolerant, double moderate, double fairly, double very) {
return 4.0 * intolerant + 3.0 * moderate + 2.0 * fairly + 1.0 * very;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ public double calculateWQI() {
public static double getWQI(double tempChange, double turbidity, double pH, double nitrate, double phosphate, double oxygen) {
return tempChange * 0.11 + turbidity * 0.09 + pH * 0.12 + nitrate * 0.1 + phosphate * 0.11 + oxygen * 0.18;
}
}

}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package com.sf.stormwaterutilityandroid.WaterWay;

import java.util.Map;
import java.util.HashMap;

public class WaterWay {

private Map<String, Double> WaterWayDoubleFields = new HashMap<String, Double>();
private Map<String, Boolean> WaterWayBoolFields = new HashMap<String, Boolean>();
private Map<String, String> WaterWayStringFields = new HashMap<String, String>();

public WaterWay() {
//Water Quality Index Data
WaterWayDoubleFields.put("CT_temperature_change", new Double(0.0));
WaterWayDoubleFields.put("CT_turbidity", new Double(0.0));
WaterWayDoubleFields.put("CT_pH", new Double(0.0));
WaterWayDoubleFields.put("CT_nitrate", new Double(0.0));
WaterWayDoubleFields.put("CT_total_phosphate", new Double(0.0));
WaterWayDoubleFields.put("CT_dissolved_oxygen", new Double(0.0));
//PTI Data
WaterWayDoubleFields.put("BM_intolerant", new Double(0.0));
WaterWayDoubleFields.put("BM_moderately_tolerant", new Double(0.0));
WaterWayDoubleFields.put("BM_fairly_tolerant", new Double(0.0));
WaterWayDoubleFields.put("BM_very_tolerant", new Double(0.0));

WaterWayDoubleFields.put("WQI", new Double(0.0));
WaterWayDoubleFields.put("HEI", new Double(0.0));
WaterWayDoubleFields.put("PTI", new Double(0.0));

//Boolean Fields
WaterWayBoolFields.put("DWS_needs_maintenance", new Boolean(false));
WaterWayBoolFields.put("DWS_obstruction", new Boolean(false));
WaterWayBoolFields.put("DWS_polutants", new Boolean(false));
WaterWayBoolFields.put("DWS_presence_of_flow", new Boolean(false));
WaterWayBoolFields.put("DWS_screened_OK", new Boolean(false));
WaterWayBoolFields.put("DWS_unusual_color", new Boolean(false));
WaterWayBoolFields.put("DWS_unusual_odor", new Boolean(false));
WaterWayBoolFields.put("FC_complaint_investigation", new Boolean(false));
WaterWayBoolFields.put("FC_further_action_needed", new Boolean(false));
WaterWayBoolFields.put("FC_illicit_discharge_detected", new Boolean(false));
WaterWayBoolFields.put("FC_no_illicit_discharge_detected", new Boolean(false));
WaterWayBoolFields.put("FC_routine_evaluation", new Boolean(false));

//String Fields
//HEI Data
WaterWayStringFields.put("QHEI_substrate_size", "");
WaterWayStringFields.put("QHEI_smothering", "");
WaterWayStringFields.put("QHEI_silting", "");
WaterWayStringFields.put("QHEI_rootwads", "");
WaterWayStringFields.put("QHEI_overhanging_veg", "");
WaterWayStringFields.put("QHEI_oxbowsblack_waters", "");
WaterWayStringFields.put("QHEI_downed_treeslogs","");
WaterWayStringFields.put("QHEI_shallows", "");
WaterWayStringFields.put("QHEI_water_plants", "");
WaterWayStringFields.put("QHEI_deep_pools", "");
WaterWayStringFields.put("QHEI_logswoody_debris", "");
WaterWayStringFields.put("QHEI_boulders", "");
WaterWayStringFields.put("QHEI_undercut_banks", "");
WaterWayStringFields.put("QHEI_sinuosity", "");
WaterWayStringFields.put("QHEI_riparian_width", "");
WaterWayStringFields.put("QHEI_land_use", "");
WaterWayStringFields.put("QHEI_bank_erosion", "");
WaterWayStringFields.put("QHEI_stream_shading", "");
WaterWayStringFields.put("QHEI_deepest_pool", "");
WaterWayStringFields.put("QHEI_velocity", "");
WaterWayStringFields.put("QHEI_rifflerun_depth", "");
WaterWayStringFields.put("QHEI_rifflerun_substrate", "");

WaterWayStringFields.put("GOD_channel_bottom_width", "");
WaterWayStringFields.put("GOD_invert_elevation", "");
WaterWayStringFields.put("GOD_latitude", "");
WaterWayStringFields.put("GOD_longitude", "");
WaterWayStringFields.put("GOD_outfall", "");
WaterWayStringFields.put("GOD_pipe_size", "");
WaterWayStringFields.put("GOD_receiving_water", "");
WaterWayStringFields.put("GOD_type", "");

//Comments
WaterWayStringFields.put("CS_comments", "");
WaterWayStringFields.put("CT_other_1", "");
WaterWayStringFields.put("CT_other_2", "");
}
}
Loading

0 comments on commit bed5bfc

Please sign in to comment.