Hello Sazna,
so far I understood your implementation, the log data is stored in array existing in a global autoobject LogArray1. The array entries themself are instances of the LogParameters class. The LogParameters class has variables for the Channel1..Channel3 values. These variables refer the global autoobjects Channel1Params, Channel2Params and Channel3Params. Consequently all LogParameters objects will have the same data in the Channel1..Channel3 variables.
I would recommend to avoid the global Channel1..Channel3 autoobjects. Use instead local instances of LogParameters embedded directly into LogParameters class. Or much simple, store the values MainMeasureValue and MainMeasureUnit directly in LogParameters avoiding so the overhead of additional embedded objects.
Concerning the second question, so far I have understood it, what you intent to implement will become complicated. You could implement slot methods for the events OnEnd of the Slide Touch Handler. In this manner you can react when the scrolling is finished. The actual scroll position can then be obtained by evaluating the property ScrollOffset of the Vertical List.
Assuming however, that the log data is already available in the device (it is stored in some memory in the device) I would recommend other approach. Here implement in DeviceClass a simple interface to query the number of existing logs and query the content of a log with a particular number. For example:
int32 GetLogsCount( void )
string GetLogDate( int32 aLogNumber )
string GetLogTime( int32 aLogNumber )
string GetLogMeasureValue( int32 aLogNumber )
string GetLogMeasureUnit( int32 aLogNumber )
This interface is composed of methods. See also Implementing a Device Interface: Command. The implementation of the methods limit to query the information stored in your device. Additionally add a System Event to the DeviceClass. The idea here: when new log entry is recorded in your device, just trigger the System Event. Nothing else.
Now, in the component Application::Logs (where the log data is displayed) modify OnLoadItem slot method to use the new interface explained above. It means, when the Vertical List asks to load the item with number itemNo, you invoke Application::Device.GetLogDate( itemNo ) to get the date and use the returned info in the initialization of the list item. Similarly other methods are invoked and the returned values used to get the respective information.
Finally, add a System Event Handler to Application::Log component. Connect this handler with the System Event object explained above. And implement the onEvent method for the handler. In the method perform following code:
VerticalList.NoOfItems = Application::Device.GetLogsCount();
VerticalList.InvalidateItems( 0, VerticalList.NoOfItems - 1 );
This implementation will ensure that the list updates when new log entries are recorded. I hope it helps you further.
Best regards
Paul Banach