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
22
#include "
modules/common/monitor_log/monitor_log_buffer.h
"
23
#include "
modules/dreamview/backend/common/handlers/websocket_handler.h
"
24
#include "
modules/dreamview/backend/hmi/hmi_worker.h
"
25
#include "
modules/dreamview/backend/common/map_service/map_service.h
"
26
31
namespace
apollo
{
32
namespace
dreamview {
33
34
class
HMI
{
35
public
:
36
using
DvCallback
= std::function<nlohmann::json(
37
const
std::string &function_name,
const
nlohmann::json ¶m_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);
44
bool
UpdateRecordToStatus
();
45
bool
UpdateVehicleToStatus
();
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_;
57
apollo::common::monitor::MonitorLogBuffer
monitor_log_buffer_;
58
59
// No ownership.
60
WebSocketHandler
*websocket_;
61
MapService
*map_service_;
62
};
63
64
}
// namespace dreamview
65
}
// namespace apollo
hmi_worker.h
apollo::common::monitor::MonitorLogBuffer
class MonitorLogBuffer
Definition
monitor_log_buffer.h:60
apollo::dreamview::HMI
Definition
hmi.h:34
apollo::dreamview::HMI::Stop
void Stop()
Definition
hmi.cc:54
apollo::dreamview::HMI::DvCallback
std::function< nlohmann::json(const std::string &function_name, const nlohmann::json ¶m_json)> DvCallback
Definition
hmi.h:37
apollo::dreamview::HMI::UpdateDynamicModelToStatus
bool UpdateDynamicModelToStatus(const std::string &dynamic_model_name)
Definition
hmi.cc:243
apollo::dreamview::HMI::UpdatePointChannelToStatus
bool UpdatePointChannelToStatus(const std::string &channel_name)
Definition
hmi.cc:256
apollo::dreamview::HMI::UpdateRecordToStatus
bool UpdateRecordToStatus()
Definition
hmi.cc:247
apollo::dreamview::HMI::UpdateCameraChannelToStatus
bool UpdateCameraChannelToStatus(const std::string &channel_name)
Definition
hmi.cc:251
apollo::dreamview::HMI::UpdateScenarioSetToStatus
bool UpdateScenarioSetToStatus(const std::string &scenario_set_id, const std::string &scenario_set_name)
Definition
hmi.cc:237
apollo::dreamview::HMI::Start
void Start(DvCallback callback_api)
Definition
hmi.cc:52
apollo::dreamview::HMI::UpdateVehicleToStatus
bool UpdateVehicleToStatus()
Definition
hmi.cc:249
apollo::dreamview::MapService
Definition
map_service.h:43
apollo::dreamview::WebSocketHandler
The WebSocketHandler, built on top of CivetWebSocketHandler, is a websocket handler that handles diff...
Definition
websocket_handler.h:46
apollo::dreamview::WebSocketHandler::Connection
mg_connection Connection
Definition
websocket_handler.h:54
map_service.h
monitor_log_buffer.h
The class of MonitorLogBuffer
apollo
class register implement
Definition
arena_queue.h:37
websocket_handler.h
modules
dreamview
backend
hmi
hmi.h