TestDataGeneratorBlock Editor-TestData Editor/en

Aus expecco Wiki (Version 2.x)
Version vom 10. Dezember 2014, 21:11 Uhr von Cg (Diskussion | Beiträge) (→‎Importing Existing Data Sets from a CSV File)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen
Testdata Generator Editor

The test data editor is used to set the values generated by a test data generator block. It can be found on the "Data" tab after selecting a test data generator in the navigation tree.

To the right, you see an example for some data in the editor.

Buttons[Bearbeiten]

  • Datei:Icon Open External CSV Editor.png Open an external CSV Editor application (as specified in the "External Tools" settings. If no CSV editor is specified in the settings, a regular text editor is used. If no regular text editor is defined in the settings, the builtin FileBrowser is used as editor.
  • Datei:Icon Import CSV TableData.png Import rows from a CSV file. The file may optionally contain timing data in the first column of each row. The file must use ";"s as column separator.
  • Icon Add Data.png Add a new entry to the data list
  • Datei:Icon Add Multiple Data.png Add multiple new entries to the data list
  • Datei:Icon Insert Datarow.png Insert a new entry to the data list before the currently selected row. The timing value is computed to be in-between the selected and the row before.
  • Icon Remove Data.png Remove the selected entry from the data list
  • Icon Up.png Icon Down.png Change the order of the datasequence (move the selected row)

Usage[Bearbeiten]

The editor is separated into at least two columns. The first contains the sequence number of the entry and the second contains the delay time for the entry. The other columns contain data for each output pin. The data columns are filled with datatype specific values and should be filled in as required. Additional columns will be shown, if more output pins are defined in the schema page. Please note that the list will be sorted according to the time delay.

When the block is invoked during an execution, it will send the data from the list to its output pins after the specified delay. The block in the example above would start immediately by sending the string 'One' to its output pin. Then, after a delay of one second it would send the string 'Two', after two seconds 'Three' and so on.

Manipulating the Data in an external Editor[Bearbeiten]

The editing capabilities of this editor may not be sufficient for the manipulation of large tables, and you may want to edit it using a mpre sophisticated tool, which is specifically tuned for table editing. For example, "Excel", "OpenCalc" or even "Emacs" may be better suited for this task.

Click on the "edit-with-tool" button. Expecco will write the table data to a temporary file in CSV format, open the tool and finally read back in the changed file's contents.

For this to work, you have to define which tool to use in the "External Tools" settings dialog. We recommend, to set this to a CSV-capable editor, such as "Excel" or "ocalc" (from the OpenOffice suite).

If you do not have any useful CSV-editor installed on your system, specify an ordinary text editor in the settings ("vi", "emacs" or "notepad+" among others). If nothing was specified in the settings, the builtin Filebrowser application is used, which comes automatically with expecco.


Importing Existing Data Sets from a CSV File[Bearbeiten]

If you already have the data present present in an appropriate format, you can immediately use the "Import from CSV" menu button and import both pin names and data values. You can either import the first column of each row as the timing column, or alternatively let the imported generate time values for you (with 1 second delta). Notice that the CSV import always creates the column pins with a "String" type. If required, change the types after the import in the block's schema definition.

If the data is not present in an appropriate format, you will first have to use an external CSV editor to modify the data as required. Click on the "Open External CSV Editor" icon and proceed as described above.

 

See Also[Bearbeiten]

As an alternative to a test data generator block, you can also use an attachment containing CSV data records and feed that data into a CSV-reader block, optionally followed by a delay block (both found in the standard library). The contents of a CSV attachment can be edited with a spreadsheet application (Excel or OpenOffice) or a text editor (notepad), which is often more convenient to use (but may take longer to start up). However, notice that producing data sets with delays in between is much easier to setup and understand when a test data generator block is used.



Copyright © 2014-2024 eXept Software AG