我正在使用DOORS的PFM模块。我必须从PFM中的配置中向文件写入一些信息。
我希望所有的参数都有名称,价值和单位。以下是我尝试过的代码,但无法获得所有参数
DxlObject paramdxl = null
DxlObject comp = CONF_getCompVersion(node)
DxlObject progV = CONF_getUsingProgVersion (comp)
param = CONF_getAllParams(comp, progV)
for paramdxl in param do{
string name1 = paramdxl->"name"
string unit1 = paramdxl->"unit"
string value1 = ""
string value2 = ""
string name2 = ""
for value1 in paramdxl->"values" do{
}
print "name: "name1 " value : " value1 " unit: " unit1 "\n"
}
根据PFM API,参数值包含在跳过列表中。 但是,value1包含'标准布局''而不是值,而其他值(名称和单位)是正确的。
感谢您的帮助。
答案 0 :(得分:0)
求助:
以下是从file.csv导出的条件导出的代码(带状态)和参数(带有值和单位)的配置。这可以很容易地修改,以导出项目PFM中所有配置中的所有元素。
//Path of CSV file
Stream outcrit = write "C:\\YOURPATH\\crit.csv"
Stream outparam = write "C:\\YOURPATH\\param.csv"
string separator = ";"
string endline = "\n"
outcrit<< "famille"separator"nom"separator"etat"endline
outparam<< "nom"separator"valeur"separator"unite"endline
Skip param = create
Skip param2 = create
Skip crit = create
Skip critSet = create
Skip values1 = createString
string c = ""
string p = ""
string message = ""
string data = ""
DxlObject dxlParam = null
DxlObject dxl = null
DxlObject dxlCritSet = null
DxlObject dxlCrit = null
int n = 1
int type = CONF_getNodeType(node)
if (type == CONF_PROG){ //Configuration selected
infoBox "toto"
DxlObject dxlConfig = null
dxlConfig = node->"lastVersion" //Get Configuration set
Skip activOpt = dxlConfig->"activOptions" //Get Criteria activated
Skip packVer = dxlConfig->"compVersions" //Get list of package version
DxlObject dxlPackVer = null
for dxlPackVer in packVer do{ //Get Object package Version
}
DxlObject progV = CONF_getUsingProgVersion (dxlPackVer)
critSet = dxlPackVer->"variantsets" //Get list of criteria
param = dxlPackVer->"params" //Get list of parameters
print "Listes des criteres \n"
for dxlCritSet in critSet do{
string nameF = dxlCritSet->"name" //Name of criteria set
print "famille :" nameF "\n"
crit = dxlCritSet->"options"
for dxlCrit in crit do{
string nameCrit = dxlCrit->"name" //Name of criteria
bool stateCrit = false
if (find(activOpt, dxlCrit)){
stateCrit = true //Update state of criteria
}
print "name :" nameCrit " state : "stateCrit"\n"
outcrit<< nameF separator nameCrit separator stateCrit endline
}
}
print "Listes des parametres \n"
for dxlParam in param do{
string nameParam = dxlParam->"name" //Parameter name
string unitParam = dxlParam->"unit" //Parameter unit
param2 = dxlParam->"values"
string valueParam = ""
find (param2, progV, valueParam) //get parameter value
print "Parametre " nameParam " : " valueParam " " unitParam "\n"
outparam<< nameParam separator valueParam separator unitParam endline
}
close outcrit
close outparam
nicodupe