Example #1
0
func createOutChannelFromXml(xmlc backend.XmlOutChannel, p pf.ProcessIf) (ch *channel, err error) {
	var iot pf.IOTypeIf
	iot, err = channelGetIOTypeFromArch(p.Arch(), xmlc.IOType)
	if err != nil {
		return
	}
	ch = ChannelNew(gr.OutPort, iot, p, xmlc.Dest)
	//ch.channelPositionsFromXml(xmlc.XmlChannel)
	ap := p.Arch().(*arch).AddArchPort(ch)
	//ap.archPortPositionsFromXml(xmlc.XmlChannel)
	ch.archport = ap
	return
}
Example #2
0
func getOtherProcesses(fts *models.FilesTreeStore, object tr.TreeElementIf) (ret []pf.ProcessIf) {
	var thisProcess pf.ProcessIf
	switch object.(type) {
	case pf.ChannelIf:
		thisProcess = object.(pf.ChannelIf).Process()
	case pf.ProcessIf:
		thisProcess = object.(pf.ProcessIf)
	default:
		log.Fatalf("getOtherProcesses error: invalid type %T\n", object)
	}
	platform := thisProcess.Arch().Platform()
	for _, a := range platform.Arch() {
		for _, p := range a.Processes() {
			if p != thisProcess {
				ret = append(ret, p)
			}
		}
	}
	return
}
Example #3
0
func CreateXmlProcess(p pf.ProcessIf) *backend.XmlProcess {
	ret := backend.XmlProcessNew(p.Name())
	for _, c := range p.InChannels() {
		ret.InputChannels = append(ret.InputChannels, *CreateXmlInChannel(c))
	}
	for _, c := range p.OutChannels() {
		ret.OutputChannels = append(ret.OutputChannels, *CreateXmlOutChannel(c))
	}
	//ret.Entry = freesp.CreateXmlModePosition(p).Entry
	return ret
}
Example #4
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 #5
0
func channelMakeName(iotype pf.IOTypeIf, link pf.ProcessIf) string {
	return fmt.Sprintf("%s-%s/%s", iotype.Name(), link.Arch().Name(), link.Name())
}