-
-
Save Grigorov-/d98e2a872e4241e65ca2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var devices = this.ToXTypedElementBooking(); | |
var devicePairs = this.EnumerateAllDevicePairs().ToArray(); | |
var xmlData = new IGEXAO_PIN_BOOKING() | |
{ | |
Device = this.ConnectorPairsByTag | |
.SelectMany(connectorPair => | |
{ | |
return connectorPair.Value.DevicePairs | |
.SelectMany(dp => | |
{ | |
var pair = (dp.Value as DevicePair); | |
var pairRecord = new[] { pair.Side1, pair.Side2 }; | |
return pairRecord.Select(device => | |
{ | |
return new ctDevice() | |
{ | |
FullTag = device.Tag, | |
Pin = device.PinsByName.Select(pin => | |
{ | |
var deviceSide = pairRecord[0] == device ? DeviceSide.Left : DeviceSide.Right; | |
var pinID = FullDeviceIdManipulations.GetConnectorPairId(this.Tag, connectorPair.Value.Tag) | |
.Concat(new[] { FullDeviceIdManipulations.ToPartIdFragment(device, deviceSide) }) | |
.Concat(new[] { FullDeviceIdManipulations.ToPartIdFragment(pin.Value, deviceSide) }); | |
var assignNets = GetAssignedNetsToPin(pinID); | |
return new ctPin() | |
{ | |
Name = pin.Value.Name, | |
Rule = new List<ctRule>() | |
{ | |
new ctRule() | |
{ | |
Status = RuleStatus, | |
Validity = validity, | |
Criteria = new ctCriteria() | |
{ | |
FunctionalGroup = assignNets.Select(assNet => | |
new tCriteriaType() | |
{ | |
Value = string.Format("{0};{1}", | |
assNet.Key.FunctionGroupLevel1, assNet.Key.FunctionGroupLevel2) | |
}).ToList() | |
} | |
}, | |
} | |
}; | |
}).ToList(), | |
}; | |
}).ToList(); | |
}); | |
}).ToList(), | |
}; | |
return xmlData.Untyped; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment