public void UniversalContainsSpecificIO() { //Ex. 5 UI contains 3 AI and 3 DI separately, uses Contains(TECIO) TECIO ui = new TECIO(IOType.UI); ui.Quantity = 5; TECIO uo = new TECIO(IOType.UO); uo.Quantity = 5; List <TECIO> io = new List <TECIO> { ui, uo }; IOCollection collection = new IOCollection(io); TECIO aiX = new TECIO(IOType.AI); aiX.Quantity = 3; TECIO aoX = new TECIO(IOType.AO); aoX.Quantity = 3; TECIO diX = new TECIO(IOType.DI); diX.Quantity = 3; TECIO ioDOX = new TECIO(IOType.DO); ioDOX.Quantity = 3; Assert.IsTrue(collection.Contains(aiX)); Assert.IsTrue(collection.Contains(aoX)); Assert.IsTrue(collection.Contains(diX)); Assert.IsTrue(collection.Contains(ioDOX)); }
public void GetUniversalTypeTest() { Assert.AreEqual(TECIO.GetUniversalType(IOType.AI), IOType.UI); Assert.AreEqual(TECIO.GetUniversalType(IOType.DI), IOType.UI); Assert.AreEqual(TECIO.GetUniversalType(IOType.AO), IOType.UO); Assert.AreEqual(TECIO.GetUniversalType(IOType.DO), IOType.UO); }
public void RemoveIO() { TECIO ai = new TECIO(IOType.AI); ai.Quantity = 5; TECIO ao = new TECIO(IOType.AO); ao.Quantity = 5; TECIO di = new TECIO(IOType.DI); di.Quantity = 5; TECIO ioDO = new TECIO(IOType.DO); ioDO.Quantity = 5; List <TECIO> io = new List <TECIO> { ai, ao, di, ioDO }; IOCollection collection = new IOCollection(io); TECIO toRemove = new TECIO(IOType.AI); toRemove.Quantity = 2; collection.Remove(toRemove); Assert.AreEqual(3, collection.IONumber(IOType.AI)); }
public void SpecificDoesntContainUniversalIO() { //Ex. 6 AI doesn't contain 5 UI, uses Contains(TECIO) TECIO ai = new TECIO(IOType.AI); ai.Quantity = 5; TECIO ao = new TECIO(IOType.AO); ao.Quantity = 5; TECIO di = new TECIO(IOType.DI); di.Quantity = 5; TECIO ioDO = new TECIO(IOType.DO); ioDO.Quantity = 5; List <TECIO> io = new List <TECIO> { ai, ao, di, ioDO }; IOCollection collection = new IOCollection(io); TECIO ui = new TECIO(IOType.UI); ui.Quantity = 3; TECIO uo = new TECIO(IOType.UO); uo.Quantity = 3; Assert.IsFalse(collection.Contains(ui)); Assert.IsFalse(collection.Contains(uo)); }
public void AddType() { TECIO ai = new TECIO(IOType.AI); ai.Quantity = 5; TECIO ao = new TECIO(IOType.AO); ao.Quantity = 5; TECIO di = new TECIO(IOType.DI); di.Quantity = 5; TECIO ioDO = new TECIO(IOType.DO); ioDO.Quantity = 5; List <TECIO> io = new List <TECIO> { ai, ao, di, ioDO }; IOCollection collection = new IOCollection(io); collection.Add(IOType.AI); Assert.AreEqual(6, collection.IONumber(IOType.AI)); }
public void TECIOTest() { TECIO io = new TECIO(IOType.AI); Assert.AreEqual(IOType.AI, io.Type); Assert.IsNull(io.Protocol); Assert.AreEqual(1, io.Quantity); }
public void TECIOTest1() { TECProtocol protocol = new TECProtocol(new List <TECConnectionType>()); TECIO io = new TECIO(protocol); Assert.AreEqual(IOType.Protocol, io.Type); Assert.AreEqual(protocol, io.Protocol); Assert.AreEqual(1, io.Quantity); }
public void TECIOSetType() { TECProtocol protocol = new TECProtocol(new List <TECConnectionType>()); TECIO io = new TECIO(protocol); io.Type = IOType.AI; Assert.AreEqual(IOType.AI, io.Type); Assert.IsNull(io.Protocol); Assert.AreEqual(1, io.Quantity); }
public void ContainsSameCollection() { //Ex. 5 AI, 3 DI contains 4 AI, 2 DI. Uses Contains(IOCollection) TECIO ai = new TECIO(IOType.AI); ai.Quantity = 5; TECIO ao = new TECIO(IOType.AO); ao.Quantity = 5; TECIO di = new TECIO(IOType.DI); di.Quantity = 5; TECIO ioDO = new TECIO(IOType.DO); ioDO.Quantity = 5; List <TECIO> io = new List <TECIO> { ai, ao, di, ioDO }; IOCollection collection = new IOCollection(io); TECIO aix = new TECIO(IOType.AI); aix.Quantity = 3; TECIO aox = new TECIO(IOType.AO); aox.Quantity = 2; TECIO dix = new TECIO(IOType.DI); dix.Quantity = 4; TECIO ioDOx = new TECIO(IOType.DO); ioDOx.Quantity = 5; List <TECIO> subjectIo = new List <TECIO> { aix, aox, dix, ioDOx }; IOCollection subjectCollection = new IOCollection(subjectIo); Assert.IsTrue(collection.Contains(subjectCollection)); }
private bool addCanExecute() { IControllerConnection connection = parent.Connection; if (connection == null) { return(true); } else { TECIO proposedIO = new TECIO(ToAdd.Type); proposedIO.Quantity = ToAdd.Quantity; bool containsIO = connection.ParentController.AvailableIO.Contains(proposedIO); bool isNetworkIO = connection is TECNetworkConnection netConnect; return(containsIO || isNetworkIO); } }
public void RemoveSpecificIOFromUniversal() { TECIO ui = new TECIO(IOType.UI); ui.Quantity = 5; List <TECIO> io = new List <TECIO> { ui }; IOCollection collection = new IOCollection(io); TECIO toRemove = new TECIO(IOType.DI); toRemove.Quantity = 2; collection.Remove(toRemove); Assert.AreEqual(3, collection.IONumber(IOType.UI)); }
public void ContainsSameIO() { //Ex. 5 AI contains 3 AI, uses Contains(TECIO) TECIO ai = new TECIO(IOType.AI); ai.Quantity = 5; TECIO ao = new TECIO(IOType.AO); ao.Quantity = 5; TECIO di = new TECIO(IOType.DI); di.Quantity = 5; TECIO ioDO = new TECIO(IOType.DO); ioDO.Quantity = 5; List <TECIO> io = new List <TECIO> { ai, ao, di, ioDO }; IOCollection collection = new IOCollection(io); TECIO aiX = new TECIO(IOType.AI); aiX.Quantity = 3; TECIO aoX = new TECIO(IOType.AO); aoX.Quantity = 3; TECIO diX = new TECIO(IOType.DI); diX.Quantity = 3; TECIO ioDOX = new TECIO(IOType.DO); ioDOX.Quantity = 3; Assert.IsTrue(collection.Contains(aiX)); Assert.IsTrue(collection.Contains(aoX)); Assert.IsTrue(collection.Contains(diX)); Assert.IsTrue(collection.Contains(ioDOX)); }
private void addIOToModuleExecute() { bool wasAdded = false; foreach (TECIO io in this.ModuleIO) { if (io.Type == this.SelectedIO) { io.Quantity += SelectedIOQty; wasAdded = true; break; } } if (!wasAdded) { TECIO newIO = new TECIO(SelectedIO); newIO.Quantity = SelectedIOQty; ModuleIO.Add(newIO); } }
public void SpecificDoesntContainUniversalCollection() { //Ex. 3 AI, 2 DI, 3 AO, 2 DO doesn't contain 2 UI, 2 UO. Uses Contains(IOCollection) TECIO ai = new TECIO(IOType.AI); ai.Quantity = 5; TECIO ao = new TECIO(IOType.AO); ao.Quantity = 5; TECIO di = new TECIO(IOType.DI); di.Quantity = 5; TECIO ioDO = new TECIO(IOType.DO); ioDO.Quantity = 5; List <TECIO> io = new List <TECIO> { ai, ao, di, ioDO }; IOCollection collection = new IOCollection(io); TECIO ui = new TECIO(IOType.UI); ui.Quantity = 2; TECIO uo = new TECIO(IOType.UO); uo.Quantity = 2; List <TECIO> subjectIO = new List <TECIO> { ui, uo }; IOCollection subjectCollection = new IOCollection(subjectIO); Assert.IsFalse(collection.Contains(subjectCollection)); }
public void UniversalContainsSpecificCollection() { //Ex. 5 UI, 5 UO contains 3 AI, 2 DI, 3 AO, 2 DO. Uses Contains(IOCollection) TECIO ui = new TECIO(IOType.UI); ui.Quantity = 5; TECIO uo = new TECIO(IOType.UO); uo.Quantity = 5; List <TECIO> io = new List <TECIO> { ui, uo }; IOCollection collection = new IOCollection(io); TECIO ai = new TECIO(IOType.AI); ai.Quantity = 3; TECIO ao = new TECIO(IOType.AO); ao.Quantity = 2; TECIO di = new TECIO(IOType.DI); di.Quantity = 2; TECIO ioDO = new TECIO(IOType.DO); ioDO.Quantity = 3; List <TECIO> subjectIo = new List <TECIO> { ai, ao, di, ioDO }; IOCollection subjectCollection = new IOCollection(subjectIo); Assert.IsTrue(collection.Contains(subjectCollection)); }
private void addTypicalExecute() { TECTypical typical = new TECTypical(); typical.Name = "test"; TECEquipment equipment = new TECEquipment(); equipment.Name = "test equipment"; TECSubScope ss = new TECSubScope(); ss.Name = "Test Subscope"; ss.AddDevice(bid.Catalogs.Devices[0]); TECPoint point = new TECPoint(); point.Type = IOType.AI; point.Quantity = 1; ss.AddPoint(point); equipment.SubScope.Add(ss); typical.Equipment.Add(equipment); TECSubScope connected = new TECSubScope(); connected.Name = "Connected"; connected.AddDevice(bid.Catalogs.Devices[0]); TECPoint point2 = new TECPoint(); point2.Type = IOType.AI; point2.Quantity = 1; connected.AddPoint(point2); equipment.SubScope.Add(connected); TECSubScope toConnect = new TECSubScope(); toConnect.Name = "To Connect"; toConnect.AddDevice(bid.Catalogs.Devices[0]); TECPoint point3 = new TECPoint(); point3.Type = IOType.AI; point3.Quantity = 1; toConnect.AddPoint(point3); equipment.SubScope.Add(toConnect); TECControllerType controllerType = new TECControllerType(new TECManufacturer()); controllerType.IOModules.Add(bid.Catalogs.IOModules[0]); TECIO io = new TECIO(IOType.AI); io.Quantity = 10; controllerType.IO.Add(io); bid.Catalogs.IOModules[0].IO.Add(io); controllerType.Name = "Test Type"; TECProvidedController controller = new TECProvidedController(controllerType); controller.IOModules.Add(bid.Catalogs.IOModules[0]); controller.Name = "Test Controller"; typical.AddController(controller); TECProvidedController otherController = new TECProvidedController(controllerType); otherController.Name = "Other Controller"; typical.AddController(otherController); IControllerConnection connection = controller.Connect(connected, (connected as IConnectable).AvailableProtocols.First()); connection.Length = 10; connection.ConduitLength = 20; connection.ConduitType = bid.Catalogs.ConduitTypes[1]; TECPanelType panelType = new TECPanelType(new TECManufacturer()); panelType.Name = "test type"; TECPanel panel = new TECPanel(panelType); panel.Name = "Test Panel"; typical.Panels.Add(panel); TECMisc misc = new TECMisc(CostType.TEC); misc.Name = "test Misc"; typical.MiscCosts.Add(misc); bid.Systems.Add(typical); typical.AddInstance(); }
public static TECCatalogs CreateTestCatalogs() { TECCatalogs outCatalogs = new TECCatalogs(); //Associated Costs TECAssociatedCost elecCost = new TECAssociatedCost(CostType.Electrical); elecCost.Name = "Elec Cost"; elecCost.Cost = 156.61; elecCost.Labor = 456.64; elecCost.Type = CostType.Electrical; outCatalogs.AssociatedCosts.Add(elecCost); TECAssociatedCost tecCost = new TECAssociatedCost(CostType.TEC); tecCost.Name = "TEC Cost"; tecCost.Cost = 46.43; tecCost.Labor = 61.45; tecCost.Type = CostType.TEC; outCatalogs.AssociatedCosts.Add(tecCost); //Tags var tag1 = new TECTag(); tag1.Label = "Tag 1"; var tag2 = new TECTag(); tag2.Label = "Test Tag"; outCatalogs.Tags.Add(tag1); outCatalogs.Tags.Add(tag2); //Conduit Types var conduitType1 = new TECElectricalMaterial(); conduitType1.Name = "Test Conduit 1"; conduitType1.Cost = 64.49; conduitType1.Labor = 463.87; AssignSecondaryProperties(conduitType1, outCatalogs); conduitType1.RatedCosts.Add(tecCost); conduitType1.RatedCosts.Add(elecCost); outCatalogs.ConduitTypes.Add(conduitType1); var conduitType2 = new TECElectricalMaterial(); conduitType2.Name = "Test Conduit 2"; conduitType2.Cost = 13.45; conduitType2.Labor = 9873.40; AssignSecondaryProperties(conduitType2, outCatalogs); conduitType2.RatedCosts.Add(tecCost); conduitType2.RatedCosts.Add(elecCost); outCatalogs.ConduitTypes.Add(conduitType2); //ConnectionTypes var connectionType1 = new TECConnectionType(); connectionType1.Name = "FourC18"; connectionType1.Cost = 64.63; connectionType1.Labor = 98.16; AssignSecondaryProperties(connectionType1, outCatalogs); connectionType1.RatedCosts.Add(tecCost); connectionType1.RatedCosts.Add(elecCost); var connectionType2 = new TECConnectionType(); connectionType2.Name = "ThreeC18"; connectionType2.Cost = 73.16; connectionType2.Labor = 35.49; AssignSecondaryProperties(connectionType1, outCatalogs); connectionType1.RatedCosts.Add(tecCost); connectionType1.RatedCosts.Add(elecCost); outCatalogs.ConnectionTypes.Add(connectionType1); outCatalogs.ConnectionTypes.Add(connectionType2); //Manufacturers var manufacturer1 = new TECManufacturer(); manufacturer1.Label = "Test"; manufacturer1.Multiplier = .51; outCatalogs.Manufacturers.Add(manufacturer1); //Devices ObservableCollection <TECConnectionType> contypes4 = new ObservableCollection <TECConnectionType>(); contypes4.Add(connectionType1); TECDevice device1 = new TECDevice(Guid.NewGuid(), contypes4, new List <TECProtocol>(), manufacturer1); device1.Name = "Device 1"; device1.Description = "Description 1"; device1.Price = 64.96; device1.Tags.Add(tag1); AssignSecondaryProperties(device1, outCatalogs); outCatalogs.Devices.Add(device1); //IO Modules TECIOModule testIOModule = new TECIOModule(manufacturer1); testIOModule.Name = "Test IO Module"; testIOModule.Price = 13.46; testIOModule.Manufacturer = manufacturer1; outCatalogs.IOModules.Add(testIOModule); //Controller Types TECControllerType controllerType = new TECControllerType(manufacturer1); controllerType.Name = "Test Controller Type"; controllerType.Price = 196.73; controllerType.Labor = 61.34; AssignSecondaryProperties(controllerType, outCatalogs); TECIO io = new TECIO(IOType.AI); io.Quantity = 100; controllerType.IO.Add(io); io = new TECIO(IOType.UI); io.Quantity = 100; controllerType.IO.Add(io); io = new TECIO(IOType.UO); io.Quantity = 100; controllerType.IO.Add(io); outCatalogs.ControllerTypes.Add(controllerType); //Panel Types TECPanelType panelType = new TECPanelType(manufacturer1); panelType.Price = 16.64; panelType.Labor = 91.46; panelType.Name = "Test Panel Type"; AssignSecondaryProperties(panelType, outCatalogs); outCatalogs.PanelTypes.Add(panelType); TECPanelType otherPanelType = new TECPanelType(manufacturer1); otherPanelType.Price = 46.61; otherPanelType.Labor = 64.19; otherPanelType.Name = "Other Test Panel Type"; AssignSecondaryProperties(otherPanelType, outCatalogs); outCatalogs.PanelTypes.Add(otherPanelType); //Valves TECDevice actuator = new TECDevice(new ObservableCollection <TECConnectionType>() { connectionType1 }, new List <TECProtocol>(), manufacturer1); actuator.Name = "actuator"; outCatalogs.Devices.Add(actuator); TECValve valve = new TECValve(manufacturer1, actuator); outCatalogs.Valves.Add(valve); //Protocols TECProtocol protocol = new TECProtocol(new List <TECConnectionType> { connectionType1 }); protocol.Label = "BACnet IP"; outCatalogs.Protocols.Add(protocol); controllerType.IO.Add(new TECIO(protocol)); TECDevice netDevice = new TECDevice(Guid.NewGuid(), new List <TECConnectionType>(), new List <TECProtocol> { protocol }, manufacturer1); outCatalogs.Devices.Add(netDevice); return(outCatalogs); }
public static TECTemplates CreateTestTemplates() { TECTemplates templates = new TECTemplates(); //Labor //templates.Labor = CreateTestLabor(); templates.Parameters.Add(CreateTestParameters(Guid.NewGuid())); templates.Catalogs = CreateTestCatalogs(); //Tags TECTag testTag = new TECTag(); testTag.Label = "Test Tag"; TECTag sysTag = new TECTag(); sysTag.Label = "System Tag"; TECTag equipTag = new TECTag(); equipTag.Label = "Equipment Tag"; TECTag ssTag = new TECTag(); ssTag.Label = "SubScope Tag"; TECTag devTag = new TECTag(); devTag.Label = "Device Tag"; templates.Catalogs.Tags.Add(testTag); templates.Catalogs.Tags.Add(sysTag); templates.Catalogs.Tags.Add(equipTag); templates.Catalogs.Tags.Add(ssTag); templates.Catalogs.Tags.Add(devTag); //Manufacturers TECManufacturer testMan = new TECManufacturer(); testMan.Label = "Test Manufacturer"; testMan.Multiplier = 0.654; TECManufacturer testDevMan = new TECManufacturer(); testDevMan.Label = "Child Manufacturer (Test Device)"; testDevMan.Multiplier = 0.446; TECManufacturer childDevMan = new TECManufacturer(); childDevMan.Label = "Child Manufacturer (Child Device)"; childDevMan.Multiplier = 0.916; templates.Catalogs.Manufacturers.Add(testMan); templates.Catalogs.Manufacturers.Add(testDevMan); templates.Catalogs.Manufacturers.Add(childDevMan); //Connection Types TECConnectionType testDevConnType = new TECConnectionType(); testDevConnType.Name = "FourC18"; TECConnectionType childDevConnType = new TECConnectionType(); childDevConnType.Name = "ThreeC18"; templates.Catalogs.ConnectionTypes.Add(testDevConnType); templates.Catalogs.ConnectionTypes.Add(childDevConnType); //Conduit Types TECElectricalMaterial testConduitType = new TECElectricalMaterial(); testConduitType.Name = "EMT"; testConduitType.Cost = 12; testConduitType.Labor = 2; templates.Catalogs.ConduitTypes.Add(testConduitType); TECElectricalMaterial otherConduitType = new TECElectricalMaterial(); otherConduitType.Name = "RGS"; otherConduitType.Cost = 18; otherConduitType.Labor = 4; templates.Catalogs.ConduitTypes.Add(otherConduitType); //Associated Costs TECAssociatedCost testAssociatedCost = new TECAssociatedCost(CostType.Electrical); testAssociatedCost.Name = "Flex"; testAssociatedCost.Cost = 42; templates.Catalogs.AssociatedCosts.Add(testAssociatedCost); var testCost2 = new TECAssociatedCost(CostType.TEC); testCost2.Name = "Other Cost"; templates.Catalogs.AssociatedCosts.Add(testCost2); //IO Modules TECIOModule testIOModule = new TECIOModule(testMan); testIOModule.Name = "Test IO Module"; testIOModule.Price = 42; testIOModule.Manufacturer = testMan; templates.Catalogs.IOModules.Add(testIOModule); //Devices ObservableCollection <TECConnectionType> contypes2 = new ObservableCollection <TECConnectionType>(); contypes2.Add(testDevConnType); TECDevice testDev = new TECDevice(Guid.NewGuid(), contypes2, new List <TECProtocol>(), testDevMan); testDev.Name = "Test Device"; testDev.Description = "Device Description"; testDev.Price = 20.3; ObservableCollection <TECConnectionType> contypes3 = new ObservableCollection <TECConnectionType>(); contypes3.Add(childDevConnType); TECDevice childDev = new TECDevice(Guid.NewGuid(), contypes3, new List <TECProtocol>(), childDevMan); childDev.Name = "Child Device"; childDev.Description = "Child Device Description"; childDev.Price = 54.1; testDev.Tags.Add(devTag); childDev.Tags.Add(devTag); templates.Catalogs.Devices.Add(testDev); templates.Catalogs.Devices.Add(childDev); //System TECSystem system = new TECSystem(false); system.Name = "Test System"; system.Description = "System Description"; TECEquipment sysEquip = new TECEquipment(false); sysEquip.Name = "System Equipment"; sysEquip.Description = "Child Equipment"; TECSubScope sysSS = new TECSubScope(false); sysSS.Name = "System SubScope"; sysSS.Description = "Child SubScope"; sysSS.AssociatedCosts.Add(testAssociatedCost); TECPoint sysPoint = new TECPoint(false); sysPoint.Type = IOType.AI; sysPoint.Label = "System Point"; sysSS.Points.Add(sysPoint); sysSS.Devices.Add(childDev); sysSS.Tags.Add(ssTag); sysEquip.SubScope.Add(sysSS); sysEquip.Tags.Add(equipTag); system.Equipment.Add(sysEquip); system.Tags.Add(sysTag); templates.SystemTemplates.Add(system); //Equipment TECEquipment equipment = new TECEquipment(false); equipment.Name = "Test Equipment"; equipment.Description = "Equipment Description"; TECSubScope equipSS = new TECSubScope(false); equipSS.Name = "Equipment SubScope"; equipSS.Description = "Child SubScope"; TECPoint equipPoint = new TECPoint(false); equipPoint.Type = IOType.AI; equipPoint.Label = "Equipment Point"; equipSS.Points.Add(equipPoint); equipSS.Devices.Add(childDev); equipSS.Tags.Add(ssTag); equipment.SubScope.Add(equipSS); equipment.Tags.Add(equipTag); templates.EquipmentTemplates.Add(equipment); //SubScope TECSubScope subScope = new TECSubScope(false); subScope.Name = "Test SubScope"; subScope.Description = "SubScope Description"; TECPoint ssPoint = new TECPoint(false); ssPoint.Type = IOType.DO; ssPoint.Label = "SubScope Point"; subScope.Points.Add(ssPoint); subScope.Devices.Add(childDev); subScope.Tags.Add(ssTag); subScope.AssociatedCosts.Add(testAssociatedCost); templates.SubScopeTemplates.Add(subScope); //Controller var expectedControllerType = new TECControllerType(testMan); expectedControllerType.Price = 42.6; TECIO ioToAdd = new TECIO(IOType.AI); ioToAdd.Quantity = 5; TECIO otherIO = new TECIO(IOType.UI); otherIO.Quantity = 3; expectedControllerType.IO.Add(ioToAdd); expectedControllerType.IO.Add(otherIO); templates.Catalogs.ControllerTypes.Add(expectedControllerType); TECController expectedController = new TECProvidedController(expectedControllerType, false); expectedController.Name = "Test Controller"; expectedController.Description = "Test description"; TECController controlledController = new TECProvidedController(expectedControllerType, false); controlledController.Name = "Controlled Controller"; templates.ControllerTemplates.Add(expectedController); //Misc Cost TECMisc cost = new TECMisc(CostType.TEC, false); cost.Name = "Test Cost"; cost.Cost = 79.79; cost.Quantity = 67; templates.MiscCostTemplates.Add(cost); //Misc wiring TECMisc wiring = new TECMisc(CostType.Electrical, false); wiring.Name = "Test Wiring"; wiring.Cost = 69.69; wiring.Quantity = 69; templates.MiscCostTemplates.Add(wiring); //Panel Types TECPanelType panelType = new TECPanelType(testMan); panelType.Price = 123.4; panelType.Name = "Test Panel Type"; templates.Catalogs.PanelTypes.Add(panelType); //Panels TECPanel panel = new TECPanel(panelType, false); panel.Name = "Test Panel"; panel.AssociatedCosts.Add(testAssociatedCost); panel.AssociatedCosts.Add(testAssociatedCost); TECPanel controlledPanel = new TECPanel(panelType, false); controlledPanel.Name = "Controlled Panel"; templates.PanelTemplates.Add(panel); //Synchronizer TemplateSynchronizer <TECEquipment> equipSynchronizer = templates.EquipmentSynchronizer; TemplateSynchronizer <TECSubScope> ssSynchronizer = templates.SubScopeSynchronizer; TECSystem syncSys = new TECSystem(false); syncSys.Name = "Sync System"; templates.SystemTemplates.Add(syncSys); TECEquipment syncEquip = new TECEquipment(false); syncEquip.Name = "Sync Equip"; templates.EquipmentTemplates.Add(syncEquip); syncSys.Equipment.Add(equipSynchronizer.NewItem(syncEquip)); TECSubScope syncSubScope = new TECSubScope(false); syncSubScope.Name = "Sync SS"; templates.SubScopeTemplates.Add(syncSubScope); syncEquip.SubScope.Add(ssSynchronizer.NewItem(syncSubScope)); return(templates); }