diff --git a/api/src/Page.php b/api/src/Page.php index 3fc366473..c9f293507 100644 --- a/api/src/Page.php +++ b/api/src/Page.php @@ -366,6 +366,9 @@ function auth($require_staff) { if (sizeof(array_intersect($vis, $this->visits))) $auth = True; + if ($this->user->hasPermission('all_dewars')) + // allow to see anything without an id or a visit + $auth = True; } // No id or visit, anyone ok to view diff --git a/api/src/Page/DC.php b/api/src/Page/DC.php index ec3d8619a..8999bd09c 100644 --- a/api/src/Page/DC.php +++ b/api/src/Page/DC.php @@ -1082,14 +1082,8 @@ function _chk_image() $images = array(); foreach (array('X1', 'X2', 'X3', 'X4') as $j => $im) { array_push($images, file_exists($dc[$im]) ? 1 : 0); - if ($im == 'X1') { - $ext = pathinfo($dc[$im], PATHINFO_EXTENSION); - $thumb = str_replace('.' . $ext, 't.' . $ext, $dc[$im]); - if ($this->staff && $this->has_arg('debug')) - $debug['snapshot_thumb'] = array('file' => $thumb, 'exists' => file_exists($thumb) ? 1 : 0); - if (file_exists($thumb)) - $sn = 1; - } + if ($im == 'X1' && file_exists($dc[$im])) + $sn = 1; unset($dc[$im]); } diff --git a/api/src/Page/Image.php b/api/src/Page/Image.php index 56925ae6d..5829aadb3 100644 --- a/api/src/Page/Image.php +++ b/api/src/Page/Image.php @@ -22,13 +22,13 @@ class Image extends Page 'thresh' => '\d', ); - public static $dispatch = array(array('/id/:id(/f/:f)(/n/:n)', 'get', '_xtal_image'), + public static $dispatch = array(array('/id/:id(/n/:n)', 'get', '_xtal_image'), array('/diff/id/:id(/f/:f)(/n/:n)', 'get', '_diffraction_image'), array('/di/id/:id(/thresh/:thresh)(/n/:n)', 'get', '_diffraction_viewer'), array('/cam/bl/:bl(/n/:n)', 'get', '_forward_webcam'), array('/oav/bl/:bl(/n/:n)', 'get', '_forward_oav'), array('/fa/fid/:id', 'get', '_fault_attachment'), - array('/ai/visit/:visit/aid/:aid(/n/:n)(/f/:f)', 'get', '_action_image'), + array('/ai/visit/:visit/aid/:aid(/n/:n)', 'get', '_action_image'), array('/dr/:drid', 'get', '_dewar_report_image'), array('/cr/:crid', 'get', '_container_report_image'), ); @@ -121,8 +121,6 @@ function _action_image() { INNER JOIN proposal p ON s.proposalid = p.proposalid WHERE r.robotactionid=:1 AND CONCAT(p.proposalcode, p.proposalnumber, '-', s.visit_number) LIKE :2", array($this->arg('aid'), $this->arg('visit'))); - //print_r($image); - if (!sizeof($image)) return; else $image = $image[0]; @@ -133,10 +131,9 @@ function _action_image() { if ($n < sizeof($images)) { $this->_browser_cache(); $ext = pathinfo($images[$n], PATHINFO_EXTENSION); - $file = $this->has_arg('f') ? $images[$n] : str_replace('.'.$ext, 't.'.$ext, $images[$n]); - if (file_exists($file)) { + if (file_exists($images[$n])) { $this->app->contentType('image/'.$ext); - readfile($file); + readfile($images[$n]); } else { $this->_error('Not found', 'That image is no longer available'); } @@ -161,11 +158,10 @@ function _xtal_image() { if ($n < sizeof($images)) { $ext = pathinfo($images[$n], PATHINFO_EXTENSION); - $file = $this->has_arg('f') ? $images[$n] : str_replace('.'.$ext, 't.'.$ext, $images[$n]); - if (file_exists($file)) { + if (file_exists($images[$n])) { $this->_browser_cache(); $this->app->contentType('image/'.$ext); - readfile($file); + readfile($images[$n]); } else { $this->_error('Not found', 'That image is no longer available'); diff --git a/api/src/Page/Imaging.php b/api/src/Page/Imaging.php index db495ba96..43c480859 100644 --- a/api/src/Page/Imaging.php +++ b/api/src/Page/Imaging.php @@ -407,8 +407,15 @@ function _get_inspections() 'STATE' => 'i.state', 'SCHEDULECOMPONENTID' => 'i.schedulecomponentid', 'MANUAL' => 'i.manual', - 'IMAGESSCORED' => 'imagesscored', 'CONTAINER' => 'c.code', + 'CONTAINERID' => 'i.containerid', + 'PROP' => 'prop', + 'VISIT_NUMBER' => 'ses.visit_number', + 'CONTAINERINSPECTIONID' => 'i.containerinspectionid', + 'INSPECTIONTYPE' => 'inspectiontype', + 'DURATION' => 'duration', + 'DWELL' => 'dwell', + 'AGE' => 'age', ); $dir = $this->has_arg('order') ? ($this->arg('order') == 'asc' ? 'ASC' : 'DESC') : 'ASC'; if (array_key_exists($this->arg('sort_by'), $cols)) @@ -439,11 +446,30 @@ function _get_inspections() $extc = ", ROUND(TIMESTAMPDIFF('MINUTE', min(i2.bltimestamp), i.bltimestamp)/(60*24),1) as delta, CONCAT(CONCAT(CONCAT(CONCAT(TO_CHAR(i.bltimestamp, 'HH24:MI DD-MM-YYYY'), ' (+'), ROUND(TIMESTAMPDIFF('HOUR', case when min(i2.bltimestamp) is not null then min(i2.bltimestamp) else i.bltimestamp end, i.bltimestamp)/24,1)), 'd) '), (case when i.manual=1 then '[Manual]' else (case when i.schedulecomponentid is null then '[Adhoc]' else '' end) end)) as title"; } - $inspections = $this->db->paginate("SELECT ROUND(TIMESTAMPDIFF('HOUR', i.bltimestamp, CURRENT_TIMESTAMP)/24,1) as age, ROUND(TIMESTAMPDIFF('MINUTE', i.scheduledtimestamp, i.bltimestamp)/(24*60),2) as dwell, c.code as container, CONCAT(p.proposalcode, p.proposalnumber) as prop, TO_CHAR(min(im.modifiedtimestamp), 'DD-MM-YYYY HH24:MI') as imagesscoredtimestamp, case when count(im.blsampleimageid) > 0 then 1 else 0 end as imagesscored, - TO_CHAR(i.scheduledtimestamp, 'DD-MM-YYYY HH24:MI') as scheduledtimestamp, sc.offset_hours, i.priority, i.state, i.schedulecomponentid, i.manual, img.name as imager, it.name as inspectiontype, i.containerinspectionid, i.containerid, i.inspectiontypeid, i.temperature, TO_CHAR(i.bltimestamp, 'DD-MM-YYYY HH24:MI') as bltimestamp, i.imagerid, CONCAT(p.proposalcode, p.proposalnumber, '-', ses.visit_number) as visit, ses.visit_number, TIMESTAMPDIFF('MINUTE', i.bltimestamp, i.completedtimestamp) as duration $extc + $inspections = $this->db->paginate("SELECT ROUND(TIMESTAMPDIFF('HOUR', i.bltimestamp, CURRENT_TIMESTAMP)/24,1) as age, + ROUND(TIMESTAMPDIFF('MINUTE', i.scheduledtimestamp, i.bltimestamp)/(24*60),2) as dwell, + c.code as container, + CONCAT(p.proposalcode, p.proposalnumber) as prop, + TO_CHAR(i.scheduledtimestamp, 'DD-MM-YYYY HH24:MI') as scheduledtimestamp, + sc.offset_hours, + i.priority, + i.state, + i.schedulecomponentid, + i.manual, + img.name as imager, + it.name as inspectiontype, + i.containerinspectionid, + i.containerid, + i.inspectiontypeid, + i.temperature, + TO_CHAR(i.bltimestamp, 'DD-MM-YYYY HH24:MI') as bltimestamp, + i.imagerid, + CONCAT(p.proposalcode, p.proposalnumber, '-', ses.visit_number) as visit, + ses.visit_number, + TIMESTAMPDIFF('MINUTE', i.bltimestamp, i.completedtimestamp) as duration + $extc FROM containerinspection i LEFT OUTER JOIN schedulecomponent sc ON sc.schedulecomponentid = i.schedulecomponentid - LEFT OUTER JOIN blsampleimage im ON im.containerinspectionid = i.containerinspectionid AND im.blsampleimagescoreid IS NOT NULL INNER JOIN inspectiontype it ON it.inspectiontypeid = i.inspectiontypeid INNER JOIN container c ON c.containerid = i.containerid LEFT OUTER JOIN imager img ON img.imagerid = i.imagerid @@ -456,6 +482,13 @@ function _get_inspections() GROUP BY i.containerinspectionid ORDER BY $order", $args); + foreach ($inspections as &$i) { + $args = array($i['CONTAINERINSPECTIONID']); + $scored = $this->db->pq("SELECT case when count(im.blsampleimageid) > 0 then 1 else 0 end as imagesscored + FROM blsampleimage im + WHERE im.containerinspectionid=:1 AND im.blsampleimagescoreid IS NOT NULL", $args); + $i['IMAGESSCORED'] = $scored[0]['IMAGESSCORED']; + } if ($this->has_arg('iid')) { if (!sizeof($inspections)) diff --git a/api/src/Page/Proposal.php b/api/src/Page/Proposal.php index 72566b138..ab719e2e7 100644 --- a/api/src/Page/Proposal.php +++ b/api/src/Page/Proposal.php @@ -170,6 +170,8 @@ function _get_proposals($id = null) $where .= " AND (shp.personid=:" . (sizeof($args) + 1) . " OR s.beamlinename in ('" . implode("','", $bls) . "'))"; array_push($args, $this->user->personId); } + } else if ($this->user->hasPermission('all_dewars')) { + // allow to see shipments on all proposals } else { $where = " INNER JOIN session_has_person shp ON shp.sessionid = s.sessionid " . $where; $where .= " AND shp.personid=:" . (sizeof($args) + 1); @@ -921,6 +923,8 @@ function _lookup() $where .= " AND ses.beamlinename in ('" . implode("','", $bls) . "')"; } + } else if ($field == 'SHIPPINGID' && $this->user->hasPermission('all_dewars')) { + // allow to see shipments } else { $where = " INNER JOIN session_has_person shp ON shp.sessionid = ses.sessionid " . $where; $where .= " AND shp.personid=:" . (sizeof($args) + 1); diff --git a/api/src/Page/Shipment.php b/api/src/Page/Shipment.php index 821b73117..1b069a851 100644 --- a/api/src/Page/Shipment.php +++ b/api/src/Page/Shipment.php @@ -1973,7 +1973,7 @@ function _get_all_containers() array_push($args, $start); array_push($args, $end); - $order = 'c.bltimestamp DESC'; + $order = 'c.containerid DESC'; if ($this->has_arg('ty')) { if ($this->arg('ty') == 'todispose') { diff --git a/client/src/js/app/components/header.vue b/client/src/js/app/components/header.vue index ec412d0e4..c9d91de97 100644 --- a/client/src/js/app/components/header.vue +++ b/client/src/js/app/components/header.vue @@ -50,7 +50,6 @@
diff --git a/client/src/js/modules/assign/views/assign.js b/client/src/js/modules/assign/views/assign.js index a5c619720..5b8df9f16 100644 --- a/client/src/js/modules/assign/views/assign.js +++ b/client/src/js/modules/assign/views/assign.js @@ -301,6 +301,7 @@ define(['marionette', 'backbone', 'views/pages', templateHelpers: function() { return { VISIT: this.getOption('visit').toJSON(), + APP_TYPE: app.type, } }, diff --git a/client/src/js/modules/assign/views/selectvisit.js b/client/src/js/modules/assign/views/selectvisit.js index 66f679fbc..34249a362 100644 --- a/client/src/js/modules/assign/views/selectvisit.js +++ b/client/src/js/modules/assign/views/selectvisit.js @@ -19,7 +19,13 @@ define(['marionette', 'templates/assign/selectvisit.html'], function(Marionette, className: 'content', childView: VisitView, childViewContainer: 'ul.visits', - emptyView: EmptyView + emptyView: EmptyView, + + templateHelpers: function() { + return { + APP_TYPE: app.type, + } + }, }) diff --git a/client/src/js/modules/dc/views/gridplot.js b/client/src/js/modules/dc/views/gridplot.js index 40305d640..fd70a0ff6 100644 --- a/client/src/js/modules/dc/views/gridplot.js +++ b/client/src/js/modules/dc/views/gridplot.js @@ -158,9 +158,9 @@ define(['jquery', 'marionette', opts.push('') if (i === 1) { // show button to view image full size - this.ui.sns.append('') + this.ui.sns.append('') } else { - this.ui.sns.append('') + this.ui.sns.append('') } } } @@ -171,7 +171,7 @@ define(['jquery', 'marionette', loadImage: function() { var n = this.ui.ty3.val() - this.snapshot.load(app.apiurl+'/image/id/'+this.getOption('ID')+'/f/1/n/'+n) + this.snapshot.load(app.apiurl+'/image/id/'+this.getOption('ID')+'/n/'+n) }, toggleFluo: function() { @@ -270,7 +270,7 @@ define(['jquery', 'marionette', if (m.get('SNS')[this.getOption('snapshotId')] && !this.hasSnapshot) { this.snapshotLoading = true this.$el.addClass('loading') - this.snapshot.load(app.apiurl+'/image/id/'+this.getOption('ID')+'/f/1') + this.snapshot.load(app.apiurl+'/image/id/'+this.getOption('ID')) } } }, diff --git a/client/src/js/modules/dc/views/imagestatusitem.js b/client/src/js/modules/dc/views/imagestatusitem.js index dbbc757cb..774e8c68c 100644 --- a/client/src/js/modules/dc/views/imagestatusitem.js +++ b/client/src/js/modules/dc/views/imagestatusitem.js @@ -69,7 +69,7 @@ define(['marionette', var sns = '' for (var i = 1; i < this.model.get('SNS').length; i++) { if (this.model.get('SNS')[i]) { - sns += ('') + sns += ('') } } @@ -91,4 +91,4 @@ define(['marionette', }, }) -}) \ No newline at end of file +}) diff --git a/client/src/js/modules/samples/components/sample-group-create-and-edit.vue b/client/src/js/modules/samples/components/sample-group-create-and-edit.vue index 613601823..7f8ade6d6 100644 --- a/client/src/js/modules/samples/components/sample-group-create-and-edit.vue +++ b/client/src/js/modules/samples/components/sample-group-create-and-edit.vue @@ -71,6 +71,7 @@ v-else-if="selectedContainerType.NAME && selectedContainerType.NAME.toLowerCase() !== 'puck'" :container-type="selectedContainerType" :valid-samples="validSamples" + :manually-selected-samples="manuallySelectedSamples" :container-identifier="selectedContainerName" color-attribute="VALID" added-color-attribute="ADDED" @@ -218,11 +219,14 @@ export default { validSamples() { if (this.selectedContainerId) { const selectedContainer = this.selectedSamplesInGroups[this.selectedContainerId] || [] - const difference = differenceBy(selectedContainer, this.selectedContainerAddedSamples, 'BLSAMPLEID') - return [...this.selectedContainerAddedSamples, ...difference] + const uniqueSelectedContainer = uniqBy(selectedContainer.concat(this.selectedContainerAddedSamples), 'BLSAMPLEID') + return uniqueSelectedContainer } return [] + }, + manuallySelectedSamples() { + return this.selectedSamplesInGroups[this.selectedContainerId] || [] } }, created: function () { diff --git a/client/src/js/modules/shipment/components/plate-view.vue b/client/src/js/modules/shipment/components/plate-view.vue index 7c7b57e38..4962b3bdc 100644 --- a/client/src/js/modules/shipment/components/plate-view.vue +++ b/client/src/js/modules/shipment/components/plate-view.vue @@ -76,6 +76,10 @@ export default { type: Array, default: () => ([]) }, + manuallySelectedSamples: { + type: Array, + default: () => ([]) + }, addedColorAttribute: { type: String, default: '' @@ -425,7 +429,7 @@ export default { } } else { - if (this.selectedDrops.includes(itemsWithSample[0])) { + if (this.manuallySelectedSamples.some(e => Number(e.LOCATION) === itemsWithSample[0])) { this.$emit('unselect-cell', itemsWithSample) this.currentSelectedDropIndex = -1 } @@ -625,4 +629,4 @@ export default { .pointer { cursor: pointer } - \ No newline at end of file + diff --git a/client/src/js/modules/shipment/views/shipment.js b/client/src/js/modules/shipment/views/shipment.js index 489df144c..7c4bf7842 100644 --- a/client/src/js/modules/shipment/views/shipment.js +++ b/client/src/js/modules/shipment/views/shipment.js @@ -146,16 +146,23 @@ define(['marionette', showDewar: function(did, force) { if (did == this.lastDewarID && !force) return - this.$el.find('.dewar_name').text(this.dewars.findWhere({ DEWARID: did }).get('CODE')) - if (app.proposal && app.proposal.get('ACTIVE') == '1') this.$el.find('.add_container').html(' Add Container') + if (app.proposal && app.proposal.get('ACTIVE') == '1') { + if (app.type == "xpdf"){ + this.$el.find('.add_container').html(' Add Puck') + this.$el.find('.add-container-small').prop('title', 'Click to add a puck') + this.$el.find('.add-container-text').text('Add Puck') + } else { + this.$el.find('.add_container').html(' Add Container') + } + } this.dewarcontent.dewarID = did this.dewarcontent.fetch() this.dewarhistory.id = did this.dewarhistory.fetch() var d = this.dewars.findWhere({ DEWARID: did }) - if (d && (d.get('TRACKINGNUMBERTOSYNCHROTRON') || d.get('TRACKINGNUMBERTOSYNCHROTRON'))) { + if (d && (d.get('TRACKINGNUMBERTOSYNCHROTRON') || d.get('TRACKINGNUMBERFROMSYNCHROTRON'))) { this.dewartracking.queryParams.DEWARID = did this.dewartracking.fetch() @@ -163,9 +170,8 @@ define(['marionette', this.dewartracking.ORIGIN = 'N/A' this.dewartracking.DESTINATION = 'N/A' this.dewartracking.reset() - - this.lastDewarID = did } + this.lastDewarID = did }, refreshDewar: function() { diff --git a/client/src/js/modules/submission/views/conexs-submission.vue b/client/src/js/modules/submission/views/conexs-submission.vue index 30524aebf..d04784152 100644 --- a/client/src/js/modules/submission/views/conexs-submission.vue +++ b/client/src/js/modules/submission/views/conexs-submission.vue @@ -109,66 +109,30 @@

If you publish calculation results performed with ORCA code please cite the original papers:

F. Neese, Wiley Interdisciplinary Reviews: Computational Molecular Science 2, 73 (2012).

F. Neese, Wiley Interdisciplinary Reviews: Computational Molecular Science 8, e1327 (2018).

-
-

- In general, the input file is a free format ASCII file and can contain one or more keyword lines that start with a - "!" sign, one or more input blocks enclosed between an "%" sign and "end" that provide finer control over specific - aspects of the calculation, and finally the specification of the coordinates for the system along with the charge and - multiplicity provided either with a %coords block, or more usually enclosed within two "*" symbols. Here is an - example of a simple input file that contains all three input elements: -

-
- -

! BLYP DKH2 def2-SVP def2/J SlowConv NoFinalGrid # This is a comment

-
- -

%maxcore 5024 # global scratch memory limit (in MB) per processing core.

-
- -

%pal nprocs 4 # requested number of CPUs

- end

- - * xyz 0 1 +

Performing X-Ray Spectral Calculations with ORCA

+

+

For X-Ray Absorption Spectroscopy (XAS) calculations, we use the Time-Dependent Density Functional Theory (TD-DFT) approach.

+

In TD-DFT we must define the set of donor (core) and acceptor (empty) orbitals using the Orbital Window parameter orbwin[0] (and orbWin[1] in an open shell system), which defines the range of orbitals included in the calculation of the transitions. The 1s orbital is usually the lowest energy orbital and so has the index 0. We can specify the all of the empty orbitals using the flag -1 so:


- C   0.0   0.0   0.0 +

orbwin[0] 0, 0, -1, -1


- O   0.0   0.0   1.13 +

requests a calculation of the transitions (or roots) between the 0 index orbital (1s) and all of the empty orbitals. If you require a transition from a 1s orbital that is not the lowest index orbital, search for the appropriate index in the output file under the section ORBITAL ENERGIES and use this in place of “0, 0”


- * -

- -

- The input may contain several blocks, which consist of logically related data that can be user controlled. The program tries to choose sensible default values for all of these variables. - However, it is impossible to give defaults that are equally sensible for all systems. In general the defaults are slightly on the conservative side and more aggressive cutoffs etc. can - be chosen by the user and may help to speed things up for actual systems or give higher accuracy if desired. One-liner explanation (starts with !, order of the keywords is not important) -

+

Two other parameters important for the calculation of the XAS spectrum are doquad, which when set to true, tells ORCA to compute quadrupole-allowed transitions and nroots which determines the number of transitions to compute. A higher value of nroot corresponds to increasingly higher energy transitions.


- -

!Keywords Functional Hamiltonian BasisSet AuxBasisSet

+

The main ORCA TD-DFT program computes a set of discrete transition energies and oscillator strengths. A post-processing tool orca_mapspc translates ORCA output files into plottable spectra. The post-processing tool is used to prepare many different spectra, for the XAS spectrum you can use the options ABSQ and XASQ for quadrupole inclusive spectra.


- -

BLYP   - generalized gradient approximation (GGA) DFT functional; see Table 6.2: Density functionals available in ORCA.

-

DKH2   - scalar relativistic Douglas-Kroll-Hess Hamiltonian of 2nd order; see Table 6.2: Density functionals available in ORCA.

-

def2-SVP   - basis set for H-Rn; see Table 9.8: Basis sets availability.

-

def2/J   - Coulomb-fitting auxiliary basis sets (AuxJ); see Table 9.8: Basis sets availability.

-

UKS   - selects spin unrestricted SCF method; Table 6.1: Main keywords that can be used in the simple input of ORCA.

-

RKS   - selects restricted closed-shell SCF method.

-

SlowConv   - selects appropriate SCF converger criteria for difficult cases. Most transition metal complexes fall into this category.

-

NoFinalGrid   - turns the final integration grid feature off.

+

The spectrum can be plotted within a given energy range and with a given (Gaussian) broadening to approximate the core-hole lifetime broadening effects.

+

+

A note on the computation of XES spectra:


- - -

Reading geometry from file.xyz in XMol format with coordinates in Ångström and a 2-line header that contains the number of atoms and a description line:

+

In XES mode, Web-CONEXS sets the acceptor core orbitals (final state) to the lowest energy orbitals through the keyword “CoreOrb 0,1”. In some cases, the final state could be to higher energy orbitals.


- -

4

-

description line

-

C   0.000000000   0.000000000   0.000000000

-

O   2.362157486   0.000000000   0.000000000

-

H   -1.109548835   1.774545300   0.000000000

-

H   -1.109548835   -1.774545300   0.000000000

+

In this instance, the user must manually modify the core acceptor orbital within the input file. To do so, navigate to the ORBITAL ENERGIES section of the orca_result.txt and identify the index of the orbital with the correct energy. Using a plain text editor, update the “CoreOrb” keyword with the index of the desired orbital. You can run this calculation on your own computing facility or upload the new input file to Web-CONEXS for simulation.


+

The post processing tool orca_mapspc can be used to covert the main ORCA output into a plottable spectrum. For XES you can use either the XES or XESQ options to compute the spectrum with or without quadrupole transitions.

+