org.unizone.source | ![]() |
org.unizone.0.4140
Instance of Type
Inheriting from SourceAdapterSingleTimeseries
Type data | Value |
org.uninode.Type.displayPattern | {att:org.unizone.source.Source.displayName} |
org.unizone.source.Source.valueAttribute | |
org.uninode.Resource.resourceType | |
org.uninode.Resource.label | |
org.uninode.Resource.resourceOf | List{} |
org.uninode.Listable.resources | Reference[org.uninode.Listable.resources] of org.unizone.source.RSI |
Attribute summary | Defined in | Uninode® Id | Properties | Default | |
Reference[org.uninode.Listable.resources] | resources | Listable | org.uninode.0.2001 | type | |
String | toString This is the display string. | Node | org.uninode.0.102 | ||
Type | type The type of an object determines the behaviour and attributes of the object. | Node | org.uninode.0.101 | ||
String | uri | Node | org.uninode.0.103 | ||
String | label | Resource | org.uninode.0.2041 | type | |
List[Type] | resourceOf | Resource | org.uninode.0.2042 | type | |
Signature | resourceType This defines the type of resource. It can be 'view', 'adapter' or 'action' | Resource | org.uninode.0.2043 | type | |
String | displayName The display name is the name that is shown in lists, displays and graphs. | Source | org.unizone.0.4001 | essential | |
Attribute | valueAttribute The value attribute is used for determining the default value that should be used for displaying this source in a graph. | Source | org.unizone.0.4011 | type inheritValue | |
Signature | valueType The value type determines which axes should be used in graphs. | Source | org.unizone.0.4002 | inheritValue | |
Source | source | SourceAdapterSingle | org.unizone.0.4051 |
Method summary | Defined in | Overrides | Properties | |
void | activate | Listable | ||
void | checkRange | SourceAdapterSingle | Source | |
void | designEditor(WidgetWorkspace ws) | Listable | ||
void | generateScript(ScriptGenerationInfo info) | SourceAdapterSingle | ScriptGenerator | |
Real | get(DateTime timestamp) | SourceAdapterSingleTimeseries | ||
Boolean | isResourceOf(Listable listable, Signature aspect) | Mixable | type | |
Listable | mixOn(Mixable mix) | Mixable | ||
Listable | mixWith(Mixable mix) | Mixable | ||
void | put(DateTime timestamp, Real value) | SourceAdapterSingleTimeseries | ||
String | resourceString | Listable | introspection | |
void | setSource(Source source) | SourceAdapterSingle | ||
Source | source | SourceAdapterSingle | ||
void | XXXcom.nodelab.java.sourceadaptersingle.CheckRange | SourceAdapterSingle | ||
Signature | XXXcom.nodelab.java.sourceadaptersingle.ValueType | SourceAdapterSingle | ||
void | com.nodelab.java.source.Activate | Source | Listable | |
Listable | com.nodelab.java.source.MixWithMi | Source | Mixable |
Script summary |
org.unizone.0.8552/* instance Value[Int] days; constructor() { TimeSeries:(); instance days = new Value(Int, 30); instance days.addListener(Void () {changedHistory()}); } constructor(Source src, Int days) { TimeSeries:(); setNextSource(src); instance days = new Value(Int, days); instance days.addListener(Void () {changedHistory()}); } Void activate() { Gig gig = new Gig(ViewDiagramStandard); gig.addSource(this); gig.addSource(nextSource()); gig.activate(); } Void setDays(Int days) { instance days.set(days); } class Boolean isResourceOf(Listable node, Symbol aspect) { if (aspect == #adaptors) return true; false; } class String resourceLabel() "Name of resource" { "RSI day"; } String resourceString() "Description of resource" { instance days.value.toString + " days RSI of " + nextSource().toString(); } Mixable mixWith(Mixable item) { if (item.class.subclassOf(Source)) { setNextSource(Source{item}); return this; } return TimeSeries:mixWith(item); } Symbol valueType() {#rsi} Void designEditor(WidgetWorkspace ws) { ws.addLabel(new Place(0, 0).setPadding(5, 5), "Days"); ws.addField(new Place(1, 0).setPadding(20, 5), instance days, null); } trace Void prepareData(Time from, Time to, Symbol resolution) { Source src = nextSource(); Producer.report("Preparing " + toString()); external cond_history_from = from.addDays(-instance days.value); external cond_history_to = to; external cond_history_resolution = #day; Set[Time] dates = new Set(Time); src.collectSteps(#cond_history, dates); Real sumUp = 0.0; Real sumDown = 0.0; Int fromIndex = 0; Int toIndex = 0; Int index = 0; Real val; Real trailFrom; Real trailTo; while (index < dates.size && dates.at(index) < from) index = index + 1; while (index < dates.size) { while (toIndex < index) { toIndex = toIndex + 1; external cond_history = dates.at(toIndex); val = Real{src.aspectValue(#value)}; if (val != null) { if (trailTo != null) { if (dates.at(fromIndex) < fromTime) { external cond_history = dates.at(fromIndex); val = Real{src.aspectValue(#value)}; if (val != null) { if (trailFrom != null) { if (val > trailFrom) sumUp = sumUp - val + trailFrom ; else sumDown = sumDown - trailFrom + val; } trailFrom = val; } fromIndex = fromIndex + 1; } if (sumUp + sumDown > 0) val = 100 * (sumUp - sumDown) / (sumUp + sumDown); else nextSource().instanceScript(info); // create variables info.objectId(this, AdaptorRSIDay, "rsi"); } String initScript(InstanceScriptInfo info) { String prefix = info.methodPrefix(this); " " + prefix + "setNextSource(" + nextSource().instanceScript(info) + "); " + prefix + "setDays(" + instance days.value.toString + "); "; } */ |