From 10bf81e20cae72a29dc08e3cc5c323c7c40a0a8f Mon Sep 17 00:00:00 2001 From: Dan Dooley Date: Fri, 3 Nov 2017 16:25:24 +1300 Subject: [PATCH] Creation of SIT protobufs --- .gitignore | 3 +- .travis.yml | 9 +- build.sh | 5 + tools/sit/main.go | 478 +++++++++++++++++ tools/sit/sit_build.sh | 19 + .../GeoNet/kit/sit_delta_pb/sit_delta.pb.go | 488 ++++++++++++++++++ vendor/vendor.json | 14 +- 7 files changed, 1010 insertions(+), 6 deletions(-) create mode 100644 tools/sit/main.go create mode 100755 tools/sit/sit_build.sh create mode 100644 vendor/github.com/GeoNet/kit/sit_delta_pb/sit_delta.pb.go diff --git a/.gitignore b/.gitignore index 7e5ae75df..28a17a5b4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ delta.iml tools/rinexml/rinexml tools/gloria/output -tools/gloria/gloria \ No newline at end of file +tools/gloria/gloria +tools/sit/output \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 4c1c30351..d79ebe62d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,10 @@ go: install: true +env: + global: #The TRAVIS_API_TOKEN for triggering SIT build + secure: fVKWnQE9GDIJIwqU+gwfGLfZi6ZGHkoeIFwv0d0R1YAxiv0dIkG1F/tvmqOm82wHPiKgB9kBHVVgxfz8miALpkCsVAeVss4g/hpbjG9vlIm26vpvonw+2FUe04jBpf1gtEAy8waTwHYcAPm58W8Q72/P8unlc7onOuLRYBNabVdtE36An34Yq0bTmc8cUyCP6Gg14SzAmYl6A5fOtbgUc72EgJ7MGnaeifjIaH+CQSVWK5SSuANv70v4aD18P2Fwe5TNSa1Loah/AE33xgeCbiYeZsjUCQ0b7HEbhT+22gh2wORlLIM58SKE10dx/O1pI2axoTeqUjLKCs8TqkHtwc82h8wt4uDwqsH8zCwpYqjr2bSyzoG+9mV+AdB135EtBT6NrIB9vDbr/0u35D61LUrbPZnPARVyzrT9WvYG0B8/HkEayrBWWX+chRUCARDghSEKfBmH9HqXwJenYTau6AuqkqBh/pt54MvNzg8uk+HNzUSpxxLPVq1Xix/QC/uf43VNaavF7ZfzAYMHBr6Kg+/qcAWsNGw3Gf+45EHTedQdetdPdzTTdqeF5SN7kNtP+NSuAwsSgwekqcX0hPD+BsIjAOHCOG5M/09NYJvA5vJ/cMMnxBaPXH3I0lG96TXO7t3yq6Nncit1D6Np9XlDPOgBJDlEQvEdER/4XMT+jKQ= + script: - ./test.sh - ./build.sh @@ -49,4 +53,7 @@ deploy: on: branch: master -# vim: set ts=2 sw=2 tw=0 et: +after_deploy: + - ./tools/sit/sit_build.sh + +# vim: set ts=2 sw=2 tw=0 et: \ No newline at end of file diff --git a/build.sh b/build.sh index db6c1cdff..ef3e02d7b 100755 --- a/build.sh +++ b/build.sh @@ -49,6 +49,11 @@ go build ./tools/gloria || exit 255 ./gloria --install install --network network -output .tmp/geonet-meta/config/gloria +mkdir -p .tmp/geonet-meta/config/sit || exit 255 +go build ./tools/sit || exit 255 + +./sit -install install -network network -asset assets -output .tmp/geonet-meta/config/sit + exit $errcount # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 diff --git a/tools/sit/main.go b/tools/sit/main.go new file mode 100644 index 000000000..c9fafa61c --- /dev/null +++ b/tools/sit/main.go @@ -0,0 +1,478 @@ +package main + +import ( + "encoding/json" + "flag" + "fmt" + "github.com/GeoNet/delta/meta" + "github.com/GeoNet/kit/sit_delta_pb" + "github.com/golang/protobuf/proto" + "io/ioutil" + "os" + "path/filepath" + "strings" + "time" +) + +func main() { + + //Meta Loading Code grabbed from rinexml + var verbose bool + flag.BoolVar(&verbose, "verbose", false, "make noise") + + var output string + flag.StringVar(&output, "output", "output", "output directory") + + var network string + flag.StringVar(&network, "network", "../../network", "base network directory") + + var install string + flag.StringVar(&install, "install", "../../install", "base install directory") + + var asset string + flag.StringVar(&asset, "asset", "../../assets", "base asset directory") + + flag.Usage = func() { + fmt.Fprint(os.Stderr, "\n") + fmt.Fprint(os.Stderr, "Build a set of ProtoBuf files for Gloria from delta meta information\n") + fmt.Fprint(os.Stderr, "\n") + fmt.Fprint(os.Stderr, "Usage:\n") + fmt.Fprint(os.Stderr, "\n") + fmt.Fprintf(os.Stderr, " %s [options]\n", os.Args[0]) + fmt.Fprint(os.Stderr, "\n") + fmt.Fprint(os.Stderr, "Options:\n") + fmt.Fprint(os.Stderr, "\n") + flag.PrintDefaults() + fmt.Fprint(os.Stderr, "\n") + } + + flag.Parse() + + //data from 'network' files + //List of marks from marks.csv - gps + var markList meta.MarkList + if err := meta.LoadList(filepath.Join(network, "marks.csv"), &markList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load mark list: %v\n", err) + os.Exit(-1) + } + + //List of monuments from monuments.csv + var monumentList meta.MonumentList + if err := meta.LoadList(filepath.Join(network, "monuments.csv"), &monumentList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load monuments list: %v\n", err) + os.Exit(-1) + } + monuments := make(map[string][]meta.Monument) + for _, m := range monumentList { + monuments[m.Mark] = append(monuments[m.Mark], m) + } + + //List of mounts from mounts.csv - cameras + var mountList meta.MountList + if err := meta.LoadList(filepath.Join(network, "mounts.csv"), &mountList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load mounts list: %v\n", err) + os.Exit(-1) + } + + //List of stations from stations.csv - seismic AND tsunami + var stationList meta.StationList + if err := meta.LoadList(filepath.Join(network, "stations.csv"), &stationList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load stations list: %v\n", err) + os.Exit(-1) + } + + //List of sites from sites.csv - 'location' for stations + var siteList meta.SiteList + locations := make(map[string][]*sit_delta_pb.Location) + if err := meta.LoadList(filepath.Join(network, "sites.csv"), &siteList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load sites list: %v\n", err) + os.Exit(-1) + } + for _, m := range siteList { + locations[m.Station] = append(locations[m.Station], &sit_delta_pb.Location{ + Point: &sit_delta_pb.Point{ + Datum: m.Datum, + Elevation: m.Elevation, + Latitude: m.Latitude, + Longitude: m.Longitude, + }, + Location: m.Location, + Span: &sit_delta_pb.Span{ + Start: m.Start.Unix(), + End: m.End.Unix(), + }, + }) + } + + + //asset files -- All have the same format so just pull them all into a single big map + assetFiles := []string{ + "antennas.csv", + "cameras.csv", + "dataloggers.csv", + "metsensors.csv", + "radomes.csv", + "receivers.csv", + "recorders.csv", + "sensors.csv", + } + assets := make(map[string]meta.Asset) + for _, f := range assetFiles { + var assetList meta.AssetList + if err := meta.LoadList(filepath.Join(asset, f), &assetList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load assets '%s': %v\n", f, err) + os.Exit(-1) + } + for _, a := range assetList { + assets[a.Make+a.Model+a.Serial] = a + } + } + + //install files -- pull in each files and turn into a map of it's mark/site to a list of matching entries + //antennas.csv + equipment := make(map[string][]*sit_delta_pb.Equipment_Install) + var installedAntennaList meta.InstalledAntennaList + if err := meta.LoadList(filepath.Join(install, "antennas.csv"), &installedAntennaList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load antenna installs: %v\n", err) + os.Exit(-1) + } + for _, i := range installedAntennaList { + equipment[i.Mark] = append(equipment[i.Mark], &sit_delta_pb.Equipment_Install{ + Equipment: &sit_delta_pb.Equipment{ + Type: "Antenna", + Model: i.Model, + AssetNumber: assets[i.Make+i.Model+i.Serial].Number, + SerialNumber: i.Serial, + Manufacturer: i.Make, + Height: -i.Vertical, + }, + Installed: &sit_delta_pb.Span{ + Start: i.Start.Unix(), + End: i.End.Unix(), + }, + }) + } + + //cameras.csv + var installedCameraList meta.InstalledCameraList + if err := meta.LoadList(filepath.Join(install, "cameras.csv"), &installedCameraList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load camera installs: %v\n", err) + os.Exit(-1) + } + for _, i := range installedCameraList { + equipment[i.Mount] = append(equipment[i.Mount], &sit_delta_pb.Equipment_Install{ + Equipment: &sit_delta_pb.Equipment{ + Type: "Camera", + Model: i.Model, + AssetNumber: assets[i.Make+i.Model+i.Serial].Number, + SerialNumber: i.Serial, + Manufacturer: i.Make, + Height: -i.Vertical, + }, + Installed: &sit_delta_pb.Span{ + Start: i.Start.Unix(), + End: i.End.Unix(), + }, + }) + } + + //connections.csv - needed to link a site to a datalogger + var connectionList meta.ConnectionList + if err := meta.LoadList(filepath.Join(install, "connections.csv"), &connectionList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load datalogger installs: %v\n", err) + os.Exit(-1) + } + connections := make(map[string][]string) + for _, c := range connectionList { + //TODO - Do we need to display 'connection' info? + + arr := connections[strings.TrimSpace(c.Place + c.Role)] + found := false + for _, s := range arr { + if s == c.Station { + found = true + break + } + } + if !found { + connections[strings.TrimSpace(c.Place+c.Role)] = append(connections[strings.TrimSpace(c.Place+c.Role)], c.Station) + } + } + + //dataloggers.csv + var deployedDataloggerList meta.DeployedDataloggerList + if err := meta.LoadList(filepath.Join(install, "dataloggers.csv"), &deployedDataloggerList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load datalogger installs: %v\n", err) + os.Exit(-1) + } + for _, i := range deployedDataloggerList { + stations := connections[strings.TrimSpace(i.Place + i.Role)] + for _, s := range stations { + equipment[s] = append(equipment[s], &sit_delta_pb.Equipment_Install{ + Equipment: &sit_delta_pb.Equipment{ + Type: "Datalogger", + Model: i.Model, + AssetNumber: assets[i.Make+i.Model+i.Serial].Number, + SerialNumber: i.Serial, + Manufacturer: i.Make, + }, + Installed: &sit_delta_pb.Span{ + Start: i.Start.Unix(), + End: i.End.Unix(), + }, + }) + } + } + + //metsensors.csv + var installedMetsensorList meta.InstalledMetSensorList + if err := meta.LoadList(filepath.Join(install, "metsensors.csv"), &installedMetsensorList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load metsensor installs: %v\n", err) + os.Exit(-1) + } + for _, i := range installedMetsensorList { + equipment[i.Mark] = append(equipment[i.Mark], &sit_delta_pb.Equipment_Install{ + Equipment: &sit_delta_pb.Equipment{ + Type: "Metsensor", + Model: i.Model, + AssetNumber: assets[i.Make+i.Model+i.Serial].Number, + SerialNumber: i.Serial, + Manufacturer: i.Make, + }, + Installed: &sit_delta_pb.Span{ + Start: i.Start.Unix(), + End: i.End.Unix(), + }, + }) + } + + //recorders.csv + var installedRecorderList meta.InstalledRecorderList + if err := meta.LoadList(filepath.Join(install, "recorders.csv"), &installedRecorderList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load recorder installs: %v\n", err) + os.Exit(-1) + } + for _, i := range installedRecorderList { + equipment[i.Station] = append(equipment[i.Station], &sit_delta_pb.Equipment_Install{ + Equipment: &sit_delta_pb.Equipment{ + Type: "Recorder", + Model: i.Model, + AssetNumber: assets[i.Make+i.Model+i.Serial].Number, + SerialNumber: i.Serial, + Manufacturer: i.Make, + Height: -i.Vertical, + }, + Installed: &sit_delta_pb.Span{ + Start: i.Start.Unix(), + End: i.End.Unix(), + }, + }) + for _, l := range locations[i.Station] { + if l.Location == i.Location { + l.GroundRelationship = -i.Vertical + } + } + } + + //receivers.csv + var deployedReceiverList meta.DeployedReceiverList + if err := meta.LoadList(filepath.Join(install, "receivers.csv"), &deployedReceiverList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load receiver installs: %v\n", err) + os.Exit(-1) + } + for _, i := range deployedReceiverList { + equipment[i.Mark] = append(equipment[i.Mark], &sit_delta_pb.Equipment_Install{ + Equipment: &sit_delta_pb.Equipment{ + Type: "Receiver", + Model: i.Model, + AssetNumber: assets[i.Make+i.Model+i.Serial].Number, + SerialNumber: i.Serial, + Manufacturer: i.Make, + }, + Installed: &sit_delta_pb.Span{ + Start: i.Start.Unix(), + End: i.End.Unix(), + }, + }) + } + + //radomes.csv + var installedRadomeList meta.InstalledRadomeList + if err := meta.LoadList(filepath.Join(install, "radomes.csv"), &installedRadomeList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load radome installs: %v\n", err) + os.Exit(-1) + } + for _, i := range installedRadomeList { + equipment[i.Mark] = append(equipment[i.Mark], &sit_delta_pb.Equipment_Install{ + Equipment: &sit_delta_pb.Equipment{ + Type: "Radome", + Model: i.Model, + AssetNumber: assets[i.Make+i.Model+i.Serial].Number, + SerialNumber: i.Serial, + Manufacturer: i.Make, + }, + Installed: &sit_delta_pb.Span{ + Start: i.Start.Unix(), + End: i.End.Unix(), + }, + }) + } + + //sensors.csv + var installedSensorList meta.InstalledSensorList + if err := meta.LoadList(filepath.Join(install, "sensors.csv"), &installedSensorList); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to load sensor installs: %v\n", err) + os.Exit(-1) + } + for _, i := range installedSensorList { + equipment[i.Station] = append(equipment[i.Station], &sit_delta_pb.Equipment_Install{ + Equipment: &sit_delta_pb.Equipment{ + Type: "Sensor", + Model: i.Model, + AssetNumber: assets[i.Make+i.Model+i.Serial].Number, + SerialNumber: i.Serial, + Manufacturer: i.Make, + Height: -i.Vertical, + }, + Installed: &sit_delta_pb.Span{ + Start: i.Start.Unix(), + End: i.End.Unix(), + }, + }) + for _, l := range locations[i.Station] { + if l.Location == i.Location { + l.GroundRelationship = -i.Vertical + } + } + } + + + for _, m := range markList { + + im := make([]*sit_delta_pb.InstalledMonument, 0) + + list := monuments[m.Code] + var currentMon *meta.Monument + for _, l := range list { + newMonument := sit_delta_pb.InstalledMonument{ + Span: &sit_delta_pb.Span{ + Start: l.Start.Unix(), + End: l.End.Unix(), + }, + Monument: &sit_delta_pb.Monument{ + DomesNumber: l.DomesNumber, + Height: l.GroundRelationship, + }, + } + im = append(im, &newMonument) + if l.End.Unix() > time.Now().Unix() { + currentMon = &l + } + } + + mark := sit_delta_pb.Mark{ + InstalledMonument: im, + Point: &sit_delta_pb.Point{ + Longitude: m.Longitude, + Latitude: m.Latitude, + Elevation: m.Elevation, + Datum: m.Datum, + }, + } + + site_pb := sit_delta_pb.Site{ + Code: m.Code, + Span: &sit_delta_pb.Span{Start: m.Start.Unix(), End: m.End.Unix()}, + Network: m.Network, + Mark: &mark, + Point: &sit_delta_pb.Point{Longitude: m.Longitude, Latitude: m.Latitude, Elevation: m.Elevation, Datum: m.Datum}, + GroundRelationship: 0, + EquipmentInstalls: equipment[m.Code], + } + if currentMon != nil { + site_pb.GroundRelationship = currentMon.GroundRelationship + } + + b, err := proto.Marshal(&site_pb) + if err != nil { + fmt.Fprintf(os.Stderr, "error: unable to marsh protobuf: %v\n", err) + os.Exit(-1) + } + + pbfile := filepath.Join(output, strings.ToUpper(m.Code)+".pb") + if err := os.MkdirAll(filepath.Dir(pbfile), 0755); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to create dir: %v\n", err) + os.Exit(-1) + } + if err := ioutil.WriteFile(pbfile, b, 0644); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to write file: %v\n", err) + os.Exit(-1) + } + if verbose { + out_json, _ := json.MarshalIndent(site_pb, "", " ") + ioutil.WriteFile(filepath.Join(output, strings.ToUpper(m.Code)+".json"), []byte(out_json), 0644) + } + } + + for _, m := range stationList { + site_pb := sit_delta_pb.Site{ + Code: m.Code, + Span: &sit_delta_pb.Span{Start: m.Start.Unix(), End: m.End.Unix()}, + Network: m.Network, + Point: &sit_delta_pb.Point{Longitude: m.Longitude, Latitude: m.Latitude, Elevation: m.Elevation, Datum: m.Datum}, + GroundRelationship: 0, + EquipmentInstalls: equipment[m.Code], + Locations: locations[m.Code], + } + b, err := proto.Marshal(&site_pb) + if err != nil { + fmt.Fprintf(os.Stderr, "error: unable to marsh protobuf: %v\n", err) + os.Exit(-1) + } + + pbfile := filepath.Join(output, strings.ToUpper(m.Code)+".pb") + if err := os.MkdirAll(filepath.Dir(pbfile), 0755); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to create dir: %v\n", err) + os.Exit(-1) + } + if err := ioutil.WriteFile(pbfile, b, 0644); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to write file: %v\n", err) + os.Exit(-1) + } + if verbose { + out_json, _ := json.MarshalIndent(site_pb, "", " ") + ioutil.WriteFile(filepath.Join(output, strings.ToUpper(m.Code)+".json"), []byte(out_json), 0644) + } + } + + for _, m := range mountList { + site_pb := sit_delta_pb.Site{ + Code: m.Code, + Span: &sit_delta_pb.Span{Start: m.Start.Unix(), End: m.End.Unix()}, + Network: m.Network, + Point: &sit_delta_pb.Point{Longitude: m.Longitude, Latitude: m.Latitude, Elevation: m.Elevation, Datum: m.Datum}, + EquipmentInstalls: equipment[m.Code], + } + + b, err := proto.Marshal(&site_pb) + if err != nil { + fmt.Fprintf(os.Stderr, "error: unable to marsh protobuf: %v\n", err) + os.Exit(-1) + } + + pbfile := filepath.Join(output, strings.ToUpper(m.Code)+".pb") + if err := os.MkdirAll(filepath.Dir(pbfile), 0755); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to create dir: %v\n", err) + os.Exit(-1) + } + + if err := ioutil.WriteFile(pbfile, b, 0644); err != nil { + fmt.Fprintf(os.Stderr, "error: unable to write file: %v\n", err) + os.Exit(-1) + } + if verbose { + out_json, _ := json.MarshalIndent(site_pb, "", " ") + ioutil.WriteFile(filepath.Join(output, strings.ToUpper(m.Code)+".json"), []byte(out_json), 0644) + } + } +} diff --git a/tools/sit/sit_build.sh b/tools/sit/sit_build.sh new file mode 100755 index 000000000..b19784e24 --- /dev/null +++ b/tools/sit/sit_build.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [[ "$TRAVIS_BRANCH" == "master" ]] +then + echo 'Triggering SIT Build' + + body='{ + "request": { + "branch":"master" + }}' + + curl -s -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Authorization: token $TRAVIS_API_TOKEN" \ + -d "$body" \ + https://api.travis-ci.com/repo/GeoNet%2Fsit/requests +fi \ No newline at end of file diff --git a/vendor/github.com/GeoNet/kit/sit_delta_pb/sit_delta.pb.go b/vendor/github.com/GeoNet/kit/sit_delta_pb/sit_delta.pb.go new file mode 100644 index 000000000..5593682ce --- /dev/null +++ b/vendor/github.com/GeoNet/kit/sit_delta_pb/sit_delta.pb.go @@ -0,0 +1,488 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sit_delta.proto + +/* +Package sit_delta_pb is a generated protocol buffer package. + +It is generated from these files: + sit_delta.proto + +It has these top-level messages: + Point + Span + Site + Location + Equipment + Equipment_Install + Mark + InstalledMonument + Monument +*/ +package sit_delta_pb + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// A geographical point on NZGD2000 +type Point struct { + // Latitude - geographical latitude of the point. + Latitude float64 `protobuf:"fixed64,1,opt,name=latitude" json:"latitude,omitempty"` + // Longitude - geographical longitude of the point. + Longitude float64 `protobuf:"fixed64,2,opt,name=longitude" json:"longitude,omitempty"` + // Elevation - geographical height of the point. + Elevation float64 `protobuf:"fixed64,3,opt,name=elevation" json:"elevation,omitempty"` + // Datum + Datum string `protobuf:"bytes,4,opt,name=datum" json:"datum,omitempty"` +} + +func (m *Point) Reset() { *m = Point{} } +func (m *Point) String() string { return proto.CompactTextString(m) } +func (*Point) ProtoMessage() {} +func (*Point) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Point) GetLatitude() float64 { + if m != nil { + return m.Latitude + } + return 0 +} + +func (m *Point) GetLongitude() float64 { + if m != nil { + return m.Longitude + } + return 0 +} + +func (m *Point) GetElevation() float64 { + if m != nil { + return m.Elevation + } + return 0 +} + +func (m *Point) GetDatum() string { + if m != nil { + return m.Datum + } + return "" +} + +// A time span that has a start and an end. +type Span struct { + // Start - time in Unix seconds. + Start int64 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` + // End - time in Unix seconds. A future date of 9999-01-01T00:00:00Z is used to indicate still open. + End int64 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` +} + +func (m *Span) Reset() { *m = Span{} } +func (m *Span) String() string { return proto.CompactTextString(m) } +func (*Span) ProtoMessage() {} +func (*Span) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Span) GetStart() int64 { + if m != nil { + return m.Start + } + return 0 +} + +func (m *Span) GetEnd() int64 { + if m != nil { + return m.End + } + return 0 +} + +// A site record (represents a seismic site OR gps mark (OR tsunami station?)) +type Site struct { + // The site code or station ID of the site + Code string `protobuf:"bytes,1,opt,name=code" json:"code,omitempty"` + // The location of the site + Point *Point `protobuf:"bytes,2,opt,name=point" json:"point,omitempty"` + // The ground relationship + GroundRelationship float64 `protobuf:"fixed64,3,opt,name=ground_relationship,json=groundRelationship" json:"ground_relationship,omitempty"` + // The network code + Network string `protobuf:"bytes,4,opt,name=network" json:"network,omitempty"` + // The date the site was established + Span *Span `protobuf:"bytes,5,opt,name=span" json:"span,omitempty"` + // Information for a 'Mark' site (will only exist if site is a mark) + Mark *Mark `protobuf:"bytes,6,opt,name=mark" json:"mark,omitempty"` + // List of 'Location' (for seismic + tsunami) + Locations []*Location `protobuf:"bytes,7,rep,name=locations" json:"locations,omitempty"` + EquipmentInstalls []*Equipment_Install `protobuf:"bytes,8,rep,name=equipment_installs,json=equipmentInstalls" json:"equipment_installs,omitempty"` +} + +func (m *Site) Reset() { *m = Site{} } +func (m *Site) String() string { return proto.CompactTextString(m) } +func (*Site) ProtoMessage() {} +func (*Site) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Site) GetCode() string { + if m != nil { + return m.Code + } + return "" +} + +func (m *Site) GetPoint() *Point { + if m != nil { + return m.Point + } + return nil +} + +func (m *Site) GetGroundRelationship() float64 { + if m != nil { + return m.GroundRelationship + } + return 0 +} + +func (m *Site) GetNetwork() string { + if m != nil { + return m.Network + } + return "" +} + +func (m *Site) GetSpan() *Span { + if m != nil { + return m.Span + } + return nil +} + +func (m *Site) GetMark() *Mark { + if m != nil { + return m.Mark + } + return nil +} + +func (m *Site) GetLocations() []*Location { + if m != nil { + return m.Locations + } + return nil +} + +func (m *Site) GetEquipmentInstalls() []*Equipment_Install { + if m != nil { + return m.EquipmentInstalls + } + return nil +} + +// A location record (seismic site, tsunami guage, etc.) +type Location struct { + // The actual 'location' value (i.e. 40) + Location string `protobuf:"bytes,1,opt,name=location" json:"location,omitempty"` + // The geographical location + Point *Point `protobuf:"bytes,2,opt,name=point" json:"point,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"` + // depth? maybe? + GroundRelationship float64 `protobuf:"fixed64,4,opt,name=ground_relationship,json=groundRelationship" json:"ground_relationship,omitempty"` + Notes string `protobuf:"bytes,5,opt,name=notes" json:"notes,omitempty"` + Span *Span `protobuf:"bytes,6,opt,name=span" json:"span,omitempty"` +} + +func (m *Location) Reset() { *m = Location{} } +func (m *Location) String() string { return proto.CompactTextString(m) } +func (*Location) ProtoMessage() {} +func (*Location) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *Location) GetLocation() string { + if m != nil { + return m.Location + } + return "" +} + +func (m *Location) GetPoint() *Point { + if m != nil { + return m.Point + } + return nil +} + +func (m *Location) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *Location) GetGroundRelationship() float64 { + if m != nil { + return m.GroundRelationship + } + return 0 +} + +func (m *Location) GetNotes() string { + if m != nil { + return m.Notes + } + return "" +} + +func (m *Location) GetSpan() *Span { + if m != nil { + return m.Span + } + return nil +} + +// An equipment record +type Equipment struct { + AssetNumber string `protobuf:"bytes,1,opt,name=asset_number,json=assetNumber" json:"asset_number,omitempty"` + SerialNumber string `protobuf:"bytes,2,opt,name=serial_number,json=serialNumber" json:"serial_number,omitempty"` + Manufacturer string `protobuf:"bytes,3,opt,name=manufacturer" json:"manufacturer,omitempty"` + Model string `protobuf:"bytes,4,opt,name=model" json:"model,omitempty"` + Type string `protobuf:"bytes,5,opt,name=type" json:"type,omitempty"` + Owner string `protobuf:"bytes,6,opt,name=owner" json:"owner,omitempty"` + ExtrasType string `protobuf:"bytes,7,opt,name=extras_type,json=extrasType" json:"extras_type,omitempty"` + Extras map[string]string `protobuf:"bytes,8,rep,name=extras" json:"extras,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Height float64 `protobuf:"fixed64,9,opt,name=height" json:"height,omitempty"` +} + +func (m *Equipment) Reset() { *m = Equipment{} } +func (m *Equipment) String() string { return proto.CompactTextString(m) } +func (*Equipment) ProtoMessage() {} +func (*Equipment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *Equipment) GetAssetNumber() string { + if m != nil { + return m.AssetNumber + } + return "" +} + +func (m *Equipment) GetSerialNumber() string { + if m != nil { + return m.SerialNumber + } + return "" +} + +func (m *Equipment) GetManufacturer() string { + if m != nil { + return m.Manufacturer + } + return "" +} + +func (m *Equipment) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +func (m *Equipment) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *Equipment) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *Equipment) GetExtrasType() string { + if m != nil { + return m.ExtrasType + } + return "" +} + +func (m *Equipment) GetExtras() map[string]string { + if m != nil { + return m.Extras + } + return nil +} + +func (m *Equipment) GetHeight() float64 { + if m != nil { + return m.Height + } + return 0 +} + +// An equipment install record +type Equipment_Install struct { + Equipment *Equipment `protobuf:"bytes,1,opt,name=equipment" json:"equipment,omitempty"` + Installed *Span `protobuf:"bytes,2,opt,name=installed" json:"installed,omitempty"` +} + +func (m *Equipment_Install) Reset() { *m = Equipment_Install{} } +func (m *Equipment_Install) String() string { return proto.CompactTextString(m) } +func (*Equipment_Install) ProtoMessage() {} +func (*Equipment_Install) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *Equipment_Install) GetEquipment() *Equipment { + if m != nil { + return m.Equipment + } + return nil +} + +func (m *Equipment_Install) GetInstalled() *Span { + if m != nil { + return m.Installed + } + return nil +} + +// A GNSS Mark. +type Mark struct { + InstalledMonument []*InstalledMonument `protobuf:"bytes,1,rep,name=installed_monument,json=installedMonument" json:"installed_monument,omitempty"` + Point *Point `protobuf:"bytes,2,opt,name=point" json:"point,omitempty"` +} + +func (m *Mark) Reset() { *m = Mark{} } +func (m *Mark) String() string { return proto.CompactTextString(m) } +func (*Mark) ProtoMessage() {} +func (*Mark) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *Mark) GetInstalledMonument() []*InstalledMonument { + if m != nil { + return m.InstalledMonument + } + return nil +} + +func (m *Mark) GetPoint() *Point { + if m != nil { + return m.Point + } + return nil +} + +type InstalledMonument struct { + Span *Span `protobuf:"bytes,1,opt,name=span" json:"span,omitempty"` + Monument *Monument `protobuf:"bytes,2,opt,name=monument" json:"monument,omitempty"` +} + +func (m *InstalledMonument) Reset() { *m = InstalledMonument{} } +func (m *InstalledMonument) String() string { return proto.CompactTextString(m) } +func (*InstalledMonument) ProtoMessage() {} +func (*InstalledMonument) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *InstalledMonument) GetSpan() *Span { + if m != nil { + return m.Span + } + return nil +} + +func (m *InstalledMonument) GetMonument() *Monument { + if m != nil { + return m.Monument + } + return nil +} + +// A monument for a Mark +type Monument struct { + DomesNumber string `protobuf:"bytes,1,opt,name=domes_number,json=domesNumber" json:"domes_number,omitempty"` + Height float64 `protobuf:"fixed64,3,opt,name=height" json:"height,omitempty"` +} + +func (m *Monument) Reset() { *m = Monument{} } +func (m *Monument) String() string { return proto.CompactTextString(m) } +func (*Monument) ProtoMessage() {} +func (*Monument) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *Monument) GetDomesNumber() string { + if m != nil { + return m.DomesNumber + } + return "" +} + +func (m *Monument) GetHeight() float64 { + if m != nil { + return m.Height + } + return 0 +} + +func init() { + proto.RegisterType((*Point)(nil), "sit_delta.Point") + proto.RegisterType((*Span)(nil), "sit_delta.Span") + proto.RegisterType((*Site)(nil), "sit_delta.site") + proto.RegisterType((*Location)(nil), "sit_delta.Location") + proto.RegisterType((*Equipment)(nil), "sit_delta.Equipment") + proto.RegisterType((*Equipment_Install)(nil), "sit_delta.Equipment_Install") + proto.RegisterType((*Mark)(nil), "sit_delta.Mark") + proto.RegisterType((*InstalledMonument)(nil), "sit_delta.InstalledMonument") + proto.RegisterType((*Monument)(nil), "sit_delta.Monument") +} + +func init() { proto.RegisterFile("sit_delta.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 660 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x41, 0x6f, 0xd3, 0x4c, + 0x10, 0x95, 0x13, 0x27, 0x8d, 0x27, 0xf9, 0xbe, 0x36, 0xdb, 0x0a, 0x59, 0x55, 0x25, 0x52, 0x57, + 0x42, 0xbd, 0x90, 0x8a, 0x70, 0x29, 0x1c, 0x91, 0x72, 0xa8, 0xa0, 0x08, 0x2d, 0x9c, 0xb8, 0x58, + 0xdb, 0x7a, 0x69, 0xad, 0xd8, 0x6b, 0xb3, 0xbb, 0x6e, 0xa9, 0xf8, 0x97, 0x5c, 0xf8, 0x05, 0xfc, + 0x0f, 0xb4, 0xb3, 0x9b, 0x8d, 0x49, 0xda, 0xaa, 0xb7, 0x9d, 0xf7, 0xde, 0x7a, 0x66, 0xde, 0xcc, + 0x26, 0xb0, 0xad, 0x72, 0x9d, 0x66, 0xbc, 0xd0, 0x6c, 0x5a, 0xcb, 0x4a, 0x57, 0x24, 0xf2, 0x40, + 0xd2, 0x40, 0xef, 0x53, 0x95, 0x0b, 0x4d, 0xf6, 0x61, 0x50, 0x30, 0x9d, 0xeb, 0x26, 0xe3, 0x71, + 0x30, 0x09, 0x8e, 0x03, 0xea, 0x63, 0x72, 0x00, 0x51, 0x51, 0x89, 0x2b, 0x4b, 0x76, 0x90, 0x5c, + 0x01, 0x86, 0xe5, 0x05, 0xbf, 0x61, 0x3a, 0xaf, 0x44, 0xdc, 0x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 0xe6, 0xf1, 0x2d, 0xf8, 0x9d, 0x33, 0xc9, 0x1c, + 0x4d, 0xa5, 0x37, 0xac, 0x68, 0xb8, 0x33, 0xc5, 0x06, 0x6f, 0x3b, 0xa7, 0x41, 0x72, 0x03, 0xe3, + 0x8d, 0x25, 0x23, 0x33, 0x88, 0xfc, 0x9a, 0xe1, 0x67, 0x86, 0xb3, 0xbd, 0xfb, 0x8a, 0xa4, 0x2b, + 0x19, 0x79, 0x09, 0x91, 0x5b, 0x64, 0x9e, 0xb9, 0x05, 0xdb, 0x18, 0xed, 0x4a, 0x91, 0xfc, 0x84, + 0xd0, 0x3c, 0x21, 0xf3, 0x12, 0x3c, 0x98, 0x96, 0x95, 0x68, 0x5c, 0xce, 0xf5, 0x97, 0x70, 0xb6, + 0x14, 0x9d, 0x3b, 0x0d, 0x1d, 0xe7, 0xeb, 0xd0, 0x53, 0x17, 0x3c, 0xc9, 0x61, 0xbc, 0xf1, 0x3d, + 0xbf, 0x96, 0xc1, 0x63, 0x3f, 0x08, 0x27, 0x30, 0xf0, 0x45, 0xda, 0x24, 0xed, 0xa7, 0xee, 0x6b, + 0xf3, 0xa2, 0x64, 0x0e, 0x03, 0x9f, 0xe1, 0x10, 0x46, 0x59, 0x55, 0x72, 0xb5, 0xb6, 0xc5, 0x88, + 0xb9, 0x05, 0x5d, 0x4d, 0xb8, 0xdb, 0x9e, 0xf0, 0xbb, 0xff, 0xbf, 0x8e, 0x7c, 0x9a, 0xb4, 0xbe, + 0xb8, 0xe8, 0xe3, 0xdf, 0xc0, 0xeb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x5d, 0x26, 0x62, + 0x19, 0x06, 0x00, 0x00, +} diff --git a/vendor/vendor.json b/vendor/vendor.json index e055bd8ce..1b2b64cfa 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -5,14 +5,20 @@ { "checksumSHA1": "+i9FIyYfPr/lGT3+eXLwdGZgCFI=", "path": "github.com/GeoNet/kit/gloria_pb", - "revision": "36355c79499e61e8c9992f9e8148e00d323796a1", - "revisionTime": "2017-11-13T23:53:48Z" + "revision": "abdb83ba090b65a1c1f997a8b78f3ba6b7ae1a64", + "revisionTime": "2017-11-15T23:54:23Z" + }, + { + "checksumSHA1": "UEnV9FZ9gzvY0tT7uZ6tpS0F5yg=", + "path": "github.com/GeoNet/kit/sit_delta_pb", + "revision": "4b82a08656297c554d406fd67aad4fdd2860838e", + "revisionTime": "2017-11-10T03:01:44Z" }, { "checksumSHA1": "kBeNcaKk56FguvPSUCEaH6AxpRc=", "path": "github.com/golang/protobuf/proto", - "revision": "18c9bb3261723cd5401db4d0c9fbc5c3b6c70fe8", - "revisionTime": "2017-04-27T21:32:20Z" + "revision": "ab9f9a6dab164b7d1246e0e688b0ab7b94d8553e", + "revisionTime": "2017-08-16T00:15:14Z" }, { "checksumSHA1": "GoEtguzRyXdK8vyOEKFLynWOIcM=",