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

Code review changes for new REFL gui #11064

Closed
1 task done
OwenArnold opened this issue Sep 9, 2014 · 1 comment
Closed
1 task done

Code review changes for new REFL gui #11064

OwenArnold opened this issue Sep 9, 2014 · 1 comment
Assignees
Labels
Reflectometry Issues and pull requests related to reflectometry
Milestone

Comments

@OwenArnold
Copy link
Contributor

This ticket is blocked by :

This ticket is blocks : TRAC10223

Nice work on 9371. Here are some changes i suggest from my code review.

  1. Missing : TODO : DESCRIPTION in headers

  2. No need for Code/Mantid/MantidQt/CustomInterfaces/src/IReflPresenter.cpp

  3. Mark slots as such in the implementation documentation for each. Makes them easier to read and identify what they relate to.

  4. Declare and initialise close to use in ReflLoadedMainViewPresenter::hasValidModel()

  5. CreateTransmissionWorkspaceAuto should not need the following. Just delete the lines and test that it still works (creating a transmission workspace)

algCreateTrans->setProperty("Params",HACKYPARAMS); //HACK FOR NOW
algCreateTrans->setProperty("StartOverlap",10.0); //HACK FOR NOW
algCreateTrans->setProperty("EndOverlap",12.0); //HACK FOR NOW
  1. Transmission workspaces should be called TRANS_{0} or TRANS_{0}_{1} where {0} and {1} should be substituted for run numbers of the transmission workspaces. See refl_gui.py

  2. Multiple definitions of the same type : class MockView : public ReflMainView

Instead, create a MockObjects.h and put in the test directory. Include it where needed, but don't add to cmake test list.

  1. Tests are hard to read (not your fault)
  • Use TSM_ASSERT where possible, as this provides the ability to write a custom message explaining what the assertion is actually checking.
  • Comment each derived class from ReflMainView in the tests. Explain what it is being used for.
  • Evaluate the need for so many Fake types. Add ones that are really needed, and could be shared to the aforementioned MockObjects.h. Better to refactor the code in such a way that Fakes are not needed altogether.
  1. Created Tranmsission workspaces (see 7) should not be deleted at the end of processing.

  2. Add a bold Prototoype label to the GUI. I don't want users accidently picking this up at this stage.

'''Things to think about, but not necessarily correct:'''

Might be better to inject a new object rather than create one in an opaque fashion. For example QtReflMainView::setNew()

QtReflMainView::getFlag() has unsafe behaviour equivalent to pop found on many containers. Method has two responsibilities. What should happen if
it fails to achieve one or the other of the responsibilities. What happens if another instance of getFlag is run from another thread at the same time?
Is it better that the view clears the flags, or that the presenter commands it?

Algorithm execution should keep workspaces out of the ADS until required otherwise. Use setChild(true) on the algorithms. For example of misuse see ReflMainViewPresenter::processRow()

@OwenArnold
Copy link
Contributor Author

This issue was originally trac ticket 10222

@OwenArnold OwenArnold added the Reflectometry Issues and pull requests related to reflectometry label Jun 3, 2015
@OwenArnold OwenArnold added this to the Release 3.3 milestone Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reflectometry Issues and pull requests related to reflectometry
Projects
None yet
Development

No branches or pull requests

2 participants