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

Skyline: Improve code for finding Thermo method export DLLs #3352

Merged
merged 18 commits into from
Mar 8, 2025

Conversation

brendanx67
Copy link
Contributor

  • Thermo reported this code as failing on an Ascend at Thermo
  • This code was written after a full review of 7 machines in the MacCoss lab and the Ascend at Thermo to do a more complete job of finding the necessary DLLs
  • More recent machines have added Thermo.TNG.MethodXMLInterface2.dll to support Adaptive RT so it needs to be copied if it is found
  • Added a fairly thorough unit test for this more complicated new code to make sure it works as expected and stays working

- Thermo reported this code as failing on an Ascend at Thermo
- This code was written after a full review of 7 machines in the MacCoss lab and the Ascend at Thermo to do a more complete job of finding the necessary DLLs
- More recent machines have added Thermo.TNG.MethodXMLInterface2.dll to support Adaptive RT so it needs to be copied if it is found
- Added a fairly thorough unit test for this more complicated new code to make sure it works as expected and stays working
brendanx67 and others added 13 commits January 31, 2025 07:22
- but also turn off DLL copying, since Thermo feels this should not be necessary and the variety of DLLs we are seeing is not their intention.
- easier to test DLL combinations when this code is turned off
- made it possible to have just "Thermo" as a method type where Skyline auto-detects the instrument form the registry
…ProteoWizard/pwiz into Skyline/work/20250130_thermo_dll_finder
…ProteoWizard/pwiz into Skyline/work/20250130_thermo_dll_finder
- added error message testing in the ExportMethodDlg
@brendanx67
Copy link
Contributor Author

I think this is ready to go. I will do another round of live testing tomorrow in the lab, but I am not expecting any surprises. It is pretty well tested. Would appreciate at least one code review before merging.

@nickshulman
Copy link
Contributor

On my desktop computer my registry looks like this:
image
The ProgramPath is the relative path "System\Programs\dependencies\tng" which actually seems to refer to the path "C:\Program Files\Thermo Scientific\Instruments\Astral\1.1\System\Programs\dependencies\tng".

There was a support request from a user last year who also had a relative path in the registry:
https://skyline.ms/announcements/home/support/thread.view?rowId=63895

They apparently were able to fix their problem by changing the relative path in the registry to an absolute path.

The error message I got was:
image

Does Skyline have enough information to figure out how to turn the relative path into an absolute path?
If it were to look in the correct absolute path it would find the dll's it's looking for.

@brendanx67
Copy link
Contributor Author

brendanx67 commented Mar 7, 2025 via email

@brendanx67
Copy link
Contributor Author

I don't think we are going to fix that problem in this PR. I like that the error message is pretty clear for it. None of the instruments in the MacCoss lab have this issue. If you can reproduce how you ended up with your registry looking like this, we should report it to Thermo, but is may already be fixed on their end.

@nickshulman
Copy link
Contributor

nickshulman commented Mar 7, 2025

I don't think we are going to fix that problem in this PR.

Sounds good. I could not find anything in my registry that could be used to figure out that "C:\Program Files\Thermo Scientific\Instruments\Astral\1.1"

@brendanx67
Copy link
Contributor Author

Any other thoughts on this PR before I merge to master?

Copy link
Contributor

@nickshulman nickshulman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

private class ProgramPath
{
public string Path;
public bool IsFull;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably should be called "IsFullInstall" because otherwise it sure sounds like it means "IsFullPath" given the class it's in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Changed to IsFullInstall and added comments.

{
string selectionType = GetSelectedInstrument(instrumentType);
if (listTypes.Contains(selectionType) && GetInstrumentTypeFromSelection(selectionType, true) != null)
InstrumentType = listTypes.FirstOrDefault(typeName => typeName.Equals(instrumentType));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is a little confusing, because there's "instrumentType", "selectionType" and whatever "GetInstrumentTypeFromSelection(selectionType)" returns.

This particular line is equivalent to:
InstrumentType = listTypes.Contains(instrumentType) ? instrumentType : null;

Is that what you intended? (it probably is)
Just wanted to make sure this code is doing what you expect it to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Good point. I could barely understand it myself, and I am not sure it worked correctly. I have added a bunch of comments, and several tests of the initial selection of the Instrument type combo box, and also improved the code to work exactly the way I was expecting it to, after debug stepping through it during the tests.

@brendanx67 brendanx67 merged commit 73af77a into master Mar 8, 2025
11 checks passed
@brendanx67 brendanx67 deleted the Skyline/work/20250130_thermo_dll_finder branch March 8, 2025 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants