aboutsummaryrefslogtreecommitdiff
path: root/vendor/voclient/libsamp/_samp
blob: 9693b9d29d37c9ff6ff3a5de2bf4785da319b725 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101


SMAP Methods:
=============

  Hub
  ---
               map reg-info = register  ()

                       declareMetadata  (map metadata)
            map metadata = getMetadata  (string client-id)
                  declareSubscriptions  (map subscriptions)
  map subscriptions = getSubscriptions  (string client-id)
list client-ids = getRegisteredClients  ()
map client-subs = getSubscribedClients  (string mtype)

                        notify  (string recip-id, map message)
    list recip-ids = notifyAll  (map message)
          string msg-id = call  (string recip-id, string msg-tag, map message)
           map calls = callAll  (string msg-tag, map message)
    map response = callAndWait  (string recip-id, map message, string timeout)
                         reply  (string msg-id, map response)


  Client
  ------
      receiveNotification  (string sender-id, map message)
              receiveCall  (string sender-id, string msg-id, map message)
          receiveResponse  (string responder-id, string msg-tag, map response)


API
===

		  samp = sampInit  (appName, descr)
                 samp_setMetadata  (samp, field, value)
                 samp_setCallMode  (samp, sync|async)
            samp_setReplyCallback  (samp, func)
         samp_setResponseCallback  (samp, func)
		        sampClose  (samp)

         samp_defaultReplyHandler  (samp)
      samp_deaultfResponseHandler  (samp)

              list = samp_newList  (samp)
              samp_listAddElement  (list, value, type)
        ptr = samp_getListElement  (list, index)
                    samp_freeList  (list)

                map = samp_newMap  (samp)
               samp_mapAddElement  (map, name, value, type)
         ptr = samp_getMapElement  (map, name)
                     samp_freeMap  (map)

    Hi-Level Utilities:

     list = samp_getAvailableHubs  (samp)
          hub = samp_getActiveHub  (samp, hubName)
              samp = samp_hubInit  (samp, appName, descr)

	            samp_Register  (hub)
	          samp_UnRegister  (hub)
             samp_DeclareMetadata  (hub)
  	                samp_Ping  (hub)
           map = samp_GetMetadata  (hub)
        samp_DeclareSubscriptions  (hub, subscripMap)
      map = samp_GetSubscriptions  (hub)
 list = samp_GetRegisteredClients  (hub, mtype)

            samp_tableLoadVotable  (samp, recip, url, table-id, name)
               samp_tableLoadFits  (samp, recip, url, table-id, name)
           samp_tableHighlightRow  (samp, recip, table-id, url, row)
          samp_tableSelectRowList  (samp, recip, table-id, url, row-list)

               samp_imageLoadFits  (samp, recip, url, image-id, name)

             samp_coordPointAtSky  (samp, recip, ra, dec)
          samp_specLoadSSAGeneric  (samp, recip, url, meta, spectrum-id, name)


    Lo-Level Messaging:
               list = samp_notify  (samp, recipId, msgMap)
            list = samp_notifyAll  (samp, msgMap)
                msgId = samp_call  (samp, recipId, msgTag, msgMap)
               map = samp_callAll  (samp, msgTag, msgMap)
           map = samp_callAndWait  (samp, recipId, msgMap, timeout)
 	               samp_Reply  (samp, msgId, respMap)


	- 'recip' can be reserved word 'all' to indicate broadcast

Messages
========

          table.load.votable  (url, table-id*, name*)
             table.load.fits  (url, table-id*, name*)
         table.highlight.row  (table-id, url, (int)row)
        table.select.rowList  (table-id, url, (List)row-list)
             image.load.fits  (url, image-id*, name*)
           coord.pointAt.sky  ((float)ra, (float)dec)
   spectrum.load.ssa-generic  (url, (map)meta, spectrum-id*, name*)