Esempio n. 1
0
 public TECBid() : this(Guid.NewGuid())
 {
     foreach (string item in Defaults.Scope)
     {
         var branchToAdd = new TECScopeBranch();
         branchToAdd.Label = item;
         ScopeTree.Add(new TECScopeBranch(branchToAdd));
     }
     foreach (string item in Defaults.Exclusions)
     {
         var exclusionToAdd = new TECLabeled();
         exclusionToAdd.Label = item;
         Exclusions.Add(new TECLabeled(exclusionToAdd));
     }
     foreach (string item in Defaults.Notes)
     {
         var noteToAdd = new TECLabeled();
         noteToAdd.Label = item;
         Notes.Add(new TECLabeled(noteToAdd));
     }
     foreach (var item in Defaults.BidToDoList)
     {
         ToDoList.Add(new TECToDoItem(item.description, item.url));
     }
     _parameters.Markup = 20;
 }
 //Copy Constructor
 public TECSubScope(TECSubScope sourceSubScope, Dictionary <Guid, Guid> guidDictionary = null,
                    ObservableListDictionary <ITECObject> characteristicReference      = null) : this()
 {
     if (guidDictionary != null)
     {
         guidDictionary[_guid] = sourceSubScope.Guid;
     }
     foreach (IEndDevice device in sourceSubScope.Devices)
     {
         Devices.Add(device);
     }
     foreach (TECPoint point in sourceSubScope.Points)
     {
         var toAdd = new TECPoint(point);
         characteristicReference?.AddItem(point, toAdd);
         Points.Add(toAdd);
     }
     foreach (TECInterlockConnection interlock in sourceSubScope.Interlocks)
     {
         var toAdd = new TECInterlockConnection(interlock);
         characteristicReference?.AddItem(interlock, toAdd);
         Interlocks.Add(toAdd);
     }
     foreach (TECScopeBranch branch in sourceSubScope.ScopeBranches)
     {
         var toAdd = new TECScopeBranch(branch);
         characteristicReference?.AddItem(branch, toAdd);
         ScopeBranches.Add(toAdd);
     }
     this.copyPropertiesFromScope(sourceSubScope);
 }
Esempio n. 3
0
        public TECSystem(TECSystem source, Dictionary <Guid, Guid> guidDictionary      = null,
                         ObservableListDictionary <ITECObject> characteristicReference = null,
                         Tuple <TemplateSynchronizer <TECEquipment>, TemplateSynchronizer <TECSubScope> > synchronizers = null) : this()
        {
            if (guidDictionary == null)
            {
                guidDictionary = new Dictionary <Guid, Guid>();
            }

            guidDictionary[_guid] = source.Guid;
            foreach (TECEquipment equipment in source.Equipment)
            {
                var toAdd = new TECEquipment(equipment, guidDictionary, characteristicReference, ssSynchronizer: synchronizers?.Item2);
                if (synchronizers != null && synchronizers.Item1.Contains(equipment))
                {
                    synchronizers.Item1.LinkNew(synchronizers.Item1.GetTemplate(equipment), toAdd);
                }
                if (characteristicReference != null)
                {
                    characteristicReference.AddItem(equipment, toAdd);
                }
                Equipment.Add(toAdd);
            }
            foreach (TECController controller in source._controllers)
            {
                var toAdd = controller.CopyController(guidDictionary);
                if (characteristicReference != null)
                {
                    characteristicReference.AddItem(controller, toAdd);
                }
                _controllers.Add(toAdd);
            }
            foreach (TECPanel panel in source.Panels)
            {
                var toAdd = new TECPanel(panel, guidDictionary);
                if (characteristicReference != null)
                {
                    characteristicReference.AddItem(panel, toAdd);
                }
                Panels.Add(toAdd);
            }
            foreach (TECMisc misc in source.MiscCosts)
            {
                var toAdd = new TECMisc(misc);
                MiscCosts.Add(toAdd);
            }
            foreach (TECScopeBranch branch in source.ScopeBranches)
            {
                var toAdd = new TECScopeBranch(branch);
                ScopeBranches.Add(toAdd);
            }
            foreach (TECProposalItem item in source.ProposalItems)
            {
                var toAdd = new TECProposalItem(item, guidDictionary);
                ProposalItems.Add(toAdd);
            }
            this.copyPropertiesFromLocated(source);
            ModelLinkingHelper.LinkSystem(this, guidDictionary);
        }
Esempio n. 4
0
 //Copy Constructor
 public TECScopeBranch(TECScopeBranch scopeBranchSource) : this()
 {
     foreach (TECScopeBranch branch in scopeBranchSource.Branches)
     {
         Branches.Add(new TECScopeBranch(branch));
     }
     _label = scopeBranchSource.Label;
 }
Esempio n. 5
0
        public TECSystem AddInstance()
        {
            Dictionary <Guid, Guid> guidDictionary = new Dictionary <Guid, Guid>();
            var newSystem = new TECSystem();

            newSystem.CopyPropertiesFromScope(this);
            if (this.Location != null)
            {
                newSystem.Location = this.Location;
            }
            foreach (TECEquipment equipment in Equipment)
            {
                var toAdd = new TECEquipment(equipment, guidDictionary, TypicalInstanceDictionary);
                TypicalInstanceDictionary.AddItem(equipment, toAdd);
                newSystem.Equipment.Add(toAdd);
            }
            foreach (TECController controller in Controllers)
            {
                var toAdd = controller.CopyController(guidDictionary);
                TypicalInstanceDictionary.AddItem(controller, toAdd);
                newSystem.AddController(toAdd);
            }
            foreach (TECPanel panel in Panels)
            {
                var toAdd = new TECPanel(panel, guidDictionary);
                TypicalInstanceDictionary.AddItem(panel, toAdd);
                newSystem.Panels.Add(toAdd);
            }
            foreach (TECMisc misc in MiscCosts)
            {
                var toAdd = new TECMisc(misc);
                TypicalInstanceDictionary.AddItem(misc, toAdd);
                newSystem.MiscCosts.Add(toAdd);
            }
            foreach (TECScopeBranch branch in ScopeBranches)
            {
                var toAdd = new TECScopeBranch(branch);
                TypicalInstanceDictionary.AddItem(branch, toAdd);
                newSystem.ScopeBranches.Add(toAdd);
            }
            //Proposal items are not currently synced to instances
            //foreach(TECProposalItem propItem in ProposalItems)
            //{
            //    var toAdd = new TECProposalItem(propItem);
            //    TypicalInstanceDictionary.AddItem(propItem, toAdd);
            //    newSystem.ProposalItems.Add(toAdd);
            //}
            ModelLinkingHelper.LinkSystem(newSystem, guidDictionary);

            Instances.Add(newSystem);
            return(newSystem);
        }
Esempio n. 6
0
 public TECTypical(TECTypical source, Dictionary <Guid, Guid> guidDictionary     = null,
                   ObservableListDictionary <ITECObject> characteristicReference = null) : this()
 {
     if (guidDictionary != null)
     {
         guidDictionary[_guid] = source.Guid;
     }
     foreach (TECEquipment equipment in source.Equipment)
     {
         var toAdd = new TECEquipment(equipment, guidDictionary, characteristicReference);
         if (characteristicReference != null)
         {
             characteristicReference.AddItem(equipment, toAdd);
         }
         Equipment.Add(toAdd);
     }
     foreach (TECController controller in source.Controllers)
     {
         var toAdd = controller.CopyController(guidDictionary);
         if (characteristicReference != null)
         {
             characteristicReference.AddItem(controller, toAdd);
         }
         AddController(toAdd);
     }
     foreach (TECPanel panel in source.Panels)
     {
         var toAdd = new TECPanel(panel, guidDictionary);
         if (characteristicReference != null)
         {
             characteristicReference.AddItem(panel, toAdd);
         }
         Panels.Add(toAdd);
     }
     foreach (TECMisc misc in source.MiscCosts)
     {
         var toAdd = new TECMisc(misc);
         MiscCosts.Add(toAdd);
     }
     foreach (TECScopeBranch branch in source.ScopeBranches)
     {
         var toAdd = new TECScopeBranch(branch);
         ScopeBranches.Add(toAdd);
     }
     copyPropertiesFromLocated(source);
 }
Esempio n. 7
0
        public TECTypical(TECSystem system, TECScopeManager manager) : this()
        {
            Dictionary <Guid, Guid> guidDictionary = new Dictionary <Guid, Guid>();

            guidDictionary[_guid] = system.Guid;
            foreach (TECEquipment equipment in system.Equipment)
            {
                var toAdd = new TECEquipment(equipment, guidDictionary);
                Equipment.Add(toAdd);
            }
            foreach (TECController controller in system.Controllers)
            {
                var toAdd = controller.CopyController(guidDictionary);
                AddController(toAdd);
            }
            foreach (TECPanel panel in system.Panels)
            {
                var toAdd = new TECPanel(panel, guidDictionary);
                Panels.Add(toAdd);
            }
            foreach (TECMisc misc in system.MiscCosts)
            {
                var toAdd = new TECMisc(misc);
                MiscCosts.Add(toAdd);
            }
            foreach (TECScopeBranch branch in system.ScopeBranches)
            {
                var toAdd = new TECScopeBranch(branch);
                ScopeBranches.Add(toAdd);
            }
            foreach (TECProposalItem item in system.ProposalItems)
            {
                var toAdd = new TECProposalItem(item, guidDictionary);
                ProposalItems.Add(toAdd);
            }
            copyPropertiesFromLocated(system);
            ModelLinkingHelper.LinkSystem(this, guidDictionary);
        }