Filter Control

The Search Filter, in many reports, uses a simple, intuitive, and easy-to-use interface. The following items present these features in more detail.

Tab Tags

This session was divided into 5 parts highlighted in red in the image below.

  1. Tag tree filter functionality by categories. When selecting the categories in the combo box the tree will show only the tags of the selected categories.

  2. Tag tree filter functionality by name. Three search options:

    • Type only one text. The search will be done looking for tags that start with this text.

    • Insert the text between the % character. The search will be done looking for tags that contain this text. Example: %CT%

    • Insert N text between the % character. The search will be done looking for tags that contain all the texts. Example: %CT%83%

  3. By ticking the check box of the nodes of the tag tree. They will be selected and shown on the grid.

  4. Functionality to save filters.

    • Combo box shows the saved filters. When you select a filter, it will be loaded.

    • New button inserts a new filter. The name of the same will be asked to the user.

    • The Delete button will delete the selected filter.

  5. Clear button resets the entire screen for initial setup.

  6. Filter button runs the filter on the screen where it was opened.

Note: If the total of individual tags included in the query exceeds 100 the query will not run. In this case you should refine the selection.

Date / Time

In this session, the user has the option to filter by start and end date/time. And on some screens the option to filter by hour: minute interval is also shown.

Historian

This session is available only for measurement history. In it, the user has the option to show the Minimum, Maximum and Average of the selected filter, as well as the date and time of the occurrence of the maximums and minimums. To show this data, simply select the desired option in the 'Historian' tab and then click the filter button. Only histories with quality equal to 192 (when the history table is configured to save quality) and histories with non-null values are computed.

The table below illustrates the selection of the three boxes (maximum, average, and minimum) and the way the data is shown to the user after applying the filter.


Also in the measurement history, when the history table is configured to save the quality, the results that have the quality other than 192 will have a risk in their value, to alert the user of the measurement report if the values shown on screen are reliable or if at the time they were recorded there was some problem regarding communication with the field that may have caused a poor quality of the data. An example of a case of poor quality is shown below:

Filter application

Screen

Tag

Kind


AN_HistoricEventsSummary

Tag.zz_system. HistEvents.TagsFilterSQL

Text



Tag.zz_system. HistEvents.DateFilter.StartDateTime

DateTime



Tag.zz_system. HistEvents.DateFilter.FinishDateTime

DateTime

AN_HistoricMeasuresQuery

Tag.zz_system. GenericFilter.HistoricMeasures

DataTable

AN_TagsSummary

Tag.zz_system. TagsSummary.LastRefreshTime

DateTime



Tag.zz_system. TagsSummary.GridDataSource

DataTable

AN_TrendsScreen

Tag.zz_system. NewPens[]. PenLabel

Text



Tag.zz_system. NewPens[]. TagName

Text



Tag.zz_system. NewPens[]. Visible

Digital



Tag.zz_system. NewTrend.StartDateTime

DateTime



Tag.zz_system. NewTrend.Duration

TimeSpan

 

Custom Export Service - Alarms

Presentation

This is a custom alarm export service that can be used to replace the export functionality of the tAlarmWindow control. It uses string construction using a specific delimiter ("|") and creating a disk file from an alarm table. It uses a robust method and is ideal for use in export operations of surveys with more than 100,000 records.
Uses the Tag.ZZ_System.Export.ExportingStatus and Tag.ZZ_System.Export.IsExportRunningFlag tags as supporting tags.
These tags can be used to demonstrate the status of the export operation.

How to use

In the codebehind of the screen selected for export use, enter the definition of a variable of type SPIN. ActionNet.Service.Wpf, SPIN.ActionNet.Biz, and System.Threading.Tasks.

In the method responsible for calling the export, call the ExportAlarmToCsvAsync method for calling in asynchronous mode or ExportAlarmToCsv for calling in synchronous mode.
These methods have as parameters to be passed a DataTable that corresponds to the Action.Net alarm table, a flag indicating whether to update the value for use as a state value (EnumerationSets), and the name of a tag for updating status messages.

 

Hint
The total amount of selected elements to be exported is relative to the amount of main memory installed and available on the user's computer (ram), so if it is observed that a quantity of elements less than the excel limit was selected and the export results in a quantity less than the selected one, this export must be done in more than one step or the upgrade of the computer hardware.
For lookups in the project's alarm table, it is recommended to use a Dataset Query. In the above code, a query named ExportAlms was used.

Showing status

To show a progress bar with the status of the export operation, create a rectangle on the screen and within it insert a TextBlock control as shown below:


Configure the dynamics of the rectangle control as shown in the figures below.

For the dynamics of the TextBlock control, configure them as follows:

Opening the csv file

To view the data of the csv file, open excel and in the "Data" tab, click the "From text" button.

Select the exported csv file. The text import wizard opens. Select as the source of the file the option " ̈5001: Unicode (UTF-8).

Click Next. In the next window, select the vertical bar character ("|") as the delimiter.

Complete the data import through the wizard by clicking the "Next" button.
For date/time columns, right-click the column header and select the "Format cells..." option. Select the custom option and in the "Type" text box enter the formatting "dd/mm/yyyy hh:mm:ss,000". Click the "OK" button to finish.

Note: For previewing, Excel is limited to 1,048,576 rows and 16,384 columns.


Custom Export Service - Measurement History

Presentation

This is a custom export service of historical measures that can be used in place of the standard csv export functionality. It uses as input of the function only a string that contains the directory, name and format (.xml) of the file to be saved. The creation of the file on disk is done from the history table, tag zz_system. GenericFilter.HistoricMeasures.

How to use

In the codebehind of the screen selected for export use, enter the definition of a variable of type SPIN. ActionNet.Biz.
Then, within some function, just declare in some variable of type 'string' the directory, name and format (.xml) of the file to be saved, and pass to the function call MeasuresBiz.ExportXmlMeasures() this string, as in the example below:
string fileName = @"C:\Users\username. SPINENGINEERING\Desktop\Measure.xml" MeasuresBiz.ExportXmlMeasures(fileName);

Opening the xml file

After saving the history measures table with the MeasuresBiz.ExportXmlMeasures() function, simply open the file with excel. When you open it, a message will appear asking how to open the file. Select the option to open the file as a xml table and in the next question click 'Ok', in the option to create a schema for the file.

Finally, the data of the normally saved file will be displayed, exemplified below: