Variable into data collector
Hi,
Is there a way to get a variable I have filled in a sub (for instance a corrected number of objects) into the data collector table?
I tried a few things but without success so far (e.g. parsing a System.Double from a function into the expression of Region:Area(count)
Thanks
Daniel
0
Best Answer
-
Hi Daniel,
Nikita's example is a good start, but if you need more details I've attached an app that demonstrated how to control Data Collector. Check the app's code to see how it works.
Regards,
Yuri
0
Answers
-
Hi Daniel,
I think, this example will help you. What I did:
1) Added user defined measurement "MyTest" (double) into the "Image" table without expression,
2) Collect the data into the Data Collector (now, you have a row in the Image table, "MyTest" value is empty)
3) Run macro Set_Value_in_DataCollector (this macro will set value in the last row)Public Function Set_Value_in_DataCollector() As SimpleScript Set_Value_in_DataCollector = New SimpleScript Dim ds With Measure.Data.CollectorCommands.GetData(Set_Value_in_DataCollector) .Run(ds)'get DataCollector data set End With With Automate.ScriptingCommands.CodeCommand(Set_Value_in_DataCollector) If .Run() Then ' User Code Here Dim ds2 As System.Data.DataSet = ds Dim dt As System.Data.DataTable = ds2.Tables("Image")'get table Dim dr As System.Data.DataRow = dt.Rows.Item(dt.Rows.Count-1)'get last row dr.Item("MyTest")=123.456'set value End If End With End Function
Thanks,
Nikita.
0 -
Thanks to both of you!0
-
Hi Nikita,
I tried your solution for Measurement Stats data table and a table column "Corrected Count", however it tells me that it does not belong to the data table (although there). So could you specify "1) Added user defined measurement "MyTest" (double) into the "Image" table without expression" a bit more concrete?
Hi Yuri,
Could not find an attached app. Is there a link?
Thx
Daniel
0 -
Hi Daniel,
I'm attaching it again (it looks like when the answer is marked as Accepted, the attachment disappears).
Yuri0 -
-
Yes - sorry and thx. I'll remember.0
-
Hi Daniel,
You can add the user defined measurements into the regular tables:
The stats table generated automatically and I'm not sure you have any access to it.
Thanks,
Nikita.0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions