Click or drag to resize

How to develop an ImportType

The Import tab in the Data Manager View lets user to import external data files. However it can be quite a challange using these external data as the data format vary from source to source.

The ImportType scripts overcomes these challanges by letting the user to define how these external data files will be parsed and imported into ArthaChitra.

Main methods

Once user chooses the necessary importType script from the comboBox located in the Import tab in the Data Manager view, and click on Import, a choose file dialog will pop up. Once user selects the necessary files and click on Open, ArthaChitra will start parsing the files.

ArthaChitra internally will loop through the selected file one by one. When a new file is being read it will call the OnNextFile(String). This method will also pass the full name of the file which is to be parsed.

ArthaChitra will then internally calls the TryParseLineAsync(String, Instrument, DateTime, TimeSpan, Double, Double, Double, Double, Double, Double, Int64, Int64, String) method. User have to define for which instrument the data is being parsed for and the neessary data values. If the line is not successfully parsed, ArthaChitra will skip to the next line.

OnStateChanged

The OnStateChanged method is called whenever the State of the script is changed. The various states which the ImportType script have are:

  • Initialize - when the ImportType class is created.
  • Startup - Before the file selector dialog is opened.
  • Finalize - When the script encounters an error or is being finalized (disposed off). All clear up codes should be placed here.
Example
C#
protected override void OnStateChange()
 {
     //your code here
 }
Configuring properties via GUI using Xaml templates
See Also

Reference

ImportBase