implemented the epansion line stuff
made adjustments to to the grain cable by adding i2c as an option as long as you set and expander line, also ajusted DeviceAvailability so that an i2c address will not be claimed if the component has an expansion line set, updated the device wizard to removed pin options if the i2c port was selected and vice versa for pins since we now have a components that supports both types, updated the components setting to set the default address type based on the restriction passed in that is set by the wizard, and fall back to what is was before if one is not passed in
This commit is contained in:
parent
54a826bc2d
commit
3325c9d75b
11 changed files with 113 additions and 36 deletions
|
|
@ -198,16 +198,23 @@ export default function DeviceWizard(props: Props) {
|
|||
|
||||
/**
|
||||
* function that restricts the pin availabilty in the availability map to the pin of the port that was selected
|
||||
* does nothing for I2C ports as the restrictions for that are handled by the component type
|
||||
* @param port port that was selected
|
||||
* @param availability availability map of the device
|
||||
* @returns modified availability map
|
||||
*/
|
||||
const adjustAvailablePositions = (port: PortInformation, availability: DeviceAvailabilityMap) => {
|
||||
let currentAvailability = availability;
|
||||
console.log(port)
|
||||
switch (port.addressType) {
|
||||
case quack.AddressType.ADDRESS_TYPE_CONFIGURABLE_PIN_ARRAY:
|
||||
currentAvailability.set(port.addressType, [{ address: port.address, label: port.label }]);
|
||||
//since we now have a component type that can be pins or i2c need to remove i2c options if they selected a pin port
|
||||
currentAvailability.set(quack.AddressType.ADDRESS_TYPE_I2C, new Map());
|
||||
break;
|
||||
case quack.AddressType.ADDRESS_TYPE_I2C:
|
||||
//since we now have a component type that can be pins or i2c need to remove pin options if they selected the i2c port
|
||||
currentAvailability.set(quack.AddressType.ADDRESS_TYPE_CONFIGURABLE_PIN_ARRAY, []);
|
||||
break;
|
||||
}
|
||||
return currentAvailability;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue