Improve:MissionManager include cleaner.
This commit is contained in:
parent
21a97dc6f2
commit
ac578c063a
|
@ -13,7 +13,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "AppMonitor.h"
|
||||
#include "IAppManager.h"
|
||||
#include "ILog.h"
|
||||
#include "IStorageManager.h"
|
||||
#include "StatusCode.h"
|
||||
#include <vector>
|
||||
AppMonitor::AppMonitor() : mMicStatus(SwitchStatus::END)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,13 @@
|
|||
*/
|
||||
#include "DataProcessing.h"
|
||||
#include "ILog.h"
|
||||
#include "IMissionManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "KeyControl.h"
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
const bool NOT_EXECUTED = false;
|
||||
const bool EXECUTED = true;
|
||||
key_event_data::key_event_data(const std::string &keyName, const KeyEvent &keyEvent, const unsigned int &holdTime)
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
*/
|
||||
#include "IMissionManager.h"
|
||||
#include "ILog.h"
|
||||
#include "StatusCode.h"
|
||||
#include <memory>
|
||||
std::shared_ptr<IMissionManager> &IMissionManager::GetInstance(std::shared_ptr<IMissionManager> *impl)
|
||||
{
|
||||
static auto instance = std::make_shared<IMissionManager>();
|
||||
|
|
|
@ -13,10 +13,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "IdleState.h"
|
||||
#include "IFilesManager.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "ILog.h"
|
||||
#include "IMediaManager.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include "IStateMachine.h"
|
||||
IdleState::IdleState() : State("IdleState")
|
||||
{
|
||||
// mEventHandle[InternalStateEvent::MEDIA_REPORT_EVENT] = std::bind(&IdleState::MediaReportHandle, this, _1);
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
*/
|
||||
#include "LedsHandle.h"
|
||||
#include "ILog.h"
|
||||
#include "LedControl.h"
|
||||
#include "SetLedState.h"
|
||||
void LedsHandle::ControlDeviceStatusLed(const DeviceStatus &status, const long int &keepAliveTime,
|
||||
const unsigned int &blinkPeriod)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "McuMonitor.h"
|
||||
#include "ILog.h"
|
||||
#include "IMcuManager.h"
|
||||
#include <memory>
|
||||
void McuMonitor::Init(std::shared_ptr<VMcuMonitor> &monitor)
|
||||
{
|
||||
IMcuManager::GetInstance()->SetMcuMonitor(monitor);
|
||||
|
|
|
@ -13,10 +13,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "MediaHandleState.h"
|
||||
#include "IFilesManager.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "ILog.h"
|
||||
#include "IMediaManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "MediaTaskHandle.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
MediaHandleState::MediaHandleState() : State("MediaHandleState")
|
||||
{
|
||||
mEventHandle[InternalStateEvent::RESET_KEY_MEDIA_TASK] =
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "MediaTask.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "IMediaManager.h"
|
||||
#include <memory>
|
||||
MediaTask::MediaTask(const MediaTaskType &type, const InternalStateEvent &bindEvent,
|
||||
const std::weak_ptr<VMediaTaskIniator> &iniator)
|
||||
: mType(type), mBindEvent(bindEvent), mIniator(iniator)
|
||||
|
|
|
@ -13,8 +13,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "MediaTaskHandle.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "ILog.h"
|
||||
#include "IMediaManager.h"
|
||||
#include "IMissionManager.h"
|
||||
#include "MediaTask.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include "StatusCode.h"
|
||||
#include <memory>
|
||||
MediaTaskHandle::MediaTaskHandle()
|
||||
{
|
||||
mMediaHandle.reset();
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "MissionManager.h"
|
||||
#include "IAppManager.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include "StatusCode.h"
|
||||
const StatusCode MissionManager::Init(void)
|
||||
{
|
||||
MissionStateMachine::GetInstance()->Init();
|
||||
|
|
|
@ -14,16 +14,21 @@
|
|||
*/
|
||||
#include "MissionManagerMakePtr.h"
|
||||
#include "ILog.h"
|
||||
#include "IMcuManager.h"
|
||||
#include "IMissionManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "IdleState.h"
|
||||
#include "MediaHandleState.h"
|
||||
#include "MissionManager.h"
|
||||
#include "OnMissionState.h"
|
||||
#include "PirTriggeredMissionState.h"
|
||||
#include "SdCardHandleState.h"
|
||||
#include "StatusCode.h"
|
||||
#include "StorageHandleState.h"
|
||||
#include "TestMissionState.h"
|
||||
#include "TopState.h"
|
||||
#include "UpgradeState.h"
|
||||
#include <memory>
|
||||
bool CreateMissionManagerModule(void)
|
||||
{
|
||||
auto instance = std::make_shared<IMissionManager>();
|
||||
|
|
|
@ -13,9 +13,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "MissionState.h"
|
||||
#include "IAppManager.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "ILog.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "LedsHandle.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include <functional>
|
||||
#include <string>
|
||||
MissionState::MissionState(const std::string &name) : State(name)
|
||||
{
|
||||
mEventHandle[InternalStateEvent::MEDIA_REPORT_EVENT] = std::bind(&MissionState::MediaReportHandle, this, _1);
|
||||
|
|
|
@ -15,8 +15,13 @@
|
|||
#include "MissionStateMachine.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "ILog.h"
|
||||
#include "IMcuManager.h"
|
||||
#include "IMissionManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "McuAskBase.h"
|
||||
#include "MissionManagerMakePtr.h"
|
||||
#include "StatusCode.h"
|
||||
#include <memory>
|
||||
// #include "TopState.h"
|
||||
std::shared_ptr<MissionStateMachine> &MissionStateMachine::GetInstance(std::shared_ptr<MissionStateMachine> *impl)
|
||||
{
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
*/
|
||||
#include "OnMissionState.h"
|
||||
#include "ILog.h"
|
||||
#include "IStorageManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "MissionState.h"
|
||||
#include "MissionStateMachine.h"
|
||||
OnMissionState::OnMissionState() : MissionState("OnMissionState")
|
||||
{
|
||||
|
|
|
@ -12,10 +12,11 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "PirTriggeredMissionState.h"
|
||||
#include "ILog.h"
|
||||
#include "IStorageManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "MissionState.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include "PirTriggeredMissionState.h"
|
||||
PirTriggeredMissionState::PirTriggeredMissionState() : MissionState("PirTriggeredMissionState")
|
||||
{
|
||||
// mEventHandle[InternalStateEvent::ANY_STATE_SD_STATUS_PERORIED] =
|
||||
|
|
|
@ -13,10 +13,18 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "SdCardHandleState.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "IFilesManager.h"
|
||||
#include "ILog.h"
|
||||
#include "IMediaManager.h"
|
||||
#include "IMissionManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "IStorageManager.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include "StatusCode.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
using std::placeholders::_1;
|
||||
SdCardHandleState::SdCardHandleState() : State("SdCardHandleState"), mSdCardStatus(StorageEvent::END)
|
||||
{
|
||||
mEventHandle[InternalStateEvent::MEDIA_REPORT_EVENT] = std::bind(&SdCardHandleState::MediaReportHandle, this, _1);
|
||||
|
|
|
@ -13,6 +13,11 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "SetLedState.h"
|
||||
#include "IDeviceManager.h"
|
||||
#include "LedControl.h"
|
||||
#include "StatusCode.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
SetLedState::SetLedState(const LedState &state, const unsigned int &keepAliveTime, const unsigned int &blinkPeriod)
|
||||
: mState(state), mKeepAliveTime(keepAliveTime), mBlinkPeriod(blinkPeriod)
|
||||
{
|
||||
|
|
|
@ -13,9 +13,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "StorageHandleState.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "ILog.h"
|
||||
#include "IMediaManager.h"
|
||||
#include "IMissionManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "IStorageManager.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
StorageHandleState::StorageHandleState() : State("StorageHandleState")
|
||||
{
|
||||
mEventHandle[InternalStateEvent::STORAGE_HANDLE_STATE_INIT] =
|
||||
|
|
|
@ -13,10 +13,17 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "TestMissionState.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "IAppManager.h"
|
||||
#include "ILog.h"
|
||||
#include "IMissionManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "IStorageManager.h"
|
||||
#include "LedsHandle.h"
|
||||
#include "MissionState.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
TestMissionState::TestMissionState() : MissionState("TestMissionState")
|
||||
{
|
||||
mEventHandle[InternalStateEvent::ANY_STATE_SD_STATUS_PERORIED] =
|
||||
|
|
|
@ -13,10 +13,19 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "TopState.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "IDeviceManager.h"
|
||||
#include "ILog.h"
|
||||
#include "IMcuManager.h"
|
||||
#include "IMediaManager.h"
|
||||
#include "IMissionManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "KeyControl.h"
|
||||
#include "McuMonitor.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include "StatusCode.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
TopState::TopState() : State("TopState")
|
||||
{
|
||||
mEventHandle[InternalStateEvent::STORAGE_HANDLE_STATE_INIT] =
|
||||
|
|
|
@ -13,10 +13,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "UpgradeState.h"
|
||||
#include "DataProcessing.h"
|
||||
#include "IHuntingUpgrade.h"
|
||||
#include "ILog.h"
|
||||
#include "IMediaManager.h"
|
||||
#include "IStateMachine.h"
|
||||
#include "MissionStateMachine.h"
|
||||
#include <functional>
|
||||
UpgradeState::UpgradeState() : State("UpgradeState")
|
||||
{
|
||||
mEventHandle[InternalStateEvent::CHECK_UPGRADE_FILE] = std::bind(&UpgradeState::CheckUpgradeFileHandle, this, _1);
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
*/
|
||||
#include "IMediaManager.h"
|
||||
#include "ILog.h"
|
||||
#include "StatusCode.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
media_report_event::media_report_event(const std::string &fileName, const MediaChannel &mediaChannedl)
|
||||
: mFileName(fileName), mMediaChannedl(mediaChannedl)
|
||||
{
|
||||
|
|
|
@ -13,8 +13,17 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "MediaHandle.h"
|
||||
#include "IHalCpp.h"
|
||||
#include "ILog.h"
|
||||
#include "IMediaManager.h"
|
||||
#include "SaveStream.h"
|
||||
#include "StatusCode.h"
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
MediaHandle::MediaHandle(const MediaChannel &mediaChannel, const std::shared_ptr<VCameraHal> &cameraHal)
|
||||
: mMediaChannel(mediaChannel), mCameraHal(cameraHal), mTaskRuning(false)
|
||||
{
|
||||
|
|
|
@ -13,8 +13,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "MediaManagerImpl.h"
|
||||
#include "IHalCpp.h"
|
||||
#include "ILog.h"
|
||||
#include "IMediaManager.h"
|
||||
#include "MediaHandle.h"
|
||||
#include "StatusCode.h"
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
StatusCode MediaManagerImpl::Init(void)
|
||||
{
|
||||
IHalCpp::GetInstance()->GetCameraHal(mAllCameras);
|
||||
|
|
|
@ -14,7 +14,10 @@
|
|||
*/
|
||||
#include "MediaManagerMakePtr.h"
|
||||
#include "ILog.h"
|
||||
#include "IMediaManager.h"
|
||||
#include "MediaManagerImpl.h"
|
||||
#include "StatusCode.h"
|
||||
#include <memory>
|
||||
bool CreateMediaManagerModule(void)
|
||||
{
|
||||
auto instance = std::make_shared<IMediaManager>();
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
*/
|
||||
#include "SaveStream.h"
|
||||
#include "ILog.h"
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
SaveStream::SaveStream() : mFileAudio(nullptr), mFileVideo(nullptr)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user