Home Image-Pro Automation (Macros, Apps, Reports)
Options

How can I get the DataCollector Statistics updated before exporting them to excel?

Hi there

I am working in a few macros to automate the measurement of fibre images. When I measure a few images and then collect the data, the statistics are not updated. The manual solution is to unclick and then click again in the statistics button, but within the macro that doesn't work.

Any advise would be highly appreciated.

Cheers!

Best Answer

  • Options
    Answer ✓
    Hi David,

    In your Finish macro I see only "Checked" command, which doesn't do anything if the data table is already shown. Try adding both "Unchecked" and "Checked" commands as in my RefreshDCStats macro.

    Yuri

Answers

  • Options
    David,

    When Data Collector table is visible, the stats are updated properly when data is collected, though they are not updated when the dialog is hidden (behind some other panels). The stats are also updated when the table is displayed, so you can either keep the table hidden during the batch and show it only in the end in "Run After" macro, before exporting the data, or hide and show the table to just to update it, like in this macro:

        Public Function RefreshDCStats() As SimpleScript
            RefreshDCStats = New SimpleScript
    
            With Measure.Data.Collector.Gadgets.DataTable(RefreshDCStats)
                .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Unchecked
                .Run()
            End With
    
            With Measure.Data.Collector.Gadgets.DataTable(RefreshDCStats)
                .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked
                .Run()
            End With
    
        End Function
    

    Yuri
  • Options
    Hi Yuri

    Thanks for your kind response. I have tested the explanation that you provided and it doesn't seem to agree with my observations. You can see below that I have the DataCollector on top, showing more than 300 data points collected from 3 recently measured samples and the statistics just below is counting 172 (from a previous sample).

    This happened even after adding the code you suggested into my finishing Macro:



    Any help would be highly appreciated. At the moment I have to manually update the statistics and then export to excel.

    Thanks a lot!

    David
Sign In or Register to comment.