UpdateDuration

Parent Previous Next

UpdateDuration

This function Update the duration of the Trend object.


Function Definition:


void UpdateDuration(int duration)


.      int duration: A Integer parameter that represents the duration of the Trend in seconds.


void UpdateDuration(TimeSpan duration)


.      TimeSpan duration: A TimeSpan parameter that represents the duration of the Trend.


To configure this function, follow the steps below:


1.   In an object event, configure the UpdateDuration function: TrendObjectName.UpdateDuration(duration);


2.    During the execution of RunTime, run the configured event.



Example 1


In the graphic document, the user has one Trend object (named as Trend1). In a Button object (named as Button1) the user configures the UpdateDuration event with the following event:


Trend1.UpdateDuration(30);


In this event, the Button1 will sets the Trend duration to 30 seconds.


Example 2


In the graphic document, the user has one Trend object (named as Trend1). In a Button object (named as Button1) the user configures the UpdateDuration event with the following event:


TimeSpan duration = new TimeSpan(0, 0, 30);

Trend1.UpdateDuration(duration);


In this event, the Button1 will sets the Trend duration to 30 seconds.


Example 3


In the graphic document, the user has one Trend object (named as Trend1). In a Button object (named as Button1) the user configures the UpdateDuration event with the following event:


TimeSpan duration = new TimeSpan(7,0, 0, 0);

Trend1.UpdateDuration(duration);


In this event, the Button1 will sets the Trend duration to 7 days.




 

Note: This property exists only to the following objects:

.        Trend


 

Note: To use TimeSpan you can use the following configurations:

TimeSpan(long ticks);

TimeSpan(int hours, int minutes, int seconds);

TimeSpan(int days, int hours, int minutes, int seconds);

TimeSpan(int days, int hours, int minutes, int seconds, int milliseconds);


 

Note: When the duration is updated, the start date will adjust itself and the end date won't change.