【问题标题】:How to display the name of a module in another module that is not directly linked to it (DXL DOORS)如何在没有直接链接的另一个模块中显示模块的名称(DXL DOORS)
【发布时间】:2014-10-10 19:00:47
【问题描述】:

我是 DXL 的新手,我正在尝试在 DOORS 中创建一个主模块(模块 A),该模块有一列显示模块 B 的文本,后跟模块 C 的标题。模块 B 链接到模块 A ,并且模块 C 链接到模块 B。我希望模块 A 有一个列 1)显示从 B 链接的内容,以及 2)在与每个模块 B 对象相同的行上,显示链接的模块 C 名称进入模块 B。我希望模块 C 的名称放在方括号中。它应该是这样的:

在模块 A 内 第一列:“在 A 中手动输入的文本” 第二列:“在 B [C 名称] 中手动输入的文本”

目前我可以将 B 带入 A 中的新列。代码如下:

pragma runLim, 0
void showIn(Object o, int depth) {
    Link l
    LinkRef lr
    ModName_ otherMod = null
    Module linkMod = null
    ModuleVersion otherVersion = null
    Object othero
    string disp = null
    string s = null
    string plain, plainDisp
    int plainTextLen
    int count
    bool doneOne = false
    string linkModName = "*"
    for lr in all(o<-linkModName) do {
        otherMod = module (sourceVersion lr)
        if (!null otherMod) {
            if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {
                load((sourceVersion lr),false)
            }
        }
    }
    for l in all(o<-linkModName) do {
        otherVersion = sourceVersion l
        otherMod = module(otherVersion)
        if (null otherMod || isDeleted otherMod) continue
        othero = source l
        if (null othero) {
            load(otherVersion,false)
        }
        othero = source l
        if (null othero) continue
        if (isDeleted othero) continue
        doneOne = true
        if (depth == 1) {
            s = probeRichAttr_(othero,"Object Text", false)
            if (s == "") 
            displayRich("\\pard " " ")
            else
            displayRich("\\pard " s)
        }
    }
}
showIn(obj,1)

这是我迄今为止从另一个查询中发现的: Show DXL columns from other modules

这是在 B 的新列中的方括号中显示 C 名称的有用开始。这是我的代码:

    pragma runLim, 0
    int lines[4] = {0, 0, 0, 0}
    void adjustLines(int depth, showAtDepth) {
    int count
    for (count = 0; count < 4; count++) {
    while (lines[depth-1] < lines[count]) {
        if (depth == showAtDepth) displayRich("\\pard " " ")
        lines[depth-1]++
    }
  }
}
void showIn(Object o, int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false

    string linkModName = "*"
    for lr in all(o<-linkModName) do {
        otherMod = module (sourceVersion lr)
        if (!null otherMod) {
            if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {
                load((sourceVersion lr),false)
            }
        }
    }
    for l in all(o<-linkModName) do {
        otherVersion = sourceVersion l
        otherMod = module(otherVersion)
        if (null otherMod || isDeleted otherMod) continue
        othero = source l
        if (null othero) {
            load(otherVersion,false)
        }
        othero = source l
        if (null othero) continue
        if (isDeleted othero) continue
        int oldLines = lines[depth-1]
        adjustLines(depth, 1)
        bool kick = (doneOne) && (lines[depth-1] == oldLines)
        if (kick) {
            lines[depth-1]++
            if (depth == 1) displayRich("\\pard " " ")
        }
        if (depth < 4) {
            showIn(othero, depth+1)
        }
        doneOne = true
        if (depth == 1) {
            s = name(otherMod)
            if (isBaseline(otherVersion)) {
                s = s " [" versionString(otherVersion) "]"
            }

        s = "{[" s "]}"

        displayRich s

        }
        lines[depth-1] += 3
    }
}
showIn(obj,1)

但是,这有两个问题。 1)我有多个从 C 中的对象进入 B 的链接,对于每个链接,它都会多次显示 C 的名称。我希望它在 B 中的每个对象只显示一次 C 的名称,因此没有冗余。 2) C 的名称在 B 中显示为新列,但我希望将其连接到现有列中的文本末尾。

此外,A 和 B 之间的链接集与 B 和 C 之间的链接集位于不同的文件夹中,因此我在上面提供的 stockoverflow 答案似乎不起作用1

我想有两种不同的方法。在 B 中的对象文本末尾显示 C 的名称,然后让 A 调用该 B 列,从而抓取两个链接的对象。在这种情况下,我只需要 B 的 DXL 代码。或者让 A 足够聪明,可以调用 B 列并将 C 的名称附加到它上面。在这种情况下,我只需要 A 的 DXL 代码。

我不确定这个论坛是否适合回答这个问题(我尝试致电 IBM 支持,他们在此处推荐了我)。提前谢谢你。

【问题讨论】:

    标签: ibm-doors


    【解决方案1】:

    我知道这个回复有点晚了,我相信你现在已经继续前进了,但是......我想你正在寻找这样的东西......

    pragma runLim, 0
    void showIn(Object o, int depth) {
      Link l, l2
      LinkRef lr
      ModName_ modC = null
      ModName_ otherMod = null
      Module linkMod = null
      ModuleVersion otherVersion = null
      Object othero
      string disp = null
      string s = null
      string plain, plainDisp
      int plainTextLen
      int count
      bool doneOne = false
      string linkModName = "*"
      for lr in all(o<-linkModName) do {
        otherMod = module (sourceVersion lr)
        if (!null otherMod) {
            if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {
                load((sourceVersion lr),false)
            }
        }
      }
      for l in all(o<-linkModName) do {
        otherVersion = sourceVersion l
        otherMod = module(otherVersion)
        if (null otherMod || isDeleted otherMod) continue
        othero = source l
        if (null othero) {
            load(otherVersion,false)
        }
        othero = source l
        if (null othero) continue
        if (isDeleted othero) continue
        doneOne = true
        if (depth == 1) {
            s = probeRichAttr_(othero,"Object Text", false)
             for l2 in all (othero <- "*") do {
              modC = source(l2)
              s = s " [" name(modC) "]"
              break
            }
    
            if (s != "") 
            displayRich("\\pard " s)
        }
      }
    }
    showIn(obj,1)
    

    您可能需要根据您的具体情况对其进行一些修改。

    祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-21
      • 1970-01-01
      相关资源
      最近更新 更多