Development of extension modules for the Distributed Satellite Systems Simulator
Abstract
Esta tesis presenta el diseño e implementación de la Visual Configuration Tool, y una sección de testing que describe la validación y el proceso de verificación deeste módulo de extensión del DSS-Sim.
Full text
DEVELOPMENT OF EXTENSION MODULES FOR THE DISTRIBUTED SATELLITE SYSTEM SIMULATOR A Degree Thesis Submitted to the Faculty of the Escola Tècnica d'Enginyeria de Telecomunicació de Barcelona Universitat Politècnica de Catalunya by Antoni Ramon Villalonga Gomà In partial fulfilment of the requirements for the degree in ENGINEERING OF TELECOMMUNICATION TECHNOLOGIES AND SERVICES. Advisors: Joan A. Ruiz-de-Azúa Carles Araguz Eduard Alarcón Barcelona, June 2021
1 Abstract Distributed Satellite Systems (DSS), composed of multiple (and often small-) spacecraft units orbiting around the Earth, are becoming increasingly popular due to their ability to satisfy short revisit times and responsiveness. Moreover, these DSS could also embark inner-satellite communications and networking capabilities and provide multiple services to ground and/or improve their downlink latencies. Nevertheless, to design and optimize such satellite architectures, simulation tools and computational support are needed. Thus, the main objective of the “DSS-Sim” (Distributed Satellite Systems Simulator), a project currently under development at UPC NanoSat Lab, is to simulate all the elements of this kind of in-orbit architectures and to evaluate multiple of their system-level characteristics. In this context, this thesis presents the design and implementation of a key module in the DSS-Sim: A Visual Configuration Tool (VCT) that eases the definition of simulation scenarios and configuration values in this software framework. One of the features of the DSS-Sim is to program new components that simulate custom devices, subsystems, networking protocols or spacecraft operations. These components are configurable and defined only by the end-user. Thus, the presented Visual Configuration Tool is flexible and dynamic; that is, the interface’s content is self-adaptable to the components defined by the end-user. Therefore, VCT is prepared to understand and provide the configuration of those components defined in the future. To ensure the user writing error-free configurations, the application ensures the filtering of the values entered on the input fields, and communicates the user what and why is defining an invalid configuration. Additionally, the interface is modular with its graphical design. The definition of the HTML/CSS files allows the addition, remove, and modification from the visual modules of the application, including those modules that are not defined yet. This thesis shows the design and implementation of the Visual Configuration Tool, and a test section that describes the validation and verification procedures for this extension module of the DSS-Sim.
2 Resum Distributed Satellite Systems (DSS), que es composen de múltiples (i majoritàriament petites-) unitats de naus espacials orbitant al voltant de la Terra, s’estan convertint en la opció més popular donat la seva habilitat per a satisfer períodes de revisita curts i una millor capacitat de resposta. A més, aquests DSS poden proporcionar comunicacions intra-satèl·lits i capacitats de xarxa per produir serveis múltiples a la superfície i/o millorar les latències de descàrrega. No obstant, per a dissenyar i optimitzar aquestes arquitectures de satèl·lits, es necessiten eines de simulació i suport computacional. Així, l’objectiu principal del “DSS-Sim” (Distributed Satellite Systems Simulator), un projecte actualment en desenvolupament al NanoSat Lab de la UPC, es basa en simular tots els elements tipus d’una arquitectura d’òrbita. En aquest context, aquesta tesis presenta el disseny i implementació d’una mòdul clau del DSS-Sim: Una Visual Configuration Tool (VCT) que facilita la definició de escenaris de simulació i valors de configuració en aquest programari. Una de les característiques del DSS-Sim és la de programar components nous que simulen dispositius personalitzats, subsistemes, protocols de xarxa o operacions de naus. Aquests components són configurables i definits només per l’end-user. Per tant, la presentada Visual Configuration Tool és flexible i dinàmica, és a dir, els continguts de la interfície son auto-adaptables per aquells components definits per l’end-user. D’aquesta manera, la VCT està preparada per entendre i permetre la configuració d’aquells components que es definiran en un futur. Per assegurar que l’usuari generi configuracions lliure d’errors, la aplicació assegura el filtratge d’aquells valors introduïts en les caselles de la interfície, i comunica a l’usuari el què i perquè s’està definint una configuració invàlida. A més, la interfície és modular amb el seu disseny gràfic. La definició dels fitxers HTML i CSS s’ha dut a terme de tal forma que permet la introducció, eliminació i modificació dels mòduls visuals de l’aplicació, incloent aquells que encara no s’han definit. Aquesta tesis presenta el disseny i implementació de la Visual Configuration Tool, i una secció de testing que descriu la validació i el procés de verificació d’aquest mòdul d’extensió del DSS-Sim.
3 Resumen Distributed Satellite Systems (DSS), que se componen de múltiples (y mayormente pequeñas-) unidades de astronaves orbitando alrededor de la Tierra, se están convirtiendo en la opción más popular dado su habilidad para satisfacer períodos de revisita cortos y una mejor capacidad de respuesta. Además, éstos DSS pueden proporcionar comunicaciones intra-satélites y capacidades de red para producir servicios múltiples en la superficie y/o mejorar las latencias de descarga. No obstante, para diseñar y optimizar estas arquitecturas de satélites, se necesitan herramientas de simulación y soporte computacional. El objetivo principal del “DSS-Sim” (Distributed Satellite Systems Simulator), un proyecto actualmente en desarrollo en el NanoSat Lab de la UPC, se basa en simular todos los elementos tipo de una arquitectura de órbita. En éste contexto, ésta tesis presenta el diseño e implementación de un módulo clave para el DSS-Sim: Una Visual Configuration Tool (VCT) que facilita la definición de escenarios de simulación y valores de configuración de éste software. Una de las características del DSS-Sim es el de programar componentes nuevos que simulen dispositivos personalizados, subsistemas, protocoles de red o operaciones de astronaves. Estos componentes son configurables y definidos solamente por el end-user. Por lo tanto, la presentada Visual Configuration Tool es flexible y dinámica, es decir, los contenidos de la interfaz son autoadaptables para esos componentes definidos por el end-user. De esta forma, la VCT esta preparada para entender y permitir la configuración de aquellos componentes que se definirán en un futuro. Para asegurar que el usuario genera configuraciones libres de errores, la aplicación asegura el filtrado de aquellos valores introducidos en las casillas de la interfaz, y comunica al usuario el que y porque se está definiendo una configuración inválida. Además, la interfaz es modular con su diseño gráfico. La definición de los ficheros HTML y CSS se ha llevado a cabo de tal forma que permite la introducción, eliminación y modificación de los módulos visuales de la aplicación, incluyendo los que aún no se han definido. Esta tesis presenta el diseño e implementación de la Visual Configuration Tool, y una sección de testing que describe la validación y el proceso de verificación de este módulo de extensión del DSS-Sim.
4 Al meu pare, que des d’aquí li faig arribar el meu treball. A la meva mare i família, que ho han donat tot per nosaltres and to my tutors, for their patience, trust and dedication to teaching.
5 Acknowledgements From my point of view, any student should learn from those whom he or she considers as references. This has been my case with the people at NanosatLab, and especially with my main tutor, Carles Araguz, who placed his trust in me to carry out the project, but without forgetting the invaluable contribution of Joan (Jarao), whose coverage and advice in this project have been providential. My regards to my project partner Joan Pagès, and to Professor Eduard Alarcón for his welcome and disposition.
6 Revision history and approval record Revision Date Purpose 0 15/04/2021 Document creation 1 26/04/2021 Document revision 2 06/05/2021 Document revision 3 07/05/2021 First final version. DOCUMENT DISTRIBUTION LIST Name e-mail Antoni Ramon Villalonga Gomà Carles Araguz Joan A. Ruiz-de-Azúa Eduard Alarcón Written by: Reviewed and approved by: Date 16/04/2021 Date 10/05/2021 Name Antoni Ramon Villalonga Gomà Name Carles Araguz Position Project Author Position Project Supervisor
7 Table of contents Abstract ............................................................................................................................................. 1 Resum ............................................................................................................................................... 2 Resumen ........................................................................................................................................... 3 Acknowledgements ........................................................................................................................... 5 Revision history and approval record ................................................................................................ 6 Table of contents ............................................................................................................................... 7 List of Figures .................................................................................................................................... 9 1. Introduction .............................................................................................................................. 11 1.1. Context ............................................................................................................................ 11 1.2. Statement of purpose ...................................................................................................... 12 1.3. Requirements and specifications .................................................................................... 13 1.3.1. Functional requirements (VCT-F) ............................................................................ 13 1.3.1.1. Global requirements ............................................................................................... 13 1.3.1.2. Internal global requirements ................................................................................... 13 1.3.1.3. Visual environments for the windows. .................................................................... 14 1.3.2. No functional requirements...................................................................................... 14 1.4. Work plan ........................................................................................................................ 15 1.4.1. Work Packages. ...................................................................................................... 15 1.4.2. Gantt diagram. ......................................................................................................... 15 1.5. Changes from the initial work plan. ................................................................................. 15 2. Graphical User Interface technologies and libraries. .............................................................. 15 2.1. Desktop applications frameworks .................................................................................... 16 2.1.1. Pros and cons .......................................................................................................... 16 2.2. External libraries .............................................................................................................. 17 2.3. Testing framework ........................................................................................................... 18 3. Project design: ......................................................................................................................... 18 3.1. Graphical Interface Design .............................................................................................. 19 3.1.1. Physical Component’s window design .................................................................... 19 3.1.2. Satellite window design. .......................................................................................... 19 3.1.3. System window design. ........................................................................................... 20 3.2. Architecture design .......................................................................................................... 20 4. Development ........................................................................................................................... 22 4.1. Functionalities implementation ........................................................................................ 22 4.1.1. Libraries UML files. .................................................................................................. 22 4.1.2. Satellite UML files. ................................................................................................... 23
8 4.1.3. Satellite creation and component’s drag and drop flowchart. ................................. 23 4.1.4. Satellite creation and component’s drag and drop sequence diagram. .................. 24 4.1.5. Components UML files. ........................................................................................... 26 4.1.6. System UML files. .................................................................................................... 26 4.2. Testing functionalities ...................................................................................................... 27 5. Results ..................................................................................................................................... 29 6. Budget ..................................................................................................................................... 30 7. Conclusions and future development: ..................................................................................... 31 7.1. Future development ......................................................................................................... 31 Bibliography: .................................................................................................................................... 32 Appendices ...................................................................................................................................... 33 Glossary .......................................................................................................................................... 40
15 NF.3 The configuration tables of global simulator variables shall be modular with them. VI, UT, E2E 1.4. Work plan This section divides and organizes the total work into work packages, with their respective internal tasks. First, we explain what they are, and then we show a Gantt diagram showing their organization. 1.4.1. Work Packages. WP1: System architecture design: (1) Formulation of system requirements, (2) Definition of the GUI technology, (3) Architecture design. WP2: Software design and implementation: (1) Basic GUI skeleton, (2) components and network’s window, (3) satellite’s window, (4) system’s window, (5) global’s window. WP3: Test and results assessment: (1) Test verifications during implementation, (2) Final verification and integration. WP4: Documentation: (1) Project proposal and workplan, (2) critical review, (3) final report, (4) oral presentation. 1.4.2. Gantt diagram. Figure 2: First proposal for the project organization. 1.5. Changes from the initial work plan. Since the project is developed in parallel with DSS-Sim, during the design process of this software, design modules were identified that were not considered in the initial planning and had to be included in the project. In addition, at an advanced stage of the first design, it was necessary to redefine the technologies used (incorporation of jQuery, among others). 2. Graphical User Interface technologies and libraries. User experience is an important priority for software projects that interact with the user. It does not matter how complex are the functions and background operations happening alongside. What the users see and get to experience must be a seamless and smooth execution. Many framework options allow you to combine the rendering of visual items with their behavior on user events (e.g., clicks). Among all these, priority has been given to open-source software, not only because it is free
16 of cost but also because of the community's constant updates and improvements. Another of the pillars sought is that the application must run as a block apart from DSS-Sim; therefore, we can focus on the options that allow us to develop standalone desktop applications. In this context, as the project's main objective is to build a standalone desktop application, among all the technologies currently available, we look at those that have a greater acceptance among the community: 2.1. Desktop applications frameworks Referencing what was introduced before, VCT shall be a standalone module that works synchronized with DSS-Sim. A desktop application seems to be more than suitable, allowing creating an independent block that focuses on the configuration. Qt Qt [5] is a cross-platform application framework that works with C++. Although this platform is excellent in terms of performance, especially for anything that implements complex software for a hardware-user interface, considering that there are not as many freely available libraries as in other frameworks, and considering that this project does not need excessive computer resources, the design opts for the other options. WxWidgets wxWidgets [6] is a C++ library that lets developers create applications for Windows, OS X, Linux, and UNIX on 32-bit and 64-bit architectures and several mobile platforms, including Windows Mobile, iPhone SDK, and embedded GTK+. Electron Electron [7] is a framework for creating applications with web technologies (i.e., JavaScript, HTML, and CSS), working locally on the computer without the need for an Internet connection. Initially developed for GitHub's Atom editor, Electron has since been used to create applications by companies like Microsoft, Facebook, Slack, and Docker. 2.1.1. Pros and cons As Qt is not considered, the comparative continues with wxWidgets and Electron. Table 9: Comparative of the advantages between wxWidgets and Electron. Pros of wxWidgets Pros of Electron It uses the platform’s native API rather than emulating the GUI. Github is behind electron, and there is a lot of big companies using it to make their cross-platform apps and receive updates frequently. Custom control rendering, using the classes wxDelegateRendererNative and BackgroundWindow. Less learning curve when comparing to other C++ based options. Available design tools (e.g., wxFormBuilder, wxCrafter). Electron has a friendly website with excellent documentation and a stable API. Greater performance than Electron. Electron uses Node.js, so there are a lot of free libraries available.
17 Table 10: Comparative of the cons between wxWidgets and Electron. Cons of wxWidgets Cons of Electron Written in C++, which increases the learning curve. Electron has higher CPU usage. Other visual modules of the DSS-sim use javascript-based technologies. Apps made with Electron are more prone to to have memory issues if not build with efficient coding. The learning curve is a non-depreciable factor when choosing the framework to use, and HTML/javascript/css based applications cover all the requirements. Although the simulator itself is written in C++, as this application should work as a standalone module, there is no inconvenience of being developed with a different language. Considering that, Electron seems to have all the necessary (and more) to be the correct selection. 2.2. External libraries Electron reproduces a chromium instance locally; in other words, it runs a web-page-based application on the computer. In this context, the technologies implemented are HTML, javascript, and css. Photonkit[8] is an Html/css visual component’s library that defines the starting point for the DOM design; the global style and some concrete items (e.g., buttons) follow its structure. Not all components are provided by this tool. Other visuals (e.g., collapsible) have been intentionally designed to follow the same aspect as the rest of the photonkit library. When working with back-end content, jQuery[9] is a JavaScript library that makes HTML document traversal and manipulation, event handling, animation, and Ajax much more straightforward than the native JavaScript methodology. As jQuery has changed how millions of people write JavaScript, multiple useful libraries are based on it; therefore, it is imperative to understand or let your code be prepared for its usage. As an example of why this extension is so crucial, the library that commands the tree-view (jsTree[10]) is written in jQuery. Jstree is not the only library that provides tree-view coverage (e.g., zTree[11], tree.js[12]). However, I build the project with jsTree because it has a more tailored design with the project, and its community is quite rich, plus the fact that it can be modified and brings the opportunity of event handling, which is crucial to the development of features like the drag and drop. Additionally, the library provides several plugins like drag’n’drop, checkboxes, and other required functionalities for the project. That said, I decided to follow up with jsTree as the tree-view handler. One of the most significant design aspects was drawing boxes representing components linked via dragging a line. Many diagram-oriented libraries (e.g., litegraph.js, Project Storm’s react diagrams, Beautiful React Diagrams) could be used as the basis for configuring the satellite’s physical communications. Beautiful React Diagrams got discarded as the customization is insufficient to cover all the self-descriptive requirements (unable to name input/outputs and lack of complexity). In comparison, Project Storm’s diagrams is a delightful library that can be extended, rewired, and reassembled, with excellent performance and diagram-oriented functionalities. On the other hand, Litegraph.js[13] treats nodes with a broader idea, providing the customization of their behavior on determined events and store properties inside the nodes achieving this library to be selected for the project. When inserting invalid parameters or configurations, the alerts shown on-screen shall be descriptive and need to allow the user some minor interactions (e.g., proceed, cancel). The native alert system of javascript might cause some errors when testing the code, as asynchronous code has some issues with alert events. In response, sweetalert2[14] gives an alert handler library that integrates css and javascript.
18 After the configuration is done, JSON models need to be serialized into YAML files. The most excellent parser library is js-yaml[15]. As a summary: - Photonkit: HTML/css visual components. - jQuery: JavaScript more suitable manipulation. - jsTree: Tree-view library. - Litegraph.js: Satellite’s diagrams. - SweetAlert2: Alert handler. - Js-yaml: Yaml converter. 2.3. Testing framework Testing the code is necessary to check if the code is doing what it is supposed to do and, most importantly, prevent cases when the user misconfigures or clicks unusual options (e.g., wrong values, wrong configurations, multiple clicks at the same button, click a button within configuring some process). - Jest[16]. Developed by Facebook and used to test JavaScript codes. The most significant benefit of using Jest is a minimal configuration and setup since it comes with a mocking support and assertion library. This advantage is also the main inconvenience for a starter developer, as it integrates multiple aspects of testing. Understanding all together as a starting point becomes a complex learning curve. - Mocha[17]. JavaScript testing framework meant for testing applications that run using Node.js. It is one of the best and old (many tutorials and documents are available online) JavaScript automation testing frameworks. It is an excellent starting point as it works as a base for many assertions and other testing-focused libraries, allowing flexibility and ease to understand. - Puppeteer[18]. Node.js-based automated testing library, which provides an API that helps the users to control Chrome. It allows some interesting functionalities as manipulating external resources like CSS selectors. - Chai[19]. Assertion library for Node.js that can be delightfully paired with any javascript testing framework. - Selenium WebDriver[20]. Used to perform automated visual tests for web applications. It allows to simulate the behavior of a user and see how the DOM is responding. - Spectron. Spectron is the officially supported ChromeDriver testing framework for Electron. It is built on top of WebdriverIO and has helpers to access Electron APIs. Among the listed solutions, Mocha, Chai, and Spectron-Webdriver fit our requirements the most. Between Mocha and Jest, the fact that Jest comes with “all done” pushes me back because as these are new technologies for me, I prefer to understand each one separately and how they can be tailored together. To use HTML documents outside the testing folder, Mocha needs some additional setup. JSDOM[21]. Pure JavaScript implementation of many web standards for use with Node.js. Mocha will use the created JSDOM object to test the document. 3. Project design: This unit describes the design followed to accomplish the fixed requirements. The first section discusses the ideas behind the visual interface design. On the other hand, 3.2. System architecture exposes how all the modules are interconnected with the DOM.
19 3.1. Graphical Interface Design A definition of the application’s visual design is required before knowing any technologies. The preference was to offer a simple and straightforward look that divides by blocks the information to be filled, with visual help to keep the user in touch with the current configuration. Therefore, the application should have “separate views” (see figure 3), representing each of these configuration blocks that should be globally accessible. The following aspect was defining a primary view wherein the user can configure each block. A secondary perspective is required to work as a visual tool to help the user orient what to configure and how the current configuration looks. Inspired by other programs and applications with a similar purpose, I defined the second design aspect: Each block shall have a tree-view that complements the main window. Figure 3: User Interface skeleton, physical component's window. 3.1.1. Physical Component’s window design The core of the design has always been the requirements set out above. The layout of the various windows, starting with physical components, is shown at the following sections. In Figure 18 (from the appendices A, p.32), a snapshot of the central pane is displayed. In its header, the option is given to add a component by selecting its type (the list of types comes from the models’ files), fulfilling the requirement F.a.4. In the context of requirement F.c.1, the design decision was to develop collapsible items. Collapsible boxes represent each created component that could be opened/closed to access their parameters (extracted from model class’s JSON files). Also, the configuration of the windows should bring the options to rename and delete the created elements. Protocol Components and Global’s windows are analogous to physical components. 3.1.2. Satellite window design. For the design of the satellite window, the requirements F.b.1, 2, and 3 have been considered (not including the globals). The image below illustrates the result. First, on the left side of the window, there are two tree-views, the first one with the information of the current configuration of the physical components, and the second one is a list with the current satellites, which through a right-click we can access the options of configure (fixed view in the central panel), renaming or deleting. At the capture time, the central panel was configuring a satellite (sat3) and three components, two bat_1 type batteries, and one bat_2 type with its links. Finally, some of the customization options available to the user are shown. Tree-view Central Panel Separate views Panel’s Header
20 3.1.3. System window design. Figure 19, appendix A, page32, provides the system view, which contains a drop-down menu with constellation generation options (in response to requirement F.d.1), and a table with information on each satellite’s types and orbital parameters (requirement F.d.2). The following image corresponds to the CP header and represents the single option for VCT-F-d.1. Figure 5: Single orbit option from system's window. For the rest of the options of F-d.1, they are available in the annexes of the images: Figure 20, appendix A, page 33, reveals the arrangement of the options for an equidistantly formed constellation. Followed by the choices with Walker Pattern (Figure 21, appendix A, page 33), by drag&drop of TLE files (Figure 22, appendix A, page 33), and for a random distribution of orbits (Figure 23, appendix A, page 33). 3.2. Architecture design The application scenario is built from the simulator model’s JSON configuration files, which define the list of available components (i.e., physical, protocol and globals) and their respective parameters (i.e., name, type of expected input, and a short description). Therefore, users can configure the Orbital parameters Configured satellites. Comps. tree Sats. tree Satellite Box Component Boxes Figure 4: Satellite's window with the sat3 configuration view.
21 provided variables, and VCT must be aware of the data introduced corresponds to a correct configuration. The application’s configuration flow is divided into five main sections for each window: (1) Preconfiguration JSON files determines many available contents on the DOM, (2) User event listeners (e.g., clicks, drags, writing inputs…), (3) Each window’s associated JavaScript writes the JSON model representing the current configuration of the module. (4) Each window uses its neighbour’s JSONs (making each configuration block as individual sub-apps), and (5) The final JSON configurations are converted into YAML files. Because litegraph.js is a complete diagram-based library, many design and event behavior are provided by default. In this context, multiple nodes (e.g., sum blocks, event blocks) and options that the application might not interpret may confuse the user. After researching how the library works, the default background grid was replaced by a white square and simplified the “right-click-menu” options. Figure 6: Visual Configuration Tool software architecture. Note that the application is running under Electron’s framework.
22 4. Development This section presents the javascript files with their respective methods that implement the functionalities described for the application. The files are explained as a list summary, and UML diagrams with their relationships are shown. Next, some flowcharts and sequential diagrams of some of the most representative functionalities of this project are shown. However, in the annexes, you can see all of them in code form. Finally, the definition of tests is explained, and the representation of some of them is shown. 4.1. Functionalities implementation This section explains the javascript files used for the configuration. The following section provides a brief explanation of the modules and their relationships. However, a complete UML diagram can be found in the appendix B, Figure 24, page 34. Figure 7: Reduced javascript UML diagram. 4.1.1. Libraries UML files. Analogous to previous section, a detailed explanative list for all the methods of the respective files, can be found in the appendix B.1, page 34-35. As introduced at section 2.2, the GUI uses external libraries covering some of the functionalities required. Regarding to the library for the tree-view’s panel, each of the windows’s back-ends (i.e., components.js, satellite_content.js, system.js) are composed by one instance of this library. That is, in the case of components.js, components_jstree.js makes an instance of a jsTree.js object that has its own variables and methods (defined for the library), and which is used by components.js to manage the contents of it. This behaviour is analogous to the rest of files using this library. On the other hand, sweetalert2.js provides a collection of alert’s designs that can be programmed depending on the needs, in this case, as well for the library js-yaml (that converts a JSON object into a YAML one), the window’s back-ends can directly use the content of this libraries. Globals’s window needs access to the save_configuration’s() methods for each block (i.e., save_components(), save_satellites(), and save_system()) as it needs to be triggered when the user clicks the button “save configuration” from the global’s view. Finally, tabs.js file is the one that manages the changes of view once the user clicks the different windows, and the calls for the methods that redefine or empty the tree-views content.
23 Satellite_content.js (satellite view) uses a diagram’s library (litegraph.js) to define the architecture of its satellites. The library has two classes that controls the diagram, the first, Lcanvas manages the behaviour of the graph, that is, when a link is created it defines the line and where it should be. On the other hand, Lgraph manages the rendering of this orders, that is, when canvas concretes a link, Lgraph shall draw it to the diagram. In this context, LGraph.js defines and creates both instances that are used and synchronized by satellite_content.js. 4.1.2. Satellite UML files. Analogous to previous section, a detailed explanative list for all the methods of the respective files, can be found in the appendix B.1, page 34-35. The following image show the files that are involved into the satellite’s window’s back-end. Satellite_jstree.js contains two jsTree.js objects, (The first for the physical component’s tree, and the list of the current satellites in configuration). These objects are used by satellite_content.js to change their content whenever it is an event that provokes it (e.g., the user deletes a satellite). Figure 8: Satellite UML javascript files diagram. As explained in the previows section, Lgraph.js creates the litegraph.js objects that are managed from satellites_content.js. As an illustrative example, one of the most representative processes of the application, as it applies the communication between libraries, the management of JSON models, and the prevention of the user's invalid configuration, is the drag and drop feature of components from tree-view to satellite's diagram. 4.1.3. Satellite creation and component’s drag and drop flowchart. This section explains how the code works when a user creates a satellite, and then it drops a component from the satellite’s tree-view into the configuration view of the satellite. The following image show the flowcharts of these functionalities. After the user command "create satellite," the code performs a series of comparatives with the object representing the current satellite configuration to decide whether to create it or, in case of failure, to trigger the corresponding alert. For the drag and drop, once the item is dropped, the component configuration is observed to determine the type of module being added, and the satellite configuration is checked to determine if there are other components like the one being added, and thus determine the number of repeats.
24 Figure 9: Drag & drop, and create satellite’s flowchart. 4.1.4. Satellite creation and component’s drag and drop sequence diagram. The following sequence diagram illustrates the code's functionality when a user presses the "create satellite" button, followed by the drag and drop sequence of a component from the tree-view to the satellite in configuration. After the user clicks “create satellite’s” HTML button, it triggers the event listener associated to this action from satellite_content.js file. This functionality checks the cases to determine if it is possible or not to create the satellite. If declined, satellite_content.js uses sweetalert2’s library to create the alert box that shows the error message to the user. Figure 10: (1) left, sweetalert’s event triggered when user creates a different satellite, (2) right, if user tries to create another created component’s ID. On the other hand, if the satellite can be created, satellite_content.js uses the Lgraph object defined in Lgraph, cleans the current configuration after saving it into the JSON model object, and renders with the new information. Sequentially, It communitates with satellite_jstree.js to modify the existent jsTree.js item (tree-view with the satellites list) and add the satellite into the list. For the drag and drop feature, the sequence is analogous to create_sat.
31 7. Conclusions and future development: This project has developed a standalone desktop application based on HTML and javascript, using the Electron’s framework, and tested by Mocha (Unit testing) and Spectron (end-to-end testing). It provides the user with a graphical interface to define the pre-configuration parameters for the DSS- simulator. These variables have to be defined manually in YAML files, which makes it challenging to configure large scenarios without causing any errors in the simulation execution. The GUI developed contains a modular design of the graphic part, which allows the introduction of new visual blocks quickly and easily, without restructuring the HTML and CSS code. Additionally, the application is flexible with the content displayed on the screen that defines the available configurations; it is built from the models defined by an experienced user in the simulator. Consequently, it represents a critical aspect since the GUI is prepared to understand and display its interface components that the experienced users will define in the future. This project is defined by general and specific requirements for each programming block. It considers both the user's needs and those of the simulator itself since this GUI works as an external block that communicates with it. To carry out the graphic design, the available technologies have been studied, and it has been designed so that it is modular for future implementations. For the code development part, a flexible and dynamic software has been designed with the DSS-Sim configurations, using and coordinating external libraries for certain functionalities (e.g., the diagrams that configure the architecture of a satellite). Finally, a testing tool has been introduced to verify and demonstrate the robustness of the code. The DSS-Sim project is in GitHub's nanosatlab/dss-sim: Distributed Satellite System Simulator (github.com) repository, which will be released to the general public shortly. 7.1. Future development The application has been prepared so that the rest of the functionalities that are yet to be implemented could be. It was decided in team meetings which tasks were priorities and which were not, and which could therefore be excluded from the compliance list. The core of the project, i.e., the HTML design, code structure, basic functionalities, and the primary purpose of the software, have already been achieved in this project. However, there are selfimposed requirements that determine additional functionalities that enrich the project. Referencing the compliance matrix, the implementation of ground stations is a module that improves the configuration of the simulator. Likewise, making a graphical representation of the orbits in design within the systems window was indicated, which, once implemented, would help the user to have a pre-conceived idea of the simulation to be performed.
32 Bibliography: [1] S.Dinesh, G.Sonal. "Qualnet simulator". SCALABLE Network Tecnhologies, 2008. [Online] Available: QualNet - Network Simulation Software | SCALABLE Networks (scalable-networks.com). [2] Omnet++, Open-source "Discrete Event Simulator". OpenSim Ltd, 2001-2019. [Online] Available: OMNeT++ Discrete Event Simulator (omnetpp.org). [3] NS-3, "Network Simulator". nsnam, 2011. [Online] Available: ns-3 | a discrete-event network simulator for internet systems (nsnam.org). [4] ARAGUZ LÓPEZ, Carles, et al. Simulating distributed small satellite networks: A model-based tool tailored to decentralized resource-constrained systems. In: Proceedings of the 70th International Astronautical Congress. 2019. p. 1-10. [5] Qt, The Qt Company. "interface framework". QTCOM, 2020. [Online] Available: Qt | Cross-platform software development for embedded & desktop. [6] wxWidgets, "c++ library for creating applications.". wxWidgets, 2021. [Online] Available: wxWidgets: Cross-Platform GUI Library. [7] Electron, "Desktop applications with javascript, HTML, and CSS". OpenJS Foundation, 2012. [Online] Available: Electron | Build cross-platform desktop apps with JavaScript, HTML, and CSS. (electronjs.org). [8] C.Sears, "Photonkit". MIT License, 2012. [Online] Available: Photon (photonkit.com). [9] jQuery, "Javascript library". OpenJS Foundation, 2010. [Online] Available: jQuery [10] I.Bozhanov, "jstree". MIT License, 2014. [Online] Available: jsTree. [11] zTree/zTree_v3: jQuery Tree Plugin (github.com) [12] Daweilv, "Treejs". MIT License, 2018. [Online] Available: Dynamic Tree View With Checkboxes - Treejs | CSS Script. [13] J.Agenjo, "litegraph.js". [Online] Available: litegraph.js/ at master · jagenjo/litegraph.js (github.com). [14] Sweetalert2, "replacement for javascript’s popup boxes". [Online] Available: SweetAlert2 - a beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. [15] Js-yaml, "YAML parser"., npm, 2014. [Online] Available: js-yaml - npm (npmjs.com) [16] Jest, "Javascript testing framework"., Facebook, INC, 2021. [Online] Available: Jest · 🃏 Delightful JavaScript Testing (jestjs.io). [17] Mocha, "Javascript testing framework"., OpenJS Foundation, 2014. [Online] Available: Mocha - the fun, simple, flexible JavaScript test framework (mochajs.org). [18] Puppeteer, "Javascript testing framework"., npm, 2014. [Online] Available: Puppeteer v9.0.0 (pptr.dev) [19] Chai, “Assertion library”, GoogleGroup, freenode IRC, [Online] Available: Chai (chaijs.com). [20] J.Huggins, “Selenium”, Software Freedom Conservancy, 2004. [Online] Available: SeleniumHQ Browser Automation [21] JSDOM, “Javascript web standards”, npm 2014, [Online] Available: jsdom/jsdom: A JavaScript implementation of various web standards, for use with Node.js (github.com).
33 Appendices A. Graphical Design. The following images are related with the explanation of the visual interface design. Figure 18: Physical component's window Central Panel. Figure 19: System Window with single option. F.a.4 Parameters table Pre-configuration files defines its content. Collapsible (opened) F.d.1 F.d.2
34 Figure 20: Equidistant orbit option. Figure 21: Walker Pattern orbit option. Figure 22: Dropping TLE files option. Figure 23: Randomly distributed satellites option.
35 B. Code explanation This section of the appendices, complements the section 4. With a detailed list of all the method’s functionalities and a full detailed UML diagram. Figure 24: Complete javascript files UML diagram. B.1. Satellite UML methods: JS-YAML: JSON to YAML library. Sweetalert2.js: Alert library. Used when the user makes invalid configurations. Litegraph.js: The diagram library used to represent the satellite’s configuration. - LGraphCanvas: Manages the functionalities of the diagram. - LGraph: Manages the visualizations of the graph. - Render_canvas_border: Indicates if the diagram’s border is shown. - Background_image: Defines the base64 image for the graph’s background.
36 Lgraph.js: Declares the graph and canvas object from Litegraph.js and attaches them to HTML satellite’s CP division. - Canvas.getNodeMenuOptions(node): Defines the available options shown at the context menu for the selected node. - Canvas.getCanvasMenuOptions(): Limits the available options shown at the context menu of the canvas. - Graph.start(): Starts the configured graph to the canvas’s HTML division. jsTree.js: Tree-view library. satellite_jstree.js: Defines the jsTree objects controlling the tree-views of components and satellites. Satellite_content.js: Back-end of the satellite’s window. - Satellites_model: Javascript object, which stores the current satellite’s window configuration. - Components: Javascript object representing the physical component’s configuration. - Load_sat_tree(): Checks component’s object and fills the tree-view information. - Empty_tree_sat(): Empties tree-view to be reloaded without duplicate information when returning to satellite’s window view. - $(“.btn_create_sat”).click(): Event listener to btn_create_sat HTML element. Creates a new visual item on the graph. - Custom_menu(node): Defines the options to be shown when right-clicking the graph’s node. - $(document).on(“dnd_stop.vakata”, function(event, data): Event listener to dnd_stop.vakata event (triggered when an object is dropped). Creates a new visual component to satellite’s graph. - Modelsat_add_satellite(sat_id): Adds the specified satellite to the satellites_model object. - Modelsat_save_graph(sat_id): Saves the current graph’s configuration to the satellite_model specified satellite. - Modelsat_add_component(sat_id, component): Attaches the specified component to the respective satellite from the satellites_model object. - Modelsat_delete_satellite(sat_id): Removes the satellite from the satellites_model object. - Modelsat_save_models(satellite): Stores the satellite’s graph current configuration to its analogous on the satellites_model object. - Jstree_add_satellite(sat_id): Adds a new satellite item to jstree sat list. - Jstree_delete_satellite(sat_id): Removes the satellite from jstree sat list. - Search_sat_nodes(): Returns the graph’s node that corresponds to satellite definition. - Update_graph_models(): Updates Lgraph and satellites_model information to be synchronized with the rest of the windows. (e.g., when deleting a component, if some satellite has it, has to be removed). - Update_graph_model(): Looped from above. Manages the satellites_model information. - Update_graph_nodes(): Looped from above. Manages the litegraph’s diagram visual items. - Save_satellites(): Converts the current satellites_model’s JSON object to YAML file. - Globals.js: back – end from global’s window. It calls the individual’s save_configurations() when the “save configuration” button is clicked. - Tabs.js: Manages the function calls when clicking the HTML tab items.
37 B.2. Physical components UML methods. Components_jstree.js: Defines the jsTree object that shows the available components (extracted from model files). Components.js: Back-end of the component’s window. - Physical_components: Javascript object, obtained from model pre-configuration files, that defines the available components that user can configure. - Components: Javascript object representing the physical component’s configuration. - $(“.components_window_content”).on(“click”, “.comp_collapsible”, function(): Event listener for the event click on a collapsible item, it toggles collpasible’s content between opened and closed. - $(“.components_window_content”).on(“click”, “.btn_close”, function(event): Dynamically listen (jQuery event delegation) for btn_close elements to be clicked, removes the component from the components model file. - $(“.btn_create”).click(function(): Event listener to btn_create HTML element. Creates a new collapsible representing the component’s information. - new_collapsible(): Used from above, it creates the new collapsible HTML element. - new_content(type): Used from above, it fills the parameters from the collapsible considering the information of the component’s type from physical_components file. - Model_add_component(comp_type, comp_name): Creates an empty object with the basic information and pushes to the component’s model array. - Model_edit_comp_id(component_id, new_id): Changes the component id from component’s model file. - model_delete_component(component_id): Deletes the component object from component’s model array. - Model_add_parameter(component_id, parameter_name, ref): Find the component from model array, and adds a new parameter. - Model_delete_variables(component_id, parameter_name): Executed once the user sets false, 0 or null to a variable. It deletes all the variables previously created for the variable_name from component’s model array. - Model_change_parameter(component_id, parameter_name, parameter_value): Find the component from model’s array and updates the parameter. - Model_delete_parameter(component_id, parameter_name): Triggered when user empties an existant parameter, it deletes from the component’s model correpondant element. - My_alert(alert_val): Helper to manage the alerts system. - $(“.components_window_content”).on(“blur”, “.input_comp_id”, function(): Manages the event when the rename_field is blurred, alerts the user if there is an already created component with the same id, renames it if not, and ignores the command if the field is emptied. - $(“.component_window_content”).on(“click”, “.btn_edit”, function(event): Event listener to the .btn_edit HTML element. It triggers the visualization of rename_field. - $(“.component_window_content”).on(“keypress”, “[contenteditable]”: Checks if keypress is enter, and activates the blur event. - $(“.component_window_content”).on(“blur”, “[contenteditable]”, function(event): Checks if parameter is already defined, if isn’t creates it, if is, changes it. Checks if contenteditable is empty and deletes the component if it was defined. - Save_components(): Converts the current component’s JSON object to YAML file.
38 B.3. System UML methods. System_jstree.js: Defines the jsTree object controlling the tree-view of satellites and their components. System.js: Back-end of the system’s window. - Systems_model: Javascript object, which stores the current system’s window configuration. - Components: Javascript object representing the physical component’s configuration. - Satellites_model: Javascript object representing the satellites’s configuration. - Load_system_tree(): Updates the system tree by matching with the current satellite’s model configuration. - Search_component_model(comp_id): search and return the component model that matches comp_id. - Tree_system_add_satellite_parameters(satellite, tree_satellite): Fills the parameters of each created satellite for the tree-view. - Tree_system_add_component_parameters(sat_component, component_model): Updates the parameters of each component on jstree. - Empty_tree_system(): Empties the jstree from system view. - $(“#const_types”).change(function(): Changes the constellation’s configuration menu when clicked an option from the drop-down. - $(“.single_form_items”).on(“blur”, “#single_ecc”, function(): Filters the data of eccentricity putted by the user, and alerts it if needed. - $(“.single_form_items”).on(“blur”, “#single_sma”, function(): Filters the data of semimajor axis putted by the user, and alerts it if needed. - $(“.single_form_items”).on(“blur”, “#single_incl”, function(): Filters the data of inclination putted by the user, and alerts it if needed. - $(“.single_form_items”).on(“blur”, “#single_raan”, function(): Filters the data of the ascending node putted by the user, and alerts it if needed. - $(“.single_form_items”).on(“blur”, “#single_argp”, function(): Filters the data of periapsis putted by the user, and alerts it if needed. - $(“.single_form_items”).on(“blur”, “#single_ma”, function(): Filters the data of mean anomaly putted by the user, and alerts it if needed. - $(“.system_header”).on(“click”, “#create_single”, function(): Event listener for create_single HTML element. Get the values from the single form and creates an orbit with the specified satellite. - $(“.system_header”).on(“click”, “#clear_single”, function(): Clears the values from all fields of single’s form. - $(“.system_tbl_body”).on(“click”, “#delete_single”, function(): Event listener to delete_single event, ubicated and the last column from the system’s table, and deletes the satellite with its orbit. - $(“.system_tbl_body”).on(“keypress”, “[contenteditable]”, function(): Analogous with physical components parameter’s table. - $(“.system_tbl_body”).on(“blur”, “[contenteditable]”, function(): Analogous with physical components. - Next_sat_id(orbit_id, m_sat_id): Search the next object in system.space array and returns it. - Create_single(m_sat_id, sat_type, orbit_id, ecc, sma, incl, raan, argp, ma): Reads the values set by user and inserts a row to the system’s table. - Modelsys_add_single_system(m_sat_id, sat_type, orbit_id, ecc, sma, incl, raan, argp, ma): Adds new orbit to the system’s model. - Modelsys_add_satellite(m_sat_id, sat_type, orbit_id, ecc, sma, incl, raan, argp, ma): Adds a satellite to the orbit_id system. - Modelsys_rename_system(system, new_id): Renames the constellation id.
39 - Modelsys_delete_system(system_id): Deletes the system from the system’s model object. - Modelsys_delete_satellite(system_id, sat_id): Deletes the satellite from the system’s model object. - Modelsys_save_systems(system): Prepares an object with the current system’s model configuration, to be converted to YAML. - Load_sat_types(): Gets the list of satellites and creates an option for each to the sat_types drop-down. - Empty_sat_types(): Empties the list of satellites when user changes the window’s view. - Update_systems(): Updates systems model according to satellite’s current configuration. Save_systems(): Converts the current system’s JSON object to YAML file. C. Testing The pictures of this section illustrates how the testing works. (explained at section 4.2) Figure 25: At left, Linux’s console with the information of tests. At right, automated GUI testing. Figure 26: Unit testing the model management from components and system.
40 Glossary A list of all acronyms and the meaning they stand for. DSS. Distributed Satellite System. VCT. Visual Configuration Tool. UI. User Interface. GUI. Graphical User Interface. DOM. Document Model Object. EO. Earth Observation. CP. Central Panel. TL. Tree List.