@@ -0,0 +1,3265 @@
+package com.sb.elsinore.html;%0A%0Aimport static org.rendersnake.HtmlAttributesFactory.class_;%0Aimport static org.rendersnake.HtmlAttributesFactory.id;%0Aimport static org.rendersnake.HtmlAttributesFactory.type;%0Aimport static org.rendersnake.HtmlAttributesFactory.value;%0A%0Aimport java.io.IOException;%0A%0Aimport org.rendersnake.HtmlCanvas;%0Aimport org.rendersnake.Renderable;%0A%0Aimport com.sb.elsinore.LaunchControl;%0Aimport com.sb.elsinore.Messages;%0Aimport com.sb.elsinore.inputs.PhSensor;%0A%0Apublic class PhSensorForm implements Renderable %7B%0A%0A    private PhSensor phSensor = null;%0A%0A    public PhSensorForm(PhSensor newSensor) %7B%0A        this.phSensor = newSensor;%0A    %7D%0A%0A    @Override%0A    public void renderOn(HtmlCanvas html) throws IOException %7B%0A        html.div(id(phSensor.getName() + %22-editVol%22).class_(%22col-md-12%22))%0A            .form(id(phSensor.getName() + %22-editVol%22)%0A                    .name(phSensor.getName() + %22-edit%22))%0A                .input(type(%22hidden%22).name(%22name%22).id(%22name%22)%0A                        .value(phSensor.getName()))%0A                .br();%0A                html.input(type(%22text%22).class_(%22form-control%22)%0A                        .name(%22adc_pin%22)%0A                        .id(%22adc_pin%22).value(phSensor.getAIN())%0A                        .add(%22placeholder%22, Messages.ANALOGUE_PIN))%0A                .br()%0A                // Replace this with a list%0A                .select(class_(%22holo-spinner%22).name(%22onewire_address%22)%0A                        .id(%22onewire_address%22));%0A                html.option(value(%22%22).selected_if(%0A                        %22%22.equals(phSensor.getDsAddress())))%0A                ._option();%0A                for (String addr: LaunchControl.getOneWireDevices(%22/20%22)) %7B%0A                    String address = addr.substring(1);%0A                    html.option(value(address)%0A                        .selected_if(address.equals(phSensor.getDsAddress())))%0A                        .write(address)%0A                    ._option();%0A                %7D%0A%0A                html._select();%0A                html.input(type(%22text%22).class_(%22form-control%22)%0A                        .name(%22onewire_offset%22)%0A                        .id(%22onewire_offset%22).value(phSensor.getDsOffset())%0A                        .add(%22placeholder%22, Messages.DS2450_OFFSET))%0A                .br();%0A%0A                html.option(value(%22%22).selected_if(%0A                        %22%22.equals(phSensor.getDsAddress()))).write(Messages.PH_MODEL)%0A                ._option();%0A                for (String model: phSensor.getAvailableTypes()) %7B%0A                    html.option(value(model)%0A                        .selected_if(model.equals(phSensor.getModel())))%0A                        .write(model)%0A                    ._option();%0A                %7D%0A%0A                html._select();%0A                html.button(id(%22updatePhSensor-%22 + phSensor.getName())%0A                        .onClick(%22submitForm(this.form);%22)%0A                        .class_(%22btn%22))%0A                    .write(Messages.UPDATE)%0A                ._button()%0A                .button(id(%22cancelPh-%22 + phSensor.getName())%0A                        .onClick(%22cancelPhEdit(%22 + phSensor.getName() + %22);%22)%0A                        .class_(%22btn%22))%0A                    .write(Messages.CANCEL)%0A                ._button()%0A        ._div();%0A    %7D%0A%0A%7D%0A

Add a pH Sensor Form for setting up a pH Sensor