1
0
Fork 0

Phi: Radiostack widget improvements

- add the ADF
- show station name on hover above "use frequency" input
This commit is contained in:
Torsten Dreyer 2015-02-13 22:09:27 +01:00
parent 99020d4841
commit 5808152af2
3 changed files with 12 additions and 2 deletions

View file

@ -184,11 +184,15 @@ require([
],
// radio settings
[
"com1stn", "/instrumentation/comm/station-name"
], [
"com1use", "/instrumentation/comm/frequencies/selected-mhz"
], [
"com1sby", "/instrumentation/comm/frequencies/standby-mhz"
], [
"com1stn", "/instrumentation/comm/station-name"
], [
"com2stn", "/instrumentation/comm[1]/station-name"
], [
"com2use", "/instrumentation/comm[1]/frequencies/selected-mhz"
], [

View file

@ -1,8 +1,8 @@
<div class="phi-radiostack" data-bind="foreach: radios">
<div class="phi-radio">
<span data-bind="text: label"></span>
<input data-bind="value: use"/>
<input data-bind="value: use, attr: { title: stn }"/>
<button data-bind="click: swap">&harr;</button>
<input data-bind="value: stby"/>
</div>
</div>
</div>

View file

@ -6,6 +6,7 @@ define([
var self = this;
self.useKey = pfx + "use";
self.sbyKey = pfx + "sby";
self.stnKey = pfx + "stn";
self.label = ko.observable(label);
self.use = ko.observable(188.888).extend({
@ -16,6 +17,10 @@ define([
fgprop : self.sbyKey
});
self.stn = ko.observable("").extend({
fgprop : self.stnKey
});
self.swap = function() {
ko.utils.knockprops.write(self.useKey, this.stby());
ko.utils.knockprops.write(self.sbyKey, this.use());
@ -26,6 +31,7 @@ define([
this.radios = ko.observableArray([
new DualFrequencyViewModel("COM1", "com1"), new DualFrequencyViewModel("COM2", "com2"),
new DualFrequencyViewModel("NAV1", "nav1"), new DualFrequencyViewModel("NAV2", "nav2"),
new DualFrequencyViewModel("ADF", "adf1"),
]);
}