Skip to content

Commit

Permalink
Merge branch 'DanWBR:windows' into windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mersadk authored Mar 14, 2024
2 parents 3612336 + bc6ad7d commit 8848902
Show file tree
Hide file tree
Showing 134 changed files with 9,866 additions and 6,541 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The DWSIM project maintains that all code copyrights are held by the original au

The DWSIM project uses the following license:

* The [General Public License Version 3](https://www.gnu.org/licenses/gpl-3.0.txt)
* The [General Public License Version 3](https://www.gnu.org/licenses/gpl-3.0.txt)

## Copying Files from Other Projects

Expand Down
4 changes: 2 additions & 2 deletions DWSIM.Automation.Tests/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("8.6.8.0")>
<Assembly: AssemblyFileVersion("8.6.8.0")>
<Assembly: AssemblyVersion("8.7.0.0")>
<Assembly: AssemblyFileVersion("8.7.0.0")>
2 changes: 1 addition & 1 deletion DWSIM.Automation/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("8.6.8.0")]
[assembly: AssemblyVersion("8.7.0.0")]
2 changes: 2 additions & 0 deletions DWSIM.Drawing.SkiaSharp/GraphicObjects/Base/GraphicObject.vb
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ Namespace GraphicObjects
<Xml.Serialization.XmlIgnore>
Public Property Flowsheet As IFlowsheet Implements IGraphicObject.Flowsheet

Public Property DrawLabel As Boolean = True Implements IGraphicObject.DrawLabel

Public Function GetForeColor() As SKColor

Return Drawing.SkiaSharp.GraphicsSurface.ForegroundColor
Expand Down
406 changes: 205 additions & 201 deletions DWSIM.Drawing.SkiaSharp/GraphicObjects/Base/ShapeGraphic.vb

Large diffs are not rendered by default.

190 changes: 146 additions & 44 deletions DWSIM.Drawing.SkiaSharp/GraphicObjects/Shapes/CapeOpen.vb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
Imports DWSIM.Drawing.SkiaSharp.GraphicObjects
Imports DWSIM.Interfaces.Enums.GraphicObjects
Imports DWSIM.Interfaces
Imports DWSIM.Interfaces
Imports DWSIM.DrawingTools.Point
Imports TheArtOfDev.HtmlRenderer.Adapters

Namespace GraphicObjects.Shapes

Expand Down Expand Up @@ -46,67 +43,172 @@ Namespace GraphicObjects.Shapes

Public Overrides Sub PositionConnectors()

If DrawMode = 2 And ChemSep Then
If ChemSep And Owner IsNot Nothing Then

Try
Dim i As Integer = 0
For Each ic As IConnectionPoint In Me.InputConnectors
ic.Position = New Point(Me.X + 0.1 * Width, Me.Y + (i + 1) / InputConnectors.Count * Height)
i = i + 1
Next
i = 0
For Each oc As IConnectionPoint In Me.OutputConnectors
oc.Position = New Point(Me.X + 0.9 * Width, Me.Y + (i + 1) / OutputConnectors.Count * Height)
i = i + 1
Next
Catch ex As Exception

End Try

Else

If Not Me.AdditionalInfo Is Nothing Then

Dim obj1(Me.InputConnectors.Count), obj2(Me.InputConnectors.Count) As Double
Dim obj3(Me.OutputConnectors.Count), obj4(Me.OutputConnectors.Count) As Double
obj1 = Me.AdditionalInfo(0)
obj2 = Me.AdditionalInfo(1)
obj3 = Me.AdditionalInfo(2)
obj4 = Me.AdditionalInfo(3)
If DrawMode <> 2 Then

Try
Dim i As Integer = 0
For Each ic As IConnectionPoint In Me.InputConnectors
ic.Position = New Point(Me.X + obj1(i), Me.Y + obj2(i))
If ic.ConnectorName.Contains("Feed") Then
Dim stage_number = ic.ConnectorName.Split("_")(1).Replace("stage", "")
If stage_number > 50 Then
ic.Position = New Point(X + 0.05 * 1.25 * Width, Y + 45 + 0.8 * (Height - 45))
Else
ic.Position = New Point(X + 0.05 * 1.25 * Width, Y + 45 + stage_number / 50.0 * (Height - 45))
End If
ElseIf ic.ConnectorName = "Column heat duty" Then
ic.Position = New Point(X + 0.5 * Width, Y + Height)
ic.Direction = Enums.GraphicObjects.ConDir.Up
Else
ic.Position = New Point(X + 0.05 * 1.25 * Width, Y + (i + 1) / InputConnectors.Count * Height)
ic.Direction = Enums.GraphicObjects.ConDir.Right
End If
i = i + 1
Next

i = 0
For Each oc As IConnectionPoint In Me.OutputConnectors
oc.Position = New Point(Me.X + obj3(i), Me.Y + obj4(i))
If oc.ConnectorName.Contains("Sidestream") Then
Dim stage_number = oc.ConnectorName.Split("_")(1).Replace("stage", "")
oc.Position = New Point(X + 0.31 * Width, Y + (stage_number + 10.0) / 50.0 * Height * 0.7)
ElseIf oc.ConnectorName = "Condenser heat duty" Then
oc.Position = New Point(X + Width, Y + 0.175 * Height)
oc.Direction = Enums.GraphicObjects.ConDir.Right
ElseIf oc.ConnectorName = "Reboiler heat duty" Then
oc.Position = New Point(X + Width, Y + 0.825 * Height)
oc.Direction = Enums.GraphicObjects.ConDir.Right
ElseIf oc.ConnectorName = "TopProduct" Then

Shape = 1

If oc.IsAttached Then
Dim vf = DirectCast(oc.AttachedConnector.AttachedTo.Owner, IMaterialStream).Phases(2).Properties.molarfraction.GetValueOrDefault()
If vf > 0.97 Then Shape = 0
End If

If Shape = 0 Then
oc.Position = New Point(X + 0.7 * Width, Y + 0.02 * Height)
Else
oc.Position = New Point(X + 0.9 * Width, Y + 0.3 * Height)
End If

ElseIf oc.ConnectorName = "BottomProduct" Then
oc.Position = New Point(X + Width, Y + 0.98 * Height)
oc.Direction = Enums.GraphicObjects.ConDir.Right
Else
oc.Position = New Point(X + 0.9 * Width, Y + (i + 1) / OutputConnectors.Count * Height)
End If
i = i + 1
Next
Catch ex As Exception

End Try

Else
Else

Try
Dim i As Integer = 0
For Each ic As IConnectionPoint In Me.InputConnectors
ic.Position = New Point(Me.X, Me.Y + (i + 1) / InputConnectors.Count * Height)
If ic.ConnectorName.Contains("Feed") Then
Dim stage_number = ic.ConnectorName.Split("_")(1).Replace("stage", "")
If stage_number > 50 Then
ic.Position = New Point(X + 0.15 * Width, Y + 45 + 0.8 * (Height - 45))
Else
ic.Position = New Point(X + 0.15 * Width, Y + 45 + stage_number / 50.0 * (Height - 45))
End If
ic.Direction = Enums.GraphicObjects.ConDir.Right
ElseIf ic.ConnectorName = "Column heat duty" Then
ic.Position = New Point(X + 0.15 * Width, Y + 0.8 * Height)
ic.Direction = Enums.GraphicObjects.ConDir.Right
Else
ic.Position = New Point(X + 0.05 * 1.25 * Width, Y + (i + 1) / InputConnectors.Count * Height)
ic.Direction = Enums.GraphicObjects.ConDir.Right
End If
i = i + 1
Next

i = 0
For Each oc As IConnectionPoint In Me.OutputConnectors
oc.Position = New Point(Me.X + Width, Me.Y + (i + 1) / OutputConnectors.Count * Height)
If oc.ConnectorName.Contains("Sidestream") Then
Dim stage_number = oc.ConnectorName.Split("_")(1).Replace("stage", "")
oc.Position = New Point(X + 0.31 * Width, Y + (stage_number + 10.0) / 50.0 * Height * 0.7)
ElseIf oc.ConnectorName = "Condenser heat duty" Then
oc.Position = New Point(X + 0.7 * Width, Y + 0.175 * Height)
ElseIf oc.ConnectorName = "Reboiler heat duty" Then
oc.Position = New Point(X + 0.75 * Width, Y + 0.94 * Height)
oc.Direction = Enums.GraphicObjects.ConDir.Up
ElseIf oc.ConnectorName = "TopProduct" Then

Shape = 1

If oc.IsAttached Then
Dim vf = DirectCast(oc.AttachedConnector.AttachedTo.Owner, IMaterialStream).Phases(2).Properties.molarfraction.GetValueOrDefault()
If vf > 0.97 Then Shape = 0
End If

If Shape = 0 Then
oc.Position = New Point(X + 0.87 * Width, Y + 0.01 * Height)
Else
oc.Position = New Point(X + 0.87 * Width, Y + 0.385 * Height)
End If

ElseIf oc.ConnectorName = "BottomProduct" Then
oc.Position = New Point(X + 0.9 * Width, Y + 0.95 * Height)
Else
oc.Position = New Point(X + 0.9 * Width, Y + (i + 1) / OutputConnectors.Count * Height)
End If
i = i + 1
Next
Catch ex As Exception

End Try
End If

Catch ex As Exception

End Try


Else

End If
If Not Me.AdditionalInfo Is Nothing Then

Dim obj1(Me.InputConnectors.Count), obj2(Me.InputConnectors.Count) As Double
Dim obj3(Me.OutputConnectors.Count), obj4(Me.OutputConnectors.Count) As Double
obj1 = Me.AdditionalInfo(0)
obj2 = Me.AdditionalInfo(1)
obj3 = Me.AdditionalInfo(2)
obj4 = Me.AdditionalInfo(3)

Try
Dim i As Integer = 0
For Each ic As IConnectionPoint In Me.InputConnectors
ic.Position = New Point(Me.X + obj1(i), Me.Y + obj2(i))
i = i + 1
Next
i = 0
For Each oc As IConnectionPoint In Me.OutputConnectors
oc.Position = New Point(Me.X + obj3(i), Me.Y + obj4(i))
i = i + 1
Next
Catch ex As Exception

End Try

Else

Try
Dim i As Integer = 0
For Each ic As IConnectionPoint In Me.InputConnectors
ic.Position = New Point(Me.X, Me.Y + (i + 1) / InputConnectors.Count * Height)
i = i + 1
Next
i = 0
For Each oc As IConnectionPoint In Me.OutputConnectors
oc.Position = New Point(Me.X + Width, Me.Y + (i + 1) / OutputConnectors.Count * Height)
i = i + 1
Next
Catch ex As Exception

End Try

End If

End If

Expand Down Expand Up @@ -190,7 +292,7 @@ Namespace GraphicObjects.Shapes
canvas.DrawPoints(SKPointMode.Polygon, New SKPoint() {New SKPoint(X + 0.5 * 1.25 * Width, Y + 0.825 * Height), New SKPoint(X + 0.55 * 1.25 * Width, Y + 0.825 * Height), New SKPoint(X + 0.575 * 1.25 * Width, Y + 0.875 * Height), New SKPoint(X + 0.625 * 1.25 * Width, Y + 0.775 * Height), New SKPoint(X + 0.65 * 1.25 * Width, Y + 0.825 * Height), New SKPoint(X + Width, Y + 0.825 * Height)}, gradPen)
canvas.DrawLine((X + 0.5 * 1.25 * Width), (Y + 0.825 * Height), (X + 0.4 * 1.25 * Width), (Y + 0.825 * Height), gradPen)

canvas.DrawLine((X), (Y + 0.5 * Height), (X + 0.05 * 1.25 * Width), (Y + 0.5 * Height), gradPen)
canvas.DrawLine((X + 0.05 * 1.25 * Width), (Y + 0.5 * Height), (X + 0.05 * 1.25 * Width), (Y + 0.5 * Height), gradPen)

canvas.DrawLine((X + 0.05 * 1.25 * Width), (Y + 0.2 * Height), (X + 0.31 * Width), (Y + 0.2 * Height), gradPen)
canvas.DrawLine((X + 0.05 * 1.25 * Width), (Y + 0.3 * Height), (X + 0.31 * Width), (Y + 0.3 * Height), gradPen)
Expand Down Expand Up @@ -229,7 +331,7 @@ Namespace GraphicObjects.Shapes
canvas.DrawPoints(SKPointMode.Polygon, New SKPoint() {New SKPoint(X + 0.5 * 1.25 * Width, Y + 0.825 * Height), New SKPoint(X + 0.55 * 1.25 * Width, Y + 0.825 * Height), New SKPoint(X + 0.575 * 1.25 * Width, Y + 0.875 * Height), New SKPoint(X + 0.625 * 1.25 * Width, Y + 0.775 * Height), New SKPoint(X + 0.65 * 1.25 * Width, Y + 0.825 * Height), New SKPoint(X + Width, Y + 0.825 * Height)}, myPen)
canvas.DrawLine((X + 0.5 * 1.25 * Width), (Y + 0.825 * Height), (X + 0.4 * 1.25 * Width), (Y + 0.825 * Height), myPen)

canvas.DrawLine((X), (Y + 0.5 * Height), (X + 0.05 * 1.25 * Width), (Y + 0.5 * Height), myPen)
canvas.DrawLine((X + 0.05 * 1.25 * Width), (Y + 0.5 * Height), (X + 0.05 * 1.25 * Width), (Y + 0.5 * Height), myPen)

canvas.DrawLine((X + 0.05 * 1.25 * Width), (Y + 0.2 * Height), (X + 0.31 * Width), (Y + 0.2 * Height), myPen)
canvas.DrawLine((X + 0.05 * 1.25 * Width), (Y + 0.3 * Height), (X + 0.31 * Width), (Y + 0.3 * Height), myPen)
Expand Down Expand Up @@ -322,7 +424,7 @@ Namespace GraphicObjects.Shapes
canvas.DrawPoints(SKPointMode.Polygon, New SKPoint() {New SKPoint(X + 0.5 * 1.25 * Width, Y + 0.825 * Height), New SKPoint(X + 0.55 * 1.25 * Width, Y + 0.825 * Height), New SKPoint(X + 0.575 * 1.25 * Width, Y + 0.875 * Height), New SKPoint(X + 0.625 * 1.25 * Width, Y + 0.775 * Height), New SKPoint(X + 0.65 * 1.25 * Width, Y + 0.825 * Height), New SKPoint(X + Width, Y + 0.825 * Height)}, myPen)
canvas.DrawLine((X + 0.5 * 1.25 * Width), (Y + 0.825 * Height), (X + 0.4 * 1.25 * Width), (Y + 0.825 * Height), myPen)

canvas.DrawLine((X), (Y + 0.5 * Height), (X + 0.05 * 1.25 * Width), (Y + 0.5 * Height), myPen)
canvas.DrawLine((X + 0.05 * 1.25 * Width), (Y + 0.5 * Height), (X + 0.05 * 1.25 * Width), (Y + 0.5 * Height), myPen)

canvas.DrawLine((X + 0.05 * 1.25 * Width), (Y + 0.2 * Height), (X + 0.31 * Width), (Y + 0.2 * Height), myPen)
canvas.DrawLine((X + 0.05 * 1.25 * Width), (Y + 0.3 * Height), (X + 0.31 * Width), (Y + 0.3 * Height), myPen)
Expand Down
20 changes: 11 additions & 9 deletions DWSIM.Drawing.SkiaSharp/GraphicObjects/Table/FloatingTable.vb
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Namespace GraphicObjects.Tables
maxL3 = sizes.Select(Function(s) s.Item3.Width).Max

Width = maxL1 + maxL2 + maxL3 + 8 * Padding
Height = totalH + 2 * maxH + 4 * Padding
Height = totalH + heading1size.Height + heading2size.Height + 5 * Padding

If X + Width > SW Then
XD -= Width - Owner.GraphicObject.Width * 1.5
Expand All @@ -338,10 +338,11 @@ Namespace GraphicObjects.Tables
DrawRoundRect(g, XD, YD, Width, Height, 2 / zoom, bpaint2)

'desenhar textos e retangulos
canvas.DrawText(Owner.GraphicObject.Tag.ToUpper, XD + Padding + margin, YD + maxH, tbpaint)
canvas.DrawText(Owner.GetDisplayName(), XD + Padding + margin, YD + 2 * maxH, tpaint)
canvas.DrawLine(XD + Padding + margin, YD + 2 * maxH + 2 * Padding, XD + Width - Padding - margin, YD + 2 * maxH + 2 * Padding, bpaint2)
Dim y0 = YD + 3 * maxH + Padding
canvas.DrawText(Owner.GraphicObject.Tag.ToUpper, XD + Padding + margin, YD + heading1size.Height + Padding, tbpaint)
canvas.DrawText(Owner.GetDisplayName(), XD + Padding + margin, YD + heading1size.Height + heading2size.Height + 2 * Padding, tpaint)
canvas.DrawLine(XD + Padding + margin, YD + heading1size.Height + heading2size.Height + 4 * Padding, XD + Width - Padding - margin, YD + heading1size.Height + heading2size.Height + 4 * Padding, bpaint2)
Dim y0 = YD + 4 * Padding + heading1size.Height + heading2size.Height
Dim i = 0
For Each prop In props
propstring = Owner.GetFlowsheet.GetTranslatedString(prop)
pval0 = Owner.GetPropertyValue(prop, Owner.GetFlowsheet.FlowsheetOptions.SelectedUnitSystem)
Expand All @@ -356,10 +357,11 @@ Namespace GraphicObjects.Tables
propval = str
End If
propunit = Owner.GetPropertyUnit(prop, Owner.GetFlowsheet.FlowsheetOptions.SelectedUnitSystem)
canvas.DrawText(propstring, XD + Padding + margin, y0, tbpaint)
canvas.DrawText(propval, (maxL2 - MeasureString(propval, tpaint).Width) + XD + maxL1 + 4 * Padding, y0, tpaint)
canvas.DrawText(propunit, XD + maxL1 + maxL2 + 5 * Padding + margin, y0, tbpaint)
y0 += maxH
canvas.DrawText(propstring, XD + Padding + margin, y0 + sizes(i).Item1.Height + Padding, tbpaint)
canvas.DrawText(propval, (maxL2 - MeasureString(propval, tpaint).Width) + XD + maxL1 + 4 * Padding, y0 + sizes(i).Item1.Height + Padding, tpaint)
canvas.DrawText(propunit, XD + maxL1 + maxL2 + 5 * Padding + margin, y0 + sizes(i).Item1.Height + Padding, tbpaint)
y0 += sizes(i).Item1.Height + 2 * Padding
i += 1
Next

Else
Expand Down
2 changes: 1 addition & 1 deletion DWSIM.Drawing.SkiaSharp/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("8.6.8.0")>
<Assembly: AssemblyVersion("8.7.0.0")>

<Assembly: NeutralResourcesLanguageAttribute("en")>
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("8.6.8.0")]
[assembly: AssemblyVersion("8.7.0.0")]
2 changes: 1 addition & 1 deletion DWSIM.DynamicsManager/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("8.6.8.0")>
<Assembly: AssemblyVersion("8.7.0.0")>
Loading

0 comments on commit 8848902

Please sign in to comment.