Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

23w02a #6

Merged
merged 9 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: sudo apt-get update && sudo apt-get upgrade -y

- name: Install dependencies
run: sudo apt install gcc g++ cmake libcfitsio-dev zlib1g-dev libssl-dev libzip-dev libnova-dev libfmt-dev gettext libintl-dev
run: sudo apt install gcc g++ cmake libcfitsio-dev zlib1g-dev libssl-dev libzip-dev libnova-dev libfmt-dev gettext

- name: Checkout repository
uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "libs"]
path = libs
url = https://github.com/ElementAstro/LithiumLibrary.git
[submodule "modules"]
path = modules
url = https://github.com/ElementAstro/LithiumModules.git
51 changes: 12 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,14 @@ elseif(LINUX)
set(CMAKE_INSTALL_PREFIX "/usr/lithium")
endif()

set(api_module
${lithium_client_dir}/platesolve/astap.cpp
${lithium_client_dir}/platesolve/astrometry.cpp
${lithium_client_dir}/phd2/phd2client.cpp
${lithium_client_dir}/hydrogen/hydrogenclient.cpp
${lithium_client_dir}/hydrogen/hydrogencamera.cpp
${lithium_client_dir}/hydrogen/hydrogenfilterwheel.cpp
${lithium_client_dir}/hydrogen/hydrogentelescope.cpp
${lithium_client_dir}/hydrogen/hydrogenfocuser.cpp
)

set(config_module
${lithium_src_dir}/config/configor.cpp
)

set(device_module
${lithium_src_dir}/device/device_manager.cpp
${lithium_src_dir}/device/indidevice_manager.cpp
${lithium_src_dir}/device/hydrogen_manager.cpp
${lithium_src_dir}/device/device_utils.cpp
${lithium_src_dir}/device/indi_device.cpp
${lithium_src_dir}/device/hydrogen_device.cpp
)

Expand All @@ -143,24 +131,11 @@ set(module_module
)

set(server_module
${lithium_src_dir}/websocket/WebSocketServer.cpp
${lithium_src_dir}/websocket/WsDeviceComponent.cpp
${lithium_src_dir}/websocket/WsProcessComponent.cpp
${lithium_src_dir}/websocket/WsScriptComponent.cpp
${lithium_src_dir}/websocket/WsTaskComponent.cpp

${lithium_src_dir}/websocket/device/WsDeviceHub.cpp
${lithium_src_dir}/websocket/device/WsDeviceInstance.cpp
${lithium_src_dir}/websocket/device/WsDeviceServer.cpp

${lithium_src_dir}/websocket/device/WsCameraInstance.cpp
${lithium_src_dir}/websocket/device/WsTelescopeInstance.cpp
${lithium_src_dir}/websocket/device/WsFocuserInstance.cpp
${lithium_src_dir}/websocket/device/WsFilterInstance.cpp

${lithium_src_dir}/websocket/plugin/WsPluginHub.cpp
${lithium_src_dir}/websocket/plugin/WsPluginInstance.cpp
${lithium_src_dir}/websocket/plugin/WsPluginServer.cpp
${lithium_src_dir}/websocket/WsServer.cpp
${lithium_src_dir}/websocket/WsHub.cpp
${lithium_src_dir}/websocket/WsInstance.cpp
${lithium_src_dir}/websocket/components/WsDeviceComponent.cpp
${lithium_src_dir}/websocket/components/WsTaskComponent.cpp
)

set(script_module
Expand Down Expand Up @@ -242,12 +217,12 @@ add_subdirectory(${lithium_module_dir})
# 内置的模组
include_directories(modules)
add_subdirectory(modules)
add_subdirectory(modules/hydrogen_client)


# 构建Lithium内核
add_subdirectory(${lithium_src_dir}/core)

add_executable(lithium_server ${api_module} ${config_module} ${module_module} ${device_module} ${task_module} ${server_module} ${script_module} ${Lithium_module})
add_executable(lithium_server ${config_module} ${module_module} ${device_module} ${task_module} ${server_module} ${script_module} ${Lithium_module})

target_link_directories(lithium_server PUBLIC ${CMAKE_BINARY_DIR}/libs)

Expand All @@ -258,8 +233,10 @@ target_link_libraries(lithium_server atomstatic)

target_link_libraries(lithium_server lithiumcorestatic)
target_link_libraries(lithium_server lithiumpluginstatic)
target_link_libraries(lithium_server hydrogencore)
target_link_libraries(lithium_server lithiumcorestatic)
if(NOT WIN32)
target_link_libraries(lithium_server hydrogenclientstatic)
endif()

CHECK_INCLUDE_FILE(format HAS_STD_FORMAT)
if(NOT HAS_STD_FORMAT)
Expand All @@ -273,14 +250,10 @@ target_link_libraries(lithium_server ${CFITSIO_LIBRARIES})
target_link_libraries(lithium_server OpenSSL::SSL OpenSSL::Crypto)
target_link_libraries(lithium_server ${ZLIB_LIBRARIES})
target_link_libraries(lithium_server libzip::zip)
if(WIN32)
target_link_libraries(lithium_server pugixml-shared)
else()
target_link_libraries(lithium_server pugixml-shared)
endif()
target_link_libraries(lithium_server sqlite3)
target_link_libraries(lithium_server cpp_httplib)
target_link_libraries(lithium_server backward)
target_link_libraries(lithium_server tinyxml2)

target_link_libraries(lithium_server ${Libintl_LIBRARY})
target_include_directories(lithium_server PUBLIC ${Libintl_INCLUDE_DIRS})
Expand Down
8 changes: 7 additions & 1 deletion config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
#cmakedefine01 ENABLE_FASTHASH
#cmakedefine01 ENABLE_DEBUG

#ifdef ENABLE_GETTEXT
// I18n
#include <libintl.h>
#include <locale.h>
#include <locale>

#define _(STRING) gettext(STRING)
#define N_(STRING) STRING
#define P_(SINGULAR, PLURAL, N) ngettext(SINGULAR, PLURAL, N)
#else
#define _(STRING) (STRING)
#define N_(STRING) (STRING)
#define P_(SINGULAR, PLURAL, N) (N > 1 ? PLURAL : SINGULAR)
#endif

2 changes: 1 addition & 1 deletion libs
79 changes: 57 additions & 22 deletions locale/lithium.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2023-12-01 13:45+0000\n"
"POT-Creation-Date: 2023-12-17 21:01+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -17,89 +17,124 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: /workspaces/Lithium/src/device/device_manager.cpp:161
#: E:/msys64/home/Qrm/Lithium/src/device/device_manager.cpp:167
#, c++-format
msgid "A device with name {} already exists, please choose a different name"
msgstr ""

#: /workspaces/Lithium/src/device/indidevice_manager.cpp:278
#: E:/msys64/home/Qrm/Lithium/src/device/hydrogen_manager.cpp:281
#, c++-format
msgid "Failed to run command: {}"
msgstr ""

#: /workspaces/Lithium/src/App.cpp:220
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:222
msgid "port the server running on"
msgstr ""

#: /workspaces/Lithium/src/App.cpp:221
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:223
msgid "host the server running on"
msgstr ""

#: /workspaces/Lithium/src/App.cpp:222
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:224
msgid "path to the config file"
msgstr ""

#: /workspaces/Lithium/src/App.cpp:223
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:225
msgid "path to the modules directory"
msgstr ""

#: /workspaces/Lithium/src/App.cpp:224
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:226
msgid "web panel"
msgstr ""

#: /workspaces/Lithium/src/App.cpp:225
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:227
msgid "path to log file"
msgstr ""

#: /workspaces/Lithium/src/App.cpp:227
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:229
msgid "Lithium Command Line Interface:"
msgstr ""

#: /workspaces/Lithium/src/App.cpp:228
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:230
msgid "End."
msgstr ""

#: /workspaces/Lithium/src/App.cpp:236
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:238
#, c-format
msgid "Failed to parser command line : %s"
msgstr ""

#: /workspaces/Lithium/src/App.cpp:258
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:260
#, c-format
msgid "Command line server port : %d"
msgstr ""

#: /workspaces/Lithium/src/App.cpp:264
#: E:/msys64/home/Qrm/Lithium/src/App.cpp:266
#, c-format
msgid "Set server port to %d"
msgstr ""

#: /workspaces/Lithium/src/LithiumApp.cpp:80
#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:84
#, c++-format
msgid "Failed to load Lithium App , error : {}"
msgstr ""

#: /workspaces/Lithium/src/LithiumApp.cpp:97
#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:120
#, c++-format
msgid "Get config value: {}"
msgstr ""

#: /workspaces/Lithium/src/LithiumApp.cpp:103
#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:126
#, c++-format
msgid "Set {} to {}"
msgstr ""

#: /workspaces/Lithium/src/LithiumApp.cpp:301
#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:344
#, c++-format
msgid "Failed to run chai command : {}"
msgstr ""

#: /workspaces/Lithium/src/LithiumApp.cpp:319
#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:362
#, c++-format
msgid "Failed to run chai multi command {}"
msgstr ""

#: /workspaces/Lithium/src/LithiumApp.cpp:332
#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:375
#, c++-format
msgid "Failed to load chaiscript file {}"
msgstr ""

#: /workspaces/Lithium/src/LithiumApp.cpp:345
#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:388
#, c++-format
msgid "Failed to unload chaiscript file {}"
msgstr ""

#: /workspaces/Lithium/src/LithiumApp.cpp:358
#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:401
#, c++-format
msgid "Failed to run chai script {}"
msgstr ""

#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:423
#, c++-format
msgid "Failed to load module {} in {}"
msgstr ""

#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:442
#, c++-format
msgid "Failed to unload module {}"
msgstr ""

#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:462
#, c++-format
msgid "Failed to reload module {}"
msgstr ""

#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:499
#, c++-format
msgid "Failed to enable module {}"
msgstr ""

#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:518
#, c++-format
msgid "Failed to disable module {}"
msgstr ""
Loading
Loading