Skip to content

Commit

Permalink
Merge pull request #4 from BTK203/master
Browse files Browse the repository at this point in the history
Reliability Updates
  • Loading branch information
BTK203 authored Nov 30, 2019
2 parents 68a2f55 + fe9533f commit 90b65ab
Show file tree
Hide file tree
Showing 32 changed files with 1,797 additions and 1,218 deletions.
Binary file modified KiwiLight - Vision Code/KiwiLight
Binary file not shown.
540 changes: 540 additions & 0 deletions KiwiLight - Vision Code/KiwiLight.cpp

Large diffs are not rendered by default.

91 changes: 89 additions & 2 deletions KiwiLight - Vision Code/KiwiLight.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,96 @@ namespace KiwiLight {
UI_STREAM,
UI_RUNNER,
UI_EDITOR,
UI_QUTTING
UI_PAUSING
};

/**
* Its KiwiLight! Handles everything from building, starting, calling and things in the UI.
*/
class KiwiLightApp {
public:
//UI building and starting
static void Create(int argc, char *argv[]);
static void Start();

//UI accessors
static Runner GetRunner();
static ConfigEditor GetEditor();

//camera accessors
static Mat TakeImage();
static double GetCameraProperty(int propId);
static bool CameraOpen();

//camera mutators
static void SetCameraProperty(int propId, double value);

//general accessors
static bool LastImageCaptureSuccessful();
static UIMode CurrentMode();

//misc. UI callbacks
static void CloseEditor(bool saveFirst);
static void StartEditorLearningTarget();
static void StartEditorLearningDistance();
static void EditorReconnectUDP();
static void EditorSetImageResolutionFromOverview();
static void EditorConnectUDPFromOverview();
static void EditorApplyCameraSettings();
static void EditorOpenNewCameraFromOverview();
static void OpenNewCameraOnIndex(int index);

//thread utilities
static void LaunchStreamingThread(UIMode newMode);
static void StopStreamingThread();

private:
//menu bar utility
static MenuBar CreateMenuBar();

//UI constant callbacks
static void UpdateApp();
static void UpdateStreamsConstantly();
static void UpdateStreams();

//UI button callbacks
static void OpenNewCameraFromMainIndex();
static void ToggleUDP();
static void NewConfiguration();
static void EditConfiguration();
static void OpenConfiguration();
static void OpenConfigurationFromFile(std::string fileName);
static void CloseConfiguration();
static void Quit();
static void ShowAboutWindow();
static void ShowHelpWindow();

//essential objects
static Runner runner;
static ConfigEditor configeditor;
static VideoCapture camera;
static GThread *streamingThread;

//utilities
static UIMode mode;
static bool lastImageGrabSuccessful;
static bool udpEnabled;
static bool streamThreadEnabled;
static Mat lastFrameGrabImage;
static int currentCameraIndex;

//ui widgets
static Window win;
static ConfigPanel confInfo;
static NumberBox cameraIndexBox;
static Label cameraStatusLabel;
static Image outputImage;
static Button toggleUDPButton;

//counters
static int cameraFailures;
};

}

#endif
#endif
Loading

0 comments on commit 90b65ab

Please sign in to comment.