/// <summary> /// Builds the model /// </summary> /// <returns></returns> public Dictionary<string,EquipmentContainer> BuildModel() { builder = new TopLevelBuilder(this, this.datasource); builder.BuildModel(); //Get the current working directory for the application string dir = Directory.GetCurrentDirectory(); //Create a directory for the OpenDSS script files produced by the powerflow class string newDir = dir + "//OpenDSS_Scripts"; if (!Directory.Exists(newDir)) { Directory.CreateDirectory(newDir); } //Create a new OpenDSSPowerFlow, and pass the file path for the scripts directory powerflow = new LadderPowerFlow(); var containerList = new Dictionary<string,EquipmentContainer>(); foreach (Substation station in thisRegion.SubStations.Values) { foreach (Line line in station.Lines.Values) { containerList.Add(line.Name,line); } containerList.Add(station.Name,station); } return containerList; }
internal void SetPowerFlow(IPowerFlow thisPowerFlow) { powerflow = thisPowerFlow; }