All Products
Search
Document Center

DataV:how-to-use-DataV-WS

Last Updated:Apr 18, 2024

This topic describes how to use DataV-WS.

DataV-WS service structure

DataV-WS integrates the static file service and WebSocket. The static file service is used to load local model addresses. WebSocket can be used in the blueprint editor to connect multiple projects in the same network range without additional development.

DataV-WS document directories

文档目录

Important

Do not delete the assets directory.

Start and stop DataV-WS

  • Windows:

    1. Download the DataV-WS installation package.

    2. Decompress the package and double-click the datav_ws_win.exe file.

    3. View the returned message. If the following information appears, DataV-WS is started:

      Server listen on IP address (e.g. 127.0.0.1):8181
      Important

      Do not close the command prompt after the start.

    4. After the DataV-WS service is enabled, you can develop and demonstrate the WebSocket service, model service, and static resource service. For more information, see Configure DataV-WS services.

  • Linux or macOS:

    1. Run the following command to download the DataV-WS installation package:

      wget http://sh-conf.oss-cn-shanghai.aliyuncs.com/doc_files/datav_ws.zip                      
    2. Decompress the package, start the terminal, and enter the service directory, for example, datav-ws.

    3. Run the following command. By default, the service is started on port 8181:

      chmod 777 *
      sh exec.sh start
      Note
      • You can run the sh exec.sh stop command to stop DataV-WS.

      • You can run the sh exec.sh restart command to restart DataV-WS.

    4. After the DataV-WS service is enabled, you can develop and demonstrate the WebSocket service, model service, and static resource service. For more information, see Configure DataV-WS services.

Configure DataV-WS

You can configure WebSocket and the static file service.

  • Configure WebSocket.

    • Development:

      1. Start the DataV-WS service locally. For more information, see Start and stop DataV-WS services.

      2. Log on DataV console.

      3. Create an empty DataV project.

      4. In the upper-left corner of the Canvas Editor page, click the Blueprint Editor icon to switch to the Blueprint Editor page. 蓝图编辑器界面入口

      5. In the blueprint editor, drag and drop the WebSocket node to the canvas.

      6. Click the WebSocket node in the blueprint editor and set Socket Endpoint to ws://127.0.0.1:8181. 设置socket服务地址

    • Demonstration:

      1. Start the DataV-WS service on the demo machine or on a machine in the same network segment. For more information, see Start and stop DataV-WS services.

      2. Add a WebSocket node. Set Socket Endpoint of the WebSocket node to ws://IP address of the demonstration server:8181. The projects that use the two WebSocket nodes can communicate with each other.

  • Configure the model service.

    • Development:

      1. Start the DataV-WS service locally. For more information, see Start and stop DataV-WS services.

      2. Place the model into the assets folder in the DataV-WS service. 模型放入目录

      3. Log on DataV console.

      4. Create an empty DataV project.

      5. For more information, see Add assets in Canvas Editor. On the Canvas Editor page, create the required DataV 3D engine component and add the Model Loader component.

        Note

        DataV 3D Engine is a non-generic component. If you need to use this component, contact the DataV sales staff to make an offline purchase before using it.

      6. Set the model address in the Model Loader component to http://IP address: 8181 /Model file name.

    • Demonstration:

      1. Copy the datav_ws folder generated during the development phase to the demo machine on the same network segment.

      2. Start the DataV-WS service on the demo machine. For more information, see Start and stop the DataV-WS service.

      3. Open the visualization application that needs to be demonstrated to get the model content on the service.

  • Configure the static file service.

    1. Start the DataV-WS service locally. For more information, see Start and stop DataV-WS services.

    2. Place static resources, such as images, into assets folders in the DataV-WS service. 图片资源目录

    3. Log on DataV console.

    4. Create an empty DataV project.

    5. For more information, see Add assets in Canvas Editor. In the canvas editor, create the required single image widget.

    6. Set the file address of the background image edit box of the Single Image component to http://IP address: 8181/p2544435894.webp. 图片地址