<& /htmlheader &>

<& modelheader &>
<h2>Derived Object History<br>
Object <% $do->objectName %> (<% $do->derivedobjectId %>)<br>
</h2>
<a href="/model/<% $model %>/dotimeline.html?derivedobjectId=<% $do->derivedobjectId %>">Timeline</a><br>
<a href="/model/<% $model %>/dodets.html?objectName=<% $do->objectName %>">Detections</a><br>
<a target=_blank" href="mpcheck.html?objectName=<% $do->objectName %>">MP Check</a>
<p>

% my $histcomp;
% foreach my $h (sort { $a->eventTime <=> $b->eventTime } @{$events}) {
% $histcomp = 'hist' . $h->eventType;   # history component name
<& $histcomp, event => $h &>
<p height=10>
% }

<& /htmlfooter &>

<%args>
$derivedobjectId => undef
$objectName => undef
$ssmObjectName => undef
</%args>

<%init>
# Display a table of tracklets/detection history data for specified field ID.
use PS::MOPS::DC::History;
use PS::MOPS::DC::DerivedObject;
my $inst = $m->notes('INST');
my $model = $m->notes('MODEL');
my $do;

if ($objectName) {
    $do = modcdo_retrieve($inst, objectName => $objectName);
}
else {
    $do = modcdo_retrieve($inst, derivedobjectId => $derivedobjectId);
}
my $events = modch_retrieve($inst, derivedobjectId => $do->derivedobjectId);
</%init>
