Skip to content

Commit b1ce2c1

Browse files
committed
Conan2 and minor layout fixes
1 parent 2774190 commit b1ce2c1

File tree

7 files changed

+35
-939
lines changed

7 files changed

+35
-939
lines changed

3rd_party/conan/conan.cmake

Lines changed: 0 additions & 909 deletions
This file was deleted.

3rd_party/conan/conanfile.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[requires]
2+
gtest/1.15.0
3+
4+
[generators]
5+
CMakeDeps
6+
CMakeToolchain

CMakeLists.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,10 @@ project(stm_simulator_project)
55
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
66
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
77

8-
include(${PROJECT_SOURCE_DIR}/3rd_party/conan/conan.cmake)
9-
10-
conan_cmake_configure(REQUIRES gtest/1.11.0
11-
GENERATORS cmake_find_package)
12-
13-
conan_cmake_autodetect(CONAN_SETTINGS)
14-
15-
conan_cmake_install(PATH_OR_REFERENCE ${CMAKE_BINARY_DIR}
16-
BUILD missing
17-
REMOTE conancenter
18-
SETTINGS ${CONAN_SETTINGS})
8+
execute_process(COMMAND conan profile detect --force)
9+
execute_process(COMMAND conan install ${PROJECT_SOURCE_DIR}\\3rd_party\\conan --output-folder=${CMAKE_BINARY_DIR} --build=missing -s build_type=${CMAKE_BUILD_TYPE})
10+
#include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
11+
add_compile_definitions(CMAKE_TOOLCHAIN_FILE="${CMAKE_BINARY_DIR}/conan_toolchain.cmake")
1912

2013
# specify the C++ standard
2114
set(CMAKE_CXX_STANDARD 17)

emulator/applications/printer_emulator/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ int main(int argc, char** argv)
8080
Device device(ds);
8181
AttachDevice(device);
8282

83-
SDcardMock external_card(4096);
84-
SDcardMock internal_card(4096);
83+
SDcardMock external_card(256*1024); //128MB
84+
SDcardMock internal_card(256*1024); //128MB
8585

8686
app.config.storages[STORAGE_EXTERNAL] = &external_card;
8787
app.config.storages[STORAGE_INTERNAL] = &internal_card;
@@ -91,7 +91,7 @@ int main(int argc, char** argv)
9191

9292
MKFS_PARM fs_params =
9393
{
94-
FM_FAT,
94+
FM_FAT32,
9595
1,
9696
0,
9797
0,

emulator/tests/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@ set(SOURCES
2626
# add sub-project
2727
add_executable(driver_tests ${SOURCES})
2828

29+
find_package(GTest REQUIRED)
30+
2931
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/resources/model.gcode" "${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/model.gcode" COPYONLY)
3032
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/resources/wanhao.gcode" "${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/wanhao.gcode" COPYONLY)
3133
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/resources/pla.mtl" "${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/pla.mtl" COPYONLY)
3234

33-
target_link_libraries(driver_tests PUBLIC device_mock drivers libraries solutions fatfs GTest::gtest)
35+
target_link_libraries(driver_tests PUBLIC device_mock drivers libraries solutions fatfs
36+
GTest::GTest
37+
GTest::gtest
38+
GTest::gtest_main)
3439
target_include_directories(driver_tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
3540
add_test(NAME drivers
3641
COMMAND driver_tests.exe)

lib/libraries/sources/user_interface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static void DrawLabel(UI_CORE* ui, Label* label)
269269

270270
static void DrawProgressFrame(UI_CORE* ui, Progress* progress)
271271
{
272-
DrawRect(ui, &progress->frame, "", true, true, false, ui_item_frame, ui->color_schema[ColorMain], progress->font_height);
272+
DrawRect(ui, &progress->frame, "", true, true, false, ui_item_frame, ui->color_schema[ColorMain], 0);
273273
}
274274

275275
static void DrawProgressBar(UI_CORE* ui, Progress* progress, uint16_t previous_state)
@@ -722,7 +722,7 @@ void UI_SetProgressMaximum(HProgress hprogress, uint32_t new_maximum)
722722
void UI_ProgressStep(HProgress hprogress)
723723
{
724724
Progress* progress = (Progress*)hprogress;
725-
UI_SetProgressValue(progress, progress->current_value + progress->step);
725+
UI_SetProgressValue(hprogress, progress->current_value + progress->step);
726726
}
727727

728728
uint32_t UI_GetProgressDrawPosition(HProgress hprogress)

lib/printer/printer.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ typedef struct
2727
HGCODE interpreter;
2828

2929
HFILEMANAGER file_manager;
30-
FIL* file;
31-
DIR* dir;
32-
size_t gcode_blocks_count;
33-
HSDCARD* storages;
34-
35-
HDRIVER driver;
36-
HTOUCH htouch;
37-
UI ui_handle;
30+
FIL* file;
31+
DIR* dir;
32+
size_t gcode_blocks_count;
33+
HSDCARD* storages;
34+
35+
HDRIVER driver;
36+
HTOUCH htouch;
37+
UI ui_handle;
3838
HIndicator temperature[TERMO_REGULATOR_COUNT];
39-
uint16_t current_temperature[TERMO_REGULATOR_COUNT];
39+
uint16_t current_temperature[TERMO_REGULATOR_COUNT];
4040

4141
HIndicator operation_name;
4242
HProgress progress;
@@ -142,7 +142,8 @@ HPRINTER Configure(PrinterConfiguration* cfg)
142142

143143
printer->ui_handle = UI_Configure(cfg->hdisplay, viewport, 1, 1, false);
144144

145-
uint16_t colors[ColorsCount] = { 0x0000, 0x5BDF, 0x0007, 0xFEE0 };
145+
//uint16_t colors[ColorsCount] = { 0x0000, 0x5BDF, 0x0007, 0xFEE0 };
146+
uint16_t colors[ColorsCount] = { 0x0000, 0xa082, 0x0000, 0xf800 };
146147
UI_SetUIColors(printer->ui_handle, colors);
147148

148149
DriverConfig drv_cfg = {
@@ -164,9 +165,6 @@ HPRINTER Configure(PrinterConfiguration* cfg)
164165
PrinterSetTemperature(printer->driver, i, 25, 0);
165166
}
166167

167-
Rect progress = { 0, 50, 320, 75 };
168-
printer->progress = UI_CreateProgress(printer->ui_handle, 0, progress, false, LARGE_FONT, 0, 100, 1);
169-
170168
Rect operation = { 100, 0, 220, 50 };
171169
printer->operation_name = UI_CreateIndicator(printer->ui_handle, 0, operation, "0000", LARGE_FONT, 0, true);
172170

@@ -176,6 +174,9 @@ HPRINTER Configure(PrinterConfiguration* cfg)
176174
Rect indicator = { 220, 0, 320, 50 };
177175
printer->temperature[TERMO_TABLE] = UI_CreateIndicator(printer->ui_handle, 0, indicator, "0000", LARGE_FONT, 0, true);
178176

177+
Rect progress = { 0, 50, 320, 75 };
178+
printer->progress = UI_CreateProgress(printer->ui_handle, 0, progress, false, LARGE_FONT, 0, 100, 1);
179+
179180
Rect frame = { 0, 75, 320, 240 };
180181
printer->printing_frame = UI_CreateFrame(printer->ui_handle, 0, frame, true);
181182

0 commit comments

Comments
 (0)