Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CaptureHistory() instead of HistoryCarbonCopy #460

Open
Garados007 opened this issue Nov 10, 2023 · 4 comments
Open

Use CaptureHistory() instead of HistoryCarbonCopy #460

Garados007 opened this issue Nov 10, 2023 · 4 comments

Comments

@Garados007
Copy link
Member

We can use CaptureHistoryStart() and CaptureHistory() to capture all history output between the start of the capture and the current invocation. Igor can maintain multiple history captures at the same time and all we have to do is to remember the reference number returned by CatuptureHistoryStart() and provide it to CaptureHistory(). We can call CaptureHistory() multiple times and can stop a specific capture when there is no longer a need for it.

Function test()
	variable refNum = CaptureHistoryStart()
	print "Hello world!"
	
	string capture = CaptureHistory(refNum, 0) // 0 is to keep capture active
	print "🌲"
	print capture // should be "Hello world!"
	
	capture = CaptureHistory(refNum, 1) // 1 stops capture
	print capture // should be "Hello world!\n🌲\nHello world!"
End

We currently use a single notebook with the specific name HistoryCarbonCopy which contains magically all history output including the one there is no use for us (because its the output before the current test suite, test case, ...). We capture at the start and end of all test runs/suites/cases all historic output and create the desired string slices at the end of them.

I think we can improve our data collection when we use CaptureHistoryStart() and CaptureHistory() instead and do not rely on hidden magical notebooks.

@t-b
Copy link
Member

t-b commented Nov 10, 2023

Good idea, but right now IP6 does not support fancy things like CaptureHistoryStart/CaptureHistory.

@Garados007
Copy link
Member Author

Good idea, but right now IP6 does not support fancy things like CaptureHistoryStart/CaptureHistory.

That's a pity. There was nothing in the Igor documentation about when it was introduced. Maybe keep this in mind and come back when we decide to drop support for Igor 6.

@Garados007
Copy link
Member Author

Hmm. I started Igor 6 locally and I run the test code above. Apart from the unicode tree everything was fine:

grafik

And its also in the Igor 6 documentation.

@t-b
Copy link
Member

t-b commented Nov 10, 2023

Interesting, you are right it is present in IP6. So let's switch to that!

@t-b t-b added this to the Version 1.11 milestone Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants