Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

Commit

Permalink
Flowsheet UO bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DanWBR committed Nov 13, 2017
1 parent e70cfca commit f5cfb1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
2 changes: 2 additions & 0 deletions DWSIM.Drawing/GraphicsSurface/DesignSurface.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,8 @@ Imports DWSIM.Interfaces.Enums.GraphicObjects

Private Sub DrawPropertyListBlock(canvas As Graphics, gobj As GraphicObject)

If gobj.Owner Is Nothing Then Exit Sub

Dim gCon As Drawing2D.GraphicsContainer
gCon = canvas.BeginContainer()
canvas.ScaleTransform(Zoom, Zoom)
Expand Down
27 changes: 8 additions & 19 deletions DWSIM.UnitOperations/Unit Operations/FlowsheetUO.vb
Original file line number Diff line number Diff line change
Expand Up @@ -249,27 +249,16 @@ Label_00CC:

data = xdoc.Element("DWSIM_Simulation_Data").Element("Compounds").Elements.ToList

Dim complist As New Concurrent.ConcurrentBag(Of ConstantProperties)

Parallel.ForEach(data, Sub(xel)
Try
Dim obj As New ConstantProperties
obj.LoadData(xel.Elements.ToList)
complist.Add(obj)
Catch ex As Exception
excs.Add(New Exception("Error Loading Compound Information", ex))
End Try
End Sub)

Dim orderedlist = complist.OrderBy(Function(o) o.Molar_Weight)

For Each obj In orderedlist
fs.SelectedCompounds.Add(obj.Name, obj)
For Each xel As XElement In data
Try
Dim obj As New ConstantProperties
obj.LoadData(xel.Elements.ToList)
fs.Options.SelectedComponents.Add(obj.Name, obj)
Catch ex As Exception
excs.Add(New Exception("Error Loading Compound Information", ex))
End Try
Next

complist = Nothing
orderedlist = Nothing

data = xdoc.Element("DWSIM_Simulation_Data").Element("PropertyPackages").Elements.ToList

For Each xel As XElement In data
Expand Down

0 comments on commit f5cfb1f

Please sign in to comment.