Skip to content

Commit

Permalink
fixed bugs in the forms
Browse files Browse the repository at this point in the history
  • Loading branch information
will2312 committed Apr 1, 2021
1 parent a7c03b9 commit 6dfc62d
Showing 1 changed file with 39 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,46 +161,45 @@ private void setupFormGen() {

boolgen = true;
fbGEn = new FormBuilder(getContext(), rvGen);

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

FormHeader title = (FormHeader) new FormHeader().setTitle("Report");
formItems.add(title);
formItemsGen.add(title);

FormElementTextSingleLine name = FormElementTextSingleLine.createInstance().setTitle("Name of Inspector").setValue("");
nameOfInspector = name.getValue();
formItems.add(name);
formItemsGen.add(name);

FormElementTextSingleLine site = FormElementTextSingleLine.createInstance().setTitle("Name of site").setValue("");
nameOfSite = site.getValue();
formItems.add(site);
formItemsGen.add(site);

FormElementPickerDate date = FormElementPickerDate.createInstance().setTitle("Date Row").setDateFormat("XX-XX-XXXX").setValue("");
FormElementPickerDate date = FormElementPickerDate.createInstance().setTitle("Date Row").setDateFormat("dd/MM/yyyy").setValue("");
dateRow = date.getValue();
formItems.add(date);
formItemsGen.add(date);

FormElementTextSingleLine outfallValue = FormElementTextSingleLine.createInstance().setTitle("Outfall").setValue("0");
outfall = Double.parseDouble(outfallValue.getValue());
formItems.add(outfallValue);
formItemsGen.add(outfallValue);

FormElementTextSingleLine longitudeValue = FormElementTextSingleLine.createInstance().setTitle("Longitude").setValue("0");
longitude = Double.parseDouble(longitudeValue.getValue());
formItems.add(longitudeValue);
formItemsGen.add(longitudeValue);

FormElementTextSingleLine latitudeValue = FormElementTextSingleLine.createInstance().setTitle("Latitude").setValue("0");
latitude = Double.parseDouble(latitudeValue.getValue());
formItems.add(latitudeValue);
formItemsGen.add(latitudeValue);

FormElementTextSingleLine invertElevationValue = FormElementTextSingleLine.createInstance().setTitle("Invert Elevation").setValue("0");
invertElevation = Double.parseDouble(invertElevationValue.getValue());
formItems.add(invertElevationValue);
formItemsGen.add(invertElevationValue);

List<String> pipeTypeOptions = new ArrayList<String>();
pipeTypeOptions.add("Enclosed Pipe");
pipeTypeOptions.add("Open Channel");
FormElementPickerMulti typeValue = FormElementPickerMulti.createInstance().setTitle("Type").setOptions(pipeTypeOptions);
type = typeValue.getValue();
formItems.add(typeValue);
formItemsGen.add(typeValue);

List<String> pipeSizeOptions = new ArrayList<String>();
pipeSizeOptions.add("4\"");
Expand All @@ -216,7 +215,7 @@ private void setupFormGen() {
pipeSizeOptions.add("36\"");
FormElementPickerMulti pipeSizeValue = FormElementPickerMulti.createInstance().setTitle("Pipe Size").setOptions(pipeSizeOptions);
pipeSize = pipeSizeValue.getValue();
formItems.add(pipeSizeValue);
formItemsGen.add(pipeSizeValue);

List<String> channelWidthOptions = new ArrayList<String>();
channelWidthOptions.add("2\"");
Expand All @@ -232,7 +231,7 @@ private void setupFormGen() {
FormElementPickerMulti channelBottomWidthValue = FormElementPickerMulti.createInstance().setTitle("Channel Bottom Width")
.setOptions(channelWidthOptions);
channelBottomWidth = channelBottomWidthValue.getValue();
formItems.add(channelBottomWidthValue);
formItemsGen.add(channelBottomWidthValue);

List<String> receivingWaterOptions = new ArrayList<String>();
receivingWaterOptions.add("Turkey Creek");
Expand All @@ -247,7 +246,9 @@ private void setupFormGen() {

FormElementPickerMulti receiving = FormElementPickerMulti.createInstance().setTitle("Receiving Water").setOptions(receivingWaterOptions);
receivingWater = receiving.getValue();
formItems.add(receiving);
formItemsGen.add(receiving);

fbGEn.addFormElements(formItemsGen);
}
private void setupFormHQ() {
boolhq = true;
Expand Down Expand Up @@ -345,6 +346,7 @@ private void setupFormDWS() {

formItemsDWS = new ArrayList<>();

formItemsDWS.add(title);
formItemsDWS.add(flow);
formItemsDWS.add(odor);
formItemsDWS.add(color);
Expand All @@ -355,48 +357,50 @@ private void setupFormDWS() {

fbDWS.addFormElements(formItemsDWS);
}

private void setupFormCT() {
boolct = true;
fbCT = new FormBuilder(getContext(), rvCT);

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;
double tempVal = 0;
double turbidityVal = 0;
double phVal = 0;
double nitrateVal = 0;
double phosphateVal = 0;
double oxygenVal = 0;
double coliVal = 0;
String other1Val = "";
String other2Val = "";

FormHeader title = (FormHeader) new FormHeader().setTitle("Chemical Testing");

FormElementTextSingleLine temperature = new FormElementTextSingleLine().setTitle("Temperature (C) Change").setValue("0");
FormElementTextNumber temperature = new FormElementTextNumber().createInstance().setTitle("Temperature (C) Change").setValue("0");
tempVal = Double.parseDouble(temperature.getValue());

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

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

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

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

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

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

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

FormElementTextSingleLine other2 = new FormElementTextSingleLine().createInstance().setTitle("Other 2").setValue("");
other2Val = other2.getValue();

FormElementTextSingleLine other2 = new FormElementTextSingleLine().setTitle("Other 2").setValue("");
other2Val = Double.parseDouble(other2.getValue());
formItemsCT = new ArrayList<>();

formItemsCT.add(title);
Expand All @@ -411,11 +415,9 @@ private void setupFormCT() {
formItemsCT.add(other2);

fbCT.addFormElements(formItemsCT);

}
private void setupFormBM() {
boolbm = true;

}

public boolean convertToBoolean(String s) {
Expand Down

0 comments on commit 6dfc62d

Please sign in to comment.