Skip to content

Commit 49bd44b

Browse files
authored
Merge pull request #244 from bluemodel/talsim5
Add support for using Talsim5 databases
2 parents ac83615 + a7797af commit 49bd44b

18 files changed

Lines changed: 1361 additions & 33 deletions

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[*.vb]
2+
tab_width = 4
3+
indent_size = 4
4+
end_of_line = crlf
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
8+
# IDE1006: Naming Styles
9+
dotnet_diagnostic.IDE1006.severity = none

BlueM.Opt.sln

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio Version 18
3-
VisualStudioVersion = 18.6.11806.211 stable
3+
VisualStudioVersion = 18.6.11806.211
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BlueM.Opt.Algos", "BlueM.Opt.Algos", "{44D440EE-4641-44A1-B177-2DD0FDD6FB75}"
66
EndProject
@@ -38,6 +38,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BlueM.Opt.Tests", "BlueM.Op
3838
EndProject
3939
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "BlueM.Opt.Tests", "BlueM.Opt\Tests\BlueM.Opt.Tests\BlueM.Opt.Tests.vbproj", "{BBDDC177-F059-4139-9A0E-C4B7D03F2786}"
4040
EndProject
41+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5A9D3221-E48E-4A26-9F13-090359144136}"
42+
ProjectSection(SolutionItems) = preProject
43+
.editorconfig = .editorconfig
44+
EndProjectSection
45+
EndProject
4146
Global
4247
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4348
Debug|x64 = Debug|x64

BlueM.Opt/Apps/BlueM.Opt.Apps.vbproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,20 @@
117117
</None>
118118
<Compile Include="SWMM\SWMM.vb" />
119119
<Compile Include="SWMM\SWMMThread.vb" />
120+
<Compile Include="TALSIM\TALSIM5.vb" />
120121
<Compile Include="TALSIM\TALSIM.vb" />
122+
<Compile Include="TALSIM\TALSIM5Thread.vb" />
123+
<Compile Include="TALSIM\TALSIM5_Dialog.Designer.vb">
124+
<DependentUpon>TALSIM5_Dialog.vb</DependentUpon>
125+
</Compile>
126+
<Compile Include="TALSIM\TALSIM5_Dialog.vb">
127+
<SubType>Form</SubType>
128+
</Compile>
121129
<Compile Include="TALSIM\TALSIMThread.vb" />
122130
<Compile Include="Testprobleme\Testprobleme.vb" />
131+
<None Include="TALSIM\talsim5.run">
132+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
133+
</None>
123134
</ItemGroup>
124135
<ItemGroup>
125136
<EmbeddedResource Include="My Project\Resources.resx">
@@ -128,6 +139,9 @@
128139
<CustomToolNamespace>My.Resources</CustomToolNamespace>
129140
<SubType>Designer</SubType>
130141
</EmbeddedResource>
142+
<EmbeddedResource Include="TALSIM\TALSIM5_Dialog.resx">
143+
<DependentUpon>TALSIM5_Dialog.vb</DependentUpon>
144+
</EmbeddedResource>
131145
</ItemGroup>
132146
<ItemGroup>
133147
<None Include="My Project\Application.myapp">
@@ -192,6 +206,9 @@
192206
</ProjectReference>
193207
</ItemGroup>
194208
<ItemGroup>
209+
<PackageReference Include="Microsoft.Data.Sqlite">
210+
<Version>10.0.8</Version>
211+
</PackageReference>
195212
<PackageReference Include="Steema.TeeChart.NET">
196213
<Version>4.2023.4.18</Version>
197214
</PackageReference>

BlueM.Opt/Apps/Sim.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ Public MustInherit Class Sim
534534

535535
'ModellParameter aus OptParametern errechnen
536536
'*******************************************
537-
Private Sub OptParameter_to_ModellParameter()
537+
Protected Sub OptParameter_to_ModellParameter()
538538
Dim i As Integer
539539
Dim j As Integer
540540

@@ -555,7 +555,7 @@ Public MustInherit Class Sim
555555

556556
'Die ModellParameter in die Eingabedateien des SimModells schreiben
557557
'******************************************************************
558-
Public Sub Write_ModellParameter()
558+
Public Overridable Sub Write_ModellParameter()
559559

560560
Dim WertStr As String
561561
Dim AnzZeichen, AnzNachkomma As Short

BlueM.Opt/Apps/TALSIM/TALSIM.vb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ Public Class Talsim
3030

3131
#Region "Eigenschaften"
3232

33-
Private exe_path As String
33+
Private ReadOnly exe_path As String
3434

3535
''' <summary>
3636
''' List of result file extensions to use (e.g. "WEL", "KTR.WEL", "CHLO.WEL", "WBL", etc.)
3737
''' </summary>
38-
Private resultFiles As List(Of String)
38+
Private ReadOnly resultFiles As List(Of String)
3939

4040
'**** Multithreading ****
4141
Dim MyTalsimThreads() As TalsimThread
@@ -264,8 +264,9 @@ Public Class Talsim
264264

265265
Folder = getThreadWorkDir(Thread_ID)
266266
MyTalsimThreads(Thread_ID) = New TalsimThread(Thread_ID, Child_ID, Folder, Datensatz)
267-
MyThreads(Thread_ID) = New Thread(AddressOf MyTalsimThreads(Thread_ID).launchSim)
268-
MyThreads(Thread_ID).IsBackground = True
267+
MyThreads(Thread_ID) = New Thread(AddressOf MyTalsimThreads(Thread_ID).launchSim) With {
268+
.IsBackground = True
269+
}
269270
MyThreads(Thread_ID).Start()
270271
launchSim = True
271272

@@ -325,12 +326,13 @@ Public Class Talsim
325326
Dim errfile As String = IO.Path.Combine(Me.WorkDir_Current, Me.Datensatz & ".err")
326327
Dim simendfile As String = IO.Path.Combine(Me.WorkDir_Current, Me.Datensatz & ".SIMEND")
327328
Dim proc As Process
328-
Dim startInfo As New ProcessStartInfo()
329-
startInfo.FileName = Me.exe_path
330-
startInfo.Arguments = runfilename
331-
startInfo.UseShellExecute = True
332-
startInfo.WindowStyle = ProcessWindowStyle.Hidden
333-
startInfo.WorkingDirectory = IO.Path.GetDirectoryName(Me.exe_path)
329+
Dim startInfo As New ProcessStartInfo With {
330+
.FileName = Me.exe_path,
331+
.Arguments = runfilename,
332+
.UseShellExecute = True,
333+
.WindowStyle = ProcessWindowStyle.Hidden,
334+
.WorkingDirectory = IO.Path.GetDirectoryName(Me.exe_path)
335+
}
334336
'start
335337
proc = Process.Start(startInfo)
336338
'DEBUG: write to log

0 commit comments

Comments
 (0)