spotRecordModel.setValue( "acquisition_time", recording.getAquisitionTime(), false ); //$NON-NLS-1$
spotRecordModel.updateDisplayName();
for( Iterator iterator = spotRecordModel.getFields().iterator(); iterator.hasNext(); )
{
final DataFieldModel dataFieldModel = (DataFieldModel)iterator.next();
if( dataFieldModel.getName().trim().equals( "Microscope" ) ) //$NON-NLS-1$
{
spotRecordModel.removeField( dataFieldModel );
}
}
// TODO: Work out why Microscope cannot be added.
// spotRecordModel.addChild( "Microscope", microscopeRecordModel, false ); //$NON-NLS-1$
// Add Results stub to this spot reading
final RecordModel resultRecordModel = recordModelFactory.createRecordModel( "Result" ); //$NON-NLS-1$
resultRecordModel.setValue( "results_file", recording.getName(), false ); //$NON-NLS-1$
resultRecordModel.updateDisplayName();
spotRecordModel.addChild( "Result", resultRecordModel, false ); //$NON-NLS-1$
spotRecordModel.updateDisplayName();
}
else if( deleteNonTrackedSpots )
{
final NavigationTreeNode parentNode = (NavigationTreeNode)spotNode.getParent();
final RecordModel parentRecordModel = parentNode.getRecordModel();
for( Iterator iterator = parentRecordModel.getFields().iterator(); iterator.hasNext(); )
{
final DataFieldModel dataFieldModel = (DataFieldModel)iterator.next();
if( dataFieldModel.getName().trim().equals( "SpotReading" ) ) //$NON-NLS-1$
{
if( dataFieldModel instanceof ListFieldModel )
{
final ListFieldModel listFieldModel = (ListFieldModel)dataFieldModel;
listFieldModel.removeChild( spotRecordModel );