Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
casdata committed Mar 20, 2023
0 parents commit 7f87295
Show file tree
Hide file tree
Showing 194 changed files with 136,145 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Project exclude paths
/cmake-build-debug/
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/FruitySerial.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/closeBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/iconQ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/maximizeBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/menuDarkUp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/menuLightUp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/minimizeBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/newBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/openBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/saveAsBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/saveBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/uEmpty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/uNewBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/uOpenBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/uSaveAsBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/uSaveBtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
cmake_minimum_required(VERSION 3.24)
project(FruitySerial)

set(CMAKE_CXX_STANDARD 17)

set(imgui_SOURCE_DIR ${imgui_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/imGui)
set(tools_PATH ${tools_PATH} ${CMAKE_SOURCE_DIR}/Tools)
set(uiDisplays_PATH ${uiDisplays_PATH} ${CMAKE_SOURCE_DIR}/UIDisplays)
set(data_PATH ${data_PATH} ${CMAKE_SOURCE_DIR}/Data)
set(manager_PATH ${manager_PATH} ${CMAKE_SOURCE_DIR}/Manager)
set(serial_PATH ${serial_PATH} ${CMAKE_SOURCE_DIR}/Serial)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
set(SDL2_PATH "SDL2")
set(SDL2_IMAGE_PATH "SDL2")

find_package(OpenGL REQUIRED)
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)

add_subdirectory(serial)

add_library(imgui
${imgui_SOURCE_DIR}/imgui.cpp
${imgui_SOURCE_DIR}/imgui.h
${imgui_SOURCE_DIR}/imconfig.h
${imgui_SOURCE_DIR}/imgui_demo.cpp
${imgui_SOURCE_DIR}/imgui_draw.cpp
${imgui_SOURCE_DIR}/imgui_internal.h
${imgui_SOURCE_DIR}/imgui_tables.cpp
${imgui_SOURCE_DIR}/imgui_widgets.cpp
${imgui_SOURCE_DIR}/imstb_rectpack.h
${imgui_SOURCE_DIR}/imstb_textedit.h
${imgui_SOURCE_DIR}/imstb_truetype.h
${imgui_SOURCE_DIR}/backends/imgui_impl_sdl.h
${imgui_SOURCE_DIR}/backends/imgui_impl_sdl.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.h
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3_loader.h)

include_directories(${SDL2_INCLUDE_DIR}
${SDL2_IMAGE_INCLUDE_DIR}
${imgui_SOURCE_DIR}
${tools_PATH}
${uiDisplays_PATH}
${data_PATH}
${manager_PATH}
${serial_PATH})

#link_directories(${SDL2_LIBRARY})

add_executable(FruitySerial main.cpp
UIDisplays/Hud.cpp
UIDisplays/Hud.h
Data/DTypes.h
Tools/stb_image.h
Tools/FunctionTools.cpp
Tools/FunctionTools.h
UIDisplays/SubWindow.cpp
UIDisplays/SubWindow.h
UIDisplays/MainWindow.cpp
UIDisplays/MainWindow.h
UIDisplays/TabSerialWindow.cpp
UIDisplays/TabSerialWindow.h
Manager/SerialManager.cpp
Manager/SerialManager.h
Manager/SerialConnection.cpp
Manager/SerialConnection.h
Data/LineData.cpp
Data/LineData.h
Tools/ClockTime.cpp
Tools/ClockTime.h)


target_include_directories(${PROJECT_NAME} PUBLIC ${imgui_SOURCE_DIR} ${imgui_SOURCE_DIR}/backends)

target_link_libraries(${PROJECT_NAME}
OpenGL::GL
${SDL2_LIBRARY}
${SDL2_IMAGE_LIBRARY}
imgui
serial
mingw32
)

136 changes: 136 additions & 0 deletions Data/DTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
//
// Created by castdata on 1/15/23.
//
#pragma once
#ifndef MASTERSERIALMONITOR_DTYPES_H
#define MASTERSERIALMONITOR_DTYPES_H

#include "serial/serial.h"

typedef enum {DARK, CLASSIC, LIGHT} UI_Theme;
typedef enum {OFF, DOWN, UP, ON} BtnState;
typedef enum {IDLE, SAVE, LOAD, MENU} AppState;
typedef enum {DISABLE, EN_TIME} TimeStamp;

typedef enum {
fivebits = 5,
sixbits = 6,
sevenbits = 7,
eigthbits = 8
} serialByteSize;

typedef enum {
parity_none = 0,
parity_odd = 1,
parity_even = 2,
parity_mark = 3,
parity_space = 4
} serialParity;

typedef enum {
stopbits_one = 1,
stopbits_two = 2,
stopbits_one_point_five
} serialStopbits;

typedef enum {
flowcontrol_none = 0,
flowcontrol_software,
flowcontrol_hardware
} serialFlowcontrol;

typedef enum {
baud_300 = 0,
baud_1200,
baud_2400,
baud_4800,
baud_9600,
baud_19200,
baud_38400,
baud_57600,
baud_74880,
baud_115200,
baud_230400,
baud_250000,
baud_500000,
baud_1000000,
baud_2000000
} serialBaudrate;

typedef enum {
noLine,
newLine,
carrieReturn,
crAndLf
} serialEndOfLine;

typedef enum {
RAW_DEC,
RAW_HEX,
UTF_8,
UTF_8_SPECIAL,
UTF_8_RAW_DEC,
UTF_8_RAW_HEX
} TextEncoding;

typedef struct{
bool exitApp;
} MenuData;

typedef struct{
bool disableExitMessage;
int windowCount;
int connectionCount;
UI_Theme uiTheme;
int windowPosX;
int windowPosY;
int windowSizeW;
int windowSizeH;
AppState appState;
bool cursorOverSubWinBorder;
ImFont* monoFont;
} AppData;

typedef struct{
BtnState mouseBtnRight;
BtnState mouseBtnLeft;
ImVec2 mouseCursorPosition;
} IOData;


typedef struct{
serial::PortInfo portInfo;
bool used;
bool enable;
bool updateIt;
} SerialPortData;

typedef struct{
BtnState mouseBtnLeft;
int windowSizeW;
int windowSizeH;
} HitTestData;


const char* const dataFileName = "data.bin";

static const float LEGACY_WIDTH = 1920.0f;
static const float LEGACY_HEIGHT = 1080.0f;

static const int MENU_BAR_HIGHT = 32;
static const int RESIZE_OFFSET = 10;

static const ImU32 DARK_WINDOW_BG_COL = IM_COL32(0,0,0,255);
static const ImU32 LIGHT_WINDOW_BG_COL = IM_COL32(255,255,255,255);

static const ImU32 DARK_BRACKET_COL = IM_COL32(0, 255, 255, 255);
static const ImU32 DARK_SPECIAL_UTF8_COL = IM_COL32(255, 0, 0, 255);

static const ImU32 LIGHT_BRACKET_COL = IM_COL32(0, 100, 255, 255);
static const ImU32 LIGHT_SPECIAL_UTF8_COL = IM_COL32(255, 0, 0, 255);

static const char* BAUDRATE_ITEMS[] = {"300 baud","1200 baud", "2400 baud", "4800 baud", "9600 baud", "19200 baud",
"38400 baud", "57600 baud", "74880 baud", "115200 baud", "230400 baud",
"250000 baud", "500000 baud", "1000000 baud", "2000000 baud"};

#endif //MASTERSERIALMONITOR_DTYPES_H
5 changes: 5 additions & 0 deletions Data/LineData.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//
// Created by castdata on 2/17/2023.
//

#include "LineData.h"
17 changes: 17 additions & 0 deletions Data/LineData.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// Created by castdata on 2/17/2023.
//

#ifndef TASTYSERIAL_LINEDATA_H
#define TASTYSERIAL_LINEDATA_H


class LineData {
public:

private:

};


#endif //TASTYSERIAL_LINEDATA_H
Loading

0 comments on commit 7f87295

Please sign in to comment.