构建初始构型
This commit is contained in:
commit
fb27f182dd
|
@ -0,0 +1,3 @@
|
|||
x64/*
|
||||
.vs/*
|
||||
*/x64/*
|
|
@ -0,0 +1,114 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{20CFC220-4F5B-4D39-97FA-74C70768F1A7}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared" />
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<IncludePath>$(SolutionDir)SimsBasic;$(SolutionDir)MessageBasic;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)$(Platform)\$(Configuration);$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Link>
|
||||
<AdditionalDependencies>MessageBasic.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>COMPONENTBASIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>COMPONENTBASIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="componentbasic_global.h" />
|
||||
<ClInclude Include="componentbasic.h" />
|
||||
<ClCompile Include="componentbasic.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Translation Files">
|
||||
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||
<Extensions>ts</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="componentbasic_global.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="componentbasic.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="componentbasic.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QtTouchProperty>
|
||||
</QtTouchProperty>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<QtTouchProperty>
|
||||
</QtTouchProperty>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1 @@
|
|||
#include "componentbasic.h"
|
|
@ -0,0 +1,112 @@
|
|||
#pragma once
|
||||
|
||||
#include "componentbasic_global.h"
|
||||
#include <simsbasic.h>
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 消息处理单元基类
|
||||
/// </summary>
|
||||
/// <typeparam name="MsgA">输入类型</typeparam>
|
||||
/// <typeparam name="MsgB">输出类型</typeparam>
|
||||
template<typename MsgA, typename MsgB> class WsRespond {
|
||||
public:
|
||||
using SelfType = WsRespond<MsgA, MsgB>;
|
||||
|
||||
virtual ~WsRespond() = default;
|
||||
/// <summary>
|
||||
/// Respond的类型签名
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
static WsRespondSignatureType signature()
|
||||
{
|
||||
return std::make_pair<QString, QString>(MsgA().topicString(), MsgB().topicString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 子类中实际处理函数
|
||||
/// </summary>
|
||||
/// <param name="in"></param>
|
||||
/// <returns></returns>
|
||||
virtual std::shared_ptr<MsgB> execute(std::shared_ptr<const MsgA> in) = 0;
|
||||
/// <summary>
|
||||
/// WsRespond构造函数
|
||||
/// </summary>
|
||||
/// <param name="map">注册函数</param>
|
||||
explicit WsRespond(QHash<WsRespondSignatureType, WsRespondEntry>& map) {
|
||||
WsRespondEntry ins = [=](std::shared_ptr<const WsMessage> in) -> std::shared_ptr<WsMessage> {
|
||||
return this->execute(std::static_pointer_cast<const MsgA>(in));
|
||||
};
|
||||
map[SelfType::signature()] = ins;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename... ProcSigs>struct _ProcRoute_;
|
||||
template <> struct COMPONENTBASIC_EXPORT _ProcRoute_<>
|
||||
{
|
||||
QHash<WsRespondSignatureType, WsRespondEntry> _execute_map;
|
||||
|
||||
_ProcRoute_() = default;
|
||||
};
|
||||
template <typename ProcSig, typename... ProcSigs>
|
||||
struct _ProcRoute_<ProcSig, ProcSigs...> : public _ProcRoute_<ProcSigs...>, public ProcSig
|
||||
{
|
||||
_ProcRoute_() : _ProcRoute_<ProcSigs...>(), ProcSig(_ProcRoute_<>::_execute_map) {}
|
||||
};
|
||||
|
||||
template <typename... Procs>
|
||||
struct ProcList : public _ProcRoute_<Procs...>, public WsComponent
|
||||
{
|
||||
using SuperType = ProcList<Procs...>;
|
||||
|
||||
ProcList() : _ProcRoute_<Procs...>() {}
|
||||
|
||||
// 通过 WsComponent 继承
|
||||
QList<QString> inputTypes() const override
|
||||
{
|
||||
QList<QString> list;
|
||||
for (auto key : _ProcRoute_<>::_execute_map.keys()) {
|
||||
list.append(key.first);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
WsRespondEntry getEntryWithSignature(const WsRespondSignatureType& t) const override
|
||||
{
|
||||
for (auto key : _ProcRoute_<>::_execute_map.keys()) {
|
||||
if (key == t)
|
||||
return _ProcRoute_<>::_execute_map[key];
|
||||
}
|
||||
}
|
||||
QList<WsRespondEntry> getEntrysWithInType(const QString& msg_type) const override
|
||||
{
|
||||
QList<WsRespondEntry> list;
|
||||
for (auto key : _ProcRoute_<>::_execute_map.keys()) {
|
||||
if (key.first == msg_type)
|
||||
list.append(_ProcRoute_<>::_execute_map[key]);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
};
|
||||
|
||||
#include <messagebasic.h>
|
||||
class COMPONENTBASIC_EXPORT Visible3DPlugin : public ProcList<
|
||||
WsRespond<Get3DVolume, Volume3DDesc>
|
||||
>
|
||||
{
|
||||
public:
|
||||
|
||||
// 通过 ProcList 继承
|
||||
std::shared_ptr<Volume3DDesc> execute(std::shared_ptr<const Get3DVolume> in) override;
|
||||
|
||||
void recoveryFrom(const QJsonObject& obj) override;
|
||||
|
||||
void saveTo(QJsonObject& obj) const override;
|
||||
|
||||
std::shared_ptr<WsComponent> defaultNew() const override;
|
||||
|
||||
void bindEntity(uint64_t entity_id) override;
|
||||
|
||||
QString name() const override;
|
||||
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef BUILD_STATIC
|
||||
# if defined(COMPONENTBASIC_LIB)
|
||||
# define COMPONENTBASIC_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define COMPONENTBASIC_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define COMPONENTBASIC_EXPORT
|
||||
#endif
|
|
@ -0,0 +1,108 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E1104048-F35B-40B7-995C-0320E689BF09}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared" />
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<IncludePath>$(SolutionDir)SimsBasic;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>MESSAGEBASIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>MESSAGEBASIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="messagebasic_global.h" />
|
||||
<ClInclude Include="messagebasic.h" />
|
||||
<ClCompile Include="messagebasic.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Translation Files">
|
||||
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||
<Extensions>ts</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="messagebasic_global.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="messagebasic.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="messagebasic.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QtTouchProperty>
|
||||
</QtTouchProperty>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<QtTouchProperty>
|
||||
</QtTouchProperty>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,202 @@
|
|||
#include "messagebasic.h"
|
||||
#include <QVariant>
|
||||
|
||||
void from_to_save(uint64_t f, uint64_t t, QJsonObject& o) {
|
||||
o["source_entity"] = QJsonValue::fromVariant(QVariant::fromValue(f));
|
||||
o["target_entity"] = QJsonValue::fromVariant(QVariant::fromValue(t));
|
||||
}
|
||||
void from_to_recovery(uint64_t& f, uint64_t& t, const QJsonObject& o) {
|
||||
f = o["source_entity"].toVariant().toULongLong();
|
||||
t = o["target_entity"].toVariant().toULongLong();
|
||||
}
|
||||
|
||||
DeduceRequest::DeduceRequest() {}
|
||||
|
||||
void DeduceRequest::reset(uint64_t from, uint64_t to) {
|
||||
_from_id = from;
|
||||
_to_id = to;
|
||||
}
|
||||
|
||||
void DeduceRequest::recoveryFrom(const QJsonObject& obj)
|
||||
{
|
||||
from_to_recovery(_from_id, _to_id, obj);
|
||||
}
|
||||
|
||||
void DeduceRequest::saveTo(QJsonObject& obj) const
|
||||
{
|
||||
from_to_save(_from_id, _to_id, obj);
|
||||
}
|
||||
|
||||
QString DeduceRequest::topicString() const
|
||||
{
|
||||
return NAME(DeduceRequest);
|
||||
}
|
||||
|
||||
uint64_t DeduceRequest::targetEntity() const
|
||||
{
|
||||
return _to_id;
|
||||
}
|
||||
|
||||
uint64_t DeduceRequest::sourceEntity() const
|
||||
{
|
||||
return _from_id;
|
||||
}
|
||||
|
||||
SyncRequest::SyncRequest() {
|
||||
}
|
||||
|
||||
void SyncRequest::reset(uint64_t from, uint64_t to, double timepoint)
|
||||
{
|
||||
_from_id = from;
|
||||
_to_id = to;
|
||||
this->_time_current = timepoint;
|
||||
}
|
||||
|
||||
void SyncRequest::recoveryFrom(const QJsonObject& obj)
|
||||
{
|
||||
from_to_recovery(_from_id, _to_id, obj);
|
||||
this->_time_current = obj["current_time"].toDouble();
|
||||
}
|
||||
|
||||
void SyncRequest::saveTo(QJsonObject& obj) const
|
||||
{
|
||||
from_to_save(_from_id, _to_id, obj);
|
||||
obj["current_time"] = this->_time_current;
|
||||
}
|
||||
|
||||
QString SyncRequest::topicString() const
|
||||
{
|
||||
return NAME(SyncRequest);
|
||||
}
|
||||
|
||||
uint64_t SyncRequest::targetEntity() const
|
||||
{
|
||||
return _to_id;
|
||||
}
|
||||
|
||||
uint64_t SyncRequest::sourceEntity() const
|
||||
{
|
||||
return _from_id;
|
||||
}
|
||||
|
||||
RespondDefault::RespondDefault() {
|
||||
}
|
||||
|
||||
void RespondDefault::reset(uint64_t from, uint64_t to, double consume) {
|
||||
_from_id = from;
|
||||
_to_id = to;
|
||||
_time_consume = consume;
|
||||
}
|
||||
|
||||
double RespondDefault::consume() const {
|
||||
return this->_time_consume;
|
||||
}
|
||||
|
||||
void RespondDefault::recoveryFrom(const QJsonObject& obj)
|
||||
{
|
||||
from_to_recovery(_from_id, _to_id, obj);
|
||||
this->_time_consume = obj["time_consume"].toDouble();
|
||||
}
|
||||
|
||||
void RespondDefault::saveTo(QJsonObject& obj) const
|
||||
{
|
||||
from_to_save(_from_id, _to_id, obj);
|
||||
obj["time_consume"] = this->_time_consume;
|
||||
}
|
||||
|
||||
QString RespondDefault::topicString() const
|
||||
{
|
||||
return NAME(DeduceRequest);
|
||||
}
|
||||
|
||||
uint64_t RespondDefault::targetEntity() const
|
||||
{
|
||||
return _to_id;
|
||||
}
|
||||
|
||||
uint64_t RespondDefault::sourceEntity() const
|
||||
{
|
||||
return _from_id;
|
||||
}
|
||||
|
||||
Get3DVolume::Get3DVolume()
|
||||
{
|
||||
}
|
||||
|
||||
void Get3DVolume::reset(uint64_t from, uint64_t to)
|
||||
{
|
||||
_from_id = from;
|
||||
_to_id = to;
|
||||
}
|
||||
|
||||
void Get3DVolume::recoveryFrom(const QJsonObject& obj)
|
||||
{
|
||||
from_to_recovery(_from_id, _to_id, obj);
|
||||
}
|
||||
|
||||
void Get3DVolume::saveTo(QJsonObject& obj) const
|
||||
{
|
||||
from_to_save(_from_id, _to_id, obj);
|
||||
}
|
||||
|
||||
QString Get3DVolume::topicString() const
|
||||
{
|
||||
return NAME(Get3DVolume);
|
||||
}
|
||||
|
||||
uint64_t Get3DVolume::targetEntity() const
|
||||
{
|
||||
return _to_id;
|
||||
}
|
||||
|
||||
uint64_t Get3DVolume::sourceEntity() const
|
||||
{
|
||||
return _from_id;
|
||||
}
|
||||
|
||||
Volume3DDesc::Volume3DDesc()
|
||||
{
|
||||
}
|
||||
|
||||
void Volume3DDesc::reset(uint64_t from, uint64_t to, double l, double w, double h, double azi)
|
||||
{
|
||||
_from_id = from;
|
||||
_to_id = to;
|
||||
_length = l;
|
||||
_width = w;
|
||||
_height = h;
|
||||
_azimuth_deg = azi;
|
||||
}
|
||||
|
||||
void Volume3DDesc::recoveryFrom(const QJsonObject& obj)
|
||||
{
|
||||
from_to_recovery(_from_id, _to_id, obj);
|
||||
_length = obj["length"].toDouble();
|
||||
_width = obj["width"].toDouble();
|
||||
_height = obj["height"].toDouble();
|
||||
_azimuth_deg = obj["azimuth_deg"].toDouble();
|
||||
}
|
||||
|
||||
void Volume3DDesc::saveTo(QJsonObject& obj) const
|
||||
{
|
||||
from_to_save(_from_id, _to_id, obj);
|
||||
obj["length"] = _length;
|
||||
obj["width"] = _width;
|
||||
obj["height"] = _height;
|
||||
obj["azimuth_deg"] = _azimuth_deg;
|
||||
}
|
||||
|
||||
QString Volume3DDesc::topicString() const
|
||||
{
|
||||
return NAME(Volume3DDesc);
|
||||
}
|
||||
|
||||
uint64_t Volume3DDesc::targetEntity() const
|
||||
{
|
||||
return _to_id;
|
||||
}
|
||||
|
||||
uint64_t Volume3DDesc::sourceEntity() const
|
||||
{
|
||||
return _from_id;
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
#pragma once
|
||||
|
||||
#include "messagebasic_global.h"
|
||||
#include "simsbasic.h"
|
||||
|
||||
#define NAME(v) #v
|
||||
|
||||
/// <summary>
|
||||
/// 推演请求
|
||||
/// </summary>
|
||||
class MESSAGEBASIC_EXPORT DeduceRequest : public WsMessage {
|
||||
private:
|
||||
uint64_t _from_id, _to_id;
|
||||
|
||||
public:
|
||||
DeduceRequest();
|
||||
|
||||
void reset(uint64_t from, uint64_t to);
|
||||
|
||||
// 通过 WsMessage 继承
|
||||
void recoveryFrom(const QJsonObject& obj) override;
|
||||
void saveTo(QJsonObject& obj) const override;
|
||||
QString topicString() const override;
|
||||
uint64_t targetEntity() const override;
|
||||
uint64_t sourceEntity() const override;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 默认的无返回消息的处理过程通用返回消息
|
||||
/// </summary>
|
||||
class MESSAGEBASIC_EXPORT RespondDefault : public WsMessage {
|
||||
private:
|
||||
uint64_t _from_id, _to_id;
|
||||
double _time_consume;
|
||||
|
||||
public:
|
||||
RespondDefault();
|
||||
|
||||
void reset(uint64_t from, uint64_t to, double consume);
|
||||
|
||||
double consume() const;
|
||||
|
||||
// 通过 WsMessage 继承
|
||||
void recoveryFrom(const QJsonObject& obj) override;
|
||||
void saveTo(QJsonObject& obj) const override;
|
||||
QString topicString() const override;
|
||||
uint64_t targetEntity() const override;
|
||||
uint64_t sourceEntity() const override;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 时间同步消息
|
||||
/// </summary>
|
||||
class MESSAGEBASIC_EXPORT SyncRequest : public WsMessage {
|
||||
private:
|
||||
uint64_t _from_id, _to_id;
|
||||
double _time_current;
|
||||
|
||||
public:
|
||||
SyncRequest();
|
||||
|
||||
void reset(uint64_t from, uint64_t to, double timepoint);
|
||||
|
||||
// 通过 WsMessage 继承
|
||||
void recoveryFrom(const QJsonObject& obj) override;
|
||||
void saveTo(QJsonObject& obj) const override;
|
||||
QString topicString() const override;
|
||||
uint64_t targetEntity() const override;
|
||||
uint64_t sourceEntity() const override;
|
||||
};
|
||||
|
||||
class MESSAGEBASIC_EXPORT Get3DVolume : public WsMessage {
|
||||
private:
|
||||
uint64_t _from_id = 0, _to_id = 0;
|
||||
|
||||
public:
|
||||
Get3DVolume();
|
||||
|
||||
void reset(uint64_t from, uint64_t to);
|
||||
|
||||
// 通过 WsMessage 继承
|
||||
void recoveryFrom(const QJsonObject& obj) override;
|
||||
void saveTo(QJsonObject& obj) const override;
|
||||
QString topicString() const override;
|
||||
uint64_t targetEntity() const override;
|
||||
uint64_t sourceEntity() const override;
|
||||
};
|
||||
|
||||
class MESSAGEBASIC_EXPORT Volume3DDesc : public WsMessage {
|
||||
private:
|
||||
uint64_t _from_id, _to_id;
|
||||
double _length, _width, _height;
|
||||
double _azimuth_deg;
|
||||
|
||||
public:
|
||||
Volume3DDesc();
|
||||
|
||||
void reset(uint64_t from, uint64_t to, double l, double w, double h, double azi);
|
||||
|
||||
// 通过 WsMessage 继承
|
||||
void recoveryFrom(const QJsonObject& obj) override;
|
||||
void saveTo(QJsonObject& obj) const override;
|
||||
QString topicString() const override;
|
||||
uint64_t targetEntity() const override;
|
||||
uint64_t sourceEntity() const override;
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef BUILD_STATIC
|
||||
# if defined(MESSAGEBASIC_LIB)
|
||||
# define MESSAGEBASIC_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define MESSAGEBASIC_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define MESSAGEBASIC_EXPORT
|
||||
#endif
|
|
@ -0,0 +1,107 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{DF15B899-B9AE-4EBE-8FCC-436C9DB6CEF0}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared" />
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>SIMSBASIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>SIMSBASIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="simsbasic_global.h" />
|
||||
<ClInclude Include="simsbasic.h" />
|
||||
<ClCompile Include="simsbasic.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Translation Files">
|
||||
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||
<Extensions>ts</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="simsbasic_global.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="simsbasic.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="simsbasic.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QtTouchProperty>
|
||||
</QtTouchProperty>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<QtTouchProperty>
|
||||
</QtTouchProperty>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,124 @@
|
|||
#include "simsbasic.h"
|
||||
|
||||
|
||||
UniException::UniException(const QString& msg)
|
||||
:_error_store(msg) {
|
||||
}
|
||||
|
||||
QString UniException::content() const noexcept
|
||||
{
|
||||
return _error_store;
|
||||
}
|
||||
|
||||
WsEntity::WsEntity() {}
|
||||
|
||||
void WsEntity::resetTemplet(const QString& name) {
|
||||
this->_templet_name = name;
|
||||
}
|
||||
|
||||
QString WsEntity::templetName() const {
|
||||
return this->_templet_name;
|
||||
}
|
||||
|
||||
void WsEntity::resetID(uint64_t id) {
|
||||
this->_entity_id = id;
|
||||
}
|
||||
|
||||
uint64_t WsEntity::entityID() const {
|
||||
return this->_entity_id;
|
||||
}
|
||||
|
||||
void WsEntity::resetName(const QString& name) {
|
||||
this->_runtime_name = name;
|
||||
}
|
||||
|
||||
QString WsEntity::name() const {
|
||||
return this->_runtime_name;
|
||||
}
|
||||
|
||||
void WsEntity::append(std::shared_ptr<WsComponent> ins) {
|
||||
if (this->_comps_list.contains(ins->name()))
|
||||
return;
|
||||
this->_comps_list[ins->name()] = ins;
|
||||
}
|
||||
|
||||
void WsEntity::remove(const QString& component_type) {
|
||||
this->_comps_list.remove(component_type);
|
||||
}
|
||||
|
||||
QList<std::shared_ptr<WsComponent>> WsEntity::components() const {
|
||||
return _comps_list.values();
|
||||
}
|
||||
|
||||
std::shared_ptr<WsEntity> WsEntity::defaultNew() const {
|
||||
auto newx = std::make_shared<WsEntity>();
|
||||
newx->_entity_id = this->_entity_id;
|
||||
newx->_templet_name = this->_templet_name;
|
||||
newx->_runtime_name = this->_runtime_name;
|
||||
|
||||
for (auto c : this->_comps_list)
|
||||
newx->append(c->defaultNew());
|
||||
return newx;
|
||||
}
|
||||
|
||||
#include <QSet>
|
||||
QList<QString> WsEntity::inputTypes() const
|
||||
{
|
||||
QList<QString> types;
|
||||
for (auto c : this->_comps_list)
|
||||
types.append(c->inputTypes());
|
||||
return types.toSet().toList();
|
||||
}
|
||||
|
||||
#include <QVariant>
|
||||
#include <QJsonArray>
|
||||
QList<WsRespondEntry> WsEntity::getEntryWithSignature(const WsRespondSignatureType& t) const
|
||||
{
|
||||
QList<WsRespondEntry> list;
|
||||
for(auto c : this->_comps_list)
|
||||
list.append(c->getEntryWithSignature(t));
|
||||
return list;
|
||||
}
|
||||
|
||||
QList<WsRespondEntry> WsEntity::getEntryWithInType(const QString& msg_type) const
|
||||
{
|
||||
QList<WsRespondEntry> list;
|
||||
for(auto c : this->_comps_list)
|
||||
list.append(c->getEntrysWithInType(msg_type));
|
||||
return list;
|
||||
}
|
||||
void WsEntity::recoveryFrom(const QJsonObject& obj)
|
||||
{
|
||||
this->_entity_id = obj["entity_id"].toVariant().toULongLong();
|
||||
this->_runtime_name = obj["entity_name"].toString();
|
||||
this->_templet_name = obj["entity_templet"].toString();
|
||||
|
||||
auto array = obj["component_array"].toArray();
|
||||
for (auto idx = 0; idx < array.size(); ++idx) {
|
||||
auto value = array.at(idx).toObject();
|
||||
auto type = value["component_type"].toString();
|
||||
|
||||
auto compins = this->_comps_list[type];
|
||||
if (!compins)
|
||||
throw new UniException(type + "ÀàÐͲå¼þ²»´æÔÚ£¡");
|
||||
|
||||
compins->recoveryFrom(value);
|
||||
}
|
||||
}
|
||||
|
||||
void WsEntity::saveTo(QJsonObject& obj) const
|
||||
{
|
||||
obj["entity_id"] = QJsonValue::fromVariant(QVariant::fromValue(this->_entity_id));
|
||||
obj["entity_name"] = this->_runtime_name;
|
||||
obj["entity_templet"] = this->_templet_name;
|
||||
|
||||
QJsonArray array;
|
||||
for (auto c : this->_comps_list)
|
||||
{
|
||||
QJsonObject comp_obj;
|
||||
comp_obj["component_type"] = c->name();
|
||||
c->saveTo(comp_obj);
|
||||
array.append(comp_obj);
|
||||
}
|
||||
obj["component_array"] = array;
|
||||
}
|
|
@ -0,0 +1,205 @@
|
|||
#pragma once
|
||||
|
||||
#include "simsbasic_global.h"
|
||||
#include <QJsonObject>
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
|
||||
/// <summary>
|
||||
/// 可序列化对象
|
||||
/// </summary>
|
||||
class Serializable {
|
||||
public:
|
||||
virtual ~Serializable() = default;
|
||||
/// <summary>
|
||||
/// 通过反序列化完全恢复数据
|
||||
/// </summary>
|
||||
/// <param name="obj">数据Json</param>
|
||||
virtual void recoveryFrom(const QJsonObject& obj) = 0;
|
||||
/// <summary>
|
||||
/// 通过序列化输出所有数据
|
||||
/// </summary>
|
||||
/// <param name="obj">目标Json</param>
|
||||
virtual void saveTo(QJsonObject& obj) const = 0;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 所有异常基类
|
||||
/// </summary>
|
||||
class SIMSBASIC_EXPORT UniException {
|
||||
private:
|
||||
QString _error_store;
|
||||
|
||||
public:
|
||||
explicit UniException(const QString& msg);
|
||||
virtual ~UniException() = default;
|
||||
|
||||
virtual QString content() const noexcept;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 通用消息基类
|
||||
/// </summary>
|
||||
class WsMessage : public Serializable {
|
||||
public:
|
||||
virtual ~WsMessage() = default;
|
||||
/// <summary>
|
||||
/// 获取消息类型字符串
|
||||
/// </summary>
|
||||
/// <returns>消息类型</returns>
|
||||
virtual QString topicString() const = 0;
|
||||
/// <summary>
|
||||
/// 目标实体ID
|
||||
/// </summary>
|
||||
/// <returns>ID</returns>
|
||||
virtual uint64_t targetEntity() const = 0;
|
||||
/// <summary>
|
||||
/// 来源实体ID
|
||||
/// </summary>
|
||||
/// <returns>ID</returns>
|
||||
virtual uint64_t sourceEntity() const = 0;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 所有消息处理单元通用接口
|
||||
/// </summary>
|
||||
using WsRespondEntry = std::function<std::shared_ptr<WsMessage>(std::shared_ptr<const WsMessage>)>;
|
||||
/// <summary>
|
||||
/// Respond签名类型
|
||||
/// </summary>
|
||||
using WsRespondSignatureType = std::pair<QString, QString>;
|
||||
|
||||
/// <summary>
|
||||
/// 功能插件的基类
|
||||
/// </summary>
|
||||
class WsComponent : public Serializable, public std::enable_shared_from_this<WsComponent> {
|
||||
public:
|
||||
virtual ~WsComponent() = default;
|
||||
|
||||
/// <summary>
|
||||
/// 克隆一个具有相同数据的实例
|
||||
/// </summary>
|
||||
/// <returns>实例指针</returns>
|
||||
virtual std::shared_ptr<WsComponent> defaultNew() const = 0;
|
||||
/// <summary>
|
||||
/// 绑定Entity
|
||||
/// </summary>
|
||||
/// <param name="entity_id">EntityID</param>
|
||||
virtual void bindEntity(uint64_t entity_id) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 插件唯一命名
|
||||
/// </summary>
|
||||
/// <returns>插件名</returns>
|
||||
virtual QString name() const = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 允许输入的消息类型
|
||||
/// </summary>
|
||||
/// <returns>消息类型集合</returns>
|
||||
virtual QList<QString> inputTypes() const = 0;
|
||||
/// <summary>
|
||||
/// 通过指定的签名获取处理入口
|
||||
/// </summary>
|
||||
/// <param name="t">处理签名</param>
|
||||
/// <returns>处理接口</returns>
|
||||
virtual WsRespondEntry getEntryWithSignature(const WsRespondSignatureType& t) const = 0;
|
||||
/// <summary>
|
||||
/// 通过输入消息类型获取处理入口
|
||||
/// </summary>
|
||||
/// <param name="msg_type">输入消息类型</param>
|
||||
/// <returns>处理接口列表</returns>
|
||||
virtual QList<WsRespondEntry> getEntrysWithInType(const QString& msg_type) const = 0;
|
||||
};
|
||||
|
||||
#include <QHash>
|
||||
/// <summary>
|
||||
/// 内存实体实例类型
|
||||
/// </summary>
|
||||
class SIMSBASIC_EXPORT WsEntity : public Serializable, public std::enable_shared_from_this<WsEntity> {
|
||||
private:
|
||||
uint64_t _entity_id = 0;
|
||||
QString _templet_name, _runtime_name;
|
||||
QHash<QString, std::shared_ptr<WsComponent>> _comps_list;
|
||||
|
||||
public:
|
||||
explicit WsEntity();
|
||||
virtual ~WsEntity() = default;
|
||||
|
||||
/// <summary>
|
||||
/// 重置本实例模板名
|
||||
/// </summary>
|
||||
/// <param name="name">模板名称</param>
|
||||
virtual void resetTemplet(const QString& name);
|
||||
/// <summary>
|
||||
/// 获取本实例的模板名
|
||||
/// </summary>
|
||||
/// <returns>模板名称</returns>
|
||||
virtual QString templetName() const;
|
||||
|
||||
/// <summary>
|
||||
/// 重置本实例的运行ID
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
virtual void resetID(uint64_t id);
|
||||
/// <summary>
|
||||
/// 获取本实例的运行ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
virtual uint64_t entityID() const;
|
||||
/// <summary>
|
||||
/// 重置本实例的运行名称
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
virtual void resetName(const QString& name);
|
||||
/// <summary>
|
||||
/// 获取本实例的运行名称
|
||||
/// </summary>
|
||||
/// <returns>运行名称</returns>
|
||||
virtual QString name() const;
|
||||
|
||||
/// <summary>
|
||||
/// 为本实例添加指定类型的插件
|
||||
/// </summary>
|
||||
/// <param name="ins"></param>
|
||||
virtual void append(std::shared_ptr<WsComponent> ins);
|
||||
/// <summary>
|
||||
/// 移除指定类型的插件实例
|
||||
/// </summary>
|
||||
/// <param name="component_type"></param>
|
||||
virtual void remove(const QString& component_type);
|
||||
/// <summary>
|
||||
/// 获取本实例内包含的所有插件实例
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
virtual QList<std::shared_ptr<WsComponent>> components() const;
|
||||
|
||||
/// <summary>
|
||||
/// 深度克隆本实例,插件和数据一致
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
virtual std::shared_ptr<WsEntity> defaultNew() const;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 允许输入的消息类型
|
||||
/// </summary>
|
||||
/// <returns>消息类型集合</returns>
|
||||
virtual QList<QString> inputTypes() const;
|
||||
/// <summary>
|
||||
/// 通过指定的签名获取处理入口
|
||||
/// </summary>
|
||||
/// <param name="t">签名</param>
|
||||
/// <returns>处理接口</returns>
|
||||
virtual QList<WsRespondEntry> getEntryWithSignature(const WsRespondSignatureType& t) const;
|
||||
/// <summary>
|
||||
/// 通过输入消息类型获取处理入口
|
||||
/// </summary>
|
||||
/// <param name="msg_type">输入消息类型</param>
|
||||
/// <returns>处理接口列表</returns>
|
||||
virtual QList<WsRespondEntry> getEntryWithInType(const QString& msg_type) const;
|
||||
|
||||
// 通过 Serializable 继承
|
||||
void recoveryFrom(const QJsonObject& obj) override;
|
||||
void saveTo(QJsonObject& obj) const override;
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef BUILD_STATIC
|
||||
# if defined(SIMSBASIC_LIB)
|
||||
# define SIMSBASIC_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define SIMSBASIC_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define SIMSBASIC_EXPORT
|
||||
#endif
|
|
@ -0,0 +1,43 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.13.35825.156 d17.13
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimsWorld", "SimsWorld\SimsWorld.vcxproj", "{46E3FBA5-6775-4638-AE2E-935675D3B9CE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimsBasic", "SimsBasic\SimsBasic.vcxproj", "{DF15B899-B9AE-4EBE-8FCC-436C9DB6CEF0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ComponentBasic", "ComponentBasic\ComponentBasic.vcxproj", "{20CFC220-4F5B-4D39-97FA-74C70768F1A7}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MessageBasic", "MessageBasic\MessageBasic.vcxproj", "{E1104048-F35B-40B7-995C-0320E689BF09}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{46E3FBA5-6775-4638-AE2E-935675D3B9CE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{46E3FBA5-6775-4638-AE2E-935675D3B9CE}.Debug|x64.Build.0 = Debug|x64
|
||||
{46E3FBA5-6775-4638-AE2E-935675D3B9CE}.Release|x64.ActiveCfg = Release|x64
|
||||
{46E3FBA5-6775-4638-AE2E-935675D3B9CE}.Release|x64.Build.0 = Release|x64
|
||||
{DF15B899-B9AE-4EBE-8FCC-436C9DB6CEF0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DF15B899-B9AE-4EBE-8FCC-436C9DB6CEF0}.Debug|x64.Build.0 = Debug|x64
|
||||
{DF15B899-B9AE-4EBE-8FCC-436C9DB6CEF0}.Release|x64.ActiveCfg = Release|x64
|
||||
{DF15B899-B9AE-4EBE-8FCC-436C9DB6CEF0}.Release|x64.Build.0 = Release|x64
|
||||
{20CFC220-4F5B-4D39-97FA-74C70768F1A7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{20CFC220-4F5B-4D39-97FA-74C70768F1A7}.Debug|x64.Build.0 = Debug|x64
|
||||
{20CFC220-4F5B-4D39-97FA-74C70768F1A7}.Release|x64.ActiveCfg = Release|x64
|
||||
{20CFC220-4F5B-4D39-97FA-74C70768F1A7}.Release|x64.Build.0 = Release|x64
|
||||
{E1104048-F35B-40B7-995C-0320E689BF09}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E1104048-F35B-40B7-995C-0320E689BF09}.Debug|x64.Build.0 = Debug|x64
|
||||
{E1104048-F35B-40B7-995C-0320E689BF09}.Release|x64.ActiveCfg = Release|x64
|
||||
{E1104048-F35B-40B7-995C-0320E689BF09}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {6FB4589F-9657-44A5-9137-24A66C2A5057}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
Binary file not shown.
After Width: | Height: | Size: 361 KiB |
|
@ -0,0 +1 @@
|
|||
IDI_ICON1 ICON DISCARDABLE "SimsWorld.ico"
|
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{46E3FBA5-6775-4638-AE2E-935675D3B9CE}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')"
|
||||
>$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core;gui;widgets</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core;gui;widgets</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound"
|
||||
BeforeTargets="CustomBuild;ClCompile"
|
||||
Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High"
|
||||
Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared" />
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<QtRcc Include="sims_world.qrc"/>
|
||||
<QtUic Include="sims_world.ui"/>
|
||||
<QtMoc Include="sims_world.h"/>
|
||||
<ClCompile Include="sims_world.cpp"/>
|
||||
<ClCompile Include="main.cpp"/>
|
||||
<None Include="SimsWorld.ico" />
|
||||
<ResourceCompile Include="SimsWorld.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Translation Files">
|
||||
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||
<Extensions>ts</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtRcc Include="sims_world.qrc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</QtRcc>
|
||||
<QtUic Include="sims_world.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
<QtMoc Include="sims_world.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<ClCompile Include="sims_world.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ResourceCompile Include="$pro_name$.rc">
|
||||
</ResourceCompile>
|
||||
<None Include="$pro_name$.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="$pro_name$.def">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="SimsWorld.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<ResourceCompile Include="SimsWorld.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QtTouchProperty>
|
||||
</QtTouchProperty>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<QtTouchProperty>
|
||||
</QtTouchProperty>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,10 @@
|
|||
#include "sims_world.h"
|
||||
#include <QtWidgets/QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
SimsWorld w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
#include "sims_world.h"
|
||||
|
||||
SimsWorld::SimsWorld(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
}
|
||||
|
||||
SimsWorld::~SimsWorld()
|
||||
{}
|
|
@ -0,0 +1,16 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include "ui_sims_world.h"
|
||||
|
||||
class SimsWorld : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SimsWorld(QWidget *parent = nullptr);
|
||||
~SimsWorld();
|
||||
|
||||
private:
|
||||
Ui::SimsWorldClass ui;
|
||||
};
|
|
@ -0,0 +1,4 @@
|
|||
<RCC>
|
||||
<qresource prefix="SimsWorld">
|
||||
</qresource>
|
||||
</RCC>
|
|
@ -0,0 +1,28 @@
|
|||
<UI version="4.0" >
|
||||
<class>SimsWorldClass</class>
|
||||
<widget class="QMainWindow" name="SimsWorldClass" >
|
||||
<property name="objectName" >
|
||||
<string notr="true">SimsWorldClass</string>
|
||||
</property>
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>SimsWorld</string>
|
||||
</property> <widget class="QMenuBar" name="menuBar" />
|
||||
<widget class="QToolBar" name="mainToolBar" />
|
||||
<widget class="QWidget" name="centralWidget" />
|
||||
<widget class="QStatusBar" name="statusBar" />
|
||||
</widget>
|
||||
<layoutDefault spacing="6" margin="11" />
|
||||
<pixmapfunction></pixmapfunction>
|
||||
<resources>
|
||||
<include location="sims_world.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</UI>
|
Loading…
Reference in New Issue