burrow-pi-img/deps/tools/configServer/src/Application.h
Peter Johnson c85fd9f33c
Revamp image to build dependencies as part of stages (#83)
Fixes #17.

Stage 2 is fairly minimal, stage 3 builds/installs OpenCV and WPILib et al, and stage 4
builds/installs the FRCVision webdash and adds the vision examples.

Other changes:
- OpenCV compiled with ffmpeg, OpenBLAS, and libgtk (fixes #79, fixes #80)
- OpenBLAS added to image (fixes #65)
- C++ Makefile is more easily extensible (fixes #71)
- Sources for everything are bundled into image into /usr/src
- README updated (fixes #16)
- pkg-config files for wpilibc et al are now installed and C++ Makefile uses them (if compiled local to Pi)
- Both dynamic and static libs are included in image

The only downside of all these changes (particularly the ffmpeg, OpenBLAS, and libgtk inclusion)
is the image size is now over 3GB (800MB compressed). The previous image didn't quite fit on a
2GB card however.
2019-02-02 23:37:18 -08:00

49 lines
1.5 KiB
C++

/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef RPICONFIGSERVER_APPLICATION_H_
#define RPICONFIGSERVER_APPLICATION_H_
#include <functional>
#include <memory>
#include <string>
#include <wpi/ArrayRef.h>
#include <wpi/Signal.h>
#include <wpi/StringRef.h>
namespace wpi {
class json;
} // namespace wpi
class Application {
struct private_init {};
public:
explicit Application(const private_init&) {}
Application(const Application&) = delete;
Application& operator=(const Application&) = delete;
void Set(wpi::StringRef appType, std::function<void(wpi::StringRef)> onFail);
int StartUpload(wpi::StringRef appType, char* filename,
std::function<void(wpi::StringRef)> onFail);
void Upload(int fd, bool text, wpi::ArrayRef<uint8_t> contents);
void FinishUpload(wpi::StringRef appType, int fd, const char* tmpFilename,
std::function<void(wpi::StringRef)> onFail);
void UpdateStatus();
wpi::json GetStatusJson();
wpi::sig::Signal<const wpi::json&> status;
static std::shared_ptr<Application> GetInstance();
};
#endif // RPICONFIGSERVER_APPLICATION_H_