Exemple #1
0
func Init() {
	signalTypes = make(map[string]bh.SignalTypeIf)
	nodeTypes = make(map[string]bh.NodeTypeIf)
	// TODO: is this redundant with global.libraries?
	libraries = make(map[string]bh.LibraryIf)
	ioTypes = make(map[string]pf.IOTypeIf)
	registeredNodeTypes = tool.StringListInit()
	registeredSignalTypes = tool.StringListInit()
	registeredIOTypes = tool.StringListInit()
}
func CreateXmlLibrary(l bh.LibraryIf) *backend.XmlLibrary {
	fname := l.Filename()
	ret := backend.XmlLibraryNew()
	reflist := tool.StringListInit()
	for _, t := range l.SignalTypes() {
		ref := t.DefinedAt()
		_, ok := reflist.Find(ref)
		if !ok && ref != fname {
			reflist.Append(ref)
		}
	}
	for _, t := range l.NodeTypes() {
		ref := t.DefinedAt()
		_, ok := reflist.Find(ref)
		if !ok && ref != fname {
			reflist.Append(ref)
		}
		for _, impl := range t.Implementation() {
			if impl.ImplementationType() == bh.NodeTypeGraph {
				for _, lib := range impl.Graph().Libraries() {
					ref := lib.Filename()
					_, ok := reflist.Find(ref)
					if !ok && ref != fname {
						reflist.Append(ref)
					}
				}
			}
		}
	}
	for _, ref := range reflist.Strings() {
		ret.Libraries = append(ret.Libraries, *CreateXmlLibraryRef(ref))
	}
	for _, t := range l.SignalTypes() {
		ret.SignalTypes = append(ret.SignalTypes, *CreateXmlSignalType(t))
	}
	for _, t := range l.NodeTypes() {
		ret.NodeTypes = append(ret.NodeTypes, *CreateXmlNodeType(t))
	}
	return ret
}
Exemple #3
0
func PathModePositionerObjectNew() (p *PathModePositionerObject) {
	p = &PathModePositionerObject{*ModePositionerObjectNew(), tool.StringListInit(), ""}
	p.pathlist.Append("")
	return
}