Skip to content

Commit

Permalink
Merge branch 'tapdevel'
Browse files Browse the repository at this point in the history
First GAIA TAP developments.
  • Loading branch information
pwdraper committed Aug 8, 2014
2 parents 7d544f9 + f2f103f commit b1077fe
Show file tree
Hide file tree
Showing 37 changed files with 20,643 additions and 460 deletions.
14 changes: 13 additions & 1 deletion applications/gaia/gaia/generic/GaiaSkySearch.C
Expand Up @@ -119,7 +119,7 @@ public:
{"imgplot", &GaiaSkySearch::imgplotCmd, 1, 4},
{"info", &GaiaSkySearch::infoCmd, 1, 2},
{"namesvr", &GaiaSkySearch::namesvrCmd, 2, 2},
{"open", &GaiaSkySearch::openCmd, 1, 2},
{"open", &GaiaSkySearch::openCmd, 0, 2},
{"origin", &GaiaSkySearch::originCmd, 0, 2},
{"save", &GaiaSkySearch::saveCmd, 1, 5},
{"setequinox", &GaiaSkySearch::setequinoxCmd, 1, 1}
Expand Down Expand Up @@ -225,6 +225,18 @@ GaiaSkySearch::~GaiaSkySearch()
*/
int GaiaSkySearch::openCmd(int argc, char* argv[])
{
// Return if a catalogue is open if no args are given.
if ( argc == 0 ) {
if ( cat_ ) {
set_result( "1" );
}
else {
set_result( "0" );
}
return TCL_OK;
}


if ( cat_ ) {
delete cat_;
cat_ = NULL;
Expand Down
63 changes: 53 additions & 10 deletions applications/gaia/gaia/library/Gaia.tcl
Expand Up @@ -27,7 +27,7 @@
# Copyright:
# Copyright (C) 1998-2001 Central Laboratory of the Research Councils
# Copyright (C) 2006-2007 Particle Physics & Astronomy Research Council.
# Copyright (C) 2007-2009 Science and Technology Facilities Council.
# Copyright (C) 2007-2014 Science and Technology Facilities Council.
# All Rights Reserved.

# Licence:
Expand Down Expand Up @@ -2167,7 +2167,6 @@ itcl::class gaia::Gaia {
file copy -force $config_file ${backupname}
}
file copy -force $gaia_library/skycat2.0.cfg $config_file
puts "file copy -force $gaia_library/skycat2.0.cfg $config_file"

# Make a directory entry that accesses the old configs.
if { $backupname != "" } {
Expand Down Expand Up @@ -2599,10 +2598,10 @@ window gives you access to this."

# See if the given headers and row data specify a SIAP server.
# Need a accessURL field for that.
set accessURL [gaiavo::GaiaVOCatSIAP::getAccessURL $headers $row]
set accessURL [gaiavo::GaiaVOCat::getAccessURL $headers $row]
if { $accessURL != {} } {
set name [gaiavo::GaiaVOCatSIAP::getName $headers $row]
set id [gaiavo::GaiaVOCatSIAP::getIdentifier $headers $row]
set name [gaiavo::GaiaVOCat::getName $headers $row]
set id [gaiavo::GaiaVOCat::getIdentifier $headers $row]
gaiavo::GaiaVOCatSIAP $w_.siapquery\#auto \
-accessURL $accessURL \
-identifier $id \
Expand All @@ -2625,7 +2624,7 @@ window gives you access to this."
# Find and open the current list of servers.
set cone_file [vo_config_file_ GaiaConeServers.vot]

utilReUseWidget gaiavo::GaiaVOCatRegistry $w_.voregistry \
utilReUseWidget gaiavo::GaiaVOCatRegistry $w_.voregistrycone \
-catalog $cone_file \
-service CONE \
-title "Catalogue Cone search" \
Expand All @@ -2645,9 +2644,9 @@ window gives you access to this."

# See if the given headers and row data specify a Cone
# server. Need a accessURL field for that.
set accessURL [gaiavo::GaiaVOCatCone::getAccessURL $headers $row]
set accessURL [gaiavo::GaiaVOCat::getAccessURL $headers $row]
if { $accessURL != {} } {
set name [gaiavo::GaiaVOCatCone::getName $headers $row]
set name [gaiavo::GaiaVOCat::getName $headers $row]
gaiavo::GaiaVOCatCone $w_.conequery\#auto \
-accessURL $accessURL \
-shortname $name \
Expand All @@ -2660,12 +2659,56 @@ window gives you access to this."
}
}

# Open a dialog for querying TAP services.
public method vo_find_tap {} {
if { [gaia::GaiaVOTableAccess::check_for_gaiavo] } {

# Find and open the current list of servers.
set tap_file [vo_config_file_ GaiaTAPServers.vot]

utilReUseWidget gaiavo::GaiaVOCatRegistry $w_.voregistrytap \
-catalog $tap_file \
-service TAP \
-title "TAP server queries" \
-activate_cmd [code $this vo_query_tap_] \
-whole_operation 0 \
-help_file tap
} else {
error_dialog "No GAIA-VO extension is available" $w_
}
}

# Open a dialog for querying a TAP server.
protected method vo_query_tap_ {headers row} {
if { [gaia::GaiaVOTableAccess::check_for_gaiavo] } {

# See if the given headers and row data specify a TAP
# service. Need a URL resource for that.
set accessURL [gaiavo::GaiaVOCat::getAccessURL $headers $row]
if { $accessURL != {} } {
set name [gaiavo::GaiaVOCat::getName $headers $row]
gaiavo::GaiaVOTAP $w_.tap\#auto \
-accessURL $accessURL \
-shortname $name \
-gaia $this \
-title "$name TAP service" \
-help_file tapquery
} else {
warning_dialog "TAP service does not specify a resource URL" $w_
}
}
}

# Get a cached configuration file. If not present use builtin list.
protected method vo_config_file_ {name} {
set config_file [utilGetConfigFilename .skycat $name]
if { ! [::file exists $config_file] } {
# Use builtin defaults.
::file copy -force $::gaiavo_library/$name $config_file
# Use builtin defaults. If any.
if { [::file exists $::gaiavo_library/$name ] } {
::file copy -force $::gaiavo_library/$name $config_file
} else {
puts stderr "Warning: no $name configuation file located"
}
}
return $config_file
}
Expand Down
7 changes: 6 additions & 1 deletion applications/gaia/gaia/library/GaiaSearch.tcl
Expand Up @@ -873,11 +873,16 @@ itcl::class gaia::GaiaSearch {
set state disabled
}

# Cone Search.
# Cone search.
$w add_menuitem $m command "Query a VO catalog server..." \
{Find VO cone search servers and query for catalogs} \
-command [code $w vo_find_cone] -state $state

# TAP query.
$w add_menuitem $m command "Query a TAP service..." \
{Find TAP services and query} \
-command [code $w vo_find_tap] -state $state

# Add SIAP query dialogs
$w add_menuitem $m command "Query a VO image server..." \
{Find VO image servers and make requests for images} \
Expand Down
19 changes: 16 additions & 3 deletions applications/gaia/gaiavo/Makefile.in
Expand Up @@ -490,7 +490,7 @@ distdir:
#============================================================================

VOTable1.1.C: VOTable1.1.xsd
xsd cxx-tree --root-element VOTABLE \
xsdcxx cxx-tree --root-element VOTABLE \
--generate-serialization \
--namespace-map http://www.ivoa.net/xml/VOTable/v1.1=votable_11 \
--parser-regex '/VOTABLE/VOTABLE_read/' \
Expand All @@ -504,7 +504,7 @@ VOTable1.1.C: VOTable1.1.xsd

# Note no serialization support for this. Do not want to write these.
VOTable1.1_dns.C: VOTable1.1_dns.xsd
xsd cxx-tree --root-element VOTABLE \
xsdcxx cxx-tree --root-element VOTABLE \
--namespace-map '=votable_11_dns' \
--parser-regex '/VOTABLE/VOTABLE_read/' \
--generate-wildcard \
Expand All @@ -515,7 +515,7 @@ VOTable1.1_dns.C: VOTable1.1_dns.xsd
mv VOTable1.1_dns.hxx generic/VOTable1.1_dns.hxx

VOTable1.2.C: VOTable1.2.xsd
xsd cxx-tree --root-element VOTABLE \
xsdcxx cxx-tree --root-element VOTABLE \
--generate-serialization \
--namespace-map http://www.ivoa.net/xml/VOTable/v1.2=votable_12 \
--parser-regex '/VOTABLE/VOTABLE_read/' \
Expand All @@ -527,5 +527,18 @@ VOTable1.2.C: VOTable1.2.xsd
rm -f generic/VOTable1.2.hxx
mv VOTable1.2.hxx generic/VOTable1.2.hxx

VOTable1.3.C: VOTable1.3.xsd
xsdcxx cxx-tree --root-element VOTABLE \
--generate-serialization \
--namespace-map http://www.ivoa.net/xml/VOTable/v1.3=votable_13 \
--parser-regex '/VOTABLE/VOTABLE_read/' \
--serializer-regex '/VOTABLE/VOTABLE_write/' \
--generate-wildcard \
VOTable1.3.xsd
rm -f generic/VOTable1.3.C
mv VOTable1.3.cxx generic/VOTable1.3.C
rm -f generic/VOTable1.3.hxx
mv VOTable1.3.hxx generic/VOTable1.3.hxx

# Local dependencies.
VOTableWriteFunctions.o: ./generic/VOTableWriteFunctions.icc

0 comments on commit b1077fe

Please sign in to comment.