Example #1
0
func CreateXmlIONodePosHint(n bh.NodeIf, path string) (xmln *backend.XmlNodePosHint) {
	if len(path) == 0 {
		xmln = backend.XmlNodePosHintNew(n.Name())
	} else {
		xmln = backend.XmlNodePosHintNew(fmt.Sprintf("%s/%s", path, n.Name()))
	}
	empty := image.Point{}
	for _, p := range n.PathList() {
		for _, m := range gr.ValidModes {
			xmlp := string(gr.CreatePathMode(p, m))
			pos := n.PathModePosition(p, m)
			if pos != empty {
				xmln.Entry = append(xmln.Entry, *backend.XmlModeHintEntryNew(xmlp, pos.X, pos.Y))
			}
		}
	}
	for _, p := range n.InPorts() {
		xmlp := backend.XmlPortPosHintNew(p.Name())
		xmlp.Entry = freesp.CreateXmlModePosition(p).Entry
		xmln.InPorts = append(xmln.InPorts, *xmlp)
	}
	for _, p := range n.OutPorts() {
		xmlp := backend.XmlPortPosHintNew(p.Name())
		xmlp.Entry = freesp.CreateXmlModePosition(p).Entry
		xmln.OutPorts = append(xmln.OutPorts, *xmlp)
	}
	return
}
Example #2
0
func CreateXmlProcessHint(p pf.ProcessIf) (xmlp *backend.XmlProcessPosHint) {
	xmlp = backend.XmlProcessPosHintNew(p.Name())
	xmlp.Entry = freesp.CreateXmlModePosition(p).Entry
	for _, c := range p.InChannels() {
		xmlp.InChannels = append(xmlp.InChannels, *CreateXmlChannelHint(c))
	}
	for _, c := range p.OutChannels() {
		xmlp.OutChannels = append(xmlp.OutChannels, *CreateXmlChannelHint(c))
	}
	return
}
Example #3
0
func CreateXmlArchHint(a pf.ArchIf) (xmla *backend.XmlArchPosHint) {
	xmla = backend.XmlArchPosHintNew(a.Name())
	xmla.Entry = freesp.CreateXmlModePosition(a).Entry
	for _, p := range a.ArchPorts() {
		xmla.ArchPorts = append(xmla.ArchPorts, *CreateXmlArchPortHint(p))
	}
	for _, p := range a.Processes() {
		xmla.Processes = append(xmla.Processes, *CreateXmlProcessHint(p))
	}
	return
}
Example #4
0
func CreateXmlOutPort(p bh.PortIf) (xmlp *backend.XmlOutPort) {
	xmlp = backend.XmlOutPortNew(p.Name(), p.SignalType().TypeName())
	xmlp.Entry = freesp.CreateXmlModePosition(p).Entry
	return
}
Example #5
0
func CreateXmlChannelHint(c pf.ChannelIf) (xmlc *backend.XmlChannelPosHint) {
	xmlc = backend.XmlChannelPosHintNew()
	xmlc.Entry = freesp.CreateXmlModePosition(c).Entry
	return
}
Example #6
0
func CreateXmlArchPortHint(p pf.ArchPortIf) (xmlp *backend.XmlArchPortPosHint) {
	xmlp = backend.XmlArchPortPosHintNew()
	xmlp.Entry = freesp.CreateXmlModePosition(p).Entry
	return
}