gfch100: add some new configs
* also fix spelling
* also adjust ranges of the configs
Change-Id: I54fe9398fb284451a2dd93f3abf8eb647baa1e8e
diff --git a/craftui/craftui.py b/craftui/craftui.py
index 0f21e11..9699186 100755
--- a/craftui/craftui.py
+++ b/craftui/craftui.py
@@ -124,7 +124,21 @@
"""Validate as PA power level."""
def __init__(self):
- super(VPower, self).__init__(0, 2000000) # TODO(edjames)
+ super(VPower, self).__init__(0, 2000)
+
+
+class VGain(VRange):
+ """Validate as gain level."""
+
+ def __init__(self):
+ super(VGain, self).__init__(0, 63)
+
+
+class VGainIndex(VRange):
+ """Validate as gain index."""
+
+ def __init__(self):
+ super(VGainIndex, self).__init__(0, 5)
class VDict(Validator):
@@ -206,7 +220,6 @@
"""Handle a JSON request to glaukusd."""
url = 'http://localhost:8080' + self.api
payload = self.fmt % self.validator.config
- # TODO(edjames)
print 'Glaukus: ', url, payload
try:
fd = urllib2.urlopen(url, payload)
@@ -251,7 +264,12 @@
'freq_lo': Glaukus(VFreqLo, '/api/radio/frequency', '{"loFrequency":%s}'),
'mode_hi': Glaukus(VTx, '/api/radio/hiTransceiver/mode', '%s'),
'tx_powerlevel': Glaukus(VPower, '/api/radio/tx/paPowerSet', '%s'),
- 'tx_on': Glaukus(VTrueFalse, '/api/radio/paLnaPowerEnabled', '%s'),
+ 'tx_gain': Glaukus(VGain, '/api/radio/tx/vgaGain', '%s'),
+ 'rx_gainindex': Glaukus(VGainIndex, '/api/radio/rx/agcDigitalGainIndex',
+ '%s'),
+ 'palna_on': Glaukus(VTrueFalse, '/api/radio/paLnaPowerEnabled', '%s'),
+ 'transceivers_on': Glaukus(VTrueFalse,
+ '/api/radio/transceiversPowerEnabled', '%s'),
'reboot': Reboot(VTrueFalse)
}
diff --git a/craftui/www/config.thtml b/craftui/www/config.thtml
index ccfc835..c641fb3 100644
--- a/craftui/www/config.thtml
+++ b/craftui/www/config.thtml
@@ -145,22 +145,40 @@
<span id=mode_hi_result>...</span>
<tr>
- <td><b>Power Level
- <td align=right><span id="radio/tx/paPowerSet">...</span>
+ <td><b>Transmit VGA Gain
+ <td align=right><span id="radio/tx/vgaGain">...</span>
<td>
- <input id=tx_powerlevel type=text value="">
- <input type=submit value=Configure onclick="CraftUI.config('tx_powerlevel')">
+ <input id=tx_gain type=text value="">
+ <input type=submit value=Configure onclick="CraftUI.config('tx_gain')">
<td>
- <span id=tx_powerlevel_result>...</span>
+ <span id=tx_gain_result>...</span>
<tr>
- <td><b>Power Enabled
+ <td><b>Receiver AGC Digital Gain Index
+ <td align=right><span id="radio/rx/agcDigitalGainIndex">...</span>
+ <td>
+ <input id=rx_gainindex type=text value="">
+ <input type=submit value=Configure onclick="CraftUI.config('rx_gainindex')">
+ <td>
+ <span id=rx_gainindex_result>...</span>
+
+ <tr>
+ <td><b>Receiver PA/LNA Power Enabled
<td align=right><span id="radio/paLnaPowerEnabled">...</span>
<td>
- <input id=tx_on type=text value="">
- <input type=submit value=Configure onclick="CraftUI.config('tx_on')">
+ <input id=palna_on type=text value="">
+ <input type=submit value=Configure onclick="CraftUI.config('palna_on')">
<td>
- <span id=tx_on_result>...</span>
+ <span id=palna_on_result>...</span>
+
+ <tr>
+ <td><b>Transceivers Power Enabled
+ <td align=right><span id="radio/transceiversPowerEnabled">...</span>
+ <td>
+ <input id=transceivers_on type=text value="">
+ <input type=submit value=Configure onclick="CraftUI.config('transceivers_on')">
+ <td>
+ <span id=transceivers_on_result>...</span>
</table>
</div>