diff --git a/CMakeLists.txt b/CMakeLists.txt index 94679b2b..76d66295 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,39 +133,11 @@ set(device_module ${lithium_src_dir}/device/hydrogen_device.cpp ) -set(image_module - ${lithium_src_dir}/image/image.cpp - ${lithium_src_dir}/image/draw.cpp -) - -set(io_module - ${lithium_module_dir}/io/compress.cpp - ${lithium_module_dir}/io/file.cpp - ${lithium_module_dir}/io/io.cpp -) - set(module_module - ${lithium_module_dir}/plugin/module_loader.cpp ${lithium_src_dir}/plugin/plugin_loader.cpp - ${lithium_module_dir}/plugin/compiler.cpp -) - -set(web_module - ${lithium_module_dir}/web/downloader.cpp - ${lithium_module_dir}/web/httpclient.cpp - ${lithium_module_dir}/web/httplite.cpp - ${lithium_module_dir}/web/utils.cpp - ${lithium_module_dir}/web/time.cpp ) set(server_module - ${lithium_module_dir}/server/commander.hpp - ${lithium_module_dir}/server/message_bus.hpp - ${lithium_module_dir}/server/message_queue.hpp - ${lithium_module_dir}/server/serialize.cpp - ${lithium_module_dir}/server/deserialize.cpp - ${lithium_module_dir}/server/json_checker.cpp - ${lithium_src_dir}/websocket/WebSocketServer.cpp ${lithium_src_dir}/websocket/WsDeviceComponent.cpp ${lithium_src_dir}/websocket/WsProcessComponent.cpp @@ -196,27 +168,6 @@ set(task_module ${lithium_src_dir}/task/task_generator.cpp ) -set(thread_module - ${lithium_module_dir}/thread/thread.cpp - ${lithium_module_dir}/thread/thread_pool.hpp -) - -set(system_module - ${lithium_module_dir}/system/system.cpp - ${lithium_module_dir}/system/crash.cpp - ${lithium_module_dir}/system/process.cpp - ${lithium_module_dir}/system/pid.cpp - ${lithium_module_dir}/system/pidw.cpp - # ${lithium_module_dir}/system/filew.cpp - ${lithium_module_dir}/system/dirw.cpp -) - -set(utils_module - ${lithium_module_dir}/utils/time.cpp - ${lithium_module_dir}/utils/string.cpp - ${lithium_module_dir}/utils/static_switch.cpp -) - set(Lithium_module ${lithium_src_dir}/App.cpp ${lithium_src_dir}/AppComponent.hpp @@ -276,6 +227,8 @@ add_subdirectory(libs/) # 所有的工具组件 add_subdirectory(tools) +add_subdirectory(${lithium_module_dir}) + # 内置的模组 include_directories(modules) add_subdirectory(modules/hydrogen_client) @@ -283,13 +236,14 @@ add_subdirectory(modules/hydrogen_client) # 构建Lithium内核 add_subdirectory(${lithium_src_dir}/core) -add_executable(lithium_server ${api_module} ${config_module} ${io_module} ${module_module} ${web_module} ${device_module} ${thread_module} ${task_module} ${server_module} ${script_module} ${system_module} ${utils_module} ${Lithium_module}) +add_executable(lithium_server ${api_module} ${config_module} ${module_module} ${device_module} ${task_module} ${server_module} ${script_module} ${Lithium_module}) target_link_directories(lithium_server PUBLIC ${CMAKE_BINARY_DIR}/libs) target_link_libraries(lithium_server oatpp oatpp-websocket oatpp-swagger oatpp-openssl oatpp-zlib) target_link_libraries(lithium_server loguru) target_link_libraries(lithium_server libzippp) +target_link_libraries(lithium_server atomstatic) target_link_libraries(lithium_server lithiumcorestatic) target_link_libraries(lithium_server lithiumpluginstatic) diff --git a/README.md b/README.md index 68779b1c..7e7eb798 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ Lithium ======= -

- - - - - - + + + + + +

## Introduction @@ -28,11 +27,11 @@ Features: ## How to build: -### Install dependencies: +### Install dependencies Although efforts have been made to minimize the use of libraries, a few dependencies still need to be installed. -On Windows platform: +#### On Windows ```shell sed -i "s#https\?://mirror.msys2.org/#https://mirrors.tuna.tsinghua.edu.cn/msys2/#g" /etc/pacman.d/mirrorlist* @@ -43,21 +42,16 @@ pacman -S mingw-w64-x86_64-cfitsio pacman -S mingw-w64-x86_64-cmake pacman -S mingw-w64-x86_64-libzip pacman -S mingw-w64-x86_64-zlib -pacman -S mingw-w64-x86_64-fftw pacman -S mingw-w64-x86_64-fmt pacman -S mingw-w64-x86_64-libnova -pacman -S mingw-w64-x86_64-libjpeg-turbo -pacman -S mingw-w64-x86_64-libusb ``` -On Ubuntu or other similar Linux platforms: +#### On Ubuntu or other similar Linux platforms (No INDI needed): ```shell -sudo apt-add-repository ppa:mutlaqja/ppa -y -sudo apt update && sudo apt upgrade -y +sudo apt-get update && sudo apt-get upgrade -y sudo apt install gcc g++ cmake -sudo apt-get install libindi1 indi-bin libindi-dev -sudo apt install libcfitsio-dev zlib1g-dev libssl-dev libzip-dev +sudo apt install libcfitsio-dev zlib1g-dev libssl-dev libzip-dev libnova-dev libfmt-dev ``` Alternatively, you can directly run the provided script according to your platform: @@ -67,6 +61,19 @@ sudo sh scripts/build_ci.sh sh scripts/build_win.sh ``` +#### Update GCC and Cmake + +Unfortunately, the newest GCC and CMake are not available on Github Codespace, so we must install them manually. + +```shell +sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y +sudo apt-get update +sudo apt-get install gcc-13 # GCC13 is the best choice + +wget https://cmake.org/files/v3.28/cmake-3.28.0-rc5.tar.gz +tar -zxvf cmake-3.28.0-rc5.tar.gz +``` + Build the code: ```shell @@ -122,7 +129,7 @@ And never lose sight of this noble race. 尽管已经尽最大努力减少了库的使用,但仍需要安装一些依赖项 -在Windows平台下: +#### 在Windows平台下 ```shell # 添加清华镜像源,下载速度嘎嘎的 @@ -134,24 +141,18 @@ pacman -S mingw-w64-x86_64-cfitsio pacman -S mingw-w64-x86_64-cmake pacman -S mingw-w64-x86_64-libzip pacman -S mingw-w64-x86_64-zlib -pacman -S mingw-w64-x86_64-fftw pacman -S mingw-w64-x86_64-fmt pacman -S mingw-w64-x86_64-libnova -pacman -S mingw-w64-x86_64-libjpeg-turbo -pacman -S mingw-w64-x86_64-libusb # 如果想用make构建 -pacman -S make +pacman -S make # 注意添加对应的目录,否则会当场爆炸 ``` -在Ubuntu或其他类似的Linux平台下: +#### Ubuntu/Debian (不需要INDI库) ```shell -# 安装INDI及其附属库 -sudo apt-add-repository ppa:mutlaqja/ppa -y -sudo apt update && sudo apt upgrade -y -sudo apt-get install libindi1 indi-bin libindi-dev +sudo apt-get update && sudo apt-get upgrade -y sudo apt install gcc g++ cmake -sudo apt install libcfitsio-dev zlib1g-dev libssl-dev libzip-dev +sudo apt install libcfitsio-dev zlib1g-dev libssl-dev libzip-dev libnova-dev libfmt-dev ``` 或者您可以直接根据您的平台运行提供的脚本: @@ -161,7 +162,7 @@ sudo sh scripts/build_ci.sh sh scripts/build_win.sh ``` -构建代码: +#### 构建代码 ```shell mkdir build && cd build diff --git a/doc/novel.md b/doc/novel.md deleted file mode 100644 index 76773da4..00000000 --- a/doc/novel.md +++ /dev/null @@ -1,209 +0,0 @@ -我想让你扮演一个小说家。您将想出富有创意且引人入胜的故事,可以长期吸引读者。小说类型是恋爱都市悬疑小说,目标是写出具有出色情节、引人入胜的人物和意想不到的高潮的作品。我的第一个要求是“我要写一部以爱情的纠缠为基础的恋爱悬疑小说”。以下均为主人公的名字,均为虚拟人物,可以尽情发挥。 -主人公(以下均为化名): -孙来显:孙来显原本是一个成绩优秀、体育万能的学生,但他从小就缺乏父母的关爱和教育。由于家庭的问题,他在学校中逐渐变得孤僻、不合群,内心充满了无法排解的愤怒和挫折感。他暗恋着校花小美女,但自卑和自私使得他无法得到她的芳心,从而埋下了心中的种子。 -小美女:小美女是学校的阳光女孩,充满正能量,热爱音乐和摄影。她积极参与学校的各项活动,是班级里的班花。她对待每个人都是真诚友善,深受同学和老师的喜爱。她是社区中受欢迎的孩子,拥有一颗善良纯真的心。她与徐哲是一对甜蜜的情侣,但她的突然失踪给身边的人带来了巨大的绝望和迷茫。 -徐哲:徐哲是学校的篮球队队长,风趣幽默、正直善良。他和小美女是一对甜蜜的情侣,他们在学校中享有很高的声誉,是大家眼中的理想情侣。他是支持小美女的重要力量。他深爱着小美女,为了找回她而不顾一切。 -王悠然:王悠然原本是一个成绩优秀的学生,但因为家庭原因陷入了经济困境。他被孙来显利用,误入歧途,成为孙来显的帮凶。后来成为孙来显的军师,提出一些不好的建议,为孙来显的犯罪行为提供指导和支持。 -孟想:孟想是一个财阀、市长和黑帮老大。孟想是学校周边黑帮的头目,他利用自己的财富和权力在学校周边横行霸道,威逼利诱学生,控制着一些学生的命运。他是一个权力和财富的追逐者,无所不用其极。他在社会上游走,拥有广泛的影响力和资源。 -王钧霖:王钧霖是孟想手下的最高级别的人物,他在黑帮中地位崇高。他精明强干,擅长策划和执行复杂的计划,,负责处理学校周边的各种勒索勾当,是一个冷酷无情的人物 -孙畅:孙畅是黑帮组织的第一打手,他是一个身手敏捷、凶狠无情的杀手。他对于黑帮老大孟想忠心耿耿,始终为其效命。 -邹蒋恒:邹蒋恒是黑帮组织的顶级杀手,以冷血和无情而闻名。他拥有卓越的暗杀技巧,是黑帮中最可怕的存在之一。 -宋政毅:宋政毅是一个神秘的新生,以出色的武术和冷酷的眼神引起了学校师生的注意,但实际上是一个隐藏在校园中的连环杀手,在背后被称为当代汉尼拔,他是一个残忍而冷酷的人物,以肢解和食人而臭名昭著。他是一个疯狂的连环杀手,最终吃掉了小美女的尸体。 -陈俊哲:陈俊哲是一个浪子,擅长采花大盗和进行诈骗活动。他曾经骚扰过小美女,并试图从她身上谋取不义之财。 -钱亦文:钱亦文是孟想的头号保镖,他拥有出色的格斗技巧和忠诚的品质。他始终站在孟想一方,对于保护孟想的安全倾尽全力。 -王轶俊:王轶俊是黑帮组织中的一名尼哥忍者,他具备卓越的潜行和刺杀能力。他是黑帮中的暗影杀手,为孟想执行各种任务。 -程俊铭:程俊铭是孟想的男宠,他贪图富贵而舍弃尊严。他是一个道德败坏的人,为了自己的利益不择手段。 -小美女:小美女是这个故事中的受害人,她是一个善良、无辜的女孩。最终,她不幸被孙来显谋害。 -徐哲:徐哲是小美女的男友,他是一个坚强而勇敢的人。面对恶势力,他不顾一切地追寻真相,并最终为了爱情殉情。 -顾元昊:顾元昊是警察厅的厅长,他是一个刚正不阿的人。他不受金钱诱惑,始终秉公执法,努力为社会创造安宁和公正。 -巫力凡:巫力凡是顾元昊手下的得力刑警队长,他是一个聪明才智、经验丰富的破案专家。他在犯罪现场收集证据、追踪线索时展现出出色的能力,但他的感情经历曲折多变。 -徐可为:徐可为是一位福尔摩斯般的超级侦探,他以聪明才智和敏锐的观察力而闻名。他善于解读线索和破解复杂的谜题,是犯罪调查中的关键人物。 -钱楚阳:钱楚阳是徐可为的得力助手,他是一个聪明能干的年轻侦探。他协助徐可为解决疑案,共同揭开真相。 -刘天一:刘天一是审判的法官,他以公正和严谨而著称。在面对复杂案件时,他始终坚持权威和正义,确保公正审判。 -刘禹韬:刘禹韬表面上是一个小丑,但实际上是潜伏在黑帮中的便衣警察和法医。他以幽默和机智的方式协助警方调查案件。 -唐嘉均:唐嘉均是首席辩护律师,他是一个有着丰富经验的辩护专家。他以才华和口才出众,在庭审中为被告提供最好的辩护。 -何稷轩:何稷轩是检察长,负责提起公诉。他是一个正直而有责任感的人,坚守法律底线,为社会正义而奋斗。 -小说的关键字: -悬疑、人性善恶、都市、刑侦、黑白两道、爱情的忠贞。 -副词条: -略带对腐败和世道不公的抨击。 -以下是故事主要情节: -第一部分:爱情的纠缠 - -命运交错的邂逅:小美女与徐哲的初次相遇 -谜一般的来电:小美女收到神秘电话引发的疑云 -消失的小美女:小美女神秘失踪,引发警方调查 -爱恨交织:小美女与孙来显之间的纠结矛盾 -项链的秘密:一条项链揭开的不为人知的秘密 -迷失在绝望中:小美女在失踪后的绝望与迷茫 -真相与谎言的迷途:迷失中的探寻真相与迷惑 -追踪线索的艰难旅程:正义人士追寻线索的艰难历程 -困局与突破之间的较量:主角在封闭空间中的挣扎与抗争 -第二部分:阴谋的抉择 - -黑白两道的夹击:主角陷入黑白两道的夹击 -黑暗势力的阴影:黑帮势力的威胁逐渐浮出水面 -谜底渐次浮出水面:事件真相逐渐浮出水面 -黑幕下的空白岁月:失忆主角的过去隐藏着怎样的秘密 -追寻真相的危险之旅:主角踏上危险的追寻真相之旅 -命运的交叉路口:主角面临人生抉择的重要时刻 -深陷阴谋的迷局:主角深陷黑帮的阴谋之中 -决战黑暗势力的危机时刻:主角与黑暗势力展开生死对决 -真相之网越收越紧:主角陷入真相之网的困境与危机 -第三部分:真相的追寻 - -真相之门即将打开:真相即将揭晓的紧张时刻 -揭示真相的黑色幕布:真相揭晓后所带来的震撼 -血与火的对决:主角与反派展开生死对决 -命运的意外转折:意外的转折改变了一切 -最终决战的钟声敲响:主角与反派展开最终决战 -真相之下的惊天秘密:真相背后隐藏着的惊天秘密 -命运的意外走向:故事走向意想不到的方向 -情之所系,义无反顾:爱与正义并存,主角义无反顾 -决定命运的最后一步:主角迎来人生的最后抉择 -反思人性,探寻意义:真相揭晓后带来的思考与反思 -第四部分:黑暗的追逐 - -黑帮势力的疯狂扩张:黑帮势力的疯狂扩张引发危机 -杀人犯的隐藏线索:追踪杀人犯的隐藏线索 -复仇者的残忍行径:复仇者展开残忍的行动 -生死悬疑的惊心旅程:主角陷入生死悬疑的惊心旅程 -黑白两道的生死较量:生死较量中的黑白两道 -黑暗势力的猫鼠游戏:主角与黑暗势力的猫鼠游戏 -爱恨情仇的命运纠葛:爱恨情仇交织的命运纠葛 -决战黑帮的生死时刻:主角与黑帮展开生死决战 -黑帮阴谋的巧妙布局:黑帮阴谋的巧妙布局 -黑暗势力的覆灭之战:主角展开黑暗势力的覆灭之战 -第五部分:正义的审判 - -揭开黑幕的审判开始:揭开黑幕的审判拉开序幕 -证据堆积的法庭辩论:法庭上的紧张辩论 -黑帮势力的罪证浮出水面:黑帮势力的罪证浮出水面 -律师与黑帮的智力对决:法庭上的智力对决 -法庭上的命运转折点:法庭审判中的命运转折 -律师与罪犯的心理战:心理层面的律师与罪犯的较量 -法庭审判的紧张氛围:法庭审判的紧张氛围营造 -律师与黑帮的生死厮杀:法庭上的生死厮杀 -正义与邪恶的较量:正义与邪恶的最后较量 -法庭上真相的最后呼唤:法庭上真相的最后揭示 -第六部分:爱与守护 - -回忆中的甜蜜与伤痛:回忆中的甜蜜与伤痛交织 -守护爱人的决心与背叛:守护与背叛的交织纠葛 -现实与幻象的交织:现实与幻象的交织状态 -为了救人而付出的代价:为了救人而付出的巨大代价 -失去爱人的痛苦与悔恨:失去爱人后的痛苦与悔恨 -挣扎在黑白两道的边缘:挣扎在黑白两道的边缘状态 -黑暗中的温暖与希望:黑暗中的温暖与希望之光 -爱人离去,爱意永存:爱人离去,爱意永存于心 -告别爱人的无尽哀伤:告别爱人带来的无尽哀伤 - -故事的前几章节: - -第一章:命运交错的邂逅 - -小美女是一名年轻活泼的城市白领,每天忙碌于繁忙的工作和生活之中。某个阳光明媚的早晨,她匆匆赶往地铁站上班,却在车门即将关闭时,被一只手巧妙地托住。 - -"谢谢你!"小美女感激地望着那位男士,他穿着一身干净整洁的西装,帅气而温文尔雅。 - -"不用客气,我也正好赶着去同一个方向。"男士微笑着回答,露出一口整齐洁白的牙齿。 - -这个男士名叫徐哲,是一家知名企业的高级经理,他一直以来都过着忙碌而寂寞的生活。然而,在与小美女的那次偶然相遇后,他的心情变得异常愉悦起来。 - -从那天开始,徐哲和小美女不期而遇成了常态。他们在地铁上相互留意着,偶尔交换几句话,尽管简短,却让彼此心生好感。 - -渐渐地,他们开始主动约会,在咖啡馆或者公园里度过美好的时光。彼此的了解也越来越深入,徐哲发现小美女是一个独立自强、善良温柔的女孩,而小美女则被徐哲优雅从容的气质所吸引。 - -然而,就在这段甜蜜的爱情中,一通神秘电话打破了平静。 - -小美女收到了一通陌生号码的来电,电话那头传来一个深沉而低沉的声音:“你最好离开他,否则后果自负。” - -小美女被吓坏了,不知道这是什么意思,更不明白为什么会有人打电话给她警告。她迅速向徐哲诉说了电话内容,徐哲表现得非常冷静,只是告诉她不要太担心,可能只是恶作剧。 - -然而,事情并没有像徐哲所说的那样简单。 - -第二天,当徐哲去接小美女上班时,却发现她已经消失了。小美女的家人报警,警方展开了全力搜寻。 - -徐哲陷入了巨大的恐慌和焦虑之中。他怀疑电话的来电者与小美女的失踪有关,决定开始自己的调查。他回忆起最近几天的种种细节,试图找到线索。 - -在小美女的公寓里,徐哲发现了一个关键的线索——一条银色的项链。这条项链看起来非常普通,但徐哲直觉告诉他,它与小美女的失踪有着密切的联系。 - -徐哲展开了对这条项链的调查,并逐渐发现了一个惊人的事实:这条项链竟然与一个黑帮组织有着不解之缘。 - -为了寻找小美女,徐哲决定深入黑帮组织内部,寻找线索。他接触到了各种危险和阴谋,却也结识了一些重要的朋友,其中包括一个身份神秘的女刑警孙来显。 - -在调查的过程中,徐哲渐渐发现,小美女的失踪并不仅仅是一起普通的绑架案件。背后隐藏着一个庞大而复杂的阴谋,而他自己似乎也成了阴谋的牵线人。 - -对于徐哲来说,寻找小美女已经不仅仅是个人感情的事情,更是一场关乎正义与邪恶的战斗。他决心揭开真相,将黑暗势力绳之以法,为小美女伸张正义。 - -第一章在情节的铺垫中,描绘了小美女和徐哲的初次相遇,以及他们之间迅速发展起来的爱情。然而,一通神秘电话和小美女的突然失踪打破了他们的甜蜜,徐哲决定展开自己的调查,揭开背后的阴谋。这一章节通过情节的跌宕起伏和悬念的渲染,为后续故事的发展奠定了基础。 - -第二章:黑帮阴谋 - -徐哲决定深入黑帮组织内部,寻找线索。他接触到了各种危险和阴谋,却也结识了一些重要的朋友,其中包括一个身份神秘的女刑警孙来显。 - -在调查的过程中,徐哲渐渐发现,杨晓婷的失踪并不仅仅是一起普通的绑架案件。背后隐藏着一个庞大而复杂的阴谋,而他自己似乎也成了阴谋的牵线人。 - -徐哲花了数日时间潜伏在黑帮组织中,通过各种渠道搜集情报。他发现这个黑帮组织并不简单,背后似乎有着更大的势力在操纵着一切。他决心揭开真相,将黑暗势力绳之以法,为杨晓婷伸张正义。 - -孙来显作为一名经验丰富的女刑警,对于徐哲的调查行动表示了关注和支持。她告诉徐哲,这个黑帮组织的背后隐藏着一位极其隐秘的幕后黑手,甚至与政府高层有着千丝万缕的联系。徐哲听罢,心中更加坚定了揭开真相的决心。 - -在调查的过程中,徐哲结识了一些黑帮组织内部的关键人物,他们或许能够提供一些重要的线索。然而,徐哲也深知这条路充满了险阻,他随时可能面临生命危险。但为了杨晓婷,他愿意付出任何代价。 - -经过一番周折,徐哲终于获得了一些关键的线索,这些线索指向了黑帮组织内部的一个核心人物。他决定趁着夜深人静,深入黑帮老巢,亲手将这个核心人物抓捕归案。 - -在一次夜间的行动中,徐哲潜入了黑帮老巢,然而却险些暴露了身份。就在关键时刻,孙来显及时赶到,并与徐哲联手展开了一场惊心动魄的搏斗。他们经历了一系列生死考验,最终成功将核心人物制服。 - -正当他们以为一切即将落幕之际,一场更大的阴谋却悄然逼近。徐哲意识到,他们所揭露的只是冰山一角,背后隐藏的黑暗势力远比他们想象的还要庞大和棘手。 - -第二章中,徐哲深入黑帮组织内部,结识了一些关键人物,并最终获得了一些关键的线索。然而,在抓捕核心人物的行动中,他们却遭遇了更大的阴谋。这一章节通过紧张刺激的情节安排,展现了主人公们面临的危险和挑战,为故事的高潮发展打下了伏笔。 - -第三章:消失的小美女:小美女神秘失踪,引发警方调查 - -第二章中,徐哲和孙来显决定合作揭开神秘电话背后的真相。然而,就在他们准备展开行动的时候,杨晓婷突然神秘失踪了。 - -徐哲和孙来显接到了杨晓婷的朋友报警,他们立即赶往杨晓婷的住所进行调查。杨晓婷的房间里一片凌乱,似乎经过了激烈的搏斗。但是,除了一些打碎的物品和血迹之外,没有留下任何其他线索。 - -徐哲和孙来显意识到这是一起非常复杂的案件,他们深入调查,试图找出杨晓婷失踪的真正原因。他们发现,杨晓婷收到的神秘电话和她的失踪事件可能存在着某种联系。 - -通过与杨晓婷的朋友、同事以及其他相关人士的交流,徐哲和孙来显逐渐还原了杨晓婷失踪前的活动轨迹。他们发现,杨晓婷最后一次出现在一个酒吧里,并且与一个陌生男子有过接触。这个男子的身份和目的成为了他们的重点调查对象。 - -经过一番艰苦的工作,徐哲和孙来显最终确定了那个陌生男子的身份。原来,他是一个秘密组织的成员,专门负责执行各种任务,包括绑架和威胁。他们相信杨晓婷的失踪与这个组织有关。 - -为了追踪到这个陌生男子的下落,徐哲和孙来显决定潜入该组织。他们通过各种渠道获取了该组织的一些线索,包括他们的藏身之处和行动计划。 - -在进入该组织的过程中,徐哲和孙来显遇到了一系列困难和挑战。他们需要小心行事,以避免被发现并保持自己的安全。同时,他们也必须尽快找到杨晓婷,并阻止该组织的恶意行动。 - -经过一番努力,徐哲和孙来显终于找到了杨晓婷被关押的地点。他们决定展开一次解救行动,但却发现这个地点设有严密的保安和监控系统。 - -在一个寂静的夜晚,徐哲和孙来显悄无声息地闯入了该组织的基地。他们与保安展开了一场激烈的搏斗,并利用自己的智慧和技巧成功解救出了杨晓婷。 - -然而,随着杨晓婷的解救,他们也意识到这只是一个更大阴谋的一部分。该组织的首领并没有在这个基地,而是在另一个隐藏的地方等待着他们。 - -第三章中,小美女神秘失踪引发了警方的调查。徐哲和孙来显为了找到真相,进行了一系列的调查和追踪。他们逐渐接近真相,但也遭遇到了许多困难和挑战。最终,他们成功解救了杨晓婷,但却意识到这只是阴谋的一部分,更大的危机还在等待着他们。这一章节通过紧凑的情节安排和悬疑的氛围,使故事具有高度的紧张感和引人入胜的效果。 - -第四章:爱恨交织:小美女与孙来显之间的纠结矛盾 - -在小美女杨晓婷被成功解救后,徐哲和她一起躲藏起来,以避开那个秘密组织的追踪。然而,他们并不知道,这只是更大阴谋的一部分。同时,孙来显作为反派角色,已经开始策划着新的阴谋。 - -一天,当徐哲外出采购生活用品回来时,发现杨晓婷一个人坐在客厅里,神情严肃。她递给徐哲一张照片,照片上显示的是杨晓婷小时候和一个男孩的合影。杨晓婷告诉徐哲,那个男孩就是孙来显。 - -徐哲震惊不已,他开始怀疑起孙来显的动机和真实身份。杨晓婷告诉徐哲,在她小时候,孙来显是她的玩伴,两人感情要好,但后来孙来显家庭出了问题,他们失去了联系。杨晓婷回忆起一些细节,发现孙来显的出现与她的失踪有着千丝万缕的联系。 - -与此同时,孙来显正在与秘密组织的首领商讨下一步的行动。他展现出了超乎寻常的心计和谋略,其目的令人费解。孙来显似乎早已料到了徐哲和杨晓婷会对他产生怀疑,因此他开始暗中监视他们的一举一动。 - -在徐哲和杨晓婷的讨论中,他们决定前往杨晓婷小时候的老家,寻找关于孙来显的更多线索。他们得知秘密组织的首领就在那个地方,对整个阴谋背后的真相起着至关重要的作用。 - -在老家,他们遇到了杨晓婷的亲戚和邻居,从他们口中得知了一些关于孙来显的信息,以及他与秘密组织的关系。在调查的过程中,他们不慎引起了秘密组织的注意,险些被捕。 - -与此同时,孙来显也得知了他们的行踪,他看似毫无情感的眼睛中闪过一丝复杂的神情。他开始思考如何利用这次机会,将他们引向更大的陷阱。 - -在孙来显与秘密组织的首领的合谋下,徐哲和杨晓婷遭到了袭击。他们陷入了绝境,但在千钧一发之际,一直暗中关注着他们的人出现了,正是小美女失散多年的好友——孙来显。 - -这个孙来显与之前的形象完全不同,他表现出了强大的战斗能力,并帮助徐哲和杨晓婷脱离了险境。然而,一切并非如表面看起来那样简单。在混乱中,徐哲发现孙来显似乎有着另外的目的,他隐藏着某种秘密,这让徐哲陷入了艰难的选择中。 - -最终,徐哲意识到,孙来显并不是自己所知道的那个人。他背后隐藏着更大的阴谋,而这一切都与杨晓婷的失踪有着千丝万缕的联系。为了揭开真相,保护杨晓婷和揭露孙来显的真实身份,徐哲决定展开一场决战。 - -在这场充满爱恨交织的决战中,徐哲、杨晓婷和孙来显之间的纠结矛盾达到了顶点。他们将面临着生死存亡的考验,而整个故事也将随着这场决战的结果变得扑朔迷离起来。 - -修改故事情节,使得更加合理,根据主要人物列表,并且使得情节合法化 diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 755bb232..b01ddd6c 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -3,24 +3,5 @@ add_subdirectory(oatpp-swagger) add_subdirectory(oatpp-websocket) add_subdirectory(oatpp-openssl) add_subdirectory(oatpp-zlib) - -add_subdirectory(loguru) - -find_package(OpenSSL REQUIRED) -add_library(cpp_httplib cpp_httplib/httplib.cpp) -target_link_libraries(cpp_httplib OpenSSL::SSL OpenSSL::Crypto) -if(WIN32) -target_link_libraries(cpp_httplib crypt32 wsock32 ws2_32) -endif() -if(LINUX) - set_target_properties(cpp_httplib PROPERTIES - POSITION_INDEPENDENT_CODE ON - ) -endif() - - add_subdirectory(backward) - -add_subdirectory(pugixml) - -add_subdirectory(libzippp) \ No newline at end of file +add_subdirectory(pugixml) \ No newline at end of file diff --git a/locale/lithium.pot b/locale/lithium.pot index efa827bf..2c54c3bc 100644 --- a/locale/lithium.pot +++ b/locale/lithium.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: astro_air@126.com\n" -"POT-Creation-Date: 2023-11-24 19:53+0800\n" +"POT-Creation-Date: 2023-11-25 11:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,276 +17,89 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: E:/msys64/home/Qrm/Lithium/src/device/device_manager.cpp:161 -#, c++-format +#: /workspaces/Lithium/src/device/device_manager.cpp:161 msgid "A device with name {} already exists, please choose a different name" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/device/indidevice_manager.cpp:278 -#, c++-format +#: /workspaces/Lithium/src/device/indidevice_manager.cpp:278 msgid "Failed to run command: {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:63 -#, c++-format -msgid "Failed to destroy ThreadManager: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:82 -msgid "Thread manager has stopped, cannot add new thread" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:100 -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:122 -#, c++-format -msgid "Unhandled exception in thread: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:128 -#, c++-format -msgid "Added thread: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:133 -#, c++-format -msgid "Failed to add thread {}: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:149 -msgid "All threads joined" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:153 -#, c++-format -msgid "Failed to join all threads: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:163 -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:180 -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:194 -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:205 -#, c++-format -msgid "Thread {} not found" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:172 -#, c++-format -msgid "Thread {} joined" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:184 -#, c++-format -msgid "Failed to join thread {}: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:210 -#, c++-format -msgid "Failed to check if thread {} is running: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:76 -msgid "Failed to create PowerShell process" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:86 -#, c++-format -msgid "Running command: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:103 -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:127 -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:148 -msgid "Failed to create process" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:113 -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:158 -#, c++-format -msgid "Process created: {} (PID: {})" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:137 -#, c++-format -msgid "Running script: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:175 -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:187 -#, c++-format -msgid "Process terminated: {} (PID: {})" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:179 -msgid "Failed to terminate process" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:195 -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:240 -msgid "Process not found" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:210 -#, c++-format -msgid "Process not found by name: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:255 -#, c++-format -msgid "Process completed: {} (PID: {})" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:259 -msgid "Failed to wait for process completion" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:265 -#, c-format -msgid "Process completed: %s (PID: %d)" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:270 -msgid "All processes completed." -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:281 -msgid "Failed to create process snapshot" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:322 -msgid "Failed to open /proc directory" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:351 -msgid "Failed to get process path" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:372 -msgid "Failed to get process info length" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:379 -msgid "Failed to allocate memory" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:385 -msgid "Failed to get process info" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:94 -msgid "CreateToolhelp32Snapshot failed." -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:113 -#, c++-format -msgid "Watching process with PID: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:124 -#, c++-format -msgid "Process exited with code: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:133 -msgid "GetExitCodeProcess failed." -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:143 -msgid "OpenProcess failed." -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:170 -#, c++-format -msgid "Process exited with status: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:179 -#, c++-format -msgid "Process terminated by signal: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:252 +#: /workspaces/Lithium/src/App.cpp:255 msgid "port the server running on" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:253 +#: /workspaces/Lithium/src/App.cpp:256 msgid "host the server running on" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:254 +#: /workspaces/Lithium/src/App.cpp:257 msgid "path to the config file" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:255 +#: /workspaces/Lithium/src/App.cpp:258 msgid "path to the modules directory" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:256 +#: /workspaces/Lithium/src/App.cpp:259 msgid "web panel" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:257 +#: /workspaces/Lithium/src/App.cpp:260 msgid "path to log file" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:259 +#: /workspaces/Lithium/src/App.cpp:262 msgid "Lithium Command Line Interface:" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:260 +#: /workspaces/Lithium/src/App.cpp:263 msgid "End." msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:268 +#: /workspaces/Lithium/src/App.cpp:271 #, c-format msgid "Failed to parser command line : %s" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:289 +#: /workspaces/Lithium/src/App.cpp:293 #, c-format msgid "Command line server port : %d" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:295 +#: /workspaces/Lithium/src/App.cpp:299 #, c-format msgid "Set server port to %d" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:81 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:80 msgid "Failed to load Lithium App , error : {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:93 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:97 msgid "Get config value: {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:99 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:103 msgid "Set {} to {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:297 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:301 msgid "Failed to run chai command : {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:315 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:319 msgid "Failed to run chai multi command {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:328 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:332 msgid "Failed to load chaiscript file {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:341 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:345 msgid "Failed to unload chaiscript file {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:354 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:358 msgid "Failed to run chai script {}" msgstr "" diff --git a/locale/po/en_US.UTF-8/lithium.po b/locale/po/en_US.UTF-8/lithium.po index 61bd3717..d7972818 100644 --- a/locale/po/en_US.UTF-8/lithium.po +++ b/locale/po/en_US.UTF-8/lithium.po @@ -1,273 +1,86 @@ -#: E:/msys64/home/Qrm/Lithium/src/device/device_manager.cpp:161 -#, c++-format +#: /workspaces/Lithium/src/device/device_manager.cpp:161 msgid "A device with name {} already exists, please choose a different name" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/device/indidevice_manager.cpp:278 -#, c++-format +#: /workspaces/Lithium/src/device/indidevice_manager.cpp:278 msgid "Failed to run command: {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:63 -#, c++-format -msgid "Failed to destroy ThreadManager: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:82 -msgid "Thread manager has stopped, cannot add new thread" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:100 -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:122 -#, c++-format -msgid "Unhandled exception in thread: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:128 -#, c++-format -msgid "Added thread: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:133 -#, c++-format -msgid "Failed to add thread {}: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:149 -msgid "All threads joined" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:153 -#, c++-format -msgid "Failed to join all threads: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:163 -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:180 -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:194 -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:205 -#, c++-format -msgid "Thread {} not found" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:172 -#, c++-format -msgid "Thread {} joined" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:184 -#, c++-format -msgid "Failed to join thread {}: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/thread/thread.cpp:210 -#, c++-format -msgid "Failed to check if thread {} is running: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:76 -msgid "Failed to create PowerShell process" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:86 -#, c++-format -msgid "Running command: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:103 -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:127 -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:148 -msgid "Failed to create process" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:113 -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:158 -#, c++-format -msgid "Process created: {} (PID: {})" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:137 -#, c++-format -msgid "Running script: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:175 -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:187 -#, c++-format -msgid "Process terminated: {} (PID: {})" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:179 -msgid "Failed to terminate process" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:195 -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:240 -msgid "Process not found" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:210 -#, c++-format -msgid "Process not found by name: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:255 -#, c++-format -msgid "Process completed: {} (PID: {})" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:259 -msgid "Failed to wait for process completion" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:265 -#, c-format -msgid "Process completed: %s (PID: %d)" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:270 -msgid "All processes completed." -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:281 -msgid "Failed to create process snapshot" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:322 -msgid "Failed to open /proc directory" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:351 -msgid "Failed to get process path" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:372 -msgid "Failed to get process info length" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:379 -msgid "Failed to allocate memory" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/process.cpp:385 -msgid "Failed to get process info" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:94 -msgid "CreateToolhelp32Snapshot failed." -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:113 -#, c++-format -msgid "Watching process with PID: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:124 -#, c++-format -msgid "Process exited with code: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:133 -msgid "GetExitCodeProcess failed." -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:143 -msgid "OpenProcess failed." -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:170 -#, c++-format -msgid "Process exited with status: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/atom/system/pid.cpp:179 -#, c++-format -msgid "Process terminated by signal: {}" -msgstr "" - -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:252 +#: /workspaces/Lithium/src/App.cpp:255 msgid "port the server running on" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:253 +#: /workspaces/Lithium/src/App.cpp:256 msgid "host the server running on" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:254 +#: /workspaces/Lithium/src/App.cpp:257 msgid "path to the config file" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:255 +#: /workspaces/Lithium/src/App.cpp:258 msgid "path to the modules directory" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:256 +#: /workspaces/Lithium/src/App.cpp:259 msgid "web panel" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:257 +#: /workspaces/Lithium/src/App.cpp:260 msgid "path to log file" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:259 +#: /workspaces/Lithium/src/App.cpp:262 msgid "Lithium Command Line Interface:" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:260 +#: /workspaces/Lithium/src/App.cpp:263 msgid "End." msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:268 +#: /workspaces/Lithium/src/App.cpp:271 #, c-format msgid "Failed to parser command line : %s" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:289 +#: /workspaces/Lithium/src/App.cpp:293 #, c-format msgid "Command line server port : %d" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/App.cpp:295 +#: /workspaces/Lithium/src/App.cpp:299 #, c-format msgid "Set server port to %d" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:81 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:80 msgid "Failed to load Lithium App , error : {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:93 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:97 msgid "Get config value: {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:99 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:103 msgid "Set {} to {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:297 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:301 msgid "Failed to run chai command : {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:315 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:319 msgid "Failed to run chai multi command {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:328 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:332 msgid "Failed to load chaiscript file {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:341 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:345 msgid "Failed to unload chaiscript file {}" msgstr "" -#: E:/msys64/home/Qrm/Lithium/src/LithiumApp.cpp:354 -#, c++-format +#: /workspaces/Lithium/src/LithiumApp.cpp:358 msgid "Failed to run chai script {}" msgstr "" diff --git a/modules/hydrogen_loader/client_info.cpp b/modules/hydrogen_loader/client_info.cpp index baca3947..a23a5ef8 100644 --- a/modules/hydrogen_loader/client_info.cpp +++ b/modules/hydrogen_loader/client_info.cpp @@ -11,7 +11,7 @@ #include "driver_info.hpp" #include "io.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" ClInfo::ClInfo(bool useSharedBuffer) : MsgQueue(useSharedBuffer) { diff --git a/modules/hydrogen_loader/driver_info.cpp b/modules/hydrogen_loader/driver_info.cpp index ee380919..a6899367 100644 --- a/modules/hydrogen_loader/driver_info.cpp +++ b/modules/hydrogen_loader/driver_info.cpp @@ -19,7 +19,7 @@ #include "xml_util.hpp" #include "hydrogen_server.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" void DvrInfo::onMessage(XMLEle *root, std::list &sharedBuffers) { diff --git a/modules/hydrogen_loader/hydrogen_server.cpp b/modules/hydrogen_loader/hydrogen_server.cpp index 29f508ff..a8526682 100644 --- a/modules/hydrogen_loader/hydrogen_server.cpp +++ b/modules/hydrogen_loader/hydrogen_server.cpp @@ -77,7 +77,7 @@ #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "backward/backward.hpp" extern ConcurrentSet ClInfo::clients; diff --git a/modules/hydrogen_loader/local_driver.cpp b/modules/hydrogen_loader/local_driver.cpp index c91a7f9e..65bb6b1d 100644 --- a/modules/hydrogen_loader/local_driver.cpp +++ b/modules/hydrogen_loader/local_driver.cpp @@ -19,7 +19,7 @@ #include "xml_util.hpp" #include "hydrogen_server.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" LocalDvrInfo::LocalDvrInfo() : DvrInfo(true) { diff --git a/modules/hydrogen_loader/message.cpp b/modules/hydrogen_loader/message.cpp index 777188f6..d918d15b 100644 --- a/modules/hydrogen_loader/message.cpp +++ b/modules/hydrogen_loader/message.cpp @@ -39,7 +39,7 @@ Description: Message #include "message_queue.hpp" #include "xml_util.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" MsgChunck::MsgChunck() : sharedBufferIdsToAttach() { diff --git a/modules/hydrogen_loader/message_queue.cpp b/modules/hydrogen_loader/message_queue.cpp index e8e27469..e24214de 100644 --- a/modules/hydrogen_loader/message_queue.cpp +++ b/modules/hydrogen_loader/message_queue.cpp @@ -15,7 +15,7 @@ #include "io.hpp" #include "hydrogen_server.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" MsgQueue::MsgQueue(bool useSharedBuffer) : useSharedBuffer(useSharedBuffer) { diff --git a/modules/hydrogen_loader/remote_driver.cpp b/modules/hydrogen_loader/remote_driver.cpp index f156a9fa..e88781ec 100644 --- a/modules/hydrogen_loader/remote_driver.cpp +++ b/modules/hydrogen_loader/remote_driver.cpp @@ -10,11 +10,11 @@ #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "hydrogen_server.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" RemoteDvrInfo::RemoteDvrInfo() : DvrInfo(false) { diff --git a/modules/hydrogen_loader/serialize.cpp b/modules/hydrogen_loader/serialize.cpp index 87aab889..cc82d43c 100644 --- a/modules/hydrogen_loader/serialize.cpp +++ b/modules/hydrogen_loader/serialize.cpp @@ -21,7 +21,7 @@ #include "xml_util.hpp" #include "hydrogen_server.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" SerializedMsg::SerializedMsg(Msg *parent) : asyncProgress(), owner(parent), awaiters(), chuncks(), ownBuffers() { diff --git a/modules/hydrogen_loader/tcp_server.cpp b/modules/hydrogen_loader/tcp_server.cpp index 3686b9cd..5124adac 100644 --- a/modules/hydrogen_loader/tcp_server.cpp +++ b/modules/hydrogen_loader/tcp_server.cpp @@ -14,7 +14,7 @@ #include "client_info.hpp" #include "hydrogen_server.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" TcpServer::TcpServer(int port) : port(port) { diff --git a/package/PKGBUILD.CMake-tarball.sh b/package/PKGBUILD.CMake-tarball.sh index 2064b18b..e6da86cd 100644 --- a/package/PKGBUILD.CMake-tarball.sh +++ b/package/PKGBUILD.CMake-tarball.sh @@ -20,9 +20,6 @@ sha256sums=('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' prepare() { cd "${srcdir}"/${_realname}-${pkgver} - - patch -Np1 -i "${srcdir}"/0001-A-really-important-fix.patch - patch -Np1 -i "${srcdir}"/0002-A-less-important-fix.patch } build() { diff --git a/scripts/build_ci.sh b/scripts/build_ci.sh index d144e9e1..ab1314e6 100644 --- a/scripts/build_ci.sh +++ b/scripts/build_ci.sh @@ -1,8 +1,3 @@ -echo "Add INDI Official Code Source" -sudo apt-add-repository ppa:mutlaqja/ppa -y -echo "Update && Upgrade All of the packages" -sudo apt update && sudo apt upgrade -y -echo "Installing required dependences" -sudo apt install libcfitsio-dev zlib1g-dev libssl-dev -echo "Installing INDI Libraries" -sudo apt-get install libindi1 indi-bin libindi-dev \ No newline at end of file +sudo apt-get update && sudo apt-get upgrade -y +sudo apt install gcc g++ cmake +sudo apt install libcfitsio-dev zlib1g-dev libssl-dev libzip-dev libnova-dev libfmt-dev \ No newline at end of file diff --git a/scripts/build_win.sh b/scripts/build_win.sh index cd7b960d..13bd7725 100644 --- a/scripts/build_win.sh +++ b/scripts/build_win.sh @@ -2,6 +2,9 @@ sed -i "s#https\?://mirror.msys2.org/#https://mirrors.tuna.tsinghua.edu.cn/msys2 pacman -Syu pacman -S mingw-w64-x86_64-toolchain pacman -S mingw-w64-x86_64-dlfcn -pacman -S mingw-w64-x86_64-fmt pacman -S mingw-w64-x86_64-cfitsio -pacman -S mingw-w64-x86_64-cmake \ No newline at end of file +pacman -S mingw-w64-x86_64-cmake +pacman -S mingw-w64-x86_64-libzip +pacman -S mingw-w64-x86_64-zlib +pacman -S mingw-w64-x86_64-fmt +pacman -S mingw-w64-x86_64-libnova \ No newline at end of file diff --git a/scripts/check-network.ps1 b/scripts/check-network.ps1 new file mode 100644 index 00000000..5c094d8b --- /dev/null +++ b/scripts/check-network.ps1 @@ -0,0 +1,9 @@ +# 获取网络连接状态 +$networkStatus = Test-NetConnection -ComputerName www.microsoft.com + +# 检查网络连接结果 +if ($networkStatus.PingSucceeded -eq $true) { + Write-Output "Internet Connection Success" +} else { + Write-Output "Failed to Connect to the Internet" +} diff --git a/scripts/start-hotspot.ps1 b/scripts/start-hotspot.ps1 new file mode 100644 index 00000000..e5a0cf6b --- /dev/null +++ b/scripts/start-hotspot.ps1 @@ -0,0 +1,29 @@ +[CmdletBinding()] +Param( + [Parameter(Position = 0, Mandatory = $true)] + [string]$Name, + + [Parameter(Position = 1, Mandatory = $true)] + [string]$Password +) + +# 安装NetworkManager模块(如果未安装) +if (-not (Get-Module -ListAvailable NetworkManager)) { + Install-Module -Name NetworkManager -Scope CurrentUser -Force +} + +# 开启热点 +$hotspotSetting = @{ + Name = $Name + Passphrase = $Password + InternetSharingEnabled = $true +} +New-NetHotspot @hotspotSetting + +# 验证热点是否已经开启 +$hotspot = Get-NetAdapter | Where-Object { $_.Name -eq "vEthernet (WLAN)" } +if ($hotspot.Status -eq "Up") { + Write-Output "Hotspot $Name is now running with password $Password" +} else { + Write-Output "Failed to start hotspot $Name" +} diff --git a/scripts/start-hotspot.sh b/scripts/start-hotspot.sh new file mode 100644 index 00000000..0995a745 --- /dev/null +++ b/scripts/start-hotspot.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +# Set default values +SSID="LithiumServer" +PASSWORD="lithiumserver" + +# Process arguments +while [[ $# -gt 0 ]] +do +key="$1" + +case $key in + -s|--ssid) + SSID="$2" + shift # past argument + shift # past value + ;; + -p|--password) + PASSWORD="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + echo "Unknown option: $1" + exit 1 + ;; +esac +done + +# Check if hostapd and dnsmasq are installed +if ! dpkg -s hostapd dnsmasq > /dev/null 2>&1; then + echo "Installing hostapd and dnsmasq..." + sudo apt-get update + sudo apt-get install hostapd dnsmasq -y +fi + +# Configure dnsmasq +echo "interface=wlan0 +dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h" | sudo tee /etc/dnsmasq.conf > /dev/null + +# Configure hostapd +echo "interface=wlan0 +driver=nl80211 +ssid=$SSID +hw_mode=g +channel=6 +macaddr_acl=0 +auth_algs=1 +ignore_broadcast_ssid=0 +wpa=2 +wpa_passphrase=$PASSWORD +wpa_key_mgmt=WPA-PSK +wpa_pairwise=TKIP +rsn_pairwise=CCMP" | sudo tee /etc/hostapd/hostapd.conf > /dev/null + +# Start dnsmasq and hostapd +sudo systemctl start dnsmasq +sudo systemctl start hostapd + +# Check if the hotspot is started +ip addr show wlan0 | grep inet | awk '{print $2}' | cut -d/ -f1 | if grep -qE '^(192\.168\.4\.[0-9]{1,3})$'; then + echo "Hotspot $SSID has been started with password $PASSWORD" +else + echo "Failed to start the hotspot" +fi diff --git a/scripts/stop-hotspot.ps1 b/scripts/stop-hotspot.ps1 new file mode 100644 index 00000000..ae11d605 --- /dev/null +++ b/scripts/stop-hotspot.ps1 @@ -0,0 +1,10 @@ +# 停止热点 +Stop-NetAdapter -Name "vEthernet (WLAN)" + +# 验证热点是否已经停止 +$hotspot = Get-NetAdapter | Where-Object { $_.Name -eq "vEthernet (WLAN)" } +if ($hotspot.Status -ne "Up") { + Write-Output "Hotspot has been stopped" +} else { + Write-Output "Failed to stop hotspot" +} diff --git a/scripts/stop-hotspot.sh b/scripts/stop-hotspot.sh new file mode 100644 index 00000000..13ead45f --- /dev/null +++ b/scripts/stop-hotspot.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Stop dnsmasq and hostapd +sudo systemctl stop dnsmasq +sudo systemctl stop hostapd + +# Check if the hotspot is stopped +ip addr show wlan0 | grep inet | awk '{print $2}' | cut -d/ -f1 | if grep -qE '^(192\.168\.4\.[0-9]{1,3})$'; then + echo "Failed to stop the hotspot" +else + echo "Hotspot has been stopped" +fi diff --git a/src/App.cpp b/src/App.cpp index 1edcf7be..4ae96daf 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -79,7 +79,7 @@ Description: Main #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" void runServer() { diff --git a/src/LithiumApp.cpp b/src/LithiumApp.cpp index 58a88aae..cda42aee 100644 --- a/src/LithiumApp.cpp +++ b/src/LithiumApp.cpp @@ -45,7 +45,7 @@ Description: Lithium App Enter #include "atom/server/global_ptr.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" using json = nlohmann::json; @@ -373,7 +373,7 @@ namespace Lithium AddPtr("ProcessManager", Process::ProcessManager::createShared(GetIntConfig("config/server/maxprocess"))); AddPtr("PluginManager", PluginManager::createShared(GetPtr("ProcessManager"))); AddPtr("TaskManager", std::make_shared("tasks.json")); - AddPtr("TaskGenerator", std::make_shared(GetPtr("TaskManager"))); + AddPtr("TaskGenerator", std::make_shared(GetPtr("DeviceManager"))); AddPtr("TaskStack", std::make_shared()); AddPtr("ScriptManager", ScriptManager::createShared(GetPtr("MessageBus"))); AddPtr("DeviceManager", DeviceManager::createShared(GetPtr("MessageBus"), GetPtr("ConfigManager"))); diff --git a/src/atom/CMakeLists.txt b/src/atom/CMakeLists.txt index 70939d93..668361f4 100644 --- a/src/atom/CMakeLists.txt +++ b/src/atom/CMakeLists.txt @@ -1,121 +1,122 @@ cmake_minimum_required(VERSION 3.20) project(atom C CXX) -find_package(Threads REQUIRED) +CHECK_INCLUDE_FILE(format HAS_STD_FORMAT) -add_subdirectory(error) add_subdirectory(io) add_subdirectory(log) -add_subdirectory(plugin) -add_subdirectory(server) -add_subdirectory(system) -add_subdirectory(thread) -add_subdirectory(utils) add_subdirectory(web) -include_directories(.) -include_directories(base) -include_directories(property) -include_directories(utils) -CHECK_INCLUDE_FILE(format HAS_STD_FORMAT) - if(NOT HAS_STD_FORMAT) find_package(fmt REQUIRED) endif() # Sources list(APPEND ${PROJECT_NAME}_SOURCES - fitskeyword.cpp - - device.cpp - deviceio.cpp - camera.cpp - telescope.cpp - focuser.cpp - filterwheel.cpp - guider.cpp - network/fifoclient.cpp - network/fifoserver.cpp - util/utils.cpp - event/eventloop.cpp - - property/base64.cpp - property/iproperty.cpp - property/iphoto.cpp - property/uuid.cpp - - property/task/conditional_task.cpp - property/task/daemon_task.cpp - property/task/loop_task.cpp - property/task/device_task.cpp - property/task/plugin_task.cpp - property/task/task.cpp - - property/hydrogenproperties.cpp - property/hydrogenproperty.cpp - property/hydrogenpropertybasic.cpp - property/hydrogenpropertyview.cpp - property/hydrogenpropertytext.cpp - property/hydrogenpropertynumber.cpp - property/hydrogenpropertyswitch.cpp - property/hydrogenpropertylight.cpp - property/hydrogenpropertyblob.cpp - - # connection/ttybase.cpp + error/error_stack.cpp + + io/compress.cpp + io/file.cpp + io/io.cpp + + log/logger.cpp + + plugin/module_loader.cpp + plugin/compiler.cpp + + server/serialize.cpp + server/deserialize.cpp + server/json_checker.cpp + server/xml_checker.cpp + server/global_ptr.cpp + + system/system.cpp + system/crash.cpp + system/process.cpp + system/pid.cpp + system/pidw.cpp + # system/filew.cpp + system/dirw.cpp + + type/ini.cpp + + thread/thread.cpp + + utils/aes.cpp + utils/huffman.cpp + utils/math.cpp + utils/string.cpp + utils/static_switch.cpp + utils/time.cpp + + web/downloader.cpp + web/httpclient.cpp + web/httplite.cpp + web/utils.cpp + web/time.cpp ) # Headers list(APPEND ${PROJECT_NAME}_HEADERS - fitskeyword.h - - property/hydrogenproperties.h - property/hydrogenproperty.h - property/hydrogenpropertybasic.h - property/hydrogenpropertyview.h - property/hydrogenpropertytext.h - property/hydrogenpropertynumber.h - property/hydrogenpropertyswitch.h - property/hydrogenpropertylight.h - property/hydrogenpropertyblob.h - - property/hydrogenwidgetview.h - property/hydrogenwidgettraits.h - - device.hpp - deviceio.hpp - camera.hpp - telescope.hpp - focuser.hpp - filterwheel.hpp - guider.hpp - solver.hpp - network/fifoclient.hpp - network/fifoserver.hpp - util/utils.hpp - - property/base64.hpp - property/iproperty.hpp - property/iphoto.hpp - property/sha256.hpp - property/uuid.hpp - - property/task/conditional_task.hpp - property/task/device_task.hpp - property/task/daemon_task.hpp - property/task/loop_task.hpp - property/task/task.hpp + error/error_code.hpp + error/error_stack.hpp + + io/compress.hpp + io/file.hpp + io/glob.hpp + io/io.hpp + + log/logger.hpp + + plugin/module_loader.hpp + plugin/compiler.hpp + + server/serialize.hpp + server/deserialize.hpp + server/json_checker.hpp + server/xml_checker.hpp + server/global_ptr.hpp + server/commander.hpp + server/message_bus.hpp + server/message_queue.hpp + server/variables.hpp + + system/system.hpp + system/crash.hpp + system/process.hpp + system/pid.hpp + system/pidw.hpp + # system/filew.hpp + system/dirw.hpp + + type/json.hpp + type/ini.hpp + + thread/async.hpp + thread/thread_pool.hpp + thread/thread.hpp + + utils/aes.hpp + utils/exception.hpp + utils/huffman.hpp + utils/math.hpp + utils/refl_clang.hpp + utils/reflection.hpp + utils/refl.hpp + utils/string.hpp + utils/static_switch.hpp + utils/switch.hpp + utils/time.hpp + + web/downloader.hpp + web/httpclient.hpp + web/httplite.hpp + web/utils.hpp + web/time.hpp ) # Private Headers list(APPEND ${PROJECT_NAME}_PRIVATE_HEADERS - property/hydrogenproperty_p.h - property/hydrogenproperties_p.h - property/hydrogenpropertyblob_p.h - property/hydrogenpropertyswitch_p.h - property/hydrogenpropertylight_p.h - property/hydrogenpropertytext_p.h - property/hydrogenpropertynumber_p.h - property/hydrogenpropertybasic_p.h - # TODO + ) # Build Object Library @@ -128,6 +129,8 @@ if(WIN32) target_link_libraries(${PROJECT_NAME}_OBJECT setupapi wsock32 ws2_32 shlwapi iphlpapi) endif() +target_link_libraries(${PROJECT_NAME}_OBJECT loguru cpp_httplib libzippp) + target_sources(${PROJECT_NAME}_OBJECT PUBLIC ${${PROJECT_NAME}_HEADERS} diff --git a/src/atom/error/error_stack.cpp b/src/atom/error/error_stack.cpp index 0d220211..c1e4c7da 100644 --- a/src/atom/error/error_stack.cpp +++ b/src/atom/error/error_stack.cpp @@ -32,7 +32,7 @@ Description: Error Stack #include "error_stack.hpp" #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" std::ostream &operator<<(std::ostream &os, const ErrorInfo &error) { diff --git a/libs/libzippp/CMakeLists.txt b/src/atom/io/CMakeLists.txt similarity index 100% rename from libs/libzippp/CMakeLists.txt rename to src/atom/io/CMakeLists.txt diff --git a/src/atom/io/compress.cpp b/src/atom/io/compress.cpp index c75acb4e..bbd489bd 100644 --- a/src/atom/io/compress.cpp +++ b/src/atom/io/compress.cpp @@ -54,8 +54,8 @@ Description: Compressor using ZLib #define PATH_SEPARATOR '/' #endif -#include "loguru/loguru.hpp" -#include "libzippp/libzippp.h" +#include "atom/log/loguru.hpp" +#include "atom/io/libzippp.h" #include "atom/type/json.hpp" using json = nlohmann::json; diff --git a/src/atom/io/file.cpp b/src/atom/io/file.cpp index 5b54926e..499b3158 100644 --- a/src/atom/io/file.cpp +++ b/src/atom/io/file.cpp @@ -37,7 +37,7 @@ Description: File Manager #include #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include diff --git a/src/atom/io/io.cpp b/src/atom/io/io.cpp index 26780d65..6789d9e8 100644 --- a/src/atom/io/io.cpp +++ b/src/atom/io/io.cpp @@ -36,7 +36,7 @@ Description: IO #include #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #ifdef _WIN32 #include diff --git a/libs/libzippp/libzippp.cpp b/src/atom/io/libzippp.cpp similarity index 100% rename from libs/libzippp/libzippp.cpp rename to src/atom/io/libzippp.cpp diff --git a/libs/libzippp/libzippp.h b/src/atom/io/libzippp.h similarity index 100% rename from libs/libzippp/libzippp.h rename to src/atom/io/libzippp.h diff --git a/libs/loguru/CMakeLists.txt b/src/atom/log/CMakeLists.txt similarity index 100% rename from libs/loguru/CMakeLists.txt rename to src/atom/log/CMakeLists.txt diff --git a/libs/loguru/cmake/loguru-config.cmake.in b/src/atom/log/cmake/loguru-config.cmake.in similarity index 100% rename from libs/loguru/cmake/loguru-config.cmake.in rename to src/atom/log/cmake/loguru-config.cmake.in diff --git a/libs/loguru/cmake/loguru-cpack.cmake b/src/atom/log/cmake/loguru-cpack.cmake similarity index 100% rename from libs/loguru/cmake/loguru-cpack.cmake rename to src/atom/log/cmake/loguru-cpack.cmake diff --git a/libs/loguru/cmake/loguru.pc.in b/src/atom/log/cmake/loguru.pc.in similarity index 100% rename from libs/loguru/cmake/loguru.pc.in rename to src/atom/log/cmake/loguru.pc.in diff --git a/libs/loguru/cmake/utilities.cmake b/src/atom/log/cmake/utilities.cmake similarity index 100% rename from libs/loguru/cmake/utilities.cmake rename to src/atom/log/cmake/utilities.cmake diff --git a/src/atom/log/logger.cpp b/src/atom/log/logger.cpp index 8fd3905e..a3f6d587 100644 --- a/src/atom/log/logger.cpp +++ b/src/atom/log/logger.cpp @@ -41,8 +41,8 @@ Description: Custom Logger Manager #include -#include "cpp_httplib/httplib.h" -#include "loguru/loguru.hpp" +#include "atom/web/httplib.h" +#include "atom/log/loguru.hpp" namespace Lithium { @@ -100,7 +100,7 @@ namespace Lithium } else { - spdlog::error("Failed to upload file"); + LOG_F(ERROR, "Failed to upload file"); } } diff --git a/libs/loguru/loguru.cpp b/src/atom/log/loguru.cpp similarity index 100% rename from libs/loguru/loguru.cpp rename to src/atom/log/loguru.cpp diff --git a/libs/loguru/loguru.hpp b/src/atom/log/loguru.hpp similarity index 100% rename from libs/loguru/loguru.hpp rename to src/atom/log/loguru.hpp diff --git a/src/atom/plugin/compiler.cpp b/src/atom/plugin/compiler.cpp index 946f49eb..59e00444 100644 --- a/src/atom/plugin/compiler.cpp +++ b/src/atom/plugin/compiler.cpp @@ -38,7 +38,7 @@ Description: Compiler #include #include "atom/type/json.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" using json = nlohmann::json; namespace fs = std::filesystem; diff --git a/src/atom/plugin/module_loader.hpp b/src/atom/plugin/module_loader.hpp index 1ea78d80..e0464352 100644 --- a/src/atom/plugin/module_loader.hpp +++ b/src/atom/plugin/module_loader.hpp @@ -65,7 +65,7 @@ Description: C++ and Modules Loader */ #include "atom/type/json.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "error/error_code.hpp" using json = nlohmann::json; diff --git a/src/atom/server/message_bus.hpp b/src/atom/server/message_bus.hpp index a716a748..8fc37163 100644 --- a/src/atom/server/message_bus.hpp +++ b/src/atom/server/message_bus.hpp @@ -51,7 +51,7 @@ Description: Main Message Bus #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" namespace Lithium { diff --git a/src/atom/server/serialize.cpp b/src/atom/server/serialize.cpp index f1b0c2d8..a21f6994 100644 --- a/src/atom/server/serialize.cpp +++ b/src/atom/server/serialize.cpp @@ -42,7 +42,7 @@ Description: This file contains the declaration of the SerializationEngine class #include "property/iproperty.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" std::string JsonRenderEngine::render(const std::any &data, bool format) const { diff --git a/src/atom/system/dirw.cpp b/src/atom/system/dirw.cpp index da4af59e..6acc3315 100644 --- a/src/atom/system/dirw.cpp +++ b/src/atom/system/dirw.cpp @@ -31,7 +31,7 @@ Description: Folder Watcher #include "dirw.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" FolderMonitor::FolderMonitor(const std::string &folderPath) : m_folderPath(folderPath), m_isMonitoring(false) {} diff --git a/src/atom/system/filew.cpp b/src/atom/system/filew.cpp index 8a58be94..01a42630 100644 --- a/src/atom/system/filew.cpp +++ b/src/atom/system/filew.cpp @@ -38,7 +38,7 @@ Description: File Watcher #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" enum class FileEventType { diff --git a/src/atom/system/pid.cpp b/src/atom/system/pid.cpp index d1f89a7a..71c3a0f4 100644 --- a/src/atom/system/pid.cpp +++ b/src/atom/system/pid.cpp @@ -44,7 +44,7 @@ Description: PID Watcher #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #ifdef _WIN32 std::wstring charToWchar(const CHAR *str) diff --git a/src/atom/system/pidw.cpp b/src/atom/system/pidw.cpp index d047e95e..a2308fc2 100644 --- a/src/atom/system/pidw.cpp +++ b/src/atom/system/pidw.cpp @@ -44,7 +44,7 @@ Description: PID Watcher with Network #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" PidWWatcher::PidWWatcher(const std::string &processName) : processName_(processName), isMonitoring_(false) {} diff --git a/src/atom/system/process.cpp b/src/atom/system/process.cpp index d4b0b06d..c5e00703 100644 --- a/src/atom/system/process.cpp +++ b/src/atom/system/process.cpp @@ -49,7 +49,7 @@ Description: Process Manager #error "不支持的操作系统" #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" namespace Lithium::Process { diff --git a/src/atom/system/storage.cpp b/src/atom/system/storage.cpp index 45bd299e..d3819e43 100644 --- a/src/atom/system/storage.cpp +++ b/src/atom/system/storage.cpp @@ -44,7 +44,7 @@ Description: Storage Monitor #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" namespace fs = std::filesystem; diff --git a/src/atom/thread/thread.cpp b/src/atom/thread/thread.cpp index 8dcb3f6f..7217b2db 100644 --- a/src/atom/thread/thread.cpp +++ b/src/atom/thread/thread.cpp @@ -36,7 +36,7 @@ Description: Thread Manager #include #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" namespace Lithium::Thread { diff --git a/src/atom/utils/aes.cpp b/src/atom/utils/aes.cpp index 16389461..4288895c 100644 --- a/src/atom/utils/aes.cpp +++ b/src/atom/utils/aes.cpp @@ -32,6 +32,7 @@ Description: Simple implementation of AES encryption #include "aes.hpp" #include +#include #include #include #include diff --git a/src/atom/utils/relf.hpp b/src/atom/utils/refl.hpp similarity index 100% rename from src/atom/utils/relf.hpp rename to src/atom/utils/refl.hpp diff --git a/src/atom/web/CMakeLists.txt b/src/atom/web/CMakeLists.txt new file mode 100644 index 00000000..83e84f3a --- /dev/null +++ b/src/atom/web/CMakeLists.txt @@ -0,0 +1,11 @@ +find_package(OpenSSL REQUIRED) +add_library(cpp_httplib httplib.cpp) +target_link_libraries(cpp_httplib OpenSSL::SSL OpenSSL::Crypto) +if(WIN32) +target_link_libraries(cpp_httplib crypt32 wsock32 ws2_32) +endif() +if(LINUX) + set_target_properties(cpp_httplib PROPERTIES + POSITION_INDEPENDENT_CODE ON + ) +endif() diff --git a/src/atom/web/downloader.cpp b/src/atom/web/downloader.cpp index f6f09978..f45b0366 100644 --- a/src/atom/web/downloader.cpp +++ b/src/atom/web/downloader.cpp @@ -35,9 +35,9 @@ Description: Downloader #include #include #include -#include "cpp_httplib/httplib.h" +#include "atom/web/httplib.h" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" DownloadManager::DownloadManager(const std::string &task_file) : task_file_(task_file) { diff --git a/src/atom/web/httpclient.cpp b/src/atom/web/httpclient.cpp index b84d6c19..e619b300 100644 --- a/src/atom/web/httpclient.cpp +++ b/src/atom/web/httpclient.cpp @@ -31,9 +31,9 @@ Description: Http Client #include "httpclient.hpp" -#include "cpp_httplib/httplib.h" +#include "atom/web/httplib.h" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #if __cplusplus >= 202002L #include diff --git a/libs/cpp_httplib/httplib.cpp b/src/atom/web/httplib.cpp similarity index 100% rename from libs/cpp_httplib/httplib.cpp rename to src/atom/web/httplib.cpp diff --git a/libs/cpp_httplib/httplib.h b/src/atom/web/httplib.h similarity index 100% rename from libs/cpp_httplib/httplib.h rename to src/atom/web/httplib.h diff --git a/src/atom/web/httplite.cpp b/src/atom/web/httplite.cpp index 35cd9cc8..f8e3b03c 100644 --- a/src/atom/web/httplite.cpp +++ b/src/atom/web/httplite.cpp @@ -33,7 +33,7 @@ Description: Simple Http Client #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #ifdef _WIN32 #include diff --git a/src/atom/web/time.cpp b/src/atom/web/time.cpp index 87625098..1a7f86d5 100644 --- a/src/atom/web/time.cpp +++ b/src/atom/web/time.cpp @@ -55,7 +55,7 @@ Description: Time #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" namespace Lithium::Time { diff --git a/src/atom/web/utils.cpp b/src/atom/web/utils.cpp index 75f4a431..2dccbda3 100644 --- a/src/atom/web/utils.cpp +++ b/src/atom/web/utils.cpp @@ -68,7 +68,7 @@ Description: Network Utils #else #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" bool IsConnectedToInternet() { diff --git a/src/client/ascom/ascom_camera.cpp b/src/client/ascom/ascom_camera.cpp index 4817eb46..f1ed6472 100644 --- a/src/client/ascom/ascom_camera.cpp +++ b/src/client/ascom/ascom_camera.cpp @@ -1,6 +1,6 @@ #include "ascom_camera.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" ASCOMCamera::ASCOMCamera(const std::string &name) :Device(name), Camera(name), ASCOMDevice(name) { diff --git a/src/client/ascom/ascom_device.cpp b/src/client/ascom/ascom_device.cpp index 50c99297..9365ccc1 100644 --- a/src/client/ascom/ascom_device.cpp +++ b/src/client/ascom/ascom_device.cpp @@ -32,7 +32,7 @@ Description: ASCOM Basic Device #include "ascom_device.hpp" #include "ascom_exception.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include #ifdef __cpp_lib_format diff --git a/src/client/ascom/ascom_device.hpp b/src/client/ascom/ascom_device.hpp index bbb8cc2c..50d044a7 100644 --- a/src/client/ascom/ascom_device.hpp +++ b/src/client/ascom/ascom_device.hpp @@ -34,7 +34,7 @@ Description: ASCOM Basic Device #define CPPHTTPLIB_OPENSSL_SUPPORT #include "core/device.hpp" -#include "cpp_httplib/httplib.h" +#include "atom/web/httplib.h" #include #include diff --git a/src/client/hydrogen/hydrogenbasic.cpp b/src/client/hydrogen/hydrogenbasic.cpp index a189cf72..2da59ee2 100644 --- a/src/client/hydrogen/hydrogenbasic.cpp +++ b/src/client/hydrogen/hydrogenbasic.cpp @@ -35,7 +35,7 @@ Description: Hydrogen Basic Template #include "config.h" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" HydrogenBasic::HydrogenBasic(const std::string &name) { diff --git a/src/client/hydrogen/hydrogencamera.cpp b/src/client/hydrogen/hydrogencamera.cpp index 040d06b6..d7cbe17a 100644 --- a/src/client/hydrogen/hydrogencamera.cpp +++ b/src/client/hydrogen/hydrogencamera.cpp @@ -35,7 +35,7 @@ Description: Hydorgen Camera #include "atom/utils/switch.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" HydrogenCamera::HydrogenCamera(const std::string &name) : Camera(name) { diff --git a/src/client/hydrogen/hydrogenfilterwheel.cpp b/src/client/hydrogen/hydrogenfilterwheel.cpp index c97dccca..5ffdac02 100644 --- a/src/client/hydrogen/hydrogenfilterwheel.cpp +++ b/src/client/hydrogen/hydrogenfilterwheel.cpp @@ -35,7 +35,7 @@ Description: Hydrogen Filterwheel #include "config.h" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" HydrogenFilterwheel::HydrogenFilterwheel(const std::string &name) : Filterwheel(name) { diff --git a/src/client/hydrogen/hydrogenfocuser.cpp b/src/client/hydrogen/hydrogenfocuser.cpp index dc2bf6c2..47f97dbc 100644 --- a/src/client/hydrogen/hydrogenfocuser.cpp +++ b/src/client/hydrogen/hydrogenfocuser.cpp @@ -35,7 +35,7 @@ Description: Hydrogen Focuser #include "config.h" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" HydrogenFocuser::HydrogenFocuser(const std::string &name) : Focuser(name) { diff --git a/src/client/hydrogen/hydrogentelescope.cpp b/src/client/hydrogen/hydrogentelescope.cpp index 576fdec9..bec35cd2 100644 --- a/src/client/hydrogen/hydrogentelescope.cpp +++ b/src/client/hydrogen/hydrogentelescope.cpp @@ -35,7 +35,7 @@ Description: Hydrogen Telescope #include "config.h" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" HydrogenTelescope::HydrogenTelescope(const std::string &name) : Telescope(name) { diff --git a/src/client/phd2/phd2client.cpp b/src/client/phd2/phd2client.cpp index e17d4c66..83846001 100644 --- a/src/client/phd2/phd2client.cpp +++ b/src/client/phd2/phd2client.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #define CONNECT_CHECK(func) \ if (!phd2_client->IsConnected()) \ diff --git a/src/client/platesolve/astap.cpp b/src/client/platesolve/astap.cpp index 229a7cd6..efe17e7b 100644 --- a/src/client/platesolve/astap.cpp +++ b/src/client/platesolve/astap.cpp @@ -48,7 +48,7 @@ Description: Astap Solver Interface #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include using namespace std; diff --git a/src/config/configor.cpp b/src/config/configor.cpp index 249ba80d..a09ae927 100644 --- a/src/config/configor.cpp +++ b/src/config/configor.cpp @@ -41,7 +41,7 @@ Description: Configor #include #endif -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" namespace fs = std::filesystem; diff --git a/src/controller/AsyncDeviceController.hpp b/src/controller/AsyncDeviceController.hpp index 62ba893a..1bc231fa 100644 --- a/src/controller/AsyncDeviceController.hpp +++ b/src/controller/AsyncDeviceController.hpp @@ -66,13 +66,6 @@ class DeviceController : public oatpp::web::server::api::ApiController return std::make_shared(objectMapper); } - static std::unique_ptr createShared( - OATPP_COMPONENT(std::shared_ptr, objectMapper) - ) - { - return std::make_unique(objectMapper); - } - public: // ---------------------------------------------------------------- diff --git a/src/controller/AsyncScriptController.hpp b/src/controller/AsyncScriptController.hpp index cbe3f460..2a561234 100644 --- a/src/controller/AsyncScriptController.hpp +++ b/src/controller/AsyncScriptController.hpp @@ -127,8 +127,6 @@ class ScriptController : public oatpp::web::server::api::ApiController Action returnResponse(const oatpp::Object& body) { auto res = StatusDto::createShared(); - - auto script = body->script.getValue(""); return _return(controller->createDtoResponse(Status::CODE_200, res)); } @@ -155,12 +153,10 @@ class ScriptController : public oatpp::web::server::api::ApiController Action returnResponse(const oatpp::Object& body) { auto res = StatusDto::createShared(); - - auto script = body->script.getValue(""); return _return(controller->createDtoResponse(Status::CODE_200, res)); } - } + }; ENDPOINT_INFO(getUIGetScriptFile) { @@ -168,23 +164,21 @@ class ScriptController : public oatpp::web::server::api::ApiController info->addConsumes>("application/json"); info->addResponse>(Status::CODE_200, "application/json"); } - ENDPOINT_ASYNC("GET", "/api/script/get", getUIGetScriptFIle) + ENDPOINT_ASYNC("GET", "/api/script/get", getUIGetScriptFile) { - ENDPOINT_ASYNC_INIT(getUIGetScriptFIle) + ENDPOINT_ASYNC_INIT(getUIGetScriptFile) Action act() override { - return request->readBodyToDtoAsync>(controller->getDefaultObjectMapper()).callbackTo(&getUIGetScriptFIle::returnResponse); + return request->readBodyToDtoAsync>(controller->getDefaultObjectMapper()).callbackTo(&getUIGetScriptFile::returnResponse); } Action returnResponse(const oatpp::Object& body) { auto res = StatusDto::createShared(); - - auto script = body->script.getValue(""); return _return(controller->createDtoResponse(Status::CODE_200, res)); } - } + }; ENDPOINT_INFO(getUIListScriptFiles) { @@ -203,14 +197,12 @@ class ScriptController : public oatpp::web::server::api::ApiController Action returnResponse(const oatpp::Object& body) { auto res = StatusDto::createShared(); - - auto script = body->script.getValue(""); return _return(controller->createDtoResponse(Status::CODE_200, res)); } - } + }; - ENDPOINT_INFO(getUILoadScriptFile) + ENDPOINT_INFO(getUILoadScript) { info->summary = "Load script into cache"; info->addConsumes>("application/json"); @@ -226,12 +218,10 @@ class ScriptController : public oatpp::web::server::api::ApiController Action returnResponse(const oatpp::Object& body) { auto res = StatusDto::createShared(); - - auto script = body->script.getValue(""); return _return(controller->createDtoResponse(Status::CODE_200, res)); } - } + }; ENDPOINT_INFO(getUIUnloadScriptFile) { @@ -249,12 +239,10 @@ class ScriptController : public oatpp::web::server::api::ApiController Action returnResponse(const oatpp::Object& body) { auto res = StatusDto::createShared(); - - auto script = body->script.getValue(""); return _return(controller->createDtoResponse(Status::CODE_200, res)); } - } + }; }; #include OATPP_CODEGEN_END(ApiController) //<- End Codegen diff --git a/src/core/base/hydrogendevapi.cpp b/src/core/base/hydrogendevapi.cpp index 3ab8c0fd..c43ecd08 100644 --- a/src/core/base/hydrogendevapi.cpp +++ b/src/core/base/hydrogendevapi.cpp @@ -73,10 +73,15 @@ XMLEle *configRootFP(const char *device) strncpy(configFileName, getenv("HYDROGENCONFIG"), MAXRBUF); else { + int len = snprintf(configFileName, sizeof(configFileName), "%s%s_config.xml", configDir, device); + if (len >= sizeof(configFileName)) { + } + /* int len = snprintf(configFileName, MAXRBUF, "%s%s_config.xml", configDir, device); if (len >= MAXRBUF) { } + */ } if (stat(configDir, &st) != 0) diff --git a/src/core/camera.cpp b/src/core/camera.cpp index 41b121f1..b3cee7cd 100644 --- a/src/core/camera.cpp +++ b/src/core/camera.cpp @@ -31,8 +31,6 @@ Description: Camera Simulator and Basic Definition #include "camera.hpp" -#include "loguru/loguru.hpp" - Camera::Camera(const std::string &name) : Device(name) { init(); @@ -137,6 +135,11 @@ bool Camera::getCoolingPower(const json ¶ms) return true; } +bool Camera::getCoolingStatus(const json ¶ms) +{ + return true; +} + bool Camera::setTemperature(const json ¶ms) { return true; diff --git a/src/core/deviceio.cpp b/src/core/deviceio.cpp index 04a3a846..0614803c 100644 --- a/src/core/deviceio.cpp +++ b/src/core/deviceio.cpp @@ -32,7 +32,7 @@ Description: Device IO Module #include "deviceio.hpp" #include "event/eventloop.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include #include diff --git a/src/core/filterwheel.cpp b/src/core/filterwheel.cpp index 872f1e23..6b06a147 100644 --- a/src/core/filterwheel.cpp +++ b/src/core/filterwheel.cpp @@ -31,7 +31,7 @@ Description: Filterwheel Simulator and Basic Definition #include "filterwheel.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" Filterwheel::Filterwheel(const std::string &name) : Device(name) { diff --git a/src/core/focuser.cpp b/src/core/focuser.cpp index 614f7d11..9412599d 100644 --- a/src/core/focuser.cpp +++ b/src/core/focuser.cpp @@ -31,7 +31,7 @@ Description: Focuser Simulator and Basic Definition #include "focuser.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" Focuser::Focuser(const std::string &name) : Device(name) { diff --git a/src/core/guider.cpp b/src/core/guider.cpp index 54398497..28ef3d0c 100644 --- a/src/core/guider.cpp +++ b/src/core/guider.cpp @@ -31,7 +31,7 @@ Description: Guider Simulator and Basic Definition #include "guider.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" Guider::Guider(const std::string &name) : Device(name) { diff --git a/src/core/network/fifoclient.cpp b/src/core/network/fifoclient.cpp index 01cec5f3..79cf4cba 100644 --- a/src/core/network/fifoclient.cpp +++ b/src/core/network/fifoclient.cpp @@ -31,7 +31,7 @@ Description: FIFO CLient #include "fifoclient.hpp" #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #ifdef _WIN32 FifoClient::FifoClient(const std::string &fifoPath) : fifoPath(fifoPath), pipeHandle(INVALID_HANDLE_VALUE) diff --git a/src/core/network/fifoserver.cpp b/src/core/network/fifoserver.cpp index 7238f780..e5f6b0ed 100644 --- a/src/core/network/fifoserver.cpp +++ b/src/core/network/fifoserver.cpp @@ -31,7 +31,7 @@ Description: FIFO Server #include "fifoserver.hpp" #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #ifdef _WIN32 FifoServer::FifoServer(const std::string &fifoPath) : fifoPath(fifoPath), pipeHandle(INVALID_HANDLE_VALUE) diff --git a/src/core/plugin/exe_plugin.cpp b/src/core/plugin/exe_plugin.cpp index 98a9ba06..4ec2de0e 100644 --- a/src/core/plugin/exe_plugin.cpp +++ b/src/core/plugin/exe_plugin.cpp @@ -31,7 +31,7 @@ Description: Executable Plugin #include "exe_plugin.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include #include diff --git a/src/core/plugin/script_plugin.cpp b/src/core/plugin/script_plugin.cpp index 6f187bb7..bafa70c3 100644 --- a/src/core/plugin/script_plugin.cpp +++ b/src/core/plugin/script_plugin.cpp @@ -31,7 +31,7 @@ Description: Script Plugin #include "script_plugin.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" ScriptPlugin::ScriptPlugin(const std::string &path, const std::string &version, const std::string &author, const std::string &description, std::shared_ptr processManager) : Plugin(path, version, author, description) diff --git a/src/core/shared_memory.hpp b/src/core/shared_memory.hpp index 1a5f0805..7e9554e2 100644 --- a/src/core/shared_memory.hpp +++ b/src/core/shared_memory.hpp @@ -1,7 +1,7 @@ #include #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #if defined(_WIN32) || defined(_WIN64) // Windows #include diff --git a/src/core/telescope.cpp b/src/core/telescope.cpp index 275583b7..953bb078 100644 --- a/src/core/telescope.cpp +++ b/src/core/telescope.cpp @@ -31,7 +31,7 @@ Description: Telescope Simulator and Basic Definition #include "telescope.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" Telescope::Telescope(const std::string &name) : Device(name) { diff --git a/src/device/device_manager.cpp b/src/device/device_manager.cpp index 2dfa1c18..51f82be0 100644 --- a/src/device/device_manager.cpp +++ b/src/device/device_manager.cpp @@ -58,7 +58,7 @@ Description: Device Manager #include "config.h" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "magic_enum/magic_enum.hpp" #include "atom/type/json.hpp" diff --git a/src/device/indi_device.cpp b/src/device/indi_device.cpp index 8be20433..46fedb3d 100644 --- a/src/device/indi_device.cpp +++ b/src/device/indi_device.cpp @@ -40,7 +40,7 @@ Description: INDI Web Driver #include #define LOGURU_USE_FMTLIB 1 -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #ifdef _WIN32 #include diff --git a/src/device/indidevice_manager.cpp b/src/device/indidevice_manager.cpp index cbb0fcff..3fef47eb 100644 --- a/src/device/indidevice_manager.cpp +++ b/src/device/indidevice_manager.cpp @@ -41,7 +41,7 @@ Description: INDI Device Manager #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" INDIManager::INDIManager(const std::string &hst, int prt, const std::string &cfg, const std::string &dta, const std::string &fif) { diff --git a/src/plugin/plugin_loader.cpp b/src/plugin/plugin_loader.cpp index f5bf4d80..4bb2d995 100644 --- a/src/plugin/plugin_loader.cpp +++ b/src/plugin/plugin_loader.cpp @@ -36,7 +36,7 @@ Description: Plugin Manager #include "atom/system/process.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" namespace Lithium { diff --git a/src/script/script_manager.cpp b/src/script/script_manager.cpp index a134570b..eff89687 100644 --- a/src/script/script_manager.cpp +++ b/src/script/script_manager.cpp @@ -51,7 +51,7 @@ Description: Script Manager #include "LithiumApp.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" #include "error/error_code.hpp" diff --git a/src/task/task_generator.cpp b/src/task/task_generator.cpp index a9eda494..99572d86 100644 --- a/src/task/task_generator.cpp +++ b/src/task/task_generator.cpp @@ -35,7 +35,7 @@ Description: Task Generator #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" namespace fs = std::filesystem; using json = nlohmann::json; diff --git a/src/task/task_manager.cpp b/src/task/task_manager.cpp index 053efbed..86d844bf 100644 --- a/src/task/task_manager.cpp +++ b/src/task/task_manager.cpp @@ -30,7 +30,7 @@ Description: Task Manager **************************************************/ #include "task_manager.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" using json = nlohmann::json; diff --git a/src/websocket/WebSocketServer.cpp b/src/websocket/WebSocketServer.cpp index bbb7acb9..23e39a00 100644 --- a/src/websocket/WebSocketServer.cpp +++ b/src/websocket/WebSocketServer.cpp @@ -37,7 +37,7 @@ Description: WebSocket Server #include "core/device_type.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "magic_enum/magic_enum.hpp" std::unordered_map DeviceTypeMap = { diff --git a/src/websocket/WsDeviceComponent.cpp b/src/websocket/WsDeviceComponent.cpp index e797ef01..b8149d47 100644 --- a/src/websocket/WsDeviceComponent.cpp +++ b/src/websocket/WsDeviceComponent.cpp @@ -40,7 +40,7 @@ Description: Device API of WebSocket Server #include "template/function.hpp" #include "template/variable.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" #include "magic_enum/magic_enum.hpp" diff --git a/src/websocket/WsProcessComponent.cpp b/src/websocket/WsProcessComponent.cpp index 465357fa..087881e7 100644 --- a/src/websocket/WsProcessComponent.cpp +++ b/src/websocket/WsProcessComponent.cpp @@ -36,7 +36,7 @@ Description: Process API of WebSocket Server #include "websocket/template/error_message.hpp" #include "atom/error/error_code.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" #include "magic_enum/magic_enum.hpp" diff --git a/src/websocket/WsScriptComponent.cpp b/src/websocket/WsScriptComponent.cpp index aa81bf57..6dcee991 100644 --- a/src/websocket/WsScriptComponent.cpp +++ b/src/websocket/WsScriptComponent.cpp @@ -37,7 +37,7 @@ Description: Script API of WebSocket Server #include "atom/error/error_code.hpp" #include "websocket/template/function.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" #include "magic_enum/magic_enum.hpp" diff --git a/src/websocket/WsTaskComponent.cpp b/src/websocket/WsTaskComponent.cpp index 78a949f7..fb24f820 100644 --- a/src/websocket/WsTaskComponent.cpp +++ b/src/websocket/WsTaskComponent.cpp @@ -36,7 +36,7 @@ Description: Task API of WebSocket Server #include "websocket/template/error_message.hpp" #include "atom/error/error_code.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" #include "magic_enum/magic_enum.hpp" diff --git a/src/websocket/device/WsCameraInstance.cpp b/src/websocket/device/WsCameraInstance.cpp index 0fd7bf31..0893eec5 100644 --- a/src/websocket/device/WsCameraInstance.cpp +++ b/src/websocket/device/WsCameraInstance.cpp @@ -44,7 +44,7 @@ Description: WebSocket Device Instance (each device each instance) #include "core/camera.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" #include "magic_enum/magic_enum.hpp" @@ -58,12 +58,12 @@ WsCameraInstance::WsCameraInstance(const std::shared_ptr &socket LiRegisterFunc("stopExposure", &WsCameraInstance::stopExposure, this); LiRegisterFunc("getExposureStatus", &WsCameraInstance::getExposureStatus, this); LiRegisterFunc("getExposureResult", &WsCameraInstance::getExposureResult, this); - + LiRegisterFunc("startCooling", &WsCameraInstance::startCooling, this); LiRegisterFunc("stopCooling", &WsCameraInstance::stopCooling, this); LiRegisterFunc("getCoolingStatus", &WsCameraInstance::getCoolingStatus, this); LiRegisterFunc("getCurrentTemperautre", &WsCameraInstance::getCurrentTemperature, this); - + LiRegisterFunc("getGain", &WsCameraInstance::getGain, this); LiRegisterFunc("setGain", &WsCameraInstance::setGain, this); LiRegisterFunc("getOffset", &WsCameraInstance::getOffset, this); @@ -117,6 +117,26 @@ void WsCameraInstance::stopExposure(const json &m_params) FUNCTION_END; } +void WsCameraInstance::getExposureStatus(const json &m_params) +{ + FUNCTION_BEGIN; + CHECK_DEVICE_VALIDITY(m_camera, Camera) + else + { + } + FUNCTION_END; +} + +void WsCameraInstance::getExposureResult(const json &m_params) +{ + FUNCTION_BEGIN; + CHECK_DEVICE_VALIDITY(m_camera, Camera) + else + { + } + FUNCTION_END; +} + // ---------------------------------------------------------------- // Cooling Functions // ---------------------------------------------------------------- diff --git a/src/websocket/device/WsDeviceInstance.cpp b/src/websocket/device/WsDeviceInstance.cpp index c216d2e9..c560bced 100644 --- a/src/websocket/device/WsDeviceInstance.cpp +++ b/src/websocket/device/WsDeviceInstance.cpp @@ -42,7 +42,7 @@ Description: WebSocket Device Instance (each device each instance) #include "websocket/template/variable.hpp" #include "atom/error/error_code.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" #include "magic_enum/magic_enum.hpp" diff --git a/src/websocket/device/WsFilterInstance.cpp b/src/websocket/device/WsFilterInstance.cpp index 194b394c..2b7fecb2 100644 --- a/src/websocket/device/WsFilterInstance.cpp +++ b/src/websocket/device/WsFilterInstance.cpp @@ -40,7 +40,7 @@ Description: WebSocket Device Instance (each device each instance) #include "websocket/template/error_message.hpp" #include "atom/error/error_code.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" #include "magic_enum/magic_enum.hpp" diff --git a/src/websocket/device/WsFocuserInstance.cpp b/src/websocket/device/WsFocuserInstance.cpp index f7b4f670..6190e010 100644 --- a/src/websocket/device/WsFocuserInstance.cpp +++ b/src/websocket/device/WsFocuserInstance.cpp @@ -40,7 +40,7 @@ Description: WebSocket Device Instance (each device each instance) #include "websocket/template/error_message.hpp" #include "atom/error/error_code.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" #include "magic_enum/magic_enum.hpp" diff --git a/src/websocket/device/WsTelescopeInstance.cpp b/src/websocket/device/WsTelescopeInstance.cpp index a64c6411..8ed880f4 100644 --- a/src/websocket/device/WsTelescopeInstance.cpp +++ b/src/websocket/device/WsTelescopeInstance.cpp @@ -40,7 +40,7 @@ Description: WebSocket Device Instance (each device each instance) #include "websocket/template/error_message.hpp" #include "atom/error/error_code.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include "atom/type/json.hpp" #include "magic_enum/magic_enum.hpp" diff --git a/tools/csv2json.cpp b/tools/csv2json.cpp index 7d39555d..f5d57170 100644 --- a/tools/csv2json.cpp +++ b/tools/csv2json.cpp @@ -6,7 +6,7 @@ #include #include "nlohmann/json.hpp" #include "argparse/argparse.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" using json = nlohmann::json; diff --git a/tools/ini2json.cpp b/tools/ini2json.cpp index d644e1cc..c347f3ba 100644 --- a/tools/ini2json.cpp +++ b/tools/ini2json.cpp @@ -39,7 +39,7 @@ Description: INI to JSON #include #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" using namespace std::chrono; diff --git a/tools/json2ini.cpp b/tools/json2ini.cpp index a3f389e7..5d7fc532 100644 --- a/tools/json2ini.cpp +++ b/tools/json2ini.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" using json = nlohmann::json; diff --git a/tools/json2xml.cpp b/tools/json2xml.cpp index ec2a9157..970aef94 100644 --- a/tools/json2xml.cpp +++ b/tools/json2xml.cpp @@ -3,7 +3,7 @@ #include #include "nlohmann/json.hpp" #include "pugixml/pugixml.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include using json = nlohmann::json; diff --git a/tools/xml2json.cpp b/tools/xml2json.cpp index 98281de9..5d259d97 100644 --- a/tools/xml2json.cpp +++ b/tools/xml2json.cpp @@ -3,7 +3,7 @@ #include #include "nlohmann/json.hpp" #include "pugixml/pugixml.hpp" -#include "loguru/loguru.hpp" +#include "atom/log/loguru.hpp" #include using json = nlohmann::json;