.. _javascope_legacy: ================================= JavaScope Legacy GUI (deprecated) ================================= This page preserves the documentation of the legacy JavaScope GUI in the folder ``ultrazohm_sw/javascope``. .. warning:: This page documents the legacy GUI only. For the current GUI, see :ref:`JavaScope`. Shared configuration and customization of both GUI generations are documented in :ref:`javascope_customizing`. .. _javascope_legacy_upgrade_note: .. note:: Older branches can update the legacy JavaScope files directly from ``develop``. Run the following commands from the repository root. .. code-block:: bash git fetch origin git restore --source origin/develop -- javascope/UZ_GUI.jar javascope/lib This upgrades all JavaScope files to the version that is currently in ``develop``, including added and removed libraries in ``javascope/lib``. The folder contains the following files: - ``javascope_run.bat`` is the executable for Windows, start it by double-clicking - ``UZ_GUI.jar`` is the binary file of the JavaScope, the sources are in a separate repository - ``properties.ini`` is the configuration file that is loaded when starting the JavaScope - ``JS_plot_data.m`` is a MATLAB script that reads and plots the measurement data - ``lib`` is the folder including the required Java libraries - ``Log_yyyy-mm-dd_hh-mm-ss.csv`` is a log file that is created at every startup of the GUI .. _javascope_legacy_folder: .. figure:: ./images_javascope_legacy/gui0.png :scale: 70 % :align: center JavaScope folder structure Basics ------ The GUI is shown in :numref:`javascope_legacy_gui`. .. _javascope_legacy_gui: .. figure:: ./images_javascope_legacy/gui1.png :align: center GUI #. First, press the ``connect`` button (1) in order to connect your scope to the UltraZohm. #. You will see some moving signs at (2) if the connection was successful. #. The ``Stop`` (3) or ``Run`` button stops or restarts the scope. After the connection has been established, the scope will be put into the ``Run`` mode automatically. #. You can switch between a **Lightmode** and **Darkmode** for the GUI on the fly. #. Go to the ``Setup Scope`` panel and press ``sendSelectData (all)`` to get the pre-selected values from the drop-down menus on the scope. For changing the entries of the drop-down menus, see :ref:`javascope_customizing`. #. In the time-based scope it is possible to debug up to 20 values by receiving data from the ISR (R5 processor). #. In the top panel it is possible to configure the data logging and time scale. Description of the buttons and pages ------------------------------------ .. _javascope_legacy_setup_scope: Setup Scope page """""""""""""""" The Setup Scope page is used to adjust the scope settings during operation. .. _javascope_legacy_setup: .. figure:: ./images_javascope_legacy/setupscope.png :scale: 90 % :align: center JavaScope Setup tab #. Up to 20 channels, out of a predefined variable selection, can be chosen and displayed. If other variables than the predefined ones are necessary, just change them in the ``ipc_ARM.c`` file of the R5 processor (see :ref:`javascope_customizing`). Do not forget to press the ``sendSelectData (all)`` button after selecting signals from the drop-down menus if you want to change them! #. Each channel can have a specific scale factor and an offset. The scale factor is comparable to the scale factor of an oscilloscope. It changes the value per grid unit. Do not forget to press the ``CHx`` button in the ``Set Scaling`` column if you want to change the scaling! Scaling can also be adjusted by clicking the ``+`` and ``-`` buttons. For setting offsets to the channels, type the offset value into the proper field and press the ``CHx`` button of the respective channel. The ``Scale All`` and ``Offset All`` buttons will update the respective settings for all 20 channels. Control page """""""""""" The control page is used to step through the state-machine of the system and for setting commands and reference values. All buttons and LEDs of the front panel are mirrored in the GUI. In addition, some slow data can be visualized. .. _javascope_legacy_control: .. figure:: ./images_javascope_legacy/control.png :align: center :scale: 90 % Javascope Control tab #. The ``Enable System`` button has the same functionality as the hardware button on the main front panel. a. It sets the system state to enable, which mainly enables I/O and PWM pins. b. When the enable is confirmed by the R5 of the UltraZohm, the ``Ready`` LED on the front panel as well as its mirrored twin in the GUI will blink faster. #. The ``Enable Control`` button has the same functionality as the hardware button on the main front panel. a. It sets the system state to enable control, which mainly executes a part of the ISR of the R5 where the user should place their real-time application code. b. When the enable is confirmed by the R5 of the UltraZohm, the ``Running`` LED on the front panel as well as its mirrored twin in the GUI will turn on in addition to the blinking ``Ready`` LED. #. The ``STOP`` button has the same functionality as the hardware button on the main front panel. a. It disables the control and system enable states. I/Os and PWM are deactivated and the real-time application code in the ISR is no longer executed. b. From returning to the slow blinking of the ``Ready`` LED and turning off the ``Running`` LED it can be seen that the stop command was confirmed by the R5. .. admonition:: Note for :ref:`≥Rev05-based UltraZohm systems ` With ≥Rev05 carrier boards, the STOP and Enable buttons on the front panel have an effect beyond the UZ software that has to be considered when using the JavaScope. Please refer to the "Warning" info-box in the :ref:`"Powerbutton Functionality" documentation of the Rev05 carrier board ` for details. #. The four LEDs mirror the LEDs of the front panel and always show the same state as the real LEDs do. In the case of an ``assert`` event in the UltraZohm, no data are transferred anymore to the GUI. In this case, the ``Error`` LED will only be seen on the real hardware front panel. #. The ``receive_fields`` a. Here, some user-defined slow data values can be visualized more prominently than in the slow data table. b. For the selection of which values are shown here, see section :ref:`javascope_customizing`. c. If not all of the up to 20 channels are required, they can be set to ``JSSD_FLOAT_ZEROVALUE``. They won't be displayed then. Furthermore, they won't be logged either. #. The ``send_fields`` a. Twenty values are available that can be used as references or setpoints for the user application. b. After typing in a value, press ``set`` for sending it to the R5. In ``ipc_ARM.c`` one can choose further usage of the value inside the application. .. _javascope_legacy_sendfields: .. figure:: ./images_javascope_legacy/ipcSend.png :align: center Part of ``ipc_ARM.c`` where ``send_field_x`` values are received #. The ``mybuttons`` a. Besides the ``send_field`` values, there are eight buttons available for the user. In ``ipc_ARM.c``, one can choose what happens when pressing the buttons. b. Below each button is a status indicator that can be triggered also in ``ipc_ARM.c`` if one likes to have feedback for the button actions. See ``/* Bit 4 - My_Button_1 */`` in the right picture below for example usage. .. _javascope_legacy_mybuttons: .. figure:: ./images_javascope_legacy/buttons.png :align: center left: further usage of the buttons, right: control of the status indicators of the buttons #. The ``Error Reset`` can be used to reset errors that occurred. a. What happens when pressing ``Error Reset`` can also be programmed in ``ipc_ARM.c`` b. For sending error codes to the GUI that are then displayed in the respective text field ``error code``, use the slow data variable ``JSSD_FLOAT_Error_Code``. #. In the ``SlowData`` table it is possible to debug an almost endless number of values by receiving data from the ISR (R5 processor). However, these variables share one frame and are transferred in a chain. The more values are displayed, the longer it takes until they are updated. For changing the entries in the slow data table, see :ref:`javascope_customizing`. .. warning:: Error detection and handling have to be implemented by the user. The GUI just provides an interface. Logging panel """"""""""""" The logging panel is used to set up the data logger of the GUI. .. figure:: ./images_javascope_legacy/loggingpanel.png :align: center logging panel #. The ``setTime`` button sets the time base of the scope. It simply scales the time base of the scope by the selected value. #. After zooming in on one or both axes, the ``fixAxis`` button reverts the axis limits to the default value. #. Here, the trigger level for a manual trigger can be set (e.g., 1V). #. With this slider, the ``preTrigger`` can be configured (e.g., how much time is visible before the trigger event happens). #. The button ``setTrigger`` sets the selection for rising or falling edge for CH1->Ch4. Choose the desired setting in the dropdown menu above. #. The button ``SingleShot`` triggers the scope once. #. The button ``SaveScreen XLS`` saves the visible scope content in an XLS file. #. The button ``Logging OFF`` respectively ``Logging ON`` toggles the data logger. If the button reads ``Logging OFF``, pressing it will turn on the logger. If the button reads ``Logging ON`` and is highlighted green, pressing the button again will turn off the logger. #. The button ``Log FastData`` enables or disables the logging of the fast data (the selection in the :ref:`javascope_legacy_setup_scope` panel). If the selection is enabled, the text of the button is highlighted green. If the logging is active, this button is deactivated. #. The button ``Log SlowData`` enables or disables the logging of the slow data. The slow data values, which are logged, are the values displayed in the 20 ``receive fields``. However, to reduce the file size, only values not equal to ``JSSD_FLOAT_ZEROVALUE`` are logged. For customizing them see :ref:`javascope_customizing`. If the selection is enabled, the text of the button is highlighted green. If the logging is active, this button is deactivated. #. With the ``set n-th log value`` button, the logging rate can be configured. Only the ``x-th`` value will then be logged (e.g., Factor ``10``, only the values for every 10th timestamp will be logged). This logging rate counts for the fast and slow data. Choose the desired value from the dropdown menu above. #. The button ``allow ext. logging`` enables the start and stop of the logging via a status-bit of the R5. If this functionality is enabled, the text of the button is highlighted and the button ``Logging ON/OFF`` is disabled/overwritten. To activate this status bit, comment in the status-bit 12 in the ``ipc_ARM.c`` file and replace the variable for the condition with your own. .. code-block:: c :linenos: :caption: Status bit in ``ipc_ARM.c`` to transmit the external data logger signal from the R5 to the GUI. Has to be commented in /* Bit 12 - trigger ext. logging */ // if (your condition == true) { // js_status_BareToRTOS |= (1 << 12); // } else { // js_status_BareToRTOS &= ~(1 << 12); // } #. Status indicator to display if the logging is active. It is highlighted green and displays ``Log ON`` if either the logging through the GUI-button press or via the external signal is active. If no logging is active, the text states ``Log OFF``. Customizing ----------- The customization workflow for the legacy GUI and the current GUI is documented in :ref:`javascope_customizing`. This includes ``properties.ini`` settings, adding scope and slow-data variables, and configuring labels and receive fields in ``javascope.h``. Known issues ------------ .. warning:: If the legacy GUI is distorted or the font is not readable, verify the Java installation as described in :ref:`install_java`. Designed by """"""""""" Philipp Loehdefink (THN), Sebastian Wendel (THN), Eyke Liegmann (TUM), Michael Hoerner (THN), Dennis Hufnagel (THN) in 04/2022