//public void addApxSignalToList(string sigName, string type) public void addApxTypedSignalToList(ApxType aT) { uint offset = (uint)apxSignalList.Count; int arraySize; string type; string sigName; for (int i = 0; i < aT.Defenitions.Count; i++) { type = aT.Defenitions[i]; sigName = aT.sigName + ":" + aT.typeName; arraySize = 0; if (getnumericalInHardBrackets(type).Length > 0) { arraySize = Int32.Parse(getnumericalInHardBrackets(type)); } if (aT.structNames.Count > i) { sigName += ":" + aT.structNames[i]; } uint typeLen = typeToLen(type, arraySize); indataLen += typeLen; for (int j = 0; j < typeLen; j++) { // A 32bit signal is entered 4 times to make lookup easier as you can go by address anywhere in the range ApxSignal apxsig = new ApxSignal(offset, typeLen, type[0], sigName); apxSignalList.Add(apxsig); } } }
private void addReceiveportToList() { string sigName = getStringWithinQuotes(); string signalType = getSignalType(); string typeIdentifier = getnumericalInHardBrackets(); ApxType aT; int index = int.MaxValue; if (typeIdentifier != "") { index = int.Parse(typeIdentifier); } if (signalType == "T") { if (apxTypeList.Count > index) { aT = apxTypeList[index]; aT.sigName = sigName; } else { throw new ArgumentException("not able to parse line to ApxType"); } } else if (signalType != "") { List <string> names = new List <string> { "" }; List <string> defenitions; if (index == int.MaxValue) { defenitions = new List <string> { signalType } } ; else { defenitions = new List <string>(); defenitions.Add(signalType + "[" + index.ToString() + "]"); } aT = new ApxType(sigName, signalType, names, defenitions); } else { throw new ArgumentException("not able to parse line to ApxType"); } if (aT != null) { addApxTypedSignalToList(aT); } else { throw new ArgumentException("not able to parse line to ApxType"); } }
public void addApxTypeToList(string sigName, string typeName, List <string> structNames, List <string> typeIdentifiers, string interpretation = "") { ApxType atype = new ApxType(sigName, typeName, structNames, typeIdentifiers); apxTypeList.Add(atype); }