Package com.lbslocal.cc.objects.v3.proximity

Examples of com.lbslocal.cc.objects.v3.proximity.ProximityOptions


    try {
      int parada = 1;

      // origem
      summary[0] = new RouteSummary();
      summary[0].setDistance(0);
      summary[0].setDescription(rs[0].getDescription());
      summary[0].getPoint().setX(Functions.formatDouble(rs[0].getPoint().getX(), "0.00000"));
      summary[0].getPoint().setY(Functions.formatDouble(rs[0].getPoint().getY(), "0.00000"));
      summary[0].setTime("");

      String comandoFimDaRota = "Fim da rota";

      if (ro.getLanguage().equals("espanhol"))
        comandoFimDaRota = "Fin de la ruta";

      // paradas
      double distanciaAcumulada = 0;
      String LastStop = "";
      for (int x = 0; x < segmentDescription.length; x++) {
        if (segmentDescription[x].getCommand().toUpperCase().indexOf("PARADA") >= 0
            || segmentDescription[x].getCommand().toUpperCase().indexOf(comandoFimDaRota.toUpperCase()) >= 0) {

          if (!LastStop.equals(segmentDescription[x].getCommand())) {
            try {
              summary[parada] = new RouteSummary();
              summary[parada].setDistance(Functions.formatDouble(segmentDescription[x].getCumulativeDistance(), "0.00")
                  - Functions.formatDouble(distanciaAcumulada, "0.00"));

              summary[parada].setDescription(segmentDescription[x].getDescription());
              summary[parada].getPoint().setX(Functions.formatDouble(segmentDescription[x].getPoint().getX(), "0.00000"));
View Full Code Here


                    if (seg.seg.getCommand().toLowerCase().indexOf("parada") < 0) {
                      List<RouteSummary> rsList = new ArrayList<RouteSummary>();

                      for (int z = 0; z < rStopSelect.length; z++) {
                        RouteSummary r = new RouteSummary();
                        r.setDistance(Math.sqrt(Math
                            .pow((rStopSelect[z].getPoint().getX() - segAux.seg.getPoint().getX()), 2)
                            + Math.pow((rStopSelect[z].getPoint().getY() - segAux.seg.getPoint().getY()), 2)));
                        r.setDescription(String.valueOf(z));

                        rsList.add(r);
                      }

                      Collections.sort(rsList, COMPARATOR);
View Full Code Here

        dependencyObjects[2] = cr.new ObjectsHelper();
        dependencyObjects[2].object = new RouteTotals();
        dependencyObjects[2].alias = "routeTotals";
       
        dependencyObjects[3] = cr.new ObjectsHelper();
        dependencyObjects[3].object = new RouteSummary();
        dependencyObjects[3].alias = "routeSummary";
       
        dependencyObjects[4] = cr.new ObjectsHelper();
        dependencyObjects[4].object = new RoadType();
        dependencyObjects[4].alias = "roadType";
View Full Code Here

      ri.setRouteId(rpi.getRouteId());
      if (rpi.getRouteSummary() != null) {
        ri.setRouteSummary(new RouteSummary[rpi.getRouteSummary().length]);

        for (int x = 0; x < rpi.getRouteSummary().length; x++) {
          ri.getRouteSummary()[x] = new RouteSummary();
          ri.getRouteSummary()[x].setDescription(rpi.getRouteSummary()[x].getDescription());
          ri.getRouteSummary()[x].setDistance(rpi.getRouteSummary()[x].getDistance());
          ri.getRouteSummary()[x].setPoint(new Point());
          ri.getRouteSummary()[x].setPoint(rpi.getRouteSummary()[x].getPoint());
        }
View Full Code Here

      if (rpi.getRouteSummary() != null) {
        ri.setRouteSummary(new RouteSummary[rpi.getRouteSummary().length]);

        for (int x = 0; x < rpi.getRouteSummary().length; x++) {
          ri.getRouteSummary()[x] = new RouteSummary();
          ri.getRouteSummary()[x].setDescription(rpi.getRouteSummary()[x].getDescription());
          ri.getRouteSummary()[x].setDistance(rpi.getRouteSummary()[x].getDistance());
          ri.getRouteSummary()[x].setPoint(new Point());
          ri.getRouteSummary()[x].setPoint(rpi.getRouteSummary()[x].getPoint());
        }
View Full Code Here

      totalTime = "PT1M";
    return totalTime;
  }

  private RouteTotals getTotals(SegmentDescription[] segmentDescription, RouteProximityOptions ro, RouteStop[] rs, double gTotalToolFeeCost) {
    RouteTotals rt = new RouteTotals();

    double distance;
    distance = 0;

    try {
      distance = segmentDescription[segmentDescription.length - 1].getCumulativeDistance();

      // Total com ped�gios
      rt.setTotaltollFeeCost(Functions.formatDouble(gTotalToolFeeCost, "0.00"));

      // dist�ncia total
      rt.setTotalDistance(Functions.formatDouble(distance, "0.00"));

      // calcula o tempo total da viagem
      rt.setTotalTime(getTotalTime(rt.getTotalDistance(), ro.getVehicle().getAverageSpeed()));

      // calcula o total do combust�vel gasto na viagem
      if (ro.getVehicle().getAverageConsumption() > 0)
        rt.setTotalFuelUsed(Functions.formatDouble((rt.getTotalDistance() / ro.getVehicle().getAverageConsumption()), "0.00"));

      // calcula o valor total gasto com combust�vel na viagem
      rt.setTotalfuelCost(Functions.formatDouble((rt.getTotalFuelUsed() * ro.getVehicle().getFuelPrice()), "0.00"));

      // calcula o valor total gasto na viagem
      rt.setTotalCost(Functions.formatDouble((gTotalToolFeeCost + rt.getTotalfuelCost()), "0.00"));

      // Calcula o valor de tarifas de taxi
      double[] TaxiFare = getTaxiFare(rt, rs);
      rt.setTaxiFare1(TaxiFare[0]);
      rt.setTaxiFare2(TaxiFare[1]);
    } catch (Exception ex) {
      // throw (ex);
    }

    return rt;
View Full Code Here

    String response = requestRoute("", false, rs, ro, new Extent(), new MapSize(), barriersRoute, idLicenca, _dataSource, methodID);

    SegmentDescription[] segDescription = getSegmentDescriptionAlternative(response, ro.getVehicle().getTollFeeCat(), ro, rs, _dataSource,
        idLicenca);
    RouteTotals rt = getTotals(segDescription, ro, rs, totalPedagios);

    return rt;
  }
View Full Code Here

        dependencyObjects[1] = cr.new ObjectsHelper();
        dependencyObjects[1].object = new SegmentDescription();
        dependencyObjects[1].alias = "SegmentDescription";
       
        dependencyObjects[2] = cr.new ObjectsHelper();
        dependencyObjects[2].object = new RouteTotals();
        dependencyObjects[2].alias = "routeTotals";
       
        dependencyObjects[3] = cr.new ObjectsHelper();
        dependencyObjects[3].object = new RouteSummary();
        dependencyObjects[3].alias = "routeSummary";
View Full Code Here

          ri.getRouteSummary()[x].setDistance(rpi.getRouteSummary()[x].getDistance());
          ri.getRouteSummary()[x].setPoint(new Point());
          ri.getRouteSummary()[x].setPoint(rpi.getRouteSummary()[x].getPoint());
        }
      }
      ri.setRouteTotals(new RouteTotals());
      ri.setRouteTotals(rpi.getRouteTotals());
      double totalTime = 0;
      if (rpi.getSegDescription() != null) {
        ri.setSegDescription(new SegmentDescription[rpi.getSegDescription().length]);
View Full Code Here

   * Calcula os totais da rota informada
   */
  public RouteTotals getRouteTotals(RouteStop[] rs, RouteOptions ro, int idLicenca) throws Exception {
    iniDate = System.currentTimeMillis();

    RouteTotals rt = new RouteTotals();

    try {
      Validation("getRouteTotals", idLicenca, rs, ro);
      RouteProximityOptions routeOptions = new RouteProximityOptions();

View Full Code Here

TOP

Related Classes of com.lbslocal.cc.objects.v3.proximity.ProximityOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.