advanced.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. 'use strict';
  2. 'require form';
  3. 'require view';
  4. 'require uci';
  5. return view.extend({
  6. load: function() {
  7. return Promise.all([
  8. uci.load('basicstation')
  9. ]);
  10. },
  11. render: function(data) {
  12. var m, s, o, options;
  13. /* Advanced Settings */
  14. m = new form.Map('basicstation', _('Advanced Settings'));
  15. /* RF Configuration */
  16. s = m.section(form.GridSection, 'rfconf', _('RF Configuration'));
  17. s.addremove = true;
  18. s.anonymous = false;
  19. s.nodescriptions = true;
  20. o = s.option(form.ListValue, 'type', _('Type'),
  21. _('RF front end type'));
  22. o.value('SX1250');
  23. o.default = 'SX1250';
  24. o = s.option(form.Flag, 'txEnable', _('Tx enable'),
  25. _('Enable transmission capabilities'));
  26. o.default = 'false';
  27. o = s.option(form.Value, 'freq', _('Frequency'),
  28. _('Frequency in Hz'));
  29. o.datatype = 'uinteger';
  30. o = s.option(form.Value, 'antennaGain', _('Antenna Gain'),
  31. _('Antenna gain in dBi'));
  32. o.datatype = 'uinteger';
  33. o = s.option(form.Value, 'rssiOffset', _('RSSI Offset'),
  34. _('RSSI offset in dBm'));
  35. o.datatype = 'float';
  36. o = s.option(form.ListValue, 'useRssiTcomp', _('RSSI Tcomp'),
  37. _('RSSI Tcomp object to be used for this RF configuration'));
  38. options = uci.sections('basicstation', 'rssitcomp')
  39. for (var i = 0; i < options.length; i++) {
  40. var value = options[i]['.name'];
  41. o.value(value);
  42. }
  43. o.default = 'std';
  44. /* RSSI Tcomp */
  45. s = m.section(form.GridSection, 'rssitcomp', _('RSSI Tcomp'));
  46. s.addremove = true;
  47. s.anonymous = false;
  48. s.nodescripitons = true;
  49. o = s.option(form.Value, 'coeff_a', _('Coeff A'));
  50. o.datatype = 'float';
  51. o = s.option(form.Value, 'coeff_b', _('Coeff B'));
  52. o.datatype = 'float';
  53. o = s.option(form.Value, 'coeff_c', _('Coeff C'));
  54. o.datatype = 'float';
  55. o = s.option(form.Value, 'coeff_d', _('Coeff D'));
  56. o.datatype = 'float';
  57. o = s.option(form.Value, 'coeff_e', _('Coeff E'));
  58. o.datatype = 'float';
  59. /* TX Gain Lookup Table */
  60. s = m.section(form.GridSection, 'txlut', _('TX Gain Lookup Table'));
  61. s.addremove = true;
  62. s.anonymous = true;
  63. s.nodescriptions = true;
  64. o = s.option(form.Value, 'rfPower', _('RF Power'),
  65. _('RF output power target in dBm'));
  66. o.datatype = 'uinteger';
  67. o = s.option(form.Flag, 'paGain', _('PA Enable'),
  68. _('Power amplifier enabled'));
  69. o.default = false;
  70. o = s.option(form.Value, 'pwrIdx', _('Power Index'),
  71. _('Possible gain settings from 0 (min. gain) to 22 (max. gain)'));
  72. o.datatype = 'range(0,22)';
  73. o = s.option(form.DynamicList, 'usedBy', _('Used By'),
  74. _('RF configurations that use this tx gain object'));
  75. options = uci.sections('basicstation', 'rfconf');
  76. for (var i = 0; i < options.length; i++) {
  77. var value = options[i]['.name'];
  78. o.value(value);
  79. }
  80. return m.render();
  81. },
  82. });