增加了示例fiber_id 修改了rust中关于字符串的处理

This commit is contained in:
xin
2025-06-12 09:54:15 +08:00
parent 1aba741f67
commit a500813e45
3 changed files with 19 additions and 1 deletions

View File

@ -56,6 +56,7 @@ void IRIS_DATA_example() {
tempspectradata.SpectralDataAddress = (uint8_t *)plot1;
std::string temp="HH3_IRIS";
strcpy(tempspectradata.SensorId, temp.c_str());
strcpy(tempspectradata.Name, "HH3_IRIS_Spectral_Data"); // 光谱数据名称
///赋值第二个光谱数据
One_Spectral_Data_Struct &tempspectradata1= mydata.SepctralDataSection.SectionContent.SepctralDataAddressList[1];
tempspectradata1.CollectionTime= time; // 采集时间
@ -66,7 +67,9 @@ void IRIS_DATA_example() {
tempspectradata1.SpectralDataAddress = (uint8_t *)plot2;
std::string temp1="IS3_IRIS";
strcpy(tempspectradata1.SensorId, temp1.c_str());
strcpy(tempspectradata1.Name, "IS3_IRIS_Spectral_Data"); // 光谱数据名称
///赋值第三个光谱数据
One_Spectral_Data_Struct &tempspectradata2= mydata.SepctralDataSection.SectionContent.SepctralDataAddressList[2];
tempspectradata2.CollectionTime= time; // 采集时间
@ -77,6 +80,7 @@ void IRIS_DATA_example() {
tempspectradata2.SpectralDataAddress = (uint8_t *)plot3;
std::string temp2="IS2_IRIS";
strcpy(tempspectradata2.SensorId, temp2.c_str());
strcpy(tempspectradata2.Name, "IS2_IRIS_Spectral_Data"); // 光谱数据名称
///赋值第二个光谱数据
One_Spectral_Data_Struct &tempspectradata3= mydata.SepctralDataSection.SectionContent.SepctralDataAddressList[3];
tempspectradata3.CollectionTime= time; // 采集时间
@ -87,6 +91,7 @@ void IRIS_DATA_example() {
tempspectradata3.SpectralDataAddress = (uint8_t *)plot4;
strcpy(tempspectradata3.SensorId, temp1.c_str());
strcpy(tempspectradata3.Name, "IS2_IRIS_Spectral_Data"); // 光谱数据名称
///光谱信息区域构造
mydata.SepctralInfoSection.SectionContent.SepctralInfoNumber = 3;