You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* LIMS-849: Improve view of data collection groups
* LIMS-849: Add 'stacking' effect for data collection groups
* LIMS-849: Make link to group bold
* LIMS-849: Change cursor to spinner while processing results load
---------
Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
Copy file name to clipboardExpand all lines: api/src/Page/DC.php
+43-51Lines changed: 43 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -458,8 +458,7 @@ function _data_collections($single = null)
458
458
dc.c2lens,
459
459
dc.objaperture,
460
460
dc.magnification,
461
-
dose.total as totaldose,
462
-
CAST(dc.totalabsorbeddose AS DECIMAL(5, 2)) as totalabsdose,
461
+
dc.totalabsorbeddose as totaldose,
463
462
d.detectorpixelsizehorizontal,
464
463
d.detectorpixelsizevertical,
465
464
d.detectormanufacturer,
@@ -539,6 +538,12 @@ function _data_collections($single = null)
539
538
array_push($args, $this->arg('dcg'));
540
539
}
541
540
} else {
541
+
$groupby = 'GROUP BY dc.datacollectiongroupid';
542
+
$numimgs = 'totals.numimg';
543
+
if ($this->has_arg('expandgroups')) {
544
+
$groupby = 'GROUP BY dc.datacollectionid';
545
+
$numimgs = 'dc.numberofimages as numimg';
546
+
}
542
547
$fields = "count(distinct dca.datacollectionfileattachmentid) as dcac,
543
548
if(dca.fileType='recip',1,0) as recip,
544
549
count(distinct dcc.datacollectioncommentid) as dccc,
@@ -569,7 +574,7 @@ function _data_collections($single = null)
569
574
min(dc.resolution) as resolution,
570
575
min(dc.exposuretime) as exposuretime,
571
576
min(dc.axisstart) as axisstart,
572
-
min(dc.numberofimages) as numimg,
577
+
$numimgs,
573
578
TO_CHAR(min(dc.starttime), 'DD-MM-YYYY HH24:MI:SS') as st,
574
579
min(dc.transmission) as transmission,
575
580
min(dc.axisrange) as axisrange,
@@ -596,12 +601,11 @@ function _data_collections($single = null)
596
601
max(dc.c2lens) as c2lens,
597
602
max(dc.objaperture) as objaperture,
598
603
max(dc.magnification) as magnification,
599
-
dose.total as totaldose,
600
-
CAST(dc.totalabsorbeddose AS DECIMAL(5, 2)) as totalabsdose,
601
-
max(d.detectormanufacturer) as detectormanufacturer,
602
-
max(d.detectormodel) as detectormodel,
604
+
totals.totaldose as totaldose,
603
605
max(d.detectorpixelsizehorizontal) as detectorpixelsizehorizontal,
604
606
max(d.detectorpixelsizevertical) as detectorpixelsizevertical,
607
+
max(d.detectormanufacturer) as detectormanufacturer,
608
+
max(d.detectormodel) as detectormodel,
605
609
max(TIMESTAMPDIFF('MINUTE', dc.starttime, CURRENT_TIMESTAMP)) as age,
606
610
max(dc.numberofpasses) as numberofpasses,
607
611
max(dc.c1aperture) as c1aperture,
@@ -626,11 +630,7 @@ function _data_collections($single = null)
626
630
max(ses.archived) as archived,
627
631
max(ses.purgedProcessedData) as purgedProcessedData,
628
632
IFNULL(max(dc.rotationaxis), 'Omega') as rotationaxis,
629
-
dc.detector2theta";
630
-
$groupby = "GROUP BY dc.datacollectiongroupid";
631
-
if ($this->has_arg('expandgroups')) {
632
-
$groupby = "GROUP BY dc.datacollectionid";
633
-
}
633
+
min(dc.detector2theta) as detector2theta";
634
634
}
635
635
636
636
// We don't want to remove duplicates, since if two counts are equal, one might go uncounted
@@ -687,8 +687,8 @@ function _data_collections($single = null)
687
687
FROM datacollection dc
688
688
INNER JOIN datacollectiongroup dcg ON dcg.datacollectiongroupid = dc.datacollectiongroupid
689
689
INNER JOIN (
690
-
select datacollectiongroupid, sum(totalabsorbeddose) as total from datacollection group by datacollectiongroupid) dose
691
-
ON dc.datacollectiongroupid = dose.datacollectiongroupid
690
+
select datacollectiongroupid, sum(totalabsorbeddose) as totaldose, sum(numberofimages) as numimg from datacollection group by datacollectiongroupid) totals
691
+
ON dc.datacollectiongroupid = totals.datacollectiongroupid
692
692
INNER JOIN blsession ses ON ses.sessionid = dcg.sessionid
693
693
LEFT OUTER JOIN experimenttype et on dcg.experimenttypeid = et.experimenttypeid
694
694
$sample_joins[0]
@@ -782,7 +782,6 @@ function _data_collections($single = null)
782
782
0,
783
783
0,
784
784
0,
785
-
0,
786
785
ses.beamlinename as bl,
787
786
es.blsubsampleid,
788
787
'',
@@ -879,7 +878,6 @@ function _data_collections($single = null)
879
878
0,
880
879
0,
881
880
0,
882
-
0,
883
881
ses.beamlinename as bl,
884
882
xrf.blsubsampleid,
885
883
'',
@@ -976,7 +974,6 @@ function _data_collections($single = null)
$dcg = $this->db->pq("SELECT datacollectiongroupid as dcg FROM datacollection WHERE datacollectionid=:1", array($id));
1452
-
if (!sizeof($dcg)) $this->error('No such data collection');
1453
-
$dcids = $this->db->pq("SELECT datacollectionid as id FROM datacollection WHERE datacollectiongroupid=:1", array($dcg[0]['DCG']));
1454
-
$where = array();
1455
-
$args = array();
1456
-
foreach ($dcids as $i => $id) {
1457
-
//array_push($where, ':'.($i+1));
1458
-
array_push($where, $id['ID']);
1459
-
//array_push($args, $id['ID']);
1460
-
}
1461
-
$where = implode($where, ', ');
1462
-
*/
1463
-
1464
-
/*$tot = $this->db->pq("SELECT count(im.imagenumber) as tot
1465
-
FROM image im
1466
-
INNER JOIN imagequalityindicators imq ON imq.imageid = im.imageid AND (im.datacollectionid IN ($where))
1467
-
ORDER BY imagenumber", $args);
1468
-
$int = intval($tot[0]['TOT'] / 250);
1469
-
array_push($args, $int);*/
1470
-
1471
-
#im.datacollectionid=:1
1472
-
$imqs = $this->db->pq("SELECT imq.imagenumber as nim, imq.method2res as res, imq.spottotal as s, imq.totalintegratedsignal, imq.goodbraggcandidates as b, imq.dozor_score as d
0 commit comments