Tabnine Logo
TimeResource.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
org.ogema.core.model.simple.TimeResource

Best Java code snippets using org.ogema.core.model.simple.TimeResource.getValue (Showing top 20 results out of 315)

origin: org.ogema.ref-impl/util

@XmlElement
public long getValue() {
  return ((TimeResource) res).getValue();
}
origin: org.ogema.drivers/remote-rest-connector

public static long getValue(SingleValueResource sv) {
  if (sv instanceof TimeResource)
    return ((TimeResource) sv).getValue();
  if (sv instanceof IntegerResource)
    return ((IntegerResource) sv).getValue();
    return 0;
}
 
origin: org.smartrplace.sim/resource-simulation

private static long getForecastHorizon(final ConfigPattern config) {
  if (config.forecastHorizon.isActive()) {
    final long try0 = config.forecastHorizon.getValue();
    if (try0 > 0)
      return try0;
  }
  return 24 * 60 * 60 * 1000; // one day
}

origin: org.ogema.tools/resource-manipulators

private NavigableMap<Long,TimeSeriesReduction> getActionConfigsFromResources(List<ScheduleReductionAction> actionRes) {
  NavigableMap<Long,TimeSeriesReduction> list = new TreeMap<>();
  for (ScheduleReductionAction sra: actionRes) {
    TimeSeriesReduction tsr = getActionConfigFromResource(sra);
    if (tsr == null)
      continue;
    list.put(sra.ageThreshold().getValue(), tsr);
  }
  return list;
}
 
origin: org.ogema.widgets/widget-extended

@Override
public JSONObject retrieveGETData(OgemaHttpRequest req) {
  JSONObject result = super.retrieveGETData(req);
  TimeResource tr = getSelectedResource();
  if (tr != null) {
    String str;
    if (interval != null)
      str = TimeResourceTextFieldData.getIntervalString(tr.getValue(), interval);
    else
      str = TimeUtils.getDateAndTimeString(tr.getValue());
    result.put("value", str);
  }
  return result;
}
origin: org.ogema.tools/system-supervision

@Descriptor("Print disk usage information")
public void diskUsage() {
  // actually this already logs the status, but we cannot easily determine whether the console logger is active
  tasks.diskSupervision.timerElapsed(null);
  System.out.println("Size of rundir folder: " + (config.results().rundirFolderSize().getValue()/Tasks.mb) + " MB.");
  System.out.println("Size of data folder:   " + (config.results().dataFolderSize().getValue()/Tasks.mb) + " MB.");
  System.out.println("Free disk space:       " + (config.results().freeDiskSpace().getValue()/Tasks.mb) + " MB.");
}
 
origin: org.ogema.widgets/widget-extended

  @Override
  public JSONObject retrieveGETData(OgemaHttpRequest req) {
    JSONObject result = super.retrieveGETData(req);
    TimeResource hRes = getSelectedResource();
//        if (hRes == null) {
//            super.setValue(getNaValue("n/a", interval));  // super.setValue not supported
//        } else {
//            super.setValue(getIntervalString(hRes.getValue(), interval));
//        }
    if (hRes != null) 
      result.put("value", getIntervalString(hRes.getValue(), interval)); // we simply overwrite the json answer instead of setting the value...
    return result;
  }
   
origin: org.ogema.tools/system-supervision

@Descriptor("Print memory usage information")
public void memoryUsage() {
  // actually this already logs the status, but we cannot easily determine whether the console logger is active
  tasks.ramSupervision.timerElapsed(null);
  System.out.println("RAM used: " + (config.results().usedMemorySize().getValue()/Tasks.mb) + " MB, max RAM available: " 
      + (config.results().maxAvailableMemorySize().getValue()/Tasks.mb) + " MB.");
}
 
origin: org.ogema.sim/roomsimulation-service

/** 
 * Perform the actual simulation here. The targetPattern points to the simulated resource (typically a device). 
 * The configPattern points to the simulation configuration resource indicating the 
 * simulation time interval etc.
 * @param timeStep time since last simulation step in milliseconds
 */
@Override
public void simTimerElapsed(RoomsimulationServicePattern targetPattern, RoomSimConfigPattern configPattern, Timer t, long timeStep) {
  SingleRoomSimulationImpl logic = simulatedObjects.get(targetPattern.model.getLocation());
  logic.step(t.getExecutionTime(), timeStep);
  t.setTimingInterval(configPattern.updateInterval.getValue());
}
origin: org.ogema.tools/resource-manipulators

public SumController(ApplicationManager appMan, SumModel configuration) {
  m_config = configuration;
  m_timer = new CountDownTimer(appMan, configuration.delay().getValue(), this);
  m_logger = appMan.getLogger();
}
origin: org.ogema.widgets/widget-extended

@Override
protected void updateOnGET(Locale locale) {
  TimeResource hRes = getSelectedResource();
  String val;
  if (hRes != null) 
    val = getIntervalString(hRes.getValue(), interval);
  else
    val = "n.a.";
  setValue(val);
}
origin: org.ogema.tools/resource-manipulators

public ScheduleSumController(ApplicationManager appMan, ScheduleSumModel configuration) {
  m_config = configuration;
  long delay = configuration.delay().getValue();
  if (delay <= 0) {
    delay = 1;
  }
  m_timer = new CountDownTimer(appMan, delay, this);
  m_logger = appMan.getLogger();
}
origin: org.ogema.tools/system-supervision

public static long getInterval(final TimeResource itvRes, long defaultItv) {
  long proposed = 0;
  if (itvRes.isActive())
    proposed = itvRes.getValue();
  if (proposed < MIN_SUPERVISION_ITV) {
    proposed = defaultItv;
    itvRes.<TimeResource> create().setValue(defaultItv);
    itvRes.activate(false);
  }
  return proposed;
}
origin: org.ogema.widgets/widget-extended

@Override
public JSONObject retrieveGETData(OgemaHttpRequest req) {
  if (selectedResource != null && selectedResource.exists()) 
    setDate(selectedResource.getValue());
  else
    setDate(""); // FIXME
  return super.retrieveGETData(req);
}
 
origin: org.ogema.tools/resource-manipulators

/**
 * Creates an instance of the configuration object from an existing configuration.
 */
public SumImpl(ResourceManipulatorImpl base, SumModel configResource) {
  m_base = base;
  m_inputs = new ArrayList<>(configResource.inputs().getAllElements());
  m_output = configResource.resultBase();
  m_delay = configResource.delay().getValue();
  m_deactivateEmtpySum = configResource.deactivateEmptySum().getValue();
  m_config = configResource;
}
origin: org.ogema.tools/resource-manipulators

private TimeSeriesReduction getActionConfigFromResource(ScheduleReductionAction actionRes) {
  TimeSeriesReduction tsr = null;
  if (actionRes instanceof ScheduleDeletionAction) {
    tsr = new DeletionAction(am);
  }
  else if (actionRes instanceof ScheduleDownsamplingAction) {
    long minInterval = ((ScheduleDownsamplingAction) actionRes).minInterval().getValue();
    tsr = new InterpolationAction(minInterval ,am);
  }
  else if (actionRes instanceof ScheduleStepsReductionAction) {
    tsr = new StepsReductionAction(am);
  }
  return tsr;
}
 
origin: org.smartrplace.tools/profile-api

final void resourceChanged(final long t, final SingleValueResource resource) {
  final Value v;
  if (resource instanceof FloatResource)
    v = new FloatValue(((FloatResource) resource).getValue());
  else if (resource instanceof IntegerResource)
    v = new IntegerValue(((IntegerResource) resource).getValue());
  else if (resource instanceof BooleanResource)
    v = new BooleanValue(((BooleanResource) resource).getValue());
  else if (resource instanceof TimeResource)
    v = new LongValue(((TimeResource) resource).getValue());
  else
    throw new IllegalArgumentException();
  values.add(new SampledValue(v, t, Quality.GOOD));
}

origin: org.ogema.tools/resource-manipulators

  public ScheduleManagementImpl(ResourceManipulatorImpl base, ScheduleManagementModel configResource, ApplicationManager am) {
    this.base = base;
    this.am = am;
    this.actions = getActionConfigsFromResources(configResource.actions().getAllElements()); 
    String loc = configResource.targetResourceParent().getSubResource("schedule", Schedule.class).getLocation();
    this.targetResource = am.getResourceAccess().getResource(loc);
    this.config = configResource;
    this.updateInterval = configResource.updateInterval().getValue();
    // must not do this -> more than one impl object can be created per managed resource
    // well... actually this doesn't do anything
//        if (configResource.updateInterval().isActive()) 
//            manageSchedule(sched, configResource.updateInterval().getValue(), actions); 
//        else 
//            manageSchedule(sched, actions);  
  }
 
origin: org.ogema.tools/resource-manipulators

/**
 * Creates an instance of the configuration object from an existing configuration.
 */
public ScheduleSumImpl(ResourceManipulatorImpl base, ScheduleSumModel configResource) {
  m_base = base;
  m_inputs = new ArrayList<>(configResource.inputs().getAllElements());
  m_output = configResource.resultBase().program();
  m_delay = configResource.delay().getValue();
  m_deactivateEmtpySum = configResource.deactivateEmptySum().getValue();
  m_activationControl = configResource.activationControl().getValue();
  m_incrementalUpdate = configResource.incrementalUpdate().getValue();
  m_ignoreGaps = configResource.ignoreGaps().getValue();
  m_writeImmediately = configResource.writeImmediately().getValue();
  m_config = configResource;
}
origin: org.ogema.tools/resource-manipulators

/**
 * Creates an instance of the configuration object from an existing
 * configuration.
 */
public ProgramEnforcerImpl(ResourceManipulatorImpl base, ProgramEnforcerModel configResource) {
  m_base = base;
  m_targetResource = configResource.targetResource();
  m_updateInterval = configResource.updateInterval().getValue();
  m_priority = AccessPriority.valueOf(configResource.priority().getValue());
  m_exclusiveAccessRequired = configResource.exclusiveAccessRequired().getValue();
  m_config = configResource;
  m_deactivate = m_config.deactivateIfValueMissing().getValue();
  m_scheduleName = m_config.scheduleResourceName().isActive() ? m_config.scheduleResourceName().getValue() : null;
}
org.ogema.core.model.simpleTimeResourcegetValue

Popular methods of TimeResource

  • setValue
  • isActive
  • create
  • getHistoricalData
  • exists
  • activate
  • historicalData
  • forecast
  • getPath
  • program

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • getContentResolver (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top plugins for Android Studio
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