Tabnine Logo
FloatResource.create
Code IndexAdd Tabnine to your IDE (free)

How to use
create
method
in
org.ogema.core.model.simple.FloatResource

Best Java code snippets using org.ogema.core.model.simple.FloatResource.create (Showing top 19 results out of 315)

origin: org.ogema.drivers/hm-hl

private void enableHumidity() {
  humidityEnabled = Status_hum.ENABLED;
  HumiditySensor hSensor = thDevice.sensors().addDecorator("humiditySensor", HumiditySensor.class);
  humidity = hSensor.reading().create();
  //		humidity.activate(true);
  humidity.requestAccessMode(AccessMode.EXCLUSIVE, AccessPriority.PRIO_HIGHEST);
  hSensor.activate(false);
}
origin: org.ogema.drivers/homematic-xmlrpc-hl

@Override
public void setup(HmDevice parent, DeviceDescription desc, Map<String, Map<String, ParameterDescription<?>>> paramSets) {
  logger.debug("setup SHUTTER_CONTACT handler for address {}", desc.getAddress());
  String swName = ResourceUtils.getValidResourceName("SHUTTER_CONTACT" + desc.getAddress());
  Map<String, ParameterDescription<?>> values = paramSets.get(ParameterDescription.SET_TYPES.VALUES.name());
  if (values == null) {
    logger.warn("received no VALUES parameters for device {}", desc.getAddress());
    return;
  }
  DoorWindowSensor sens = parent.addDecorator(swName, DoorWindowSensor.class);
  sens.reading().create();
  sens.activate(true);
  sens.battery().chargeSensor().reading().create();
  sens.activate(true);
  conn.addEventListener(new ShutterContactListener(sens, desc.getAddress()));
}
origin: org.ogema.drivers/homematic-xmlrpc-hl

reading.create();
reading.getParent().activate(true);
origin: org.ogema.tools/resource-manipulators

@Override
public void setRangeFilter(float lowerBoundary, float upperBoundary, int mode) throws RuntimeException {
  if (m_config == null || !m_config.exists())
    throw new RuntimeException("Cannot set filter before ProgramEnforcer has been commited");
  boolean lowerNaN = Float.isNaN(lowerBoundary);
  boolean upperNaN = Float.isNaN(upperBoundary);
  if (lowerNaN && upperNaN) {
    m_config.range().delete();
    return;
  }
  RangeFilter filter = m_config.range();
  if (!lowerNaN) {
    filter.range().lowerLimit().create();
    filter.range().lowerLimit().setValue(lowerBoundary);
  }
  if (!upperNaN) {
    filter.range().upperLimit().create();
    filter.range().upperLimit().setValue(upperBoundary);
  }
  filter.mode().create();
  filter.mode().setValue(mode);
  filter.activate(true);
}
origin: org.ogema.drivers/homematic-xmlrpc-hl

@Override
public void setup(HmDevice parent, DeviceDescription desc, Map<String, Map<String, ParameterDescription<?>>> paramSets) {
  logger.debug("setup SHUTTER_CONTACT handler for address {}", desc.getAddress());
  String swName = ResourceUtils.getValidResourceName("SHUTTER_CONTACT" + desc.getAddress());
  Map<String, ParameterDescription<?>> values = paramSets.get(ParameterDescription.SET_TYPES.VALUES.name());
  if (values == null) {
    logger.warn("received no VALUES parameters for device {}", desc.getAddress());
    return;
  }
  DoorWindowSensor sens = parent.addDecorator(swName, DoorWindowSensor.class);
  sens.reading().create();
  sens.activate(true);
  sens.battery().chargeSensor().reading().create();
  sens.activate(true);
  conn.addEventListener(new ShutterContactListener(sens, desc.getAddress()));
}
origin: org.ogema.drivers/homematic-xmlrpc-hl

reading.create();
reading.getParent().activate(true);
origin: org.ogema.drivers/homematic-xmlrpc-hl

FloatResource reading = thermos.valve().setting().stateFeedback();
if (!reading.exists()) {
  reading.create();
  thermos.activate(true);
FloatResource reading = thermos.battery().internalVoltage().reading();
if (!reading.exists()) {
  reading.create();
  thermos.activate(true);
origin: org.ogema.drivers/homematic-xmlrpc-hl

FloatResource reading = thermos.valve().setting().stateFeedback();
if (!reading.exists()) {
  reading.create();
  thermos.activate(true);
FloatResource reading = thermos.battery().internalVoltage().reading();
if (!reading.exists()) {
  reading.create();
  thermos.activate(true);
origin: org.smartrplace.apps/smartrplace-util-proposed

@Override
public void onPOSTComplete(String data, OgemaHttpRequest req) {
  FloatResource source = getResource(sva, req, FloatResource.class);
  String val = myField.getValue(req);
  float value;
  try {
    value  = Float.parseFloat(val);
  } catch (NumberFormatException | NullPointerException e) {
    if(alert != null) alert.showAlert(notAllowedMessageUsed, false, req);
    return;
  }
  if (value < minimumAllowed) {
    if(alert != null) alert.showAlert(notAllowedMessageUsed, false, req);
    return;
  }
  if (value > maximumAllowed) {
    if(alert != null) alert.showAlert(notAllowedMessageUsed, false, req);
    return;
  }
  if(!source.exists()) {
    source.create();
    setValue(source, value);
    source.activate(true);
  } else {
    setValue(source, value);
  }
  if(alert != null) alert.showAlert("New value: " + value, true, req);
}

origin: org.ogema.tools/resource-manipulators

config.targetResourceParent().create();
config.targetResourceParent().addDecorator("schedule",targetResource);
config.updateInterval().create();
origin: org.ogema.tools/resource-manipulators

FloatResource resultBase = m_config.resultBase().create();
resultBase.program().setAsReference(m_output);
m_config.delay().create();
origin: org.ogema.drivers/hm-hl

batteryStatus = (FloatResource) eSens.reading().create();
origin: org.ogema.drivers/knx

ElectricDimmer device = resMan.createResource(conInfo.getName(), ElectricDimmer.class);
device.setting().create();
device.setting().stateControl().create();
device.setting().stateControl().addValueListener(createUpdateListener(conInfo), true);
device.setting().stateFeedback().create();
createReadWriteableComInfo(device, true, false);
conInfo.setRessource(device);
origin: org.ogema.drivers/hm-hl

private void addMandatoryChannels() {
  HM_hlConfig attributeConfig = new HM_hlConfig();
  attributeConfig.driverId = hm_hlConfig.driverId;
  attributeConfig.interfaceId = hm_hlConfig.interfaceId;
  attributeConfig.deviceAddress = hm_hlConfig.deviceAddress;
  attributeConfig.channelAddress = "ATTRIBUTE:0001";
  attributeConfig.timeout = -1;
  attributeConfig.resourceName = hm_hlConfig.resourceName + "SmokeDetector";
  attributeConfig.chLocator = addChannel(attributeConfig);
  attributeConfig = new HM_hlConfig();
  attributeConfig.driverId = hm_hlConfig.driverId;
  attributeConfig.interfaceId = hm_hlConfig.interfaceId;
  attributeConfig.deviceAddress = hm_hlConfig.deviceAddress;
  attributeConfig.channelAddress = "ATTRIBUTE:0002";
  attributeConfig.timeout = -1;
  attributeConfig.resourceName = hm_hlConfig.resourceName + "_BatteryStatus";
  attributeConfig.chLocator = addChannel(attributeConfig);
  SmokeDetector smokeDetector = resourceManager.createResource(hm_hlConfig.resourceName, SmokeDetector.class);
  smokeAlert = smokeDetector.reading().create();
  // smokeAlert.activate(true);
  // smokeAlert.setValue(false);
  smokeAlert.requestAccessMode(AccessMode.EXCLUSIVE, AccessPriority.PRIO_HIGHEST);
  StateOfChargeSensor eSens = smokeDetector.battery().chargeSensor().create();
  batteryStatus = eSens.reading().create();
  // batteryStatus.activate(true);
  // batteryStatus.setValue(95);
  batteryStatus.requestAccessMode(AccessMode.EXCLUSIVE, AccessPriority.PRIO_HIGHEST);
  // do not activate value resources, since they do not contain sensible values yet
  ResourceUtils.activateComplexResources(smokeDetector, true, appManager.getResourceAccess());
}
origin: org.ogema.drivers/hm-hl

batteryStatus = (FloatResource) eSens.reading().create();
origin: org.ogema.drivers/hm-hl

private void addMandatoryChannels() {
  HM_hlConfig attributeConfig = new HM_hlConfig();
  attributeConfig.driverId = hm_hlConfig.driverId;
  attributeConfig.interfaceId = hm_hlConfig.interfaceId;
  attributeConfig.deviceAddress = hm_hlConfig.deviceAddress;
  attributeConfig.channelAddress = "ATTRIBUTE:0001";
  attributeConfig.timeout = -1;
  attributeConfig.resourceName = hm_hlConfig.resourceName + "_HighWater";
  attributeConfig.chLocator = addChannel(attributeConfig);
  attributeConfig = new HM_hlConfig();
  attributeConfig.driverId = hm_hlConfig.driverId;
  attributeConfig.interfaceId = hm_hlConfig.interfaceId;
  attributeConfig.deviceAddress = hm_hlConfig.deviceAddress;
  attributeConfig.channelAddress = "ATTRIBUTE:0002";
  attributeConfig.timeout = -1;
  attributeConfig.resourceName = hm_hlConfig.resourceName + "_BatteryStatus";
  attributeConfig.chLocator = addChannel(attributeConfig);
  WaterDetector threeStateDevice = resourceManager.createResource(hm_hlConfig.resourceName, WaterDetector.class);
  highWater = threeStateDevice.reading().create();
  // highWater.activate(true);
  // highWater.setValue("dry");
  highWater.requestAccessMode(AccessMode.EXCLUSIVE, AccessPriority.PRIO_HIGHEST);
  StateOfChargeSensor eSens = threeStateDevice.battery().chargeSensor().create();
  batteryStatus = eSens.reading().create();
  // batteryStatus.activate(true);
  // batteryStatus.setValue(95);
  batteryStatus.requestAccessMode(AccessMode.EXCLUSIVE, AccessPriority.PRIO_HIGHEST);
  // do not activate value resources, since they do not contain sensible values yet
  ResourceUtils.activateComplexResources(threeStateDevice, true, appManager.getResourceAccess());
}
origin: org.ogema.tools/resource-manipulators

@Override
public boolean commit() {
  if (m_source == null || m_target == null) {
    return false;
  }
  // delete the old configuration if it exsited.
  if (m_config != null)
    m_config.delete();
  m_config = m_base.createResource(ThresholdModel.class);
  m_config.source().setAsReference(m_source);
  m_config.target().setAsReference(m_target);
  m_config.threshold().create();
  m_config.threshold().setValue(m_threshold);
  m_config.equalityExceeds().create();
  m_config.equalityExceeds().setValue(m_equalityExceeds);
  m_config.invert().create();
  m_config.invert().setValue(m_invert);
  m_config.activate(true);
  return true;
}
origin: org.ogema.drivers/hm-hl

brightness = (FloatResource) brightnessSensor.reading().create();
brightness.requestAccessMode(AccessMode.EXCLUSIVE, AccessPriority.PRIO_HIGHEST);
batteryStatus = eSens.reading().create();
origin: org.ogema.drivers/hm-hl

batteryStatus = eSens.reading().create();
org.ogema.core.model.simpleFloatResourcecreate

Popular methods of FloatResource

  • getValue
  • setValue
  • getHistoricalData
  • isActive
  • exists
  • activate
  • addDecorator
  • addValueListener
  • historicalData
  • program
  • addStructureListener
  • forecast
  • addStructureListener,
  • forecast,
  • getParent,
  • getPath,
  • getSubResource,
  • removeStructureListener,
  • removeValueListener,
  • requestAccessMode,
  • setAsReference

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • JList (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Table (org.hibernate.mapping)
    A relational table
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now