diff options
author | Vasilii Chernov <vchernov@inr.ru> | 2016-02-25 17:02:35 +0100 |
---|---|---|
committer | Vasilii Chernov <vchernov@inr.ru> | 2016-02-25 17:02:35 +0100 |
commit | 3bf5383a7ea03c5aa263aa4d8acf8b4949547319 (patch) | |
tree | ef091c8d1084429ad8cb5d40220fe0546da04389 | |
parent | ed7a7ff66c64cc2e164070865306e7d79652063a (diff) | |
download | pcitool-3bf5383a7ea03c5aa263aa4d8acf8b4949547319.tar.gz pcitool-3bf5383a7ea03c5aa263aa4d8acf8b4949547319.tar.bz2 pcitool-3bf5383a7ea03c5aa263aa4d8acf8b4949547319.tar.xz pcitool-3bf5383a7ea03c5aa263aa4d8acf8b4949547319.zip |
Move html_server to separate folder. Update html server templates.
-rw-r--r-- | CMakeLists.txt | 26 | ||||
-rw-r--r-- | html_server/html_server.py (renamed from pywrap/html_server.py) | 11 | ||||
-rw-r--r-- | html_server/static/codebase/dhtmlx.css (renamed from pywrap/static/codebase/dhtmlx.css) | 0 | ||||
-rw-r--r-- | html_server/static/codebase/dhtmlx.js (renamed from pywrap/static/codebase/dhtmlx.js) | 0 | ||||
-rw-r--r-- | html_server/static/codebase/dhtmlx_deprecated.js (renamed from pywrap/static/codebase/dhtmlx_deprecated.js) | 0 | ||||
-rw-r--r-- | html_server/static/codebase/ext/dhxupload.xap (renamed from pywrap/static/codebase/ext/dhxupload.xap) | bin | 23436 -> 23436 bytes | |||
-rw-r--r-- | html_server/static/codebase/ext/swfobject.js (renamed from pywrap/static/codebase/ext/swfobject.js) | 0 | ||||
-rw-r--r-- | html_server/static/codebase/ext/uploader.swf (renamed from pywrap/static/codebase/ext/uploader.swf) | bin | 3646 -> 3646 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/blank.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/blank.gif) | bin | 56 -> 56 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/but_cut.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/but_cut.gif) | bin | 87 -> 87 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/folderClosed.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/folderClosed.gif) | bin | 579 -> 579 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/folderOpen.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/folderOpen.gif) | bin | 571 -> 571 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/iconCheckAll.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/iconCheckAll.gif) | bin | 155 -> 155 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/iconCheckDis.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/iconCheckDis.gif) | bin | 155 -> 155 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/iconCheckGray.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/iconCheckGray.gif) | bin | 155 -> 155 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/iconUncheckAll.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/iconUncheckAll.gif) | bin | 92 -> 92 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/iconUncheckDis.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/iconUncheckDis.gif) | bin | 878 -> 878 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/leaf.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/leaf.gif) | bin | 361 -> 361 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/line.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/line.gif) | bin | 79 -> 79 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/line1.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/line1.gif) | bin | 79 -> 79 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/line1_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/line1_rtl.gif) | bin | 79 -> 79 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/line2.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/line2.gif) | bin | 74 -> 74 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/line2_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/line2_rtl.gif) | bin | 76 -> 76 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/line3.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/line3.gif) | bin | 81 -> 81 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/line3_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/line3_rtl.gif) | bin | 81 -> 81 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/line4.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/line4.gif) | bin | 67 -> 67 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/line4_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/line4_rtl.gif) | bin | 69 -> 69 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/lock.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/lock.gif) | bin | 208 -> 208 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/minus.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/minus.gif) | bin | 107 -> 107 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/minus1.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/minus1.gif) | bin | 107 -> 107 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/minus2.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/minus2.gif) | bin | 119 -> 119 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/minus2_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/minus2_rtl.gif) | bin | 121 -> 121 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/minus3.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/minus3.gif) | bin | 125 -> 125 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/minus3_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/minus3_rtl.gif) | bin | 125 -> 125 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/minus4.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/minus4.gif) | bin | 117 -> 117 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/minus4_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/minus4_rtl.gif) | bin | 117 -> 117 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/minus5.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/minus5.gif) | bin | 111 -> 111 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/minus5_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/minus5_rtl.gif) | bin | 111 -> 111 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/plus.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/plus.gif) | bin | 111 -> 111 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/plus1.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/plus1.gif) | bin | 111 -> 111 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/plus2.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/plus2.gif) | bin | 123 -> 123 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/plus2_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/plus2_rtl.gif) | bin | 124 -> 124 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/plus3.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/plus3.gif) | bin | 128 -> 128 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/plus3_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/plus3_rtl.gif) | bin | 128 -> 128 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/plus4.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/plus4.gif) | bin | 120 -> 120 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/plus4_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/plus4_rtl.gif) | bin | 119 -> 119 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/plus5.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/plus5.gif) | bin | 114 -> 114 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/plus5_rtl.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/plus5_rtl.gif) | bin | 113 -> 113 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/radio_off.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/radio_off.gif) | bin | 213 -> 213 bytes | |||
-rw-r--r-- | html_server/static/codebase/imgs/dhxtree_skyblue/radio_on.gif (renamed from pywrap/static/codebase/imgs/dhxtree_skyblue/radio_on.gif) | bin | 223 -> 223 bytes | |||
-rw-r--r-- | html_server/static/codebase/thirdparty/excanvas/AUTHORS (renamed from pywrap/static/codebase/thirdparty/excanvas/AUTHORS) | 0 | ||||
-rw-r--r-- | html_server/static/codebase/thirdparty/excanvas/COPYING (renamed from pywrap/static/codebase/thirdparty/excanvas/COPYING) | 0 | ||||
-rw-r--r-- | html_server/static/codebase/thirdparty/excanvas/README (renamed from pywrap/static/codebase/thirdparty/excanvas/README) | 0 | ||||
-rw-r--r-- | html_server/static/codebase/thirdparty/excanvas/excanvas.js (renamed from pywrap/static/codebase/thirdparty/excanvas/excanvas.js) | 0 | ||||
-rw-r--r-- | html_server/static/jquery-2.2.1.js (renamed from pywrap/static/jquery-2.2.1.js) | 0 | ||||
-rw-r--r-- | html_server/templates/base.html | 219 | ||||
-rw-r--r-- | html_server/templates/property_info.html | 93 | ||||
-rw-r--r-- | html_server/templates/register_info.html | 148 | ||||
-rw-r--r-- | html_server/templates/registers_list.html (renamed from pywrap/templates/registers_list.html) | 0 | ||||
-rw-r--r-- | pywrap/templates/base.html | 347 | ||||
-rw-r--r-- | pywrap/templates/property_info.html | 91 | ||||
-rw-r--r-- | pywrap/templates/register_info.html | 106 |
62 files changed, 476 insertions, 565 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 22a685b..c3f953e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,20 +112,18 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcilib/version.h.in ${CMAKE_CURRENT_B configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile) if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) - file(COPY ${CMAKE_SOURCE_DIR}/xml DESTINATION ${CMAKE_BINARY_DIR}) - file(COPY ${CMAKE_SOURCE_DIR}/pci - DESTINATION ${CMAKE_BINARY_DIR} - FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - ) - file(COPY ${CMAKE_SOURCE_DIR}/run - DESTINATION ${CMAKE_BINARY_DIR} - FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - ) - - file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/xml DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/pywrap/templates DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/pywrap) - file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/pywrap/static DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/pywrap) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pywrap/html_server.py ${CMAKE_CURRENT_BINARY_DIR}/pywrap/html_server.py) + file(COPY ${CMAKE_SOURCE_DIR}/xml DESTINATION ${CMAKE_BINARY_DIR}) + file(COPY ${CMAKE_SOURCE_DIR}/pci + DESTINATION ${CMAKE_BINARY_DIR} + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + file(COPY ${CMAKE_SOURCE_DIR}/run + DESTINATION ${CMAKE_BINARY_DIR} + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + + file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/xml DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + file(COPY ${CMAKE_SOURCE_DIR}/html_server DESTINATION ${CMAKE_BINARY_DIR}) endif(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) install(FILES diff --git a/pywrap/html_server.py b/html_server/html_server.py index 76d132a..2e0af72 100644 --- a/pywrap/html_server.py +++ b/html_server/html_server.py @@ -158,8 +158,7 @@ def get_property_list(): return render_template('property_info.html', value = value, branch = branch, - properties = prop_info, - json = json + properties = prop_info ) @app.route("/") @@ -168,12 +167,8 @@ def greet(): device = device, model = model) -@app.route('/<path:path>') -def send_file(path): - return send_from_directory('static', path) - if __name__ == "__main__": - #parce command line options + #parse command line options parser = OptionParser() parser.add_option("-p", "--port", action="store", type="int", dest="port", default=5000, @@ -192,6 +187,8 @@ if __name__ == "__main__": device = opts.device model = opts.model + app.debug = True + pcilib = pcipywrap.Pcipywrap(device, model) pcipywrap.__redirect_logs_to_exeption() app.run(host = HOST_NAME, port = PORT_NUMBER) diff --git a/pywrap/static/codebase/dhtmlx.css b/html_server/static/codebase/dhtmlx.css index 9b89ec5..9b89ec5 100644 --- a/pywrap/static/codebase/dhtmlx.css +++ b/html_server/static/codebase/dhtmlx.css diff --git a/pywrap/static/codebase/dhtmlx.js b/html_server/static/codebase/dhtmlx.js index 5e560b1..5e560b1 100644 --- a/pywrap/static/codebase/dhtmlx.js +++ b/html_server/static/codebase/dhtmlx.js diff --git a/pywrap/static/codebase/dhtmlx_deprecated.js b/html_server/static/codebase/dhtmlx_deprecated.js index 5731d3f..5731d3f 100644 --- a/pywrap/static/codebase/dhtmlx_deprecated.js +++ b/html_server/static/codebase/dhtmlx_deprecated.js diff --git a/pywrap/static/codebase/ext/dhxupload.xap b/html_server/static/codebase/ext/dhxupload.xap Binary files differindex f2deecd..f2deecd 100644 --- a/pywrap/static/codebase/ext/dhxupload.xap +++ b/html_server/static/codebase/ext/dhxupload.xap diff --git a/pywrap/static/codebase/ext/swfobject.js b/html_server/static/codebase/ext/swfobject.js index 7a9d26f..7a9d26f 100644 --- a/pywrap/static/codebase/ext/swfobject.js +++ b/html_server/static/codebase/ext/swfobject.js diff --git a/pywrap/static/codebase/ext/uploader.swf b/html_server/static/codebase/ext/uploader.swf Binary files differindex 2fa8674..2fa8674 100644 --- a/pywrap/static/codebase/ext/uploader.swf +++ b/html_server/static/codebase/ext/uploader.swf diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/blank.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/blank.gif Binary files differindex d7ae406..d7ae406 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/blank.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/blank.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/but_cut.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/but_cut.gif Binary files differindex 942bd18..942bd18 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/but_cut.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/but_cut.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/folderClosed.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/folderClosed.gif Binary files differindex e0a88ce..e0a88ce 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/folderClosed.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/folderClosed.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/folderOpen.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/folderOpen.gif Binary files differindex 1680dbc..1680dbc 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/folderOpen.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/folderOpen.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/iconCheckAll.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/iconCheckAll.gif Binary files differindex a61302a..a61302a 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/iconCheckAll.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/iconCheckAll.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/iconCheckDis.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/iconCheckDis.gif Binary files differindex 42447b8..42447b8 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/iconCheckDis.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/iconCheckDis.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/iconCheckGray.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/iconCheckGray.gif Binary files differindex 0350b2a..0350b2a 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/iconCheckGray.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/iconCheckGray.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/iconUncheckAll.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/iconUncheckAll.gif Binary files differindex 9f3fe50..9f3fe50 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/iconUncheckAll.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/iconUncheckAll.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/iconUncheckDis.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/iconUncheckDis.gif Binary files differindex f15d9f7..f15d9f7 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/iconUncheckDis.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/iconUncheckDis.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/leaf.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/leaf.gif Binary files differindex 9c3e531..9c3e531 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/leaf.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/leaf.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/line.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/line.gif Binary files differindex b4f560c..b4f560c 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/line.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/line.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/line1.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/line1.gif Binary files differindex b4f560c..b4f560c 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/line1.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/line1.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/line1_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/line1_rtl.gif Binary files differindex bf32db2..bf32db2 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/line1_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/line1_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/line2.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/line2.gif Binary files differindex 23b2ce3..23b2ce3 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/line2.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/line2.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/line2_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/line2_rtl.gif Binary files differindex 6ec17b5..6ec17b5 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/line2_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/line2_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/line3.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/line3.gif Binary files differindex 43152c5..43152c5 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/line3.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/line3.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/line3_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/line3_rtl.gif Binary files differindex 74a874c..74a874c 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/line3_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/line3_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/line4.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/line4.gif Binary files differindex 907fe7a..907fe7a 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/line4.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/line4.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/line4_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/line4_rtl.gif Binary files differindex 5c7e162..5c7e162 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/line4_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/line4_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/lock.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/lock.gif Binary files differindex 67456b1..67456b1 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/lock.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/lock.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/minus.gif Binary files differindex caa3f57..caa3f57 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/minus.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus1.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/minus1.gif Binary files differindex 2ab1070..2ab1070 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus1.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/minus1.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus2.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/minus2.gif Binary files differindex 036e5b3..036e5b3 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus2.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/minus2.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus2_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/minus2_rtl.gif Binary files differindex b4672bf..b4672bf 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus2_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/minus2_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus3.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/minus3.gif Binary files differindex 3242cca..3242cca 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus3.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/minus3.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus3_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/minus3_rtl.gif Binary files differindex 8c279e0..8c279e0 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus3_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/minus3_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus4.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/minus4.gif Binary files differindex 1c7c0a7..1c7c0a7 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus4.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/minus4.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus4_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/minus4_rtl.gif Binary files differindex 70992fe..70992fe 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus4_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/minus4_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus5.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/minus5.gif Binary files differindex 031c160..031c160 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus5.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/minus5.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus5_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/minus5_rtl.gif Binary files differindex 47e25cd..47e25cd 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/minus5_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/minus5_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/plus.gif Binary files differindex 019cfbd..019cfbd 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/plus.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus1.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/plus1.gif Binary files differindex 34dee94..34dee94 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus1.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/plus1.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus2.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/plus2.gif Binary files differindex d57afa9..d57afa9 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus2.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/plus2.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus2_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/plus2_rtl.gif Binary files differindex fde3a58..fde3a58 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus2_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/plus2_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus3.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/plus3.gif Binary files differindex 2b6546b..2b6546b 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus3.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/plus3.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus3_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/plus3_rtl.gif Binary files differindex 863d34c..863d34c 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus3_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/plus3_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus4.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/plus4.gif Binary files differindex a4fe8c0..a4fe8c0 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus4.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/plus4.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus4_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/plus4_rtl.gif Binary files differindex 635e6f6..635e6f6 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus4_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/plus4_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus5.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/plus5.gif Binary files differindex 88c35a4..88c35a4 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus5.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/plus5.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus5_rtl.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/plus5_rtl.gif Binary files differindex 2ae5444..2ae5444 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/plus5_rtl.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/plus5_rtl.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/radio_off.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/radio_off.gif Binary files differindex a050afd..a050afd 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/radio_off.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/radio_off.gif diff --git a/pywrap/static/codebase/imgs/dhxtree_skyblue/radio_on.gif b/html_server/static/codebase/imgs/dhxtree_skyblue/radio_on.gif Binary files differindex 4d594b5..4d594b5 100644 --- a/pywrap/static/codebase/imgs/dhxtree_skyblue/radio_on.gif +++ b/html_server/static/codebase/imgs/dhxtree_skyblue/radio_on.gif diff --git a/pywrap/static/codebase/thirdparty/excanvas/AUTHORS b/html_server/static/codebase/thirdparty/excanvas/AUTHORS index 90decb3..90decb3 100644 --- a/pywrap/static/codebase/thirdparty/excanvas/AUTHORS +++ b/html_server/static/codebase/thirdparty/excanvas/AUTHORS diff --git a/pywrap/static/codebase/thirdparty/excanvas/COPYING b/html_server/static/codebase/thirdparty/excanvas/COPYING index 75b5248..75b5248 100644 --- a/pywrap/static/codebase/thirdparty/excanvas/COPYING +++ b/html_server/static/codebase/thirdparty/excanvas/COPYING diff --git a/pywrap/static/codebase/thirdparty/excanvas/README b/html_server/static/codebase/thirdparty/excanvas/README index eb7c42f..eb7c42f 100644 --- a/pywrap/static/codebase/thirdparty/excanvas/README +++ b/html_server/static/codebase/thirdparty/excanvas/README diff --git a/pywrap/static/codebase/thirdparty/excanvas/excanvas.js b/html_server/static/codebase/thirdparty/excanvas/excanvas.js index 66310a8..66310a8 100644 --- a/pywrap/static/codebase/thirdparty/excanvas/excanvas.js +++ b/html_server/static/codebase/thirdparty/excanvas/excanvas.js diff --git a/pywrap/static/jquery-2.2.1.js b/html_server/static/jquery-2.2.1.js index b7c491f..b7c491f 100644 --- a/pywrap/static/jquery-2.2.1.js +++ b/html_server/static/jquery-2.2.1.js diff --git a/html_server/templates/base.html b/html_server/templates/base.html new file mode 100644 index 0000000..639dc00 --- /dev/null +++ b/html_server/templates/base.html @@ -0,0 +1,219 @@ +<!DOCTYPE html> +<html> +<head> + <title>{% block title %}Device {{ device }}{% endblock %}</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='codebase/dhtmlx.css') }}"/> + <script type=text/javascript src="{{ url_for('static', filename='jquery-2.2.1.js') }}"></script> + <script src="{{ url_for('static', filename='codebase/dhtmlx.js') }}"></script> + <script src="{{ url_for('static', filename='check_err.js') }}"></script> + <script> + var propsTree + function createPropertyTree(branch, id) { + + function getPropertyItemsOnLevel(branch, id) { + pathToProperties = "{{ url_for('get_property_list_json') }}" + completePath = pathToProperties + '?branch=' + branch + + $.getJSON(completePath, + function(json) { + checkError(json) + parsePropertyItems(json, branch, id) + }); + } + + function parsePropertyItems(json, branch, id) { + + function loadPropertyInfo(branch) { + + var pathToProperties = "{{ url_for('get_property_list') }}" + var completePath = pathToProperties + '?branch=' + branch + + $("#prop_info_place").load(completePath) + } + + + function setPropertyField(id, name, branch) { + + var func = function(){loadPropertyInfo(branch)} + propsTree.insertNewItem(id, branch, + name, + func); + propsTree.closeAllItems() + } + + for(var i = 0; i < json.length; i++) { + + setPropertyField(id, json[i].name, json[i].path) + if(json[i].flags.indexOf("childs") != -1) + getPropertyItemsOnLevel(json[i].path, json[i].path) + } + } + + getPropertyItemsOnLevel(branch, id) + } + + var regTree + function createRegistersList() { + function parseJsonRegisterList(json) { + + checkError(json) + if(json.lenght <= 0) + return + + //sort registers by bank + function compareRegistersByBank(a,b) { + if (a.bank < b.bank) + return -1; + else if (a.bank > b.bank) + return 1; + else + return 0; + } + json.sort(compareRegistersByBank) + + + //create bank dirs + var curBankName = json[0].bank + var created = 0 + for(var i = 0; i < json.length; i++) { + + //create new bank tab if it has not created already + if(json[i].bank != curBankName) { + curBankName = json[i].bank + created = 0 + } + + if(!created) { + regTree.insertNewItem(0, json[i].bank, json[i].bank, 0); + created = 1 + } + + + //insert register info to bank + function loadRegisterInfo(bank, name) { + var pathToGetProperty = "{{ url_for('get_register_info') }}" + var completePath = pathToGetProperty + '?bank=' + bank + + '&name=' + name + + $("#reg_info_place").load(completePath) + } + + function setRegisterField(id, bank, name) { + + var itemId = bank + "_" + name + var func = function(){loadRegisterInfo(bank, name)} + + regTree.insertNewItem(id, itemId, name, func) + regTree.closeAllItems() + } + + setRegisterField(json[i].bank, json[i].bank, json[i].name) + } + } + + //get registers json list + getRegistersListPath = "{{ url_for('get_registers_list_json') }}" + $.getJSON(getRegistersListPath, parseJsonRegisterList); + } + + function doOnLoad() + { + propsTree = new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0); + propsTree.setImagePath("codebase/imgs/dhxtree_skyblue/"); + //generating properties list + createPropertyTree('', 0) + + regTree = new dhtmlXTreeObject("treeboxbox_tree2","100%","100%",0,0,0,0,'SELECT') + regTree.setImagePath("codebase/imgs/dhxtree_skyblue/"); + createRegistersList() + } + </script> +</head> +<body onload="doOnLoad()"> + {% block info %} + <div class="block1" > + <h2>Device {{ device }} model={{ model }} control page </h2> + </div> + {% endblock %} + + <style> + .tabs > div, .tabs > input { display: none; } + + .tabs label { + padding: 5px; + border: 1px solid #aaa; + line-height: 28px; + cursor: pointer; + position: relative; + bottom: 1px; + background: #fff; + } + + .tabs input[type="radio"]:checked + label { border-bottom: 2px solid #fff; } + + .tabs > input:nth-of-type(1):checked ~ div:nth-of-type(1), + .tabs > input:nth-of-type(2):checked ~ div:nth-of-type(2) { + display: block; + padding: 5px; + border: + 1px solid #aaa; + } + .tree { + height: 85vh; + padding: 5px; + border: 1px solid #aaa; + line-height: 28px; + cursor: pointer; + position: relative; + bottom: 1px; + background: #fff; + overflow:auto; + } + + .infoTable { + padding: 5px; + + border: 1px solid #aaa; + line-height: 28px; + cursor: pointer; + position: relative; + background: #fff; + overflow:auto; + bottom: 1px; + + text-align: left; + } + </style> + + <div class="tabs"> + <input type="radio" name="current" checked="checked" id="props_id"/> + <label for="props_id">Properties</label> + <input type="radio" name="current" id="labels_id"/> + <label for="labels_id">Registers</label> + <div> + <table> + <tr> + <td valign="top"> + <div id="treeboxbox_tree" class = "tree"></div> + </td> + <td valign="top" id="prop_info_place" /> + </tr> + </table> + </div> + <div> + <table> + <tr> + <td valign="top"> + <div id="treeboxbox_tree2" class="tree"></div> + </td> + <td valign="top" id="reg_info_place" /> + </tr> + </table> + </div> + </div> + {% block content %} + {% endblock %} +</body> +</html> diff --git a/html_server/templates/property_info.html b/html_server/templates/property_info.html new file mode 100644 index 0000000..ce974ac --- /dev/null +++ b/html_server/templates/property_info.html @@ -0,0 +1,93 @@ +{% block content %} + +{% if standalone %} +<script src="{{ url_for('static', filename='codebase/dhtmlx.js') }}"></script> +<script src="{{ url_for('static', filename='check_err.js') }}"></script> +{% endif %} + +<script> + function updateProperty(prop) { + var pathToGetProperty = "{{ url_for('get_property_json') }}" + var completePath = pathToGetProperty + '?prop=' + prop + + $.getJSON(completePath, function(json){ + checkError(json) + var valFieldId = "#actVal"+prop.split('/').join("_") + $(valFieldId).text(json.value) + }) + } + + function setProperty(prop) + { + var value = document.getElementById("set_val_" + prop).value; + if(value == "") + return + + var pathToGetProperty = "{{ url_for('set_property_json') }}" + var completePath = pathToGetProperty + '?prop=' + prop + + '&val=' + value; + + $.getJSON(completePath, + function(json) { + checkError(json) + updateProperty(prop) + }) + }; +</script> + +<table class="infoTable"> + <tr class="infoTable"> + <td class="infoTable">Name</td> + <td class="infoTable">Description</td> + <td class="infoTable">Value</td> + <td class="infoTable">Mode</td> + <td class="infoTable">Type</td> + <td class="infoTable">Unit</td> + <td class="infoTable">Path</td> + </tr> + {% for property in properties %} + <tr class="infoTable"> + <td class="infoTable">{{ property.name }}</td> + <td class="infoTable"> + {% if 'description' in property %} + {{ property.description }} + {% endif %} + </td> + <td class="infoTable"> + <table> + <tr> + <td id = "actVal{{ property.path.replace('/', '_') }}" class="infoTable"> + {{ value }} + </td> + {% if 'R' in property.mode %} + <td> + <input type="button" value="update" style="width:100%;height:100%" onclick="updateProperty('{{ property.path }}')"> + </td> + {% endif %} + </tr> + {% if 'W' in property.mode %} + <tr> + <td> + <input type="text" name="set_val_{{ property.path }}" id="set_val_{{ property.path }}" value="" /> + </td> + <td> + <input type="button" value="set" style="width:100%;height:100%" onclick="setProperty('{{ property.path }}')"> + </td> + </tr> + {% endif %} + </table> + </td> + <td class="infoTable"> + <ul> + {% for m in property.mode %} + {{ m + '; '}} + {% endfor %} + </ul> + </td> + <td class="infoTable"> {{ property.type }} </td> + <td class="infoTable"> {{ property.unit }} </td> + <td class="infoTable"> {{ property.path }} </td> + </tr> + {% endfor %} +</table> +{% endblock %} diff --git a/html_server/templates/register_info.html b/html_server/templates/register_info.html new file mode 100644 index 0000000..1118dbf --- /dev/null +++ b/html_server/templates/register_info.html @@ -0,0 +1,148 @@ +{% block content %} + +{% if standalone %} +<script src="{{ url_for('static', filename='codebase/dhtmlx.js') }}"></script> +<script src="{{ url_for('static', filename='check_err.js') }}"></script> +{% endif %} + +<script> + function updateRegister(bank, name) { + var pathToReadRegister = "{{ url_for('read_register_json') }}" + var completePath = pathToReadRegister + '?bank=' + bank + + '&name=' + name + + $.getJSON(completePath, function(json){ + checkError(json) + $("#actVal").text(json.value) + }) + } + + function writeRegister(bank, name) + { + var value = document.getElementById("set_val_box").value; + if(value == "") + return + + var pathToReadRegister = "{{ url_for('write_register_json') }}" + var completePath = pathToReadRegister + '?bank=' + bank + + '&name=' + name + '&val=' + value; + + $.getJSON(completePath, + function(json) { + checkError(json) + updateRegister(bank, name) + }) + }; +</script> + +<table class="infoTable"> + <tr class="infoTable"> + {% if 'description' in register %} + <td class="infoTable"> Description </td> + {% endif %} + <td class="infoTable"> Value </td> + <td class="infoTable">Default value</td> + <td class="infoTable">Bank</td> + <td class="infoTable">Mode</td> + {% if 'range' in register %} + <td class="infoTable">Range</td> + {% endif %} + {% if 'values' in register %} + <td class="infoTable">Values</td> + {% endif %} + </tr> + + <tr class="infoTable"> + {% if 'description' in register %} + <td class="infoTable"> {{ register.description }} </td> + {% endif %} + <td class="infoTable"> + <table> + <tr class="infoTable"> + <td id="actVal" class="infoTable"> {{ value }} </td> + {% if 'R' in register.mode %} + <td> + <input type="button" value="update" + style="width:100%;height:100%" + onclick="updateRegister('{{ register.bank }}', '{{ register.name }}')"> + </td> + {% endif %} + </tr> + {% if 'W' in register.mode %} + <tr class="infoTable"> + <td> + <input type="text" name="set_val_box" id="set_val_box" value="" /> + </td> + <td> + <input type="button" value="set" + style="width:100%;height:100%" + onclick="writeRegister('{{ register.bank }}', '{{ register.name }}')"> + </td> + </tr> + {% endif %} + </table> + </td> + <td class="infoTable">{{ register.defvalue }}</td> + <td class="infoTable">{{ register.bank }}</td> + <td class="infoTable"> + <ul> + {% for m in register.mode %} + {{ m + '; '}} + {% endfor %} + </ul> + </td> + {% if 'range' in register %} + <td class="infoTable"> + <table> + <tr class="infoTable"> + <td class="infoTable"> min </td> + <td class="infoTable"> max </td> + </tr> + <tr class="infoTable"> + <td class="infoTable"> {{ register.range.min }} </td> + <td class="infoTable"> {{ register.range.max }} </td> + </tr> + </table> + </td> + {% endif %} + {% if 'values' in register %} + <td class="infoTable"> + <table> + <tr> + {% for v in register['values'] %} + <td> + <table> + {% if 'name' in v %} + <tr class="infoTable"> + <td class="infoTable"> Name </td> + <td class="infoTable"> {{v.name}} </td> + </tr> + {% endif %} + {% if 'description' in v %} + <tr class="infoTable"> + <td class="infoTable"> Description </td> + <td class="infoTable"> {{ v.description }} </td> + </tr> + {% endif %} + <tr class="infoTable"> + <td class="infoTable"> Min </td> + <td class="infoTable"> {{ v.min }} </td> + </tr> + <tr class="infoTable"> + <td class="infoTable"> Max </td> + <td class="infoTable"> {{ v.max }} </td> + </tr> + <tr class="infoTable"> + <td class="infoTable"> Value </td> + <td class="infoTable"> {{ v.value }} </td> + </tr> + </table> + </td> + {% endfor %} + </tr> + </table> + </td> + {% endif %} + </tr> +</table> +{% endblock %} diff --git a/pywrap/templates/registers_list.html b/html_server/templates/registers_list.html index 199475b..199475b 100644 --- a/pywrap/templates/registers_list.html +++ b/html_server/templates/registers_list.html diff --git a/pywrap/templates/base.html b/pywrap/templates/base.html deleted file mode 100644 index fdb95e8..0000000 --- a/pywrap/templates/base.html +++ /dev/null @@ -1,347 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>{% block title %}Device {{ device }}{% endblock %}</title> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge"/> - <link rel="stylesheet" type="text/css" href="codebase/dhtmlx.css"/> - <script type=text/javascript src="{{ url_for('static', filename='jquery-2.2.1.js') }}"></script> - <script src="codebase/dhtmlx.js"></script> - <script src="pcilib_tree.js"></script> - <script> - var propsTree - - function checkError(json) - { - if(json.error) - alert('Error:\n' + json.error) - } - - function createPropertyTree(branch, id) - { - function getPropertyItemsOnLevel(branch, id) - { - pathToProperties = "{{ url_for('get_property_list_json') }}" - completePath = pathToProperties + '?branch=' + branch - - $.getJSON(completePath, - function(json) { - checkError(json) - parsePropertyItems(json, branch, id) - }); - } - - function parsePropertyItems(json, branch, id) - { - function updatePropertyValue(id, path) - { - pathToGetProperty = "{{ url_for('get_property_json') }}" - completePath = pathToGetProperty + '?prop=' + path - - $.getJSON(completePath, function(json){ - checkError(json) - propsTree.updateItem(id, 'value: ' + json.value); - }) - } - - function writePropertyValue(id, path) - { - value = window.prompt("Enter new property value"); - - if(value != null) - { - pathToGetProperty = "{{ url_for('set_property_json') }}" - completePath = pathToGetProperty + '?prop=' + path +'&val=' + value - - $.getJSON(completePath, - function(json) { - checkError(json) - updatePropertyValue(id, path) - }) - } - else - updatePropertyValue(id, path) - } - - function setCurrentValueField(id, path, mode) - { - var propValId = id + 'CurrVal' - var func = 0 - - if(mode) - func = function(){writePropertyValue(propValId, path)} - else - func = function(){updatePropertyValue(propValId, path)} - - propsTree.insertNewItem(id, propValId, - 'value: ', - func); - - updatePropertyValue(propValId, path) - } - - for(var i = 0; i < json.length; i++) - { - propsTree.insertNewItem(id, json[i].path, json[i].name, 0); - - if(json[i].flags.indexOf("childs") != -1) - { - getPropertyItemsOnLevel(json[i].path, json[i].path) - } - else - { - if(json[i].mode.indexOf("R") != -1) - { - var mode = (json[i].mode.indexOf("W") != -1) - setCurrentValueField(json[i].path, json[i].path, mode) - } - } - - //show aviable info - if(json[i].description) - propsTree.insertNewItem(json[i].path, json[i].path + 'Desc', - 'description:\n' + json[i].description, 0); - if(json[i].type) - propsTree.insertNewItem(json[i].path, json[i].path + 'Type', - 'type: ' + json[i].type, 0); - if(json[i].unit) - propsTree.insertNewItem(json[i].path, json[i].path + 'Unit', - 'unit: ' + json[i].unit, 0); - - if(json[i].mode) - { - var modeId = json[i].path + 'Mode' - propsTree.insertNewItem(json[i].path, modeId, - 'mode', 0); - - for(var j = 0; j < json[i].mode.length; j++) - propsTree.insertNewItem(modeId, modeId + j, - json[i].mode[j], 0); - propsTree.closeItem(modeId) - } - - if(json[i].path) - propsTree.insertNewItem(json[i].path, json[i].path + 'Path', - 'path: ' + json[i].path, 0); - - propsTree.closeItem(json[i].path); - } - } - - getPropertyItemsOnLevel(branch, id) - } - - var regTree - function createRegistersList() - { - function parseJsonRegisterList(json) - { - checkError(json) - - function compareRegistersByBank(a,b) - { - if (a.bank < b.bank) - return -1; - else if (a.bank > b.bank) - return 1; - else - return 0; - } - - if(json.lenght <= 0) - return - - //sort registers by bank - json.sort(compareRegistersByBank) - - //create bank dirs - var curBankName = json[0].bank - var created = 0 - for(var i = 0; i < json.length; i++) - { - //create new bank tab if it has not created already - if(json[i].bank != curBankName) - { - curBankName = json[i].bank - created = 0 - } - if(!created) - { - regTree.insertNewItem(0, json[i].bank, json[i].bank, 0); - created = 1 - } - - //insert register info to bank - var itemId = json[i].bank + "_" + json[i].name - regTree.insertNewItem(json[i].bank, itemId, json[i].name) - - function updateRegisterValue(id, bank, name) - { - pathToGetProperty = "{{ url_for('read_register_json') }}" - completePath = pathToGetProperty + '?bank=' + bank + - '&name=' + name - - $.getJSON(completePath, function(json){ - checkError(json) - regTree.updateItem(id, 'value: ' + json.value); - }) - } - - - function writeRegisterValue(id, bank, name) - { - value = window.prompt("Enter new register value"); - - if(value != null) - { - pathToGetProperty = "{{ url_for('write_register_json') }}" - completePath = pathToGetProperty + '?bank=' + bank + - '&name=' + name + '&val=' + value; - - $.getJSON(completePath, - function(json) { - checkError(json) - updateRegisterValue(id, bank, name) - }) - } - else - updateRegisterValue(id, bank, name) - } - - function setCurrentValueField(id, bank, name, mode) - { - var regValId = id + 'CurrVal' - var func = 0 - - if(mode) - func = function(){writeRegisterValue(regValId, bank, name)} - else - func = function(){updateRegisterValue(regValId, bank, name)} - - regTree.insertNewItem(id, regValId, - 'value: ', - func); - updateRegisterValue(regValId, bank, name) - } - - if(json[i].mode.indexOf("R") != -1) - { - var mode = (json[i].mode.indexOf("W") != -1) - setCurrentValueField(itemId, json[i].bank, json[i].name, mode) - } - - //show aviable info - if(json[i].description) - regTree.insertNewItem(itemId, itemId + 'Desc', - 'description:\n' + json[i].description, 0); - if(json[i].defvalue) - regTree.insertNewItem(itemId, itemId + 'Defvalue', - 'defvalue: ' + json[i].defvalue, 0); - - if(json[i].mode) - { - var modeId = itemId + 'Mode' - regTree.insertNewItem(itemId, modeId, - 'mode', 0); - - for(var j = 0; j < json[i].mode.length; j++) - regTree.insertNewItem(modeId, modeId + j, - json[i].mode[j], 0); - regTree.closeItem(modeId) - } - - if(json[i].range) - { - var rangeId = itemId + 'Range' - regTree.insertNewItem(itemId, rangeId, - 'range', 0); - regTree.insertNewItem(rangeId, rangeId + 'Min', - 'min: ' + json[i].range.min, 0); - regTree.insertNewItem(rangeId, rangeId + 'Max', - 'max: ' + json[i].range.max, 0); - regTree.closeItem(rangeId) - } - - if(json[i].values) - { - var valuesId = itemId + 'Values' - regTree.insertNewItem(itemId, valuesId, - 'values', 0); - - function addValueInfo(valuesId, value) - { - var valueId = valuesId + value.name - regTree.insertNewItem(valuesId, valueId, value.name, 0); - - if(value.description) - regTree.insertNewItem(valueId, valueId + 'Desc', - 'description: ' + value.description, 0); - if(value.value) - regTree.insertNewItem(valueId, valueId + 'Value', - 'value: ' + value.value, 0); - if(value.min) - regTree.insertNewItem(valueId, valueId + 'Min', - 'min: ' + value.min, 0); - if(value.max) - regTree.insertNewItem(valueId, valueId + 'Max', - 'max: ' + value.max, 0); - } - - for(var j = 0; j < json[i].values.length; j++) - { - addValueInfo(valuesId, json[i].values[j]) - } - regTree.closeItem(valuesId) - } - - propsTree.closeItem(json[i].path); - - regTree.closeItem(itemId); - } - } - - //get registers json list - getRegistersListPath = "{{ url_for('get_registers_list_json') }}" - $.getJSON(getRegistersListPath, parseJsonRegisterList); - } - - function doOnLoad() - { - propsTree = new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0); - propsTree.setImagePath("codebase/imgs/dhxtree_skyblue/"); - //generating properties list - createPropertyTree('', 0) - - regTree = new dhtmlXTreeObject("treeboxbox_tree2","100%","100%",0,0,0,0,'SELECT') - regTree.setImagePath("codebase/imgs/dhxtree_skyblue/"); - createRegistersList() - } - </script> -</head> -<body onload="doOnLoad()"> - {% block info %} - <h2>Device {{ device }} model={{ model }} control page </h2> - {% endblock %} - - {% block content %} - {% endblock %} - <table> - <tr> - <td> - <h3>Properties Tree</h3> - </td> - <td> - <h3>Registers Tree</h3> - </td> - </tr> - <tr> - <td valign="top"> - <div id="treeboxbox_tree" style="background-color:#f5f5f5;border :1px solid Silver; overflow:auto;"></div> - </td> - <td valign="top"> - <div id="treeboxbox_tree2" style="background-color:#f5f5f5;border :1px solid Silver; overflow:auto;"></div> - </td> - </tr> - </table> -</body> -</html> diff --git a/pywrap/templates/property_info.html b/pywrap/templates/property_info.html deleted file mode 100644 index 912d3d5..0000000 --- a/pywrap/templates/property_info.html +++ /dev/null @@ -1,91 +0,0 @@ -{% extends "base.html" %} -{% block title %}Property list{% endblock %} -{% block info %} -<h1>List of properties in branch {{ branch }}</h1> -{% endblock %} - -{% block content %} - - <script> - function set_property() - { - var value = document.getElementById("set_val_box").value; - window.location.href = "{{ url_for('set_property') }}?prop={{ branch }}&"+ - 'val='+value; - }; - </script> - -<table border="1" style="width:100%"> - <tr> - <th>Name</th> - <th>Description</th> - </tr> - {% for property in properties %} - <tr> - {% if ('childs' in property.flags) or (properties|length != 1) %} - <td><a href="{{ url_for('get_property_list', branch = property.path) }}">"{{ property.name }}"</td> - {% if 'description' in property %} - <script> - function set_property() - { - var value = document.getElementById("set_val_box").value; - window.location.href = "{{ url_for('set_property') }}?prop={{ branch }}&"+ - 'val='+value; - }; - </script> - <td>{{ property.description }}</td> - {% else %} - <td></td> - {% endif %} - {% else %} - <td>{{ property.name }}"</td> - <td> - <table border="1" style="width:100%"> - {% if 'description' in property %} - <tr> - <th> Description </th> - <td> {{ property.description }} </td> - </tr> - {% endif %} - <tr> - <th> Current value </th> - <td> {{ value }} </td> - </tr> - {% if 'W' in property.mode %} - <tr> - <th> Set value</th> - <td> - <input type="text" name="set_val_box" id="set_val_box" value="" /> - <input type="button" value="set" onclick="set_property()"> - </td> - </tr> - {% endif %} - <tr> - <th>Mode</th> - <td> - <ul> - {% for m in property.mode %} - <li>{{ m }}</li> - {% endfor %} - </ul> - </td> - </tr> - <tr> - <th>Type</th> - <td> {{ property.type }} </td> - </tr> - <tr> - <th>Unit</th> - <td> {{ property.unit }} </td> - </tr> - <tr> - <th>Path</th> - <td> {{ property.path }} </td> - </tr> - </table> - </td> - {% endif %} - </tr> - {% endfor %} - </table> -{% endblock %} diff --git a/pywrap/templates/register_info.html b/pywrap/templates/register_info.html deleted file mode 100644 index a7f11dc..0000000 --- a/pywrap/templates/register_info.html +++ /dev/null @@ -1,106 +0,0 @@ -{% extends "base.html" %} -{% block title %}Register info{% endblock %} -{% block info %} -<h1>Register '{{ register.name }}' info</h1> -{% endblock %} - -{% block content %} - <script> - function write_register() - { - var value = document.getElementById("set_val_box").value; - window.location.href = "{{ url_for('write_register') }}?name={{ register.name }}&"+ - 'bank={{ register.bank }}&val='+value; - }; - </script> - - <table border="1" style="width:100%"> - {% if 'description' in register %} - <tr> - <th> Description </th> - <td> {{ register.description }} </td> - </tr> - {% endif %} - <tr> - <th> Current value </th> - <td> {{ value }} </td> - </tr> - {% if 'W' in register.mode %} - <tr> - <th> Set value</th> - <td> - <input type="text" name="set_val_box" id="set_val_box" value="" /> - <input type="button" value="set" onclick="write_register()"> - </td> - </tr> - {% endif %} - <tr> - <th>Bank</th> - <td>{{ register.bank }}</td> - </tr> - <tr> - <th>Default value</th> - <td>{{ register.defvalue }}</td> - </tr> - <tr> - <th>Mode</th> - <td> - <ul> - {% for m in register.mode %} - <li>{{ m }}</li> - {% endfor %} - </ul> - </td> - </tr> - {% if 'range' in register %} - <tr> - <th> - Range - </th> - <td> - <table> - <tr> - <th> min </th> - <td> {{ register.range.min }} </td> - </tr> - <tr> - <th> max </th> - <td> {{ register.range.max }} </td> - </tr> - </table> - </td> - </tr> - {% endif %} - {% if 'values' in register %} - {% for v in register['values'] %} - <tr> - {% if 'name' in v %} - <th> {{v.name}} </th> - {% endif %} - <td> - <table> - {% if 'description' in v %} - <tr> - <th> description </th> - <td> {{ v.description }} </td> - </tr> - {% endif %} - <tr> - <th> min </th> - <td> {{ v.min }} </td> - </tr> - <tr> - <th> max </th> - <td> {{ v.max }} </td> - </tr> - <tr> - <th> value </th> - <td> {{ v.value }} </td> - </tr> - </table> - </td> - </tr> - {% endfor %} - {% endif %} - </table> -{% endblock %} |