コード例 #1
0
ファイル: PowerSystemModel.cs プロジェクト: tonyju/DSMviewer
 /// <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;
 }
コード例 #2
0
ファイル: Line.cs プロジェクト: tonyju/DSMviewer
 internal void SetPowerFlow(IPowerFlow thisPowerFlow)
 {
     powerflow = thisPowerFlow;
 }