當前位置: 首頁>>代碼示例>>Golang>>正文


Golang ModuleInfo.Id方法代碼示例

本文整理匯總了Golang中github.com/wiless/gocomm/chipset.ModuleInfo.Id方法的典型用法代碼示例。如果您正苦於以下問題:Golang ModuleInfo.Id方法的具體用法?Golang ModuleInfo.Id怎麽用?Golang ModuleInfo.Id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/wiless/gocomm/chipset.ModuleInfo的用法示例。


在下文中一共展示了ModuleInfo.Id方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: InitModules

func (m *MPChannel) InitModules() {

	var totalModules int = 1

	/// AUTO CODE
	/// something try begins
	var minfo chipset.ModuleInfo
	m.Modules = make(map[string]chipset.ModuleInfo, totalModules)
	m.ModuleNames = make(map[int]string, totalModules)

	strlist := [2]string{"channel", "channelBlock"}
	for cnt := 0; cnt < len(strlist); cnt++ {
		m.ModuleNames[cnt] = strlist[cnt]
	}
	var temp, otemp []int

	minfo.Name = "channel"
	minfo.Id = 0
	minfo.Desc = ""

	temp = append(temp, m.PinByName("inputPin0").Id)

	otemp = append(otemp, m.PinByName("outputPin0").Id, m.PinByName("coeffPin").Id)

	minfo.InPins = temp
	minfo.OutPins = otemp
	m.Modules["channel"] = minfo

	minfo.Name = "channelBlock"
	minfo.Id = 1
	minfo.Desc = ""

	temp = append(temp, m.PinByName("inputPin1").Id)

	otemp = append(otemp, m.PinByName("outputPin1").Id, m.PinByName("coeffPin").Id)

	minfo.InPins = temp
	minfo.OutPins = otemp
	m.Modules["channelBlock"] = minfo

	// minfo.Name = "feedback"
	// minfo.Id = 2
	// minfo.Desc = "internal Feedback to estimators"

	// temp = append(temp, m.PinByName("inputPin2").Id)
	// otemp = append(otemp, m.PinByName("outputPin2").Id)

	// minfo.InPins = temp
	// minfo.OutPins = otemp
	// m.Modules["feedback"] = minfo
	/// AUTO CODE

	m.isInitialized = true
}
開發者ID:postfix,項目名稱:gocomm,代碼行數:54,代碼來源:mpchannel.go

示例2: InitModules

func (m *OFDM) InitModules() {

	var totalModules int = 2

	/// AUTO CODE
	/// something try begins
	var minfo chipset.ModuleInfo
	m.Modules = make(map[string]chipset.ModuleInfo, totalModules)
	m.ModuleNames = make(map[int]string, totalModules)

	strlist := [2]string{"txmodule", "rxmodule"}
	for cnt := 0; cnt < len(strlist); cnt++ {
		m.ModuleNames[cnt] = strlist[cnt]
	}
	var temp, otemp []int

	minfo.Name = "txmodule"
	minfo.Id = 0
	minfo.Desc = ""

	temp = append(temp, m.PinByName("inputPin0").Id)

	otemp = append(otemp, m.PinByName("outputPin0").Id)

	minfo.InPins = temp
	minfo.OutPins = otemp
	method := reflect.ValueOf(m).MethodByName("Ifft")
	minfo.Function = method
	minfo.FunctionName = "Ifft"

	m.Modules["txmodule"] = minfo

	minfo.Name = "rxmodule"
	minfo.Id = 1
	minfo.Desc = ""

	temp = append(temp, m.PinByName("inputPin1").Id)

	otemp = append(otemp, m.PinByName("outputPin1").Id)

	minfo.InPins = temp
	minfo.OutPins = otemp
	method = reflect.ValueOf(m).MethodByName("Fft")
	minfo.Function = method
	minfo.FunctionName = "Fft"
	m.Modules["rxmodule"] = minfo

	/// AUTO CODE

	m.isInitialized = true
}
開發者ID:postfix,項目名稱:gocomm,代碼行數:51,代碼來源:ofdm.go

示例3: InitModules

func (m *BitSource) InitModules() {
	var totalModules int = m.ModulesCount()
	m.Modules = make(map[string]chipset.ModuleInfo, totalModules)
	m.ModuleNames = make(map[int]string, totalModules)
	// b := [...]string{"Penn", "Teller"}
	strlist := [...]string{"genbit"}
	for i := 0; i < totalModules; i++ {
		m.ModuleNames[i] = strlist[i]
	}

	for i := 0; i < totalModules; i++ {
		var minfo chipset.ModuleInfo
		minfo.Name = m.ModuleNames[i]

		switch minfo.Name {
		case "genbit":
			minfo.Id = 0
			minfo.Desc = "Generates Uniformly distributed bits 0 and 1 at output pin 'bitOut' "
			minfo.InPins = []int{}
			minfo.OutPins = []int{m.PinByName("bitOut").Id}
			method := reflect.ValueOf(m).MethodByName("GenBit")
			minfo.Function = method
			// case "demodulate":
			// 	minfo.InPins = []int{1}
			// 	minfo.OutPins = []int{1}

		}
		m.Modules[minfo.Name] = minfo
	}

}
開發者ID:postfix,項目名稱:gocomm,代碼行數:31,代碼來源:bitsource.go

示例4: InitModules

func (m *BER) InitModules() {

	var totalModules int = 1

	/// AUTO CODE
	/// something try begins
	var minfo chipset.ModuleInfo
	m.Modules = make(map[string]chipset.ModuleInfo, totalModules)
	m.ModuleNames = make(map[int]string, totalModules)

	strlist := [1]string{"ber"}
	for cnt := 0; cnt < len(strlist); cnt++ {
		m.ModuleNames[cnt] = strlist[cnt]
	}
	var temp, otemp []int

	minfo.Name = "ber"
	minfo.Id = 0
	minfo.Desc = ""

	temp = append(temp, m.PinByName("inputPin0").Id)

	otemp = append(otemp, m.PinByName("outputPin0").Id)

	minfo.InPins = temp
	minfo.OutPins = otemp
	m.Modules["ber"] = minfo

	/// AUTO CODE

	m.isInitialized = true
}
開發者ID:postfix,項目名稱:gocomm,代碼行數:32,代碼來源:ber.go

示例5: InitModules

func (m *CDMA) InitModules() {

	var totalModules int = 2

	/// AUTO CODE
	/// something try begins
	var minfo chipset.ModuleInfo
	m.Modules = make(map[string]chipset.ModuleInfo, totalModules)
	m.ModuleNames = make(map[int]string, totalModules)

	strlist := [2]string{"Spread", "DeSpread"}
	for cnt := 0; cnt < len(strlist); cnt++ {
		m.ModuleNames[cnt] = strlist[cnt]
	}
	var temp, otemp []int

	minfo.Name = "Spread"
	minfo.Id = 0
	minfo.Desc = ""

	temp = append(temp, m.PinByName("inputSymbols").Id)

	otemp = append(otemp, m.PinByName("outputChips").Id)

	minfo.InPins = temp
	minfo.OutPins = otemp
	m.Modules["Spread"] = minfo

	minfo.Name = "DeSpread"
	minfo.Id = 1
	minfo.Desc = ""

	temp = append(temp, m.PinByName("inputChipsSamples").Id)

	otemp = append(otemp, m.PinByName("outputSymbol").Id)

	minfo.InPins = temp
	minfo.OutPins = otemp
	m.Modules["DeSpread"] = minfo

	/// AUTO CODE

	m.isInitialized = true
}
開發者ID:postfix,項目名稱:gocomm,代碼行數:44,代碼來源:cdmachip.go

示例6: InitModules

func (m *Modem) InitModules() {
	var totalModules int = m.ModulesCount()
	m.Modules = make(map[string]chipset.ModuleInfo, totalModules)
	m.ModuleNames = make(map[int]string, totalModules)
	// b := [...]string{"Penn", "Teller"}
	strlist := [...]string{"modulate", "demodulate"}
	for i := 0; i < totalModules; i++ {
		m.ModuleNames[i] = strlist[i]
	}

	for i := 0; i < totalModules; i++ {
		var minfo chipset.ModuleInfo
		minfo.Name = m.ModuleNames[i]

		switch minfo.Name {
		case "modulate":
			minfo.Desc = "This modulate modulates the input bits from Inpin 'bitIn' and writes to 'symbolOut' "
			minfo.Id = 0
			minfo.InPins = []int{m.PinByName("bitIn").Id}
			minfo.OutPins = []int{m.PinByName("symbolOut").Id}
			method := reflect.ValueOf(m).MethodByName("SayModulate")
			minfo.Function = method
			minfo.FunctionName = "SayModulate"

		case "demodulate":
			minfo.Desc = "This modulate DeModulates the input Symbols from Inpin 'symbolIn' and writes to 'bitOut' "
			minfo.Id = 1
			minfo.InPins = []int{m.PinByName("symbolIn").Id}
			minfo.OutPins = []int{m.PinByName("bitOut").Id}
			method := reflect.ValueOf(m).MethodByName("SayDemodulate")
			minfo.FunctionName = "SayDemodulate"
			minfo.Function = method

		}
		m.Modules[minfo.Name] = minfo
	}

}
開發者ID:postfix,項目名稱:gocomm,代碼行數:38,代碼來源:modem.go

示例7: InitModules

func (m *ChannelEmulator) InitModules() {
	var totalModules int = m.ModulesCount()
	m.Modules = make(map[string]chipset.ModuleInfo, totalModules)
	m.ModuleNames = make(map[int]string, totalModules)
	// b := [...]string{"Penn", "Teller"}
	strlist := [...]string{"fadingChannel", "awgn"}
	for i := 0; i < totalModules; i++ {
		m.ModuleNames[i] = strlist[i]
	}

	for i := 0; i < totalModules; i++ {
		var minfo chipset.ModuleInfo
		minfo.Name = m.ModuleNames[i]

		switch minfo.Name {
		case "fadingChannel":
			minfo.Id = 0
			minfo.Desc = "This emulates a 1-tap fading (multiplicative) channel"
			minfo.InPins = []int{m.PinByName("symbolIn").Id}
			minfo.OutPins = []int{m.PinByName("symbolOut").Id}
			method := reflect.ValueOf(m).MethodByName("FadingChannel")
			minfo.Function = method

		case "awgn":
			minfo.Id = 1
			minfo.Desc = "This emulates additive white noise to the input signal "
			minfo.InPins = []int{m.PinByName("symbolIn").Id}
			minfo.OutPins = []int{m.PinByName("symbolOut").Id}
			method := reflect.ValueOf(m).MethodByName("AWGNChannel")
			minfo.Function = method

		}
		m.Modules[minfo.Name] = minfo
	}

}
開發者ID:postfix,項目名稱:gocomm,代碼行數:36,代碼來源:awgn.go


注:本文中的github.com/wiless/gocomm/chipset.ModuleInfo.Id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。