beansdoc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
beansdoc [2011/01/05 10:41]
hourdin created: windows forms doc, beginning of basic doc
beansdoc [2011/01/05 12:02]
hourdin Threshold doc
Line 23: Line 23:
  
 ===== Beans of the Basic Category ===== ===== Beans of the Basic Category =====
 +
 +==== BooleanFactory ====
 +This bean allows to generate boolean events from void events, quite similar to the [[beansdoc#​primitivevalueemitter|PrimitiveValueEmitter]],​ but more simply. The default value of the output boolean is //false//, and this value can be changed either using the **State** property and thus the **set_State(**//​boolean//​**)** method, or using the two following void methods:
 +  * **set_TrueEvent()**:​ changes the emitted boolean value to true.
 +  * **set_FalseEvent()**:​ changes the emitted boolean value to false.
 +A simple method is then used to trigger the boolean event:
 +  * **FireBool()**:​ method triggering the sending of the boolean event.
 +  * **^BooleanCreated**:​ the //boolean// event emitted by the BooleanFactory bean.
  
 ==== BoolFilter ==== ==== BoolFilter ====
 This bean is used to propagate a boolean event only when its value is either //true// or //false//, but not both. The filtered value of the boolean event can be parametrized by the **Filter** property of the bean. When the received event value matches the Filter property value, the BoolFilter can send two events, a void and an integer event: This bean is used to propagate a boolean event only when its value is either //true// or //false//, but not both. The filtered value of the boolean event can be parametrized by the **Filter** property of the bean. When the received event value matches the Filter property value, the BoolFilter can send two events, a void and an integer event:
-  * **^EventFiltered**:​ the void event sent by the bean when the incoming event matches the property value. +  * **^EventFiltered**:​ the //void// event sent by the bean when the incoming event matches the property value. 
-  * **^IntValEmitted**:​ the integer event sent by the bean when the incoming event matches the property value. The value of the integer is parametrized by the **SendValue** bean property. +  * **^IntValEmitted**:​ the //integer// event sent by the bean when the incoming event matches the property value. The value of the integer is parametrized by the **SendValue** bean property
- +  * **SetLevel(**//​boolean//​**)**:​ the input method of the bean, that will trigger the filtering and consequent event sending. 
 + 
 +==== Counter ==== 
 + 
 +This integer counter increments its internal value when the **Increment()** input method is called. It sends a //void// event indicating that its value has changed, and provides an //integer// property (Value) and thus the **get_Value()** property getter method to retrieve the value of the internal counter. 
 + 
 +Moreover, it has the ability to apply a modulo to the incrementing internal counter. This can be useful to make binary counters (modulo = 2) for example. In this case, when the counter comes back to 0, the Carry event is raised, allowing to cascade the counters when a modulo is used, and create a multi-bit counter for example. The value of the modulo is parametrized by the **Modulo** property. 
 + 
 +  * **Increment()**:​ input method, incrementing the internal counter value. 
 +  * **^ValueChanged**:​ //void// notification of incrementation. Use the **get_Value()** property getter as callback value to complete integer method calls. 
 +  * **^Carry**: //void// notification of reset of the counter value because of modulo value reaching. 
 +  * **Reset()**:​ resets the counter, setting 0 for the internal value and sending the ValueChanged event //​(introduced in version 870)//. 
 + 
 +==== EventFilter ==== 
 +The EventFilter bean acts as an electric relay on a flow of //void// events. It has a boolean property indicating if it is closed or open, and an input method relayed to an output event. 
 +  * **FireEvent()**:​ input method of the event flow. 
 +  * **^EventOut**:​ output event of the event flow. 
 +  * **set_Propagate(**//​boolean//​**)**:​ the setter method of the **Propagate** property, indicating if the event flow is relayed (//true//) or not (//​false//​). 
 + 
 +==== EventToggler ==== 
 +This bean allows to create alternating event calls from a single event stream. It receives a //void// event and sends alternatively the **^EventOut0** and **^EventOut1** //void// events. It also sends a boolean event alternating between //true// and //false// values. 
 +  * **FireEvent()**:​ the input method that triggers the sending of one of the two EventOut[0|1] events in an alternate way. Also emits the EventOut //boolean// event. 
 +  * **^EventOut**:​ the //boolean// event sent alternatively with a //true// and a //false// value
 ==== PrimitiveValueEmitter ==== ==== PrimitiveValueEmitter ====
 +The PrimitiveValueEmitter is probably the most useful bean, since it can convert a void event to any primitive type of events, like //string//, //​integer//,​ //​boolean//,​ //double// and so on. All the available types can be seen in the property panel. The value of the primitive type event you want to send has to be configured using these properties too, and all events are triggered by the same method:
 +  * **FireValueEvent()**:​ this method triggers the sending of all primitive type events of the bean.
 +  * **^Emit//​Type//​Value**:​ an event of a primitive type //Type//, sent when FireValueEvent() is invoked, and using the value set in the property **//​Type//​Value** of the bean.
 +  * **set_//​Type//​Value(**//​Type//​**)**:​ a method allowing to remotely set the value that the bean will send (property setter method).
 +
 +==== Threshold ====
 +
 +This bean allows to filter a //string// event flow containing decimal numbers according to a minimal or maximal value of the decimal number. For example, it can allow events to be relayed only when the value in the string is higher than "​17.2"​.
 +  * **set_Value(**//​string//​**)**:​ input method of the bean, receiving the string containing the decimal number.
 +  * **^CeilledValue**:​ the //string//: event emitted when the input value (of set_Value()) was higher than the threshold, or lower if the bean is inverted (Inverted property set to //true//).
 +  * **^ThresholdReachedBool**:​ a //boolean// event sent when the input values cross the threshold level, up or down. The value of the event is //true// when the value is above and //false// when value is below the threshold. This behavior is inverted when the bean is inverted (Inverted property set to //true//).
 +  * The **ThresholdValue** property parametrizes the value of the threshold that evaluates incoming events.
  
 +==== ValueFormatter ====
 +This bean allows to convert a primitive type event to a string. This is nearly the opposite of the [[beansdoc#​primitivevalueemitter|PrimitiveValueEmitter]],​ since the ValueFormatter has as many inputs as handled types and only one (//​string//​) output.
 +  * **Format(**//​Type//​**)**:​ input method, existing for many type arguments.
 +  * **^StringValueChanged**:​ the //string// output event, sent when the above method is invoked.
 +More than allowing to convert primitive types to a string, the ValueFormatter allows to modify the format of the output string, for example to add the unit of an integer value. The **ValueFormat** property of the bean allows to change the output format of the string. The format of the ValueFormat property is the standard C# formatting syntax [[http://​msdn.microsoft.com/​en-us/​library/​txafckwd.aspx|(doc page)]].
  
 +Example: a "{0} ms" ValueFormat value will emit a "12 ms" string for a Format(12) method invocation.
  • beansdoc.txt
  • Last modified: 2011/06/21 18:08
  • by hourdin