Apollo 10.0
自动驾驶开放平台
hmi.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include <memory>
20#include <string>
21
26
31namespace apollo {
32namespace dreamview {
33
34class HMI {
35 public:
36 using DvCallback = std::function<nlohmann::json(
37 const std::string &function_name, const nlohmann::json &param_json)>;
38 HMI(WebSocketHandler *websocket, MapService *map_service);
39 void Start(DvCallback callback_api);
40 void Stop();
41 bool UpdateScenarioSetToStatus(const std::string &scenario_set_id,
42 const std::string &scenario_set_name);
43 bool UpdateDynamicModelToStatus(const std::string &dynamic_model_name);
46 bool UpdateCameraChannelToStatus(const std::string& channel_name);
47 bool UpdatePointChannelToStatus(const std::string& channel_name);
48
49 private:
50 // Send VehicleParam to the given conn, or broadcast if conn is null.
51 void SendVehicleParam(WebSocketHandler::Connection *conn = nullptr);
52 void SendStatus(WebSocketHandler::Connection *conn = nullptr);
53
54 void RegisterMessageHandlers();
55
56 std::unique_ptr<HMIWorker> hmi_worker_;
58
59 // No ownership.
60 WebSocketHandler *websocket_;
61 MapService *map_service_;
62};
63
64} // namespace dreamview
65} // namespace apollo
std::function< nlohmann::json(const std::string &function_name, const nlohmann::json &param_json)> DvCallback
Definition hmi.h:37
bool UpdateDynamicModelToStatus(const std::string &dynamic_model_name)
Definition hmi.cc:243
bool UpdatePointChannelToStatus(const std::string &channel_name)
Definition hmi.cc:256
bool UpdateRecordToStatus()
Definition hmi.cc:247
bool UpdateCameraChannelToStatus(const std::string &channel_name)
Definition hmi.cc:251
bool UpdateScenarioSetToStatus(const std::string &scenario_set_id, const std::string &scenario_set_name)
Definition hmi.cc:237
void Start(DvCallback callback_api)
Definition hmi.cc:52
bool UpdateVehicleToStatus()
Definition hmi.cc:249
The WebSocketHandler, built on top of CivetWebSocketHandler, is a websocket handler that handles diff...
The class of MonitorLogBuffer
class register implement
Definition arena_queue.h:37