Compare commits
merge into: p_dynamic_electrocardiograph:master
p_dynamic_electrocardiograph:3lead_uart_test_ok_version
p_dynamic_electrocardiograph:3leadtest
p_dynamic_electrocardiograph:master
p_dynamic_electrocardiograph:only_u2
pull from: p_dynamic_electrocardiograph:3leadtest
p_dynamic_electrocardiograph:3lead_uart_test_ok_version
p_dynamic_electrocardiograph:3leadtest
p_dynamic_electrocardiograph:master
p_dynamic_electrocardiograph:only_u2
7 Commits
Author | SHA1 | Message | Date |
---|---|---|---|
|
4f3202dc6c |
update
|
1 year ago |
|
f3c64a31d9 |
update
|
1 year ago |
|
5bd7bead16 |
3lead u2,u3 testversion
|
1 year ago |
|
0cd9bbdec4 |
update
|
1 year ago |
|
4815e93aff |
update
|
1 year ago |
|
f45ae1b37e |
update
|
1 year ago |
|
521ed921cf |
update
|
1 year ago |
24 changed files with 89586 additions and 20576 deletions
-
55.vscode/settings.json
-
63app/src/ads1293_simple_tester.c
-
17app/src/board/board_beep_ctrl.c
-
3app/src/board/board_light_ctrl.c
-
1app/src/board/board_light_ctrl.h
-
16513bin2/63_whole.hex
-
7452bin2/app.hex
-
BINbin2/app3.zip
-
BINbin2/app4.zip
-
16bin2/bl_temp.hex
-
8bin2/build.bat
-
16bin2/settings.hex
-
BINonly_u2_data_parser/20240206_3ch.xlsx
-
2only_u2_data_parser/build.bat
-
63only_u2_data_parser/parse_packet_to_csv.cpp
-
BINonly_u2_data_parser/parse_packet_to_csv.exe
-
BINonly_u2_data_parser/raw.bin
-
26099only_u2_data_parser/raw.csv
-
13324only_u2_data_parser/raw.txt
-
54only_u2_data_parser/text2bin.cpp
-
BINonly_u2_data_parser/text2bin.exe
-
7392stable/onlyu2_stable_v1.hex
-
13324stable/stable_v1.txt
16513
bin2/63_whole.hex
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
7452
bin2/app.hex
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,2 @@ |
|||
g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ text2bin.cpp -o text2bin.exe |
|||
g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ parse_packet_to_csv.cpp -o parse_packet_to_csv.exe |
@ -0,0 +1,63 @@ |
|||
|
|||
#include <fstream>
|
|||
#include <functional>
|
|||
#include <iostream>
|
|||
#include <list>
|
|||
#include <map>
|
|||
#include <memory>
|
|||
#include <set>
|
|||
#include <sstream>
|
|||
#include <string>
|
|||
#include <thread>
|
|||
#include <vector>
|
|||
//
|
|||
#include <winsock2.h>
|
|||
//
|
|||
#include <Windows.h>
|
|||
//
|
|||
#include <stdio.h>
|
|||
|
|||
#pragma comment(lib, "ws2_32.lib")
|
|||
#define PORT 8988
|
|||
#pragma pack(1)
|
|||
typedef struct parse_packet_to_csv { |
|||
uint8_t h0; |
|||
uint8_t h1; |
|||
uint32_t ch0; |
|||
uint32_t ch1; |
|||
uint32_t ch2; |
|||
uint8_t e0; |
|||
uint8_t e1; |
|||
}; |
|||
#pragma pack()
|
|||
|
|||
int main(int argc, char* argv[]) { |
|||
/**
|
|||
* @brief |
|||
* 打开raw.bin |
|||
* 读取raw.bin全部内容,存放到数组中 |
|||
* |
|||
*/ |
|||
|
|||
std::ifstream ifs("raw.bin", std::ios::binary); |
|||
std::vector<char> buffer((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>()); |
|||
ifs.close(); |
|||
|
|||
printf("buffer.size() = %d\n", buffer.size()); |
|||
|
|||
// 将通道数据存储到raw.csv
|
|||
std::ofstream ofs("raw.csv"); |
|||
ofs << "II,V1,V5\n"; |
|||
for (size_t i = 0; i < buffer.size();) { |
|||
parse_packet_to_csv* packet = (parse_packet_to_csv*)&buffer[i]; |
|||
if (packet->h0 == 0xA2 && packet->h1 == 0x02 && packet->e0 == 0x02 && packet->e1 == 0xA2) { |
|||
// printf("ch0 = %d, ch1 = %d, ch2 = %d\n", packet->ch0, packet->ch1, packet->ch2);
|
|||
ofs << packet->ch0 << "," << packet->ch1 << "," << packet->ch2 << "\n"; |
|||
i += sizeof(parse_packet_to_csv); |
|||
} else { |
|||
i++; |
|||
} |
|||
} |
|||
|
|||
return 0; |
|||
} |
26099
only_u2_data_parser/raw.csv
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
13324
only_u2_data_parser/raw.txt
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,54 @@ |
|||
|
|||
#include <fstream>
|
|||
#include <functional>
|
|||
#include <iostream>
|
|||
#include <list>
|
|||
#include <map>
|
|||
#include <memory>
|
|||
#include <set>
|
|||
#include <sstream>
|
|||
#include <string>
|
|||
#include <thread>
|
|||
#include <vector>
|
|||
//
|
|||
#include <winsock2.h>
|
|||
//
|
|||
#include <Windows.h>
|
|||
//
|
|||
#include <stdio.h>
|
|||
|
|||
#pragma comment(lib, "ws2_32.lib")
|
|||
#define PORT 8988
|
|||
|
|||
int main(int argc, char *argv[]) { |
|||
/**
|
|||
* @brief |
|||
* 打开raw.txt |
|||
* 读取raw.txt全部内容 |
|||
* 去掉换行,空格,回车 |
|||
* 将16进制字符串转换成二进制 |
|||
* 写入raw.bin |
|||
*/ |
|||
|
|||
std::ifstream ifs("raw.txt"); |
|||
std::string str((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>()); |
|||
ifs.close(); |
|||
|
|||
std::string str2; |
|||
for (auto &c : str) { |
|||
if (c == ' ' || c == '\n' || c == '\r') { |
|||
continue; |
|||
} |
|||
str2.push_back(c); |
|||
} |
|||
|
|||
std::ofstream ofs("raw.bin", std::ios::binary); |
|||
for (size_t i = 0; i < str2.size(); i += 2) { |
|||
std::string str3 = str2.substr(i, 2); |
|||
char c = (char)std::stoi(str3, nullptr, 16); |
|||
ofs.write(&c, 1); |
|||
} |
|||
ofs.close(); |
|||
|
|||
return 0; |
|||
} |
7392
stable/onlyu2_stable_v1.hex
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
13324
stable/stable_v1.txt
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue