本文整理汇总了Golang中github.com/axel-freesp/sge/models.FilesTreeStore.CursorAt方法的典型用法代码示例。如果您正苦于以下问题:Golang FilesTreeStore.CursorAt方法的具体用法?Golang FilesTreeStore.CursorAt怎么用?Golang FilesTreeStore.CursorAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/axel-freesp/sge/models.FilesTreeStore
的用法示例。
在下文中一共展示了FilesTreeStore.CursorAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: updateConnections
func updateConnections(p bh.PortIf, fts *models.FilesTreeStore) {
nodeCursor := fts.Cursor(p.Node())
portCursor := fts.CursorAt(nodeCursor, p)
for _, c := range p.Connections() {
conn := p.Connection(c)
connCursor := fts.CursorAt(portCursor, conn)
otherNode := c.Node()
otherNodeCursor := fts.Cursor(otherNode)
otherPortCursor := fts.CursorAt(otherNodeCursor, c)
otherConnCursor := fts.CursorAt(otherPortCursor, conn)
connText := fmt.Sprintf("%s/%s -> %s/%s",
conn.From().Node().Name(), conn.From().Name(),
conn.To().Node().Name(), conn.To().Name())
fts.SetValueById(connCursor.Path, connText)
fts.SetValueById(otherConnCursor.Path, connText)
}
}
示例2: EditObject
//.........这里部分代码省略.........
impl := obj.(bh.ImplementationIf)
(*old)[iImplName] = impl.ElementName()
impl.SetElemName((*detail)[iImplName])
fts.SetValueById(j.objId, (*detail)[iImplName])
case eArch:
a := obj.(pf.ArchIf)
(*old)[iArchName] = a.Name()
a.SetName((*detail)[iArchName])
for _, p := range a.Processes() {
for _, c := range p.InChannels() {
link := c.Link()
id := fts.Cursor(link)
fts.SetValueById(id.Path, link.Name())
}
for _, c := range p.OutChannels() {
link := c.Link()
id := fts.Cursor(link)
fts.SetValueById(id.Path, link.Name())
}
}
fts.SetValueById(j.objId, a.Name())
case eProcess:
p := obj.(pf.ProcessIf)
(*old)[iProcessName] = p.Name()
p.SetName((*detail)[iProcessName])
for _, c := range p.InChannels() {
link := c.Link()
id := fts.Cursor(link)
fts.SetValueById(id.Path, link.Name())
}
for _, c := range p.OutChannels() {
link := c.Link()
id := fts.Cursor(link)
fts.SetValueById(id.Path, link.Name())
}
fts.SetValueById(j.objId, p.Name())
case eIOType:
t := obj.(pf.IOTypeIf)
(*old)[iIOTypeName] = t.Name()
t.SetName((*detail)[iIOTypeName])
for _, a := range t.Platform().Arch() {
aCursor := fts.Cursor(a)
for _, p := range a.Processes() {
pCursor := fts.CursorAt(aCursor, p)
for _, c := range p.InChannels() {
if t == c.IOType() {
cCursor := fts.CursorAt(pCursor, c)
fts.SetValueById(cCursor.Path, c.Name())
}
}
for _, c := range p.OutChannels() {
if t == c.IOType() {
cCursor := fts.CursorAt(pCursor, c)
fts.SetValueById(cCursor.Path, c.Name())
}
}
}
}
(*old)[iIOModeSelect] = string(t.IOMode())
t.SetIOMode(gr.IOMode((*detail)[iIOModeSelect]))
fts.SetValueById(j.objId, t.Name())
case eChannel:
c := obj.(pf.ChannelIf)
//(*old)[iChannelDirection] = direction2string[c.Direction()]
//c.SetDirection(string2direction[(*detail)[iChannelDirection]])
(*old)[iIOTypeSelect] = c.IOType().Name()
iot, ok := freesp.GetIOTypeByName((*detail)[iIOTypeSelect])
if ok {
c.SetIOType(iot)
} else {
log.Printf("jobApplier.Apply(JobEdit): ERROR: IOType %s not registered.\n", (*detail)[iIOTypeSelect])
}
fts.SetValueById(j.objId, c.Name())
link := c.Link()
id := fts.Cursor(link)
fts.SetValueById(id.Path, link.Name())
case eMapElement:
c := obj.(mp.MappedElementIf)
pr, ok := c.Process()
if !ok {
(*old)[iProcessSelect] = "<unmapped>"
} else {
(*old)[iProcessSelect] = fmt.Sprintf("%s/%s", pr.Arch().Name(), pr.Name())
}
for _, a := range c.Mapping().Platform().Arch() {
for _, pr = range a.Processes() {
if (*detail)[iProcessSelect] == fmt.Sprintf("%s/%s", a.Name(), pr.Name()) {
c.SetProcess(pr)
fts.SetValueById(j.objId, (*detail)[iProcessSelect])
return
}
}
}
c.SetProcess(nil)
fts.SetValueById(j.objId, (*detail)[iProcessSelect])
default:
log.Printf("jobApplier.Apply(JobEdit): error: invalid job description\n")
}
return
}