stella.util
Class SolarToggle

java.lang.Object
  extended by stella.util.SolarToggle
All Implemented Interfaces:
Toggling

public class SolarToggle
extends Object
implements Toggling

A Solar height toggle with two different values. If the sun is setting, i.e. the last measurement was higher than the current, then the set value is used for Toggling action, on sun rise, the rise value is used. The action is similar to a SchmidtTrigger, but the latter does not allow a setting value higher than a rising value.


Field Summary
private  double lastsol
          The last measurement added.
private  double rise
          The solar height toggle at sun rise.
private  double set
          The solar height toggle at sun set.
 
Constructor Summary
protected SolarToggle()
          Common constructor.
  SolarToggle(double offtrig, double ontrig)
          Constructs a new Schmidt trigger.
  SolarToggle(String parameter)
          Constructs a new Schmidt trigger.
 
Method Summary
 boolean addHit(double val)
          Return true, if the argument value is above the appropriate trigger.
protected  void setTriggers(double offtrig, double ontrig)
          Sets the two trigger values.
 String toString()
          Returns the two toggle edges as a description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lastsol

private double lastsol
The last measurement added.


set

private double set
The solar height toggle at sun set.


rise

private double rise
The solar height toggle at sun rise.

Constructor Detail

SolarToggle

protected SolarToggle()
Common constructor. Do not use. The toggle value starts with false;


SolarToggle

public SolarToggle(String parameter)
Constructs a new Schmidt trigger. The two toggle values, #off and #on must be separated with a comma.


SolarToggle

public SolarToggle(double offtrig,
                   double ontrig)
Constructs a new Schmidt trigger. Note that the first argument, the #off trigger must be less than the second argument, the #on trigger.

Method Detail

setTriggers

protected void setTriggers(double offtrig,
                           double ontrig)
Sets the two trigger values. The first argument is the sun-set value, the second the sun rise.


addHit

public boolean addHit(double val)
Return true, if the argument value is above the appropriate trigger. If the lastsol state of the Schmidt trigger is on, than the #on value is used, the #off value otherwise.

Specified by:
addHit in interface Toggling

toString

public String toString()
Returns the two toggle edges as a description.

Overrides:
toString in class Object