Exemple #1
0
  private Point createFeedPoint(final User user) throws NimbitsException {

    final EntityName name =
        CommonFactoryLocator.getInstance().createName(Const.TEXT_DATA_FEED, EntityType.point);

    final Entity entity =
        EntityModelFactory.createEntity(
            name,
            "",
            EntityType.feed,
            ProtectionLevel.onlyConnection,
            user.getKey(),
            user.getKey(),
            UUID.randomUUID().toString());
    // final Entity r = EntityServiceFactory.getInstance().addUpdateEntity(user, entity);

    Point point = PointModelFactory.createPointModel(entity);

    final Point result = (Point) EntityServiceFactory.getInstance().addUpdateEntity(point);

    postToFeed(
        user,
        "A new data point has been created for your data feed. Your data feed is just "
            + "a data point. Points are capable of storing numbers, text, json and xml data. Nimbits uses "
            + "a single data point to drive this feed.",
        FeedType.info);
    return result;
  }
 public static Point createPointModel(Entity entity) throws NimbitsException {
   return PointModelFactory.createPointModel(
       entity, 0.0, 90, "", 0.0, false, false, false, 0, false, FilterType.fixedHysteresis, 0.1);
 }