Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sensor offset to keel preselection #138

Merged
merged 7 commits into from
Jun 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/js/oseam-models-offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ OSeaM.models.Offset = Backbone.Model.extend({
distanceWaterline : '',
offsetKeel : '',
manufacturer : '',
model : ''
model : '',
offsetType : ''
}
});
1 change: 1 addition & 0 deletions src/js/oseam-models-vessels.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ OSeaM.models.Vessels = Backbone.Collection.extend({
newdepthoffset.set('distanceFromCenter', y['distanceFromCenter']);
newdepthoffset.set('distanceWaterline', y['distanceWaterline']);
newdepthoffset.set('offsetKeel', y['offsetKeel']);
newdepthoffset.set('offsetType', y['offsetType']);
newdepthoffset.set('manufacturer', y['manufacturer']);
newdepthoffset.set('model', y['model']);

Expand Down
1 change: 1 addition & 0 deletions src/js/oseam-views-depthsensorpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ OSeaM.views.depthsensorpage = OSeaM.View.extend({
depth_offsetKeel : depthoffset.get('offsetKeel'),
depth_manufacturer : depthoffset.get('manufacturer'),
depth_model : depthoffset.get('model'),
depth_offsetType : depthoffset.get('offsetType'),
top : topY,
left : leftX
}));
Expand Down
12 changes: 12 additions & 0 deletions src/js/oseam-views-gauges.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// -------------------------------------------------------------------------------------------------

OSeaM.views.Gauges = OSeaM.View.extend({
events: {
'click .oseam-add' : 'addNewGauge',
},
initialize: function() {
this.listenTo(this.collection, 'reset', this.refreshGauges);
this.render();
Expand All @@ -26,6 +29,15 @@ OSeaM.views.Gauges = OSeaM.View.extend({
this.initOpenLayers();
return this;
},
addNewGauge: function(evt) {
var gauge = new OSeaM.models.Gauge();
view = new OSeaM.views.GaugeDialog({
el: this.$el,
model : vessel,
collection : this.collection
});
view.render().modal('show');
},
initOpenLayers: function() {
var self = this;

Expand Down
1 change: 1 addition & 0 deletions src/js/oseam-views-vessel.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ OSeaM.views.Vessel = OSeaM.View.extend({
"click #next_step_button" : "nextStep",
"click #prev_step_button" : "prevStep",
'change input' : 'modify',
'change select' : 'modify',
'change textarea' : 'modify'
},
initialize : function() {
Expand Down
9 changes: 8 additions & 1 deletion src/js/oseam.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OSeaM = {
container: null,
frontend: null,
router: null,
// apiUrl: 'http://192.168.1.29:8100/org.osm.depth.upload/api2/',
// apiUrl: 'http://192.168.0.11:8080/org.osm.depth.upload/api2/',
apiUrl: 'http://depth.openseamap.org:8080/org.osm.depth.upload/api2/',
// apiUrl: 'http://testdepth.openseamap.org:8080/org.osm.depth.upload.stage/api2/',
// apiUrl: 'http://localhost:8080/org.osm.depth.upload/api2/',
Expand All @@ -34,6 +34,13 @@ OSeaM = {
this.container = $('.oseam-container');
this.router = new OSeaM.routers.Router();
Backbone.history.start();

// helper for setting default option
window.Handlebars.registerHelper('select', function( value, options ){
var $el = $('<select />').html( options.fn(this) );
$el.find('[value="' + value + '"]').attr({'selected':'selected'});
return $el.html();
});
},
configureBackboneSync: function() {
var originalSync = Backbone.sync;
Expand Down
16 changes: 9 additions & 7 deletions src/js/templates/depthsensoroffset-de.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,21 @@
</div>
</div>

<p><label class="tableft50">Typp der Tiefenmessung</label></p>
<p><label class="tableft50">Typ der Tiefenmessung</label></p>
<div class="input-append">
<select name="depthmeasurement" size="1">
<option>Automatisch</option>
<option>Tiefen unter der Messvorrichtung</option>
<option>Tiefe unter dem Kiel</option>
<option>Tiefe unter dem Wasserspiegel</option>
<select id="depth_offsetType" name="depth_offsetType" size="1">
{{#select depth_offsetType}}
<option value="transducer">Tiefe unter dem Geber</option>
<option value="keel">Tiefe unter dem Kiel</option>
<option value="water">Tiefe unter dem Wasserspiegel</option>
{{/select}}
</select>
</div>

<div class="control-group">
<p><label for="depth_offsetKeel" class="tableft50">Sensor Abstand zum Kiel</label></p>
<div class="input-append">
<input type="text" class="input-mini" id="depth_offsetKeel" name="depth_offsetKeel" placeholder="0.00" value="{{depth_offsetKeel}}" title="Abstand des Sensors vom Kiel"/>
<input type="text" class="input-mini" id="depth_offsetKeel" name="depth_offsetKeel" placeholder="0.00" value="{{depth_offsetKeel}}" title="Sensor Abstand zum Kiel"/>
<span class="add-on">m</span>
<span class="help-inline helpOsm"></span>
</div>
Expand All @@ -54,6 +55,7 @@
<div class="input-append">
<datalist id="depth_manufacturer" name="depth_manufacturer">
<option>Airmar</option>
<option>B&amp;G</option>
<option>Garmin</option>
<option>Humminbird</option>
<option>Lowrance</option>
Expand Down
12 changes: 7 additions & 5 deletions src/js/templates/depthsensoroffset-en.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@

<p><label class="tableft50">Depth Measurement</label></p>
<div class="input-append">
<select name="depthmeasurement" size="1">
<option>Autodetect</option>
<option>Depth below Transducer</option>
<option>Depth below Keel</option>
<option>Depth below Waterline</option>
<select id="depth_offsetType" name="depth_offsetType" size="1">
{{#select depth_offsetType}}
<option value="transducer">Depth below Transducer</option>
<option value="keel">Depth below Keel</option>
<option value="water">Depth below Waterline</option>
{{/select}}
</select>
</div>

Expand All @@ -54,6 +55,7 @@
<div class="input-append">
<datalist id="depth_manufacturer" name="depth_manufacturer">
<option>Airmar</option>
<option>B&amp;G</option>
<option>Garmin</option>
<option>Humminbird</option>
<option>Lowrance</option>
Expand Down
2 changes: 2 additions & 0 deletions src/js/templates/gauges-de.handlebars
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<div class="oseam-map-tracks"></div>

<button class="btn oseam-add"><i class="icon-plus-sign"></i> Pegel hinzuf�gen ...</button>

<div id="detail">
<table class="table table-condensed table-striped table-hover">
<thead>
Expand Down
1 change: 1 addition & 0 deletions src/js/templates/gauges-en.handlebars
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div class="oseam-map-tracks"></div>

<button class="btn oseam-add"><i class="icon-plus-sign"></i> Add new gauge ...</button>
<div id="detail">
<table class="table table-condensed table-striped table-hover">
<thead>
Expand Down