Browse Source

修复:二期红外设备转换xml的问题;

jianfeng1.wang 2 years ago
parent
commit
478ce43807
1 changed files with 18 additions and 2 deletions
  1. 18 2
      FieldTestTool/FieldTestTool/PropertiesWnd.cpp

+ 18 - 2
FieldTestTool/FieldTestTool/PropertiesWnd.cpp

@@ -412,6 +412,16 @@ void CPropertiesWnd::LoadKeyInfo(std::vector<KeyInfo>& vtKeyInfo, TString path)
 		// 是否禁用;
 		it->pbtnInfo->pBTN->EnableWindow(it->bUse);
 
+		// 如果红外值空,禁用;
+		if ( Global::g_nVersion == 1 && it->strValue.size() == 0 )
+		{
+			it->bUse = false;
+		}
+		if ( Global::g_nVersion == 2 && it->strValue2.size() == 0 )
+		{
+			it->bUse = false;
+		}
+
 		// 存入map中;
 		m_map_key.insert(std::pair<UINT, KeyInfo*>(BTNID + i, &*it));
 
@@ -604,10 +614,16 @@ void CPropertiesWnd::ConvertOldSignalsToNew(std::string strOldSignal, std::strin
 				pType->SetText(it->protocol.c_str());
 				pXmlElent->InsertEndChild(pType);
 
-				tinyxml2::XMLElement* pValue = doc.NewElement("VALUE");
+				tinyxml2::XMLElement* pValue = NULL;
+				if ( Global::g_nVersion == 1 )
+					pValue = doc.NewElement("VALUE");
+				else if ( Global::g_nVersion == 2 )
+					pValue = doc.NewElement("VALUE2");
+				else if ( Global::g_nVersion == 3 )
+					pValue = doc.NewElement("VALUE3");
 				pValue->SetText(it->key.c_str());
 				pXmlElent->InsertEndChild(pValue);
-
+				
 				pXmlRoot->InsertEndChild(pXmlElent);
 			}
 		}