Skip to content

Commit e9a66f2

Browse files
committed
Updating files
1 parent 82c3d1e commit e9a66f2

File tree

5 files changed

+24
-29
lines changed

5 files changed

+24
-29
lines changed

GUI/ThermalGUI/ThermalControl.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public partial class ThermalControl : Form
2020
Dictionary<int, string> RIDList = new Dictionary<int, string>();
2121

2222
//time to update screen
23-
private int TCS_RUN_INTERVAL;
23+
[DllImport("ThermalControlAlgorithm.dll", EntryPoint = "TCS_RUN_INTERVAL", CallingConvention = CallingConvention.Cdecl)]
24+
public static extern ref int TCS_RUN_INTERVAL;
2425

2526

2627
public ThermalControl()

GUI/ThermalGUI/ThermalGUI.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<DefineConstants>DEBUG;TRACE</DefineConstants>
2424
<ErrorReport>prompt</ErrorReport>
2525
<WarningLevel>4</WarningLevel>
26-
<Prefer32Bit>false</Prefer32Bit>
2726
</PropertyGroup>
2827
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2928
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -32,8 +31,7 @@
3231
<OutputPath>bin\Release\</OutputPath>
3332
<DefineConstants>TRACE</DefineConstants>
3433
<ErrorReport>prompt</ErrorReport>
35-
<WarningLevel>5</WarningLevel>
36-
<Prefer32Bit>false</Prefer32Bit>
34+
<WarningLevel>4</WarningLevel>
3735
</PropertyGroup>
3836
<PropertyGroup>
3937
<StartupObject>

cpp/ThermalControlAlgorithm/ThermalControlAlgorithm.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11

2-
//#include <iostream>
2+
#include <iostream>
33
#include <string>
44
//#include <chrono>
55
#include <thread>
66
#include "TCSInit.h"
77

88
constexpr auto TCS_RESET_TIME = 1800; // seconds to reset everything in TCS
9-
constexpr auto TCS_RUN_INTERVAL = 10; //seconds to run the tcs code. this parameter is sent to c# for visualization)
9+
extern "C" {
10+
__declspec(dllexport) constexpr auto TCS_RUN_INTERVAL = 10; //seconds to run the tcs code. this parameter is sent to c# for visualization)
11+
}
1012

1113

1214
int recordSize = sizeof(CompsData);
@@ -54,6 +56,8 @@ void TCS(vector<TCSComponents>& tcsComponents)
5456
}
5557
}
5658

59+
cout << "TCS called" << endl;
60+
5761
}
5862

5963

@@ -438,8 +442,7 @@ extern "C" __declspec(dllexport) int mainFunc()
438442

439443

440444
//Initializing components
441-
//cout << "initializing" << endl;
442-
InitializeData(tcsComponents);
445+
cout << "initializing" << endl;
443446
InitializeData(tcsBackup);
444447
tcsComponents = tcsBackup;
445448
RIDsize = GetRIDSize();
@@ -456,9 +459,8 @@ extern "C" __declspec(dllexport) int mainFunc()
456459
});
457460
thread reset_tcs([&]() {
458461
while (true) {
459-
//cout << "TCS Reset." << endl;
462+
cout << "TCS Reset." << endl;
460463
tcsComponents = tcsBackup;
461-
462464

463465
this_thread::sleep_for(chrono::seconds(TCS_RESET_TIME));
464466
}
@@ -469,4 +471,4 @@ extern "C" __declspec(dllexport) int mainFunc()
469471

470472

471473
return 0;
472-
}
474+
}

cpp/ThermalControlAlgorithm/ThermalControlAlgorithm.vcxproj

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
<CharacterSet>MultiByte</CharacterSet>
4646
</PropertyGroup>
4747
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
48-
<ConfigurationType>DynamicLibrary</ConfigurationType>
48+
<ConfigurationType>Application</ConfigurationType>
4949
<UseDebugLibraries>false</UseDebugLibraries>
50+
<PlatformToolset>v143</PlatformToolset>
5051
<WholeProgramOptimization>true</WholeProgramOptimization>
5152
<CharacterSet>MultiByte</CharacterSet>
52-
<PlatformToolset>v143</PlatformToolset>
5353
</PropertyGroup>
5454
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5555
<ImportGroup Label="ExtensionSettings">
@@ -127,12 +127,6 @@ copy "$(TargetDir)ThermalControlAlgorithm.dll" "$(SolutionDir)..\GUI\ThermalGUI\
127127
<EnableCOMDATFolding>true</EnableCOMDATFolding>
128128
<OptimizeReferences>true</OptimizeReferences>
129129
</Link>
130-
<PostBuildEvent>
131-
<Message>
132-
</Message>
133-
<Command>copy "$(TargetDir)ThermalControlAlgorithm.dll" "$(SolutionDir)..\GUI\ThermalGUI\bin\Release\"
134-
copy "$(TargetDir)ThermalControlAlgorithm.dll" "$(SolutionDir)..\GUI\ThermalGUI\bin\Debug\"</Command>
135-
</PostBuildEvent>
136130
</ItemDefinitionGroup>
137131
<ItemGroup>
138132
<ClCompile Include="ThermalControlAlgorithm.cpp" />
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
unsigned char heats_bin[] = {
2-
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
2+
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
33
0x19, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
4-
0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
5-
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00,
6-
0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
4+
0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
5+
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00,
6+
0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
77
0x1c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
8-
0x01, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
9-
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
10-
0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
8+
0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
9+
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
10+
0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1111
0x1f, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
12-
0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
13-
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
14-
0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
12+
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
13+
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
14+
0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1515
0x22, 0x00, 0x00, 0x00,
1616
};
1717
unsigned int heats_bin_len = 160;

0 commit comments

Comments
 (0)