V1_0.java [src/java/m/ahat] Revision: default  Date:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package m.ahat;

import csip.ModelDataService;
import csip.ServiceException;
import csip.annotations.Description;
import csip.annotations.Name;
import csip.annotations.Polling;
import csip.annotations.Resource;
import database.DBResources;
import java.sql.SQLException;
import javax.ws.rs.Path;
import static m.Constants.*;
import org.codehaus.jettison.json.JSONException;

/**
 *
 * @author Brad
 * @author <a href="mailto:shaun.case@colostate.edu">Shaun Case</a>
 */
@Name("Energy-04: Compute Animal Housing Energy Consumption Awareness Output. (AHAT)")
@Description("This service processes inputs about heating, cooling, lighting, and other energy consuming processes, as well as energy conserving steps, used in housing systems for dairy, poutry, and swine operations, and returns estimated annual energy use and cost by category.")
@Path("m/ahat/1.0")

@Resource(from = DBResources.class)

public class V1_0 extends ModelDataService {

    AHAT ahat;

    private double kWh;
    private double currentCost;
    private double estimatedkWh;
    private double estimatedCost;
    private double estimatedSavings;

    @Override
    protected void preProcess() throws SQLException, ServiceException, JSONException {
        ahat = new AHAT(getClass(), LOG);
        ahat.readAllValuesFromJSON(getParam());
    }

    @Override
    protected void doProcess() {
        
        
//        kWh = ahat.getLightingKilowattHours();
//        currentCost = ahat.getCurrentElectricCost();
//        estimatedkWh = ahat.getLightingEsimatedKilowattHours();
//        estimatedCost = ahat.getEstimatedElectricCost();
//        estimatedSavings = currentCost - estimatedCost;

    }

    @Override
    protected void postProcess() {

    }
}