Ticket #3709 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

MoveInstrumentComponent & RotateInstrumentComponent code duplication

Reported by: Russell Taylor Owned by: Karl Palmen
Priority: minor Milestone: Release 2.0
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Anders Markvardsen

Description

As well as being duplicated between the 2 algorithms, aren't the findByID() & findByName() methods duplicating functionality that's available on Geometry classes?

Change History

comment:1 Changed 9 years ago by Russell Taylor

  • Owner set to Anyone
  • Status changed from new to assigned
  • Milestone changed from Iteration 30 to Iteration 31

comment:2 Changed 9 years ago by Anders Markvardsen

  • Owner changed from Anyone to Karl Palmen

comment:3 Changed 9 years ago by Karl Palmen

A look at the code suggestes that the duplicated code should belong to the ICompAssembly or CompAssembly class.

comment:4 Changed 9 years ago by Karl Palmen

Further investigation shows that both the duplicate functions are private and findByName is never used. Instead I see a call of the getComponentByName member function of class Instrument.

I see that class instrument also has a member function called GetComponentByID. Further examination shows this is not used because its ID is a component ID, which is quite different from the detector ID used by findByID.

Now it seems that findByID could be replaced by getComponentByDetectorID of class instrument, using (almost) the same code.

comment:5 Changed 9 years ago by Russell Taylor

Instrument::getDetector retrieves a detector based on the detector ID that this algorithm is using.

comment:6 Changed 9 years ago by Karl Palmen

In [14955]:

Removed functions findByName and findByID from the MoveInstrumentComponent and RotateInstrumentComponent and replace calls of them by appropriate member functions of instrument. re #3709

comment:7 Changed 9 years ago by Karl Palmen

The appropriate function for findByName was already in use and the approprate function for findByID was getComponentByDetectorID, which was suggested by Russell.

comment:8 Changed 9 years ago by Karl Palmen

  • Status changed from assigned to accepted

comment:9 Changed 9 years ago by Karl Palmen

  • Status changed from accepted to verify
  • Resolution set to fixed

Resolved as stated last week.

comment:10 Changed 9 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:11 Changed 9 years ago by Anders Markvardsen

  • Status changed from verifying to closed

comment:12 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4556

Note: See TracTickets for help on using tickets.