DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Call dataplugin from dataplugin

Hi all, I'm starting development on DIAdem and got my first dataplugin working fine. However, I'd like to know if it's possible to selectively call a DataPlugin from within a DataPlugin? Any ideas, thanks.

0 Kudos
Message 1 of 3
(5,290 Views)

Hi,

there are two ways to achieve this. You can either call OpenStore(filepath, pluginName) within your new DataPlugin to open a file with an existing DataPlugin.

After calling this method the data is not loaded to the Data Portal of DIAdem, but returns a Store object that allows you to access the data read by the specified DataPlugin.

The other way is to create a new DataPlugin and set the file reader to your existing DataPlugin. The automatically generated DataPlugin script shows how to handle the store object that is passed to the new DataPlugin.

 

FileReaderPlugin.png

Message 2 of 3
(5,261 Views)

Hi, I'll have to try this approach, for the time being I'm using this approach and it's working fine.

 

'Bring the correct plugin code to the global namespace of the running script.
		Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
		Dim ts : Set ts = fso.OpenTextFile(PluginPath & PluginCall.Item(Matches(0).Value), ForReading)
		Dim s : s = ts.ReadAll
		ts.Close
		ExecuteGlobal s
		'Loaded plugin to namespace we're ready to call Main on correspondent plugin code.

    Main File,Replace(Matches(0).Value,"_","") 'All plugins should have the parsing code on Main Sub.

 We're trying to create a dispatcher that'll handle a particular file type, but will call a different plugin to parse the code based on the file name.

0 Kudos
Message 3 of 3
(5,246 Views)