Commit 69423e9b authored by 刘乐's avatar 刘乐

1,水力模型组件

parent ca9a3e2e
......@@ -196,8 +196,8 @@
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(ProjectDir)..\libs\x64\</OutDir>
<IntDir>$(ProjectDir)..\tmp\$(PlatformName)\$(ProjectName)\$(Configuration)\</IntDir>
<OutDir>..\..\hModelProgram\lib\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
......
// This file adds defines about the platform we're currently building on.
// Operating System:
// OS_WIN / OS_MACOSX / OS_IOS / OS_POSIX (MACOSX or LINUX or IOS)
// Compiler:
// OMPILER_MSVC / COMPILER_GCC
// Processor:
// ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64)
// ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
// Byte_Order:
// NETEASE_BIG_ENDIAN / NETEASE_LITTLE_ENDIAN
#ifndef BUILD_BUILD_CONFIG_H_
#define BUILD_BUILD_CONFIG_H_
// Define platform macro
#if defined(_WIN32)
#define OS_WIN 1
#elif defined(__APPLE__) && (defined(__i386__) || defined(__ARMEL__))
#define OS_IOS 1
#elif defined(__APPLE__)
#define OS_MACOSX 1
#elif defined(__linux__)
#define OS_LINUX 1
#elif defined(__FreeBSD__)
#define OS_FREEBSD 1
#else
#error Please add support for your platform in build/build_config.h
#endif
// For access to standard POSIXish features, use OS_POSIX instead of a
// more specific macro.
#if defined(OS_MACOSX) || defined(OS_IOS) || defined(OS_LINUX) || defined(OS_FREEBSD)
#define OS_POSIX 1
// Use base::DataPack for name/value pairs.
#define USE_BASE_DATA_PACK 1
#endif
// Use tcmalloc
#if (defined(OS_WIN) || defined(OS_POSIX)) && !defined(NO_TCMALLOC)
#define USE_TCMALLOC 1
#endif
// Compiler detection.
#if defined(__GNUC__)
#define COMPILER_GCC 1
#elif defined(_MSC_VER)
#define COMPILER_MSVC 1
#else
#error Please add support for your compiler in build/build_config.h
#endif
// Processor architecture detection. For more info on what's defined, see:
// http://msdn.microsoft.com/en-us/library/b0084kay.aspx
// http://www.agner.org/optimize/calling_conventions.pdf
// or with gcc, run: "echo | gcc -E -dM -"
#if defined(_M_X64) || defined(__x86_64__)
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86_64 1
#define ARCH_CPU_64_BITS 1
#elif defined(_M_IX86) || defined(__i386__)
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86 1
#define ARCH_CPU_32_BITS 1
#elif defined(__ARMEL__)
#define ARCH_CPU_ARM_FAMILY 1
#define ARCH_CPU_ARMEL 1
#define ARCH_CPU_32_BITS 1
#define WCHAR_T_IS_UNSIGNED 1
#else
#error Please add support for your architecture in build/build_config.h
#endif
// Type detection for wchar_t.
#if defined(OS_WIN)
#define WCHAR_T_IS_UTF16
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
defined(__WCHAR_MAX__) && \
(__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
#define WCHAR_T_IS_UTF32
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
defined(__WCHAR_MAX__) && \
(__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
// compile in this mode (in particular, Chrome doesn't). This is intended for
// other projects using base who manage their own dependencies and make sure
// short wchar works for them.
#define WCHAR_T_IS_UTF16
#else
#error Please add support for your compiler in build/build_config.h
#endif
// GNU libc offers the helpful header <endian.h> which defines
// __BYTE_ORDER
#if defined(__GLIBC__)
#include <endian.h>
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
#define NETEASE_LITTLE_ENDIAN
#elif (__BYTE_ORDER == __BIG_ENDIAN)
#define NETEASE_BIG_ENDIAN
#elif (__BYTE_ORDER == __PDP_ENDIAN)
#define NETEASE_PDP_ENDIAN
#else
#error Unknown machine endianness detected.
#endif
#define NETEASE_BYTE_ORDER __BYTE_ORDER
#elif defined(_BIG_ENDIAN)
#define NETEASE_BIG_ENDIAN
#define NETEASE_BYTE_ORDER 4321
#elif defined(_LITTLE_ENDIAN)
# define NETEASE_LITTLE_ENDIAN
# define NETEASE_BYTE_ORDER 1234
#elif defined(__sparc) || defined(__sparc__) \
|| defined(_POWER) || defined(__powerpc__) \
|| defined(__ppc__) || defined(__hpux) \
|| defined(_MIPSEB) || defined(_POWER) \
|| defined(_MIPSEB) || defined(_POWER) \
|| defined(__s390__)
# define NETEASE_BIG_ENDIAN
# define NETEASE_BYTE_ORDER 4321
#elif defined(__i386__) || defined(__alpha__) \
|| defined(__ia64) || defined(__ia64__) \
|| defined(_M_IX86) || defined(_M_IA64) \
|| defined(_M_ALPHA) || defined(__amd64) \
|| defined(__amd64__) || defined(_M_AMD64) \
|| defined(__x86_64) || defined(__x86_64__) \
|| defined(_M_X64) || defined (__ARMEL__)
# define NETEASE_LITTLE_ENDIAN
# define NETEASE_BYTE_ORDER 1234
#else
# error Please set up your byte order in build/build_config.h.
#endif
// Collapse the plethora of ARM flavors available to an easier to manage set
// Defs reference is at https://wiki.edubuntu.org/ARM/Thumb2PortingHowto
#if defined(__ARM_ARCH_6__) || \
defined(__ARM_ARCH_6J__) || \
defined(__ARM_ARCH_6K__) || \
defined(__ARM_ARCH_6Z__) || \
defined(__ARM_ARCH_6T2__) || \
defined(__ARM_ARCH_6ZK__) || \
defined(__ARM_ARCH_7__) || \
defined(__ARM_ARCH_7A__) || \
defined(__ARM_ARCH_7R__) || \
defined(__ARM_ARCH_7M__)
#define ARMV6_OR_7 1
#endif
#endif // BUILD_BUILD_CONFIG_H_
#include "build/stdafx.h"
\ No newline at end of file
//std
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <memory>
#include <functional>
#include <regex>
//base
#include "base/util/callback.h"
#include "base/util/string_util.h"
#include "base/util/unicode.h"
#include "base/util/string_number_conversions.h"
#include "base/memory/scoped_std_handle.h"
#include "base/memory/singleton.h"
#include "base/memory/scoped_ptr.h"
#include "base/win32/platform_string_util.h"
#include "base/win32/path_util.h"
#include "base/win32/win_util.h"
#include "base/thread/thread_manager.h"
#include "base/macros.h"
#include "base/base_types.h"
#include "base/file/file_util.h"
#include "base/log/log.h"
#include "base/time/time.h"
#include "base/callback/weak_callback.h"
#include "base/callback/global_listener.h"
#include "base/framework/task.h"
//shared
#include "shared/threads.h"
//biz
#include "biz/biz_api.h"
#include "biz/service/users/users_protocol.h"
#include "biz/service/team/team_protocol.h"
#include "biz/service/photo/photo_protocol.h"
//net
#include "net/export/export.h"
#include "yhttp/json_framework/yixin_http_framework.h"
//duilib
#include "third_party/duilib/UIlib.h"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
\ No newline at end of file
// The basic configuration of Windows SDK and CRT
#ifndef BUILD_WINSDK_CONFIG_H_
#define BUILD_WINSDK_CONFIG_H_
#if !defined(OS_WIN)
#error "Preprocessing symbol 'OS_WIN' needed :-)"
#endif
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN
#endif
#ifndef WIN32_LEAN_AND_MEAN // remove rarely used header files, including 'winsock.h'
#define WIN32_LEAN_AND_MEAN // which will conflict with 'winsock2.h'
#endif
#ifndef WINVER
#define WINVER _WIN32_WINNT_WINXP
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT _WIN32_WINNT_WINXP
#endif
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS _WIN32_WINNT_WINXP
#endif
#ifndef _WIN32_IE
#define _WIN32_IE _WIN32_IE_IE60
#endif
#ifdef COMPILER_MSVC
#pragma warning(disable: 4996)
#endif
#endif // BUILD_WINSDK_CONFIG_H_
// This file defines Windows embedded menifest, including the file
// in your project to make a modern look of all windows
#ifndef BUILD_XP_STYLE_MANIFEST_WIN_H_
#define BUILD_XP_STYLE_MANIFEST_WIN_H_
#if defined(OS_WIN)
#if defined(COMPILER_MSVC)
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
#endif // COMPILER_MSVC
#endif // OS_WIN
#endif // BUILD_XP_STYLE_MANIFEST_WIN_H_
......@@ -70,7 +70,7 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)..\libs\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\hModelProgram\lib\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)..\tmp\$(PlatformName)\$(ProjectName)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
......@@ -102,12 +102,12 @@
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(ProjectDir)..\libs\x64\</OutDir>
<OutDir>..\..\hModelProgram\lib\</OutDir>
<IntDir>$(ProjectDir)..\tmp\$(PlatformName)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(ProjectDir)..\libs\x64\</OutDir>
<IntDir>$(ProjectDir)..\tmp\$(PlatformName)\$(ProjectName)\$(Configuration)\</IntDir>
<OutDir>..\..\hModelProgram\lib\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
......
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
......@@ -78,6 +78,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\hModelProgram\Program\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
......
......@@ -15,8 +15,10 @@
using namespace std;
int main(int argc, char* argv[])
{
while (true)
{
const char* uri = "host=192.168.19.100 port=5432 dbname=JinXian user=postgres password=admin";
......
......@@ -3,6 +3,9 @@
#include "CivConnection.h"
#include "CivPgDbConnection.h"
#include <algorithm>
CivInpDbHelper::CivInpDbHelper(const std::string& uri)
:CivInpHelperAbs(uri)
......@@ -50,8 +53,9 @@ bool CivInpDbHelper::getPipe(CivPipe& pipes)
// 注意去重
// 查找与阀门像连的管段
std::string sql = "select pipe.\"编号\",pipe.\"起始节点\",pipe.\"终止节点\", \
pipe.\"管长\", pipe.\"管径\",pipe.\"摩阻系数\",pipe.\"局损系数\",pipe.\"初始状态\",va.\"本点号\", pipe.\"code\",\
std::string sql = "select pipe.\"编号\", pipe.\"起始节点\", pipe.\"终止节点\", \
pipe.\"管长\", pipe.\"管径\", pipe.\"摩阻系数\",pipe.\"局损系数\",\
pipe.\"初始状态\",va.\"本点号\", pipe.\"code\",\
va.\"类型\" from \"管段\" as pipe, \"阀门\" as va where pipe.\"起始节点\" = va.\"本点号\" \
or pipe.\"终止节点\" = va.\"本点号\" order by \"本点号\"";
......@@ -64,6 +68,7 @@ bool CivInpDbHelper::getPipe(CivPipe& pipes)
mDbConn->queryResult(resultMap);
int toal = resultMap.size();
std::string repeatSn;
std::string repeatVaType;
std::string starNode;
......@@ -75,46 +80,55 @@ bool CivInpDbHelper::getPipe(CivPipe& pipes)
for (int i = 0; i < toal; i++)
{
std::map<std::string, std::string> tempMap = resultMap[i];
std::string sn = tempMap.find("本点号")->second;
std::string vaType = tempMap.find("类型")->second;
std::string pipeCode = tempMap.find(pipeTable.code)->second;
filterSet.insert(pipeCode);
filterSet.insert(pipeCode);
if (sn == repeatSn && repeatVaType == vaType && repeatVaType == "BV")
if (repeatVaType == "BV") // 止回阀,是管段的一部分,需要合并管段
{
CivPipe::PipesTable pipe;
pipe.ID = tempMap.find(pipeTable.snNo)->second;
std::string secondStartNode = tempMap.find(pipeTable.startPoint)->second;
std::string secondEndNode = tempMap.find(pipeTable.endPoint)->second;
if (starNode == repeatSn)
{
pipe.Node1 = secondStartNode;
pipe.Node2 = endNode;
}
else if(endNode == repeatSn)
if (sn == repeatSn && repeatVaType == vaType)
{
pipe.Node1 = starNode;
pipe.Node2 = secondEndNode;
CivPipe::PipesTable pipe;
pipe.ID = tempMap.find(pipeTable.snNo)->second;
std::string secondStartNode = tempMap.find(pipeTable.startPoint)->second;
std::string secondEndNode = tempMap.find(pipeTable.endPoint)->second;
if (starNode == repeatSn)
{
pipe.Node1 = secondStartNode;
pipe.Node2 = endNode;
}
else if (endNode == repeatSn)
{
pipe.Node1 = starNode;
pipe.Node2 = secondEndNode;
}
pipe.Length = tempMap.find(pipeTable.length)->second;
pipe.Diameter = tempMap.find(pipeTable.diameter)->second;
pipe.Roughness = tempMap.find(pipeTable.friction)->second;
pipe.MinorLoss = tempMap.find(pipeTable.localLoss)->second;
pipe.Status = tempMap.find(pipeTable.status)->second;
pipes.addItem(pipe);
}
repeatVaType = vaType;
repeatSn = sn;
starNode = tempMap.find(pipeTable.startPoint)->second;
endNode = tempMap.find(pipeTable.endPoint)->second;
pipe.Length = tempMap.find(pipeTable.length)->second;
pipe.Diameter = tempMap.find(pipeTable.diameter)->second;
pipe.Roughness = tempMap.find(pipeTable.friction)->second;
pipe.MinorLoss = tempMap.find(pipeTable.localLoss)->second;
pipe.Status = tempMap.find(pipeTable.status)->second;
} // 其他独立阀门处理
else
{
pipes.addItem(pipe);
}
repeatVaType = vaType;
repeatSn = sn;
starNode = tempMap.find(pipeTable.startPoint)->second;
endNode = tempMap.find(pipeTable.endPoint)->second;
}
std::vector<std::string> fields;
......@@ -128,7 +142,6 @@ bool CivInpDbHelper::getPipe(CivPipe& pipes)
fields.push_back(pipeTable.status);
fields.push_back(pipeTable.code);
std::vector<std::map<std::string, std::string>> resultVector;
std::string condition = " \"code\" not in (";
for (auto iter = filterSet.begin(); iter != filterSet.end(); iter++)
......@@ -319,7 +332,6 @@ bool CivInpDbHelper::getCoordinates(CivCoordinates& coord)
fields.push_back(nodeTable.yCoord);
fields.push_back(nodeTable.code);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector, mCondtion);
mDbConn->query(TANK, fields, resultVector, mCondtion);
......@@ -352,7 +364,6 @@ bool CivInpDbHelper::getQuality(CivQuality& quality)
fields.push_back(nodeTable.initQuality);
fields.push_back(nodeTable.chlorine);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector, mCondtion);
mDbConn->query(RESIVOIR, fields, resultVector,mCondtion);
......@@ -381,4 +392,123 @@ bool CivInpDbHelper::getQuality(CivQuality& quality)
}
return true;
}
bool CivInpDbHelper::getStatus(CivStatus& status)
{
ValveTable vaTable;
std::vector<std::string> fields;
fields.push_back(vaTable.sn);
fields.push_back(vaTable.fixedState);
fields.push_back(vaTable.type);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(VALVE, fields, resultVector);
size_t total = resultVector.size();
for (int i = 0; i < total; i++)
{
CivStatus::StatusTable statTable;
auto resMap = resultVector[i];
std::string state = resMap.find(vaTable.fixedState)->second;
std::string type = resMap.find(vaTable.type)->second;
std::transform(state.begin(), state.end(), state.begin(), ::toupper);
if (type == "BV")
continue;
statTable.ID = resMap.find(vaTable.sn)->second;
statTable.Setting = state;
status.addItem(statTable);
}
return true;
}
void CivInpDbHelper::handleValves()
{
PipeTable pipeTable;
// 注意去重
// 查找与阀门像连的管段
std::string sql = "select pipe.\"编号\", pipe.\"起始节点\", pipe.\"终止节点\", \
pipe.\"管长\", pipe.\"管径\", pipe.\"摩阻系数\",pipe.\"局损系数\",\
pipe.\"初始状态\",va.\"本点号\", pipe.\"code\", va.\"类型\" from \"管段\" as pipe,\
\"阀门\" as va where pipe.\"起始节点\" = va.\"本点号\" \
or pipe.\"终止节点\" = va.\"本点号\" order by \"本点号\"";
if (!mDbConn->execSql(sql))
{
return;
}
std::vector<std::map<std::string, std::string>> resultMap;
mDbConn->queryResult(resultMap);
int toal = resultMap.size();
std::string repeatSn;
std::string repeatVaType;
std::string starNode;
std::string endNode;
// 存储已拼接的管段CODE,为下面去重
std::set<std::string> filterSet;
for (int i = 0; i < toal; i++)
{
std::map<std::string, std::string> tempMap = resultMap[i];
std::string sn = tempMap.find("本点号")->second;
std::string vaType = tempMap.find("类型")->second;
std::string pipeCode = tempMap.find(pipeTable.code)->second;
filterSet.insert(pipeCode);
if (repeatVaType == "BV") // 止回阀,是管段的一部分,需要合并管段
{
if (sn == repeatSn && repeatVaType == vaType)
{
CivPipe::PipesTable pipe;
pipe.ID = tempMap.find(pipeTable.snNo)->second;
std::string secondStartNode = tempMap.find(pipeTable.startPoint)->second;
std::string secondEndNode = tempMap.find(pipeTable.endPoint)->second;
if (starNode == repeatSn)
{
pipe.Node1 = secondStartNode;
pipe.Node2 = endNode;
}
else if (endNode == repeatSn)
{
pipe.Node1 = starNode;
pipe.Node2 = secondEndNode;
}
pipe.Length = tempMap.find(pipeTable.length)->second;
pipe.Diameter = tempMap.find(pipeTable.diameter)->second;
pipe.Roughness = tempMap.find(pipeTable.friction)->second;
pipe.MinorLoss = tempMap.find(pipeTable.localLoss)->second;
pipe.Status = tempMap.find(pipeTable.status)->second;
}
repeatVaType = vaType;
repeatSn = sn;
starNode = tempMap.find(pipeTable.startPoint)->second;
endNode = tempMap.find(pipeTable.endPoint)->second;
} // 其他独立阀门处理
else
{
}
}
}
\ No newline at end of file
......@@ -20,6 +20,14 @@ public:
bool getReservoirs(CivReservoirs& reservoirs) override;
bool getCoordinates(CivCoordinates& coord) override;
bool getQuality(CivQuality& quality) override;
bool getStatus(CivStatus& status) override;
private:
// 处理阀门
void handleValves();
std::string mCondtion;
std::multimap<std::string,std::string> mValvePipeMap;
std::multimap<std::string, CivPipe::PipesTable> mPipesMap;
std::multimap<std::string, CivNode::NodeTable> mNodeMap; // 处理与阀门相连的管段
};
......@@ -137,10 +137,6 @@ bool CivInpHelperAbs::getSources(CivSources& sources)
return true;
}
bool CivInpHelperAbs::getStatus(CivStatus& status)
{
return true;
}
bool CivInpHelperAbs::getLabels(CivLabels& labels)
{
......
......@@ -30,6 +30,8 @@ public:
virtual bool getCoordinates(CivCoordinates& coord) =0;
virtual bool getQuality(CivQuality& quality)=0;
virtual bool getStatus(CivStatus& status) = 0;
void getSnToCode(std::map<std::string, std::string>& coord);
// 不要重载函数
......@@ -37,7 +39,6 @@ public:
bool getCurves(CivCurves& curves) ;
bool getDemands(CivDemands& demands) ;
bool getSources(CivSources& sources) ;
bool getStatus(CivStatus& status) ;
bool getLabels(CivLabels& labels) ;
bool getTags(CivTags& tags) ;
bool getMixing(CivMixing& mixing);
......
......@@ -16,7 +16,7 @@ CivProjInpDbHelper::~CivProjInpDbHelper()
void CivProjInpDbHelper::setProjCode(const std::string& projCode)
{
mPorjCode = projCode;
std::string mCondition = PROJFILED + " = " + projCode + "or "+PROJFILED +" is null or "+ PROJFILED +"=''";
std::string mCondition = PROJFILED + " = " + projCode;
}
bool CivProjInpDbHelper::getNode(CivNode& node)
......@@ -30,7 +30,7 @@ bool CivProjInpDbHelper::getNode(CivNode& node)
fields.push_back(nodeTableFields.demandPattern);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector, mCondition);
mDbConn->query(PIPENODE, fields, resultVector);
mDbConn->query(PROJ_PIPENODE, fields, resultVector, mCondition);
......@@ -54,7 +54,6 @@ bool CivProjInpDbHelper::getNode(CivNode& node)
bool CivProjInpDbHelper::getPipe(CivPipe& pipes)
{
PipeTable pipeTable;
std::vector<std::string> fields;
fields.push_back(pipeTable.snNo);
......@@ -66,9 +65,8 @@ bool CivProjInpDbHelper::getPipe(CivPipe& pipes)
fields.push_back(pipeTable.localLoss);
fields.push_back(pipeTable.status);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPELINE, fields, resultVector, mCondition);
mDbConn->query(PIPELINE, fields, resultVector);
mDbConn->query(PROJ_PIPELINE, fields, resultVector, mCondition);
size_t total = resultVector.size();
......@@ -109,7 +107,7 @@ bool CivProjInpDbHelper::getTank(CivTank& tanks)
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(TANK, fields, resultVector,mCondition);
mDbConn->query(TANK, fields, resultVector);
mDbConn->query(PROJ_TANK, fields, resultVector, mCondition);
size_t total = resultVector.size();
......@@ -146,8 +144,8 @@ bool CivProjInpDbHelper::getValve(CivValve& valves)
fields.push_back(vaveTable.lossCoeff);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(VALVE, fields, resultVector,mCondition);
mDbConn->query(PROJ_VALVE, fields, resultVector,mCondition);
mDbConn->query(VALVE, fields, resultVector);
mDbConn->query(PROJ_VALVE, fields, resultVector, mCondition);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
......@@ -179,9 +177,8 @@ bool CivProjInpDbHelper::getPumps(CivPumps& pumps)
fields.push_back(pmTable.headCurve);
fields.push_back(pmTable.power);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PUMP, fields, resultVector, mCondition);
mDbConn->query(PUMP, fields, resultVector);
mDbConn->query(PROJ_PUMP, fields, resultVector,mCondition);
size_t totals = resultVector.size();
......@@ -218,8 +215,8 @@ bool CivProjInpDbHelper::getReservoirs(CivReservoirs& reservoirs)
fields.push_back(restemTable.headPattern);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(RESIVOIR, fields, resultVector, mCondition);
mDbConn->query(PROJ_RESIVOIR, fields, resultVector,mCondition);
mDbConn->query(RESIVOIR, fields, resultVector);
mDbConn->query(PROJ_RESIVOIR, fields, resultVector, mCondition);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
......@@ -247,12 +244,12 @@ bool CivProjInpDbHelper::getCoordinates(CivCoordinates& coord)
fields.push_back(nodeTable.yCoord);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector, mCondition);
mDbConn->query(PIPENODE, fields, resultVector);
mDbConn->query(PROJ_PIPENODE, fields, resultVector, mCondition);
mDbConn->query(PROJ_PIPELINE, fields, resultVector, mCondition);
mDbConn->query(PROJ_RESIVOIR, fields, resultVector, mCondition);
mDbConn->query(TANK, fields, resultVector, mCondition);
mDbConn->query(RESIVOIR, fields, resultVector, mCondition);
mDbConn->query(TANK, fields, resultVector);
mDbConn->query(RESIVOIR, fields, resultVector);
size_t totals = resultVector.size();
for (int i = 0; i < totals; i++)
......@@ -279,10 +276,9 @@ bool CivProjInpDbHelper::getQuality(CivQuality& quality)
fields.push_back(nodeTable.sn);
fields.push_back(nodeTable.initQuality);
std::vector<std::map<std::string, std::string>> resultVector;
mDbConn->query(PIPENODE, fields, resultVector, mCondition);
mDbConn->query(RESIVOIR, fields, resultVector, mCondition);
mDbConn->query(PIPENODE, fields, resultVector);
mDbConn->query(RESIVOIR, fields, resultVector);
mDbConn->query(PROJ_PIPENODE, fields, resultVector, mCondition);
mDbConn->query(PROJ_RESIVOIR, fields, resultVector, mCondition);
......@@ -301,3 +297,7 @@ bool CivProjInpDbHelper::getQuality(CivQuality& quality)
return true;
}
bool CivProjInpDbHelper::getStatus(CivStatus& status)
{
return true;
}
\ No newline at end of file
......@@ -19,8 +19,10 @@ public:
bool getReservoirs(CivReservoirs& reservoirs) override;
bool getCoordinates(CivCoordinates& coord) override;
bool getQuality(CivQuality& quality) override;
bool getStatus(CivStatus& status) override;
void setProjCode(const std::string& projCode);
private:
std::string mPorjCode;
std::string mCondition;
......
......@@ -307,8 +307,8 @@ void CivSimulResDbHelper::getLinCodeSnMap(std::map<std::string, std::string>& ma
};
std::vector<std::map<std::string, std::string>> res;
if (!mConn->query(PIPELINE, fileds, res))
return;
mConn->query(PIPELINE, fileds, res);
size_t total = res.size();
for (int i = 0; i < total; i++)
......@@ -330,8 +330,7 @@ void CivSimulResDbHelper::getNodeCodeSnMap(std::map<std::string, std::string>& m
};
std::vector<std::map<std::string, std::string>> res;
if (!mConn->query(PIPENODE, fileds, res))
return;
mConn->query(PIPENODE, fileds, res);
size_t total = res.size();
for (int i = 0; i < total; i++)
......
#include "JsonParseObject.h"
JsonParseObject::JsonParseObject()
{
}
JsonParseObject::~JsonParseObject()
{
}
\ No newline at end of file
#pragma once
/**
json
*/
class JsonParseObject
{
public:
JsonParseObject();
~JsonParseObject();
};
\ No newline at end of file
This diff is collapsed.
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef cJSON__h
#define cJSON__h
#ifdef __cplusplus
extern "C"
{
#endif
/* cJSON Types: */
#define cJSON_False 0
#define cJSON_True 1
#define cJSON_NULL 2
#define cJSON_Number 3
#define cJSON_String 4
#define cJSON_Array 5
#define cJSON_Object 6
#define cJSON_IsReference 256
#define cJSON_StringIsConst 512
/* The cJSON structure: */
typedef struct cJSON {
struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
int type; /* The type of the item, as above. */
char *valuestring; /* The item's string, if type==cJSON_String */
int valueint; /* The item's number, if type==cJSON_Number */
double valuedouble; /* The item's number, if type==cJSON_Number */
char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
} cJSON;
typedef struct cJSON_Hooks {
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
} cJSON_Hooks;
/* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks* hooks);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
extern cJSON *cJSON_Parse(const char *value);
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */
extern char *cJSON_Print(cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */
extern char *cJSON_PrintUnformatted(cJSON *item);
/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */
extern char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt);
/* Delete a cJSON entity and all subentities. */
extern void cJSON_Delete(cJSON *c);
/* Returns the number of items in an array (or object). */
extern int cJSON_GetArraySize(cJSON *array);
/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */
extern cJSON *cJSON_GetArrayItem(cJSON *array,int item);
/* Get item "string" from object. Case insensitive. */
extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string);
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
extern const char *cJSON_GetErrorPtr(void);
/* These calls create a cJSON item of the appropriate type. */
extern cJSON *cJSON_CreateNull(void);
extern cJSON *cJSON_CreateTrue(void);
extern cJSON *cJSON_CreateFalse(void);
extern cJSON *cJSON_CreateBool(int b);
extern cJSON *cJSON_CreateNumber(double num);
extern cJSON *cJSON_CreateString(const char *string);
extern cJSON *cJSON_CreateArray(void);
extern cJSON *cJSON_CreateObject(void);
/* These utilities create an Array of count items. */
extern cJSON *cJSON_CreateIntArray(const int *numbers,int count);
extern cJSON *cJSON_CreateFloatArray(const float *numbers,int count);
extern cJSON *cJSON_CreateDoubleArray(const double *numbers,int count);
extern cJSON *cJSON_CreateStringArray(const char **strings,int count);
/* Append item to the specified array/object. */
extern void cJSON_AddItemToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
extern void cJSON_AddItemToObjectCS(cJSON *object,const char *string,cJSON *item); /* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object */
/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item);
/* Remove/Detatch items from Arrays/Objects. */
extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which);
extern void cJSON_DeleteItemFromArray(cJSON *array,int which);
extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string);
extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string);
/* Update array items. */
extern void cJSON_InsertItemInArray(cJSON *array,int which,cJSON *newitem); /* Shifts pre-existing items to the right. */
extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem);
extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
/* Duplicate a cJSON item */
extern cJSON *cJSON_Duplicate(cJSON *item,int recurse);
/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
need to be released. With recurse!=0, it will duplicate any children connected to the item.
The item->next and ->prev pointers are always zero on return from Duplicate. */
/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated);
extern void cJSON_Minify(char *json);
/* Macros for creating things quickly. */
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
#define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b))
#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
/* When assigning an integer value, it needs to be propagated to valuedouble too. */
#define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
#define cJSON_SetNumberValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
#ifdef __cplusplus
}
#endif
#endif
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
......@@ -78,6 +78,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\hModelProgram\Program\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
......@@ -152,12 +153,16 @@ copy CivDate.h $(OutDir)..\include /y</Command>
<ClInclude Include="CivCsvReader.h" />
<ClInclude Include="CivDate.h" />
<ClInclude Include="CivSysLog.h" />
<ClInclude Include="cJSON.h" />
<ClInclude Include="JsonParseObject.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="CivCommonUtils.cpp" />
<ClCompile Include="CivCsvReader.cpp" />
<ClCompile Include="CivDate.cpp" />
<ClCompile Include="CivSysLog.cpp" />
<ClCompile Include="cJSON.c" />
<ClCompile Include="JsonParseObject.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
......
......@@ -27,6 +27,12 @@
<ClInclude Include="CivDate.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="cJSON.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="JsonParseObject.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="CivSysLog.cpp">
......@@ -41,5 +47,11 @@
<ClCompile Include="CivDate.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="cJSON.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="JsonParseObject.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
#pragma once
class ComputerExamineUI : public CContainerUI
{
public:
ComputerExamineUI()
{
CDialogBuilder builder;
CContainerUI* pComputerExamine = static_cast<CContainerUI*>(builder.Create(_T("ComputerExamine.xml"), 0));
if( pComputerExamine ) {
this->Add(pComputerExamine);
}
else {
this->RemoveAll();
return;
}
}
};
class CDialogBuilderCallbackEx : public IDialogBuilderCallback
{
public:
CControlUI* CreateControl(LPCTSTR pstrClass)
{
if( _tcscmp(pstrClass, _T("ComputerExamine")) == 0 ) return new ComputerExamineUI;
return NULL;
}
};
\ No newline at end of file
#include "MainFrame.hpp"
MainFrame::MainFrame()
{
}
LPCTSTR MainFrame::GetWindowClassName() const
{
return _T("UIMainFrame");
}
UINT MainFrame::GetClassStyle() const
{
return CS_DBLCLKS;
}
void MainFrame::OnFinalMessage(HWND /*hWnd*/)
{
delete this;
}
void MainFrame::Init()
{
m_pCloseBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("closebtn")));
m_pMaxBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("maxbtn")));
m_pRestoreBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("restorebtn")));
m_pMinBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("minbtn")));
}
void MainFrame::OnPrepare()
{
}
void MainFrame::Notify(TNotifyUI& msg)
{
if (msg.sType == _T("windowinit")) OnPrepare();
else if (msg.sType == _T("click")) {
if (msg.pSender == m_pCloseBtn) {
PostQuitMessage(0);
return;
}
else if (msg.pSender == m_pMinBtn) {
SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0); return;
}
else if (msg.pSender == m_pMaxBtn) {
SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0); return;
}
else if (msg.pSender == m_pRestoreBtn) {
SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0); return;
}
}
else if (msg.sType == _T("selectchanged"))
{
CDuiString name = msg.pSender->GetName();
CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
if (name == _T("examine"))
pControl->SelectItem(0);
else if (name == _T("trojan"))
pControl->SelectItem(1);
else if (name == _T("plugins"))
pControl->SelectItem(2);
else if (name == _T("vulnerability"))
pControl->SelectItem(3);
else if (name == _T("rubbish"))
pControl->SelectItem(4);
else if (name == _T("cleanup"))
pControl->SelectItem(5);
else if (name == _T("fix"))
pControl->SelectItem(6);
else if (name == _T("tool"))
pControl->SelectItem(7);
}
}
LRESULT MainFrame::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
styleValue &= ~WS_CAPTION;
::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
m_pm.Init(m_hWnd);
CDialogBuilder builder;
CDialogBuilderCallbackEx cb;
CControlUI* pRoot = builder.Create(_T("hall.xml"), 0, &cb, &m_pm);
ASSERT(pRoot && "Failed to parse XML");
m_pm.AttachDialog(pRoot);
m_pm.AddNotifier(this);
Init();
return 0;
}
LRESULT MainFrame::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
bHandled = FALSE;
return 0;
}
LRESULT MainFrame::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
::PostQuitMessage(0L);
bHandled = FALSE;
return 0;
}
LRESULT MainFrame::OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if (::IsIconic(*this)) bHandled = FALSE;
return (wParam == 0) ? TRUE : FALSE;
}
LRESULT MainFrame::OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
return 0;
}
LRESULT MainFrame::OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
return 0;
}
LRESULT MainFrame::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
POINT pt; pt.x = GET_X_LPARAM(lParam); pt.y = GET_Y_LPARAM(lParam);
::ScreenToClient(*this, &pt);
RECT rcClient;
::GetClientRect(*this, &rcClient);
RECT rcCaption = m_pm.GetCaptionRect();
if (pt.x >= rcClient.left + rcCaption.left && pt.x < rcClient.right - rcCaption.right \
&& pt.y >= rcCaption.top && pt.y < rcCaption.bottom) {
CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(pt));
if (pControl && _tcscmp(pControl->GetClass(), DUI_CTR_BUTTON) != 0 &&
_tcscmp(pControl->GetClass(), DUI_CTR_OPTION) != 0 &&
_tcscmp(pControl->GetClass(), DUI_CTR_TEXT) != 0)
return HTCAPTION;
}
return HTCLIENT;
}
LRESULT MainFrame::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
SIZE szRoundCorner = m_pm.GetRoundCorner();
if (!::IsIconic(*this) && (szRoundCorner.cx != 0 || szRoundCorner.cy != 0)) {
CDuiRect rcWnd;
::GetWindowRect(*this, &rcWnd);
rcWnd.Offset(-rcWnd.left, -rcWnd.top);
rcWnd.right++; rcWnd.bottom++;
HRGN hRgn = ::CreateRoundRectRgn(rcWnd.left, rcWnd.top, rcWnd.right, rcWnd.bottom, szRoundCorner.cx, szRoundCorner.cy);
::SetWindowRgn(*this, hRgn, TRUE);
::DeleteObject(hRgn);
}
bHandled = FALSE;
return 0;
}
LRESULT MainFrame::OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
rcWork.Offset(-oMonitor.rcMonitor.left, -oMonitor.rcMonitor.top);
LPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam;
lpMMI->ptMaxPosition.x = rcWork.left;
lpMMI->ptMaxPosition.y = rcWork.top;
lpMMI->ptMaxSize.x = rcWork.right;
lpMMI->ptMaxSize.y = rcWork.bottom;
bHandled = FALSE;
return 0;
}
LRESULT MainFrame::OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
// 有时会在收到WM_NCDESTROY后收到wParam为SC_CLOSE的WM_SYSCOMMAND
if (wParam == SC_CLOSE) {
::PostQuitMessage(0L);
bHandled = TRUE;
return 0;
}
BOOL bZoomed = ::IsZoomed(*this);
LRESULT lRes = CWindowWnd::HandleMessage(uMsg, wParam, lParam);
if (::IsZoomed(*this) != bZoomed) {
if (!bZoomed) {
CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("maxbtn")));
if (pControl) pControl->SetVisible(false);
pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("restorebtn")));
if (pControl) pControl->SetVisible(true);
}
else {
CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("maxbtn")));
if (pControl) pControl->SetVisible(true);
pControl = static_cast<CControlUI*>(m_pm.FindControl(_T("restorebtn")));
if (pControl) pControl->SetVisible(false);
}
}
return lRes;
}
LRESULT MainFrame::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
switch (uMsg) {
case WM_CREATE: lRes = OnCreate(uMsg, wParam, lParam, bHandled); break;
case WM_CLOSE: lRes = OnClose(uMsg, wParam, lParam, bHandled); break;
case WM_DESTROY: lRes = OnDestroy(uMsg, wParam, lParam, bHandled); break;
case WM_NCACTIVATE: lRes = OnNcActivate(uMsg, wParam, lParam, bHandled); break;
case WM_NCCALCSIZE: lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled); break;
case WM_NCPAINT: lRes = OnNcPaint(uMsg, wParam, lParam, bHandled); break;
case WM_NCHITTEST: lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled); break;
case WM_SIZE: lRes = OnSize(uMsg, wParam, lParam, bHandled); break;
case WM_GETMINMAXINFO: lRes = OnGetMinMaxInfo(uMsg, wParam, lParam, bHandled); break;
case WM_SYSCOMMAND: lRes = OnSysCommand(uMsg, wParam, lParam, bHandled); break;
default:
bHandled = FALSE;
}
if (bHandled) return lRes;
if (m_pm.MessageHandler(uMsg, wParam, lParam, lRes)) return lRes;
return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
}
#ifndef MAINFRAME_HPP
#define MAINFRAME_HPP
#include "StdAfx.h"
#include "ControlEx.h"
class MainFrame : public CWindowWnd, public INotifyUI
{
public:
MainFrame();
LPCTSTR GetWindowClassName() const ;
UINT GetClassStyle() const;
void OnFinalMessage(HWND /*hWnd*/) ;
void Init();
void OnPrepare();
void Notify(TNotifyUI& msg);
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
public:
CPaintManagerUI m_pm;
private:
CButtonUI* m_pCloseBtn;
CButtonUI* m_pMaxBtn;
CButtonUI* m_pRestoreBtn;
CButtonUI* m_pMinBtn;
};
#endif // MAINFRAME_HPP
\ No newline at end of file
// stdafx.cpp : source file that includes just the standard includes
// App.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
#if defined _M_IX86
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
// stdafx.h: 标准系统包含文件的包含文件,
// 或是经常使用但不常更改的
// 项目特定的包含文件
//
#pragma once
#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_DEPRECATE
#include <windows.h>
#include <objbase.h>
#include "./DuiLib\UIlib.h"
using namespace DuiLib;
#ifdef _DEBUG
# ifdef _UNICODE
# pragma comment(lib, "..\\Lib\\DuiLib_ud.lib")
# else
# pragma comment(lib, "..\\Lib\\DuiLib_d.lib")
# endif
#else
# ifdef _UNICODE
# pragma comment(lib, "..\\Lib\\DuiLib_u.lib")
# else
# pragma comment(lib, "..\\..\\hModelProgram\\lib\\DuiLib.lib")
# endif
#endif
#include "targetver.h"
// C runtime header
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
// base header
#include "base/base.h"
#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
// duilib
#include "duilib/UIlib.h"
B// Microsoft Visual C++ generated resource script.
#include "stdafx.h"
#include "basic_form.h"
const std::wstring BasicForm::kClassName = L"Basic";
BasicForm::BasicForm()
{
}
BasicForm::~BasicForm()
{
}
std::wstring BasicForm::GetSkinFolder()
{
return L"basic";
}
std::wstring BasicForm::GetSkinFile()
{
return L"basic.xml";
}
std::wstring BasicForm::GetWindowClassName() const
{
return kClassName;
}
void BasicForm::InitWindow()
{
}
LRESULT BasicForm::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
PostQuitMessage(0L);
return __super::OnClose(uMsg, wParam, lParam, bHandled);
}
#pragma once
class BasicForm : public ui::WindowImplBase
{
public:
BasicForm();
~BasicForm();
/**
* 一下三个接口是必须要覆写的接口,父类会调用这三个接口来构建窗口
* GetSkinFolder 接口设置你要绘制的窗口皮肤资源路径
* GetSkinFile 接口设置你要绘制的窗口的 xml 描述文件
* GetWindowClassName 接口设置窗口唯一的类名称
*/
virtual std::wstring GetSkinFolder() override;
virtual std::wstring GetSkinFile() override;
virtual std::wstring GetWindowClassName() const override;
/**
* 收到 WM_CREATE 消息时该函数会被调用,通常做一些控件初始化的操作
*/
virtual void InitWindow() override;
/**
* 收到 WM_CLOSE 消息时该函数会被调用
*/
virtual LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
static const std::wstring kClassName;
};
//
// win_impl_base.hpp
// ~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2011 achellies (achellies at 163 dot com), wangchyz (wangchyz at gmail dot com)
//
// This code may be used in compiled form in any way you desire. This
// source file may be redistributed by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name is included.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage to you or your
// computer whatsoever. It's free, so don't hassle me about it.
//
// Beware of bugs.
// basic.cpp : 定义应用程序的入口点。
//
#include "stdafx.h"
#include "MainFrame.hpp"
#include "main.h"
#include "basic_form.h"
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int nCmdShow)
enum ThreadId
{
CPaintManagerUI::SetInstance(hInstance);
CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
CPaintManagerUI::SetResourceZip(_T("GameRes.zip"));
kThreadUI
};
HRESULT Hr = ::CoInitialize(NULL);
if (FAILED(Hr)) return 0;
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
MainFrame* pFrame = new MainFrame();
if (pFrame == NULL) return 0;
pFrame->Create(NULL, _T("PandaWater"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 1024, 738);
pFrame->CenterWindow();
::ShowWindow(*pFrame, SW_SHOW);
// 创建主线程
MainThread thread;
CPaintManagerUI::MessageLoop();
// 执行主线程循环
thread.RunOnCurrentThreadWithLoop(nbase::MessageLoop::kUIMessageLoop);
::CoUninitialize();
return 0;
}
\ No newline at end of file
}
void MainThread::Init()
{
nbase::ThreadManager::RegisterThread(kThreadUI);
// 获取资源路径,初始化全局参数
std::wstring theme_dir = nbase::win32::GetCurrentModuleDirectory();
#ifdef _DEBUG
// Debug 模式下使用本地文件夹作为资源
// 默认皮肤使用 resources\\themes\\default
// 默认语言使用 resources\\lang\\zh_CN
// 如需修改请指定 Startup 最后两个参数
ui::GlobalManager::Startup(theme_dir + L"resources\\", ui::CreateControlCallback(), false);
#else
// Release 模式下使用资源中的压缩包作为资源
// 资源被导入到资源列表分类为 THEME,资源名称为 IDR_THEME
// 如果资源使用的是本地的 zip 文件而非资源中的 zip 压缩包
// 可以使用 OpenResZip 另一个重载函数打开本地的资源压缩包
ui::GlobalManager::OpenResZip(MAKEINTRESOURCE(IDR_THEME), L"THEME", "");
//ui::GlobalManager::OpenResZip(L"resources.zip", "");
ui::GlobalManager::Startup(L"resources\\", ui::CreateControlCallback(), false);
#endif
// 创建一个默认带有阴影的居中窗口
BasicForm* window = new BasicForm();
window->Create(NULL, BasicForm::kClassName.c_str(), WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX, 0);
window->CenterWindow();
window->ShowWindow();
}
void MainThread::Cleanup()
{
ui::GlobalManager::Shutdown();
SetThreadWasQuitProperly(true);
nbase::ThreadManager::UnregisterThread();
}
#pragma once
#include "resource.h"
/** @class MainThread
* @brief 主线程(UI线程)类,继承 nbase::FrameworkThread
* @copyright (c) 2015, NetEase Inc. All rights reserved
* @author towik
* @date 2015/1/1
*/
class MainThread : public nbase::FrameworkThread
{
public:
MainThread() : nbase::FrameworkThread("MainThread") {}
virtual ~MainThread() {}
private:
/**
* 虚函数,初始化主线程
* @return void 无返回值
*/
virtual void Init() override;
/**
* 虚函数,主线程退出时,做一些清理工作
* @return void 无返回值
*/
virtual void Cleanup() override;
};
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
......@@ -37,7 +37,7 @@
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
......@@ -50,7 +50,7 @@
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
......@@ -76,16 +76,17 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\hModelProgram\Program\</OutDir>
<IncludePath>$(OUTDIR)..\include;$(IncludePath)</IncludePath>
<IncludePath>..\..\;$(OUTDIR)..\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\hModelProgram\Program\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\hModelProgram\Program\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<IncludePath>$(OUTDIR)..\include;$(IncludePath)</IncludePath>
<IncludePath>..\..\;$(OUTDIR)..\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
......@@ -93,6 +94,8 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
......@@ -108,6 +111,8 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalIncludeDirectories>..\;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
......@@ -122,6 +127,8 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
......@@ -138,25 +145,39 @@
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\;.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>duilib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>DuiLib.lib;base.lib;ui_components.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OUTDIR)..\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="basic_form.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="MainFrame.cpp" />
<ClCompile Include="StdAfx.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="ControlEx.h" />
<ClInclude Include="MainFrame.hpp" />
<ClInclude Include="basic_form.h" />
<ClInclude Include="main.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="StdAfx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<Image Include="basic.ico" />
<Image Include="small.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="basic.rc" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\hModelProgram\Program\resources.zip" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
......
......@@ -21,7 +21,7 @@
<ClCompile Include="StdAfx.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="MainFrame.cpp">
<ClCompile Include="basic_form.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
......@@ -29,11 +29,33 @@
<ClInclude Include="StdAfx.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="MainFrame.hpp">
<ClInclude Include="main.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="ControlEx.h">
<ClInclude Include="resource.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="basic_form.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="basic.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="small.ico">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="basic.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\..\hModelProgram\Program\resources.zip" />
</ItemGroup>
</Project>
\ No newline at end of file
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ 生成的包含文件。
// 供 basic.rc 使用
//
#define IDC_MYICON 2
#define IDD_BASIC_DIALOG 102
#define IDS_APP_TITLE 103
#define IDD_ABOUTBOX 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDI_BASIC 107
#define IDI_SMALL 108
#define IDC_BASIC 109
#define IDR_MAINFRAME 128
#define IDR_THEME1 129
#define IDR_THEME 129
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif
#pragma once
// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并
// 将 _WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
#include <SDKDDKVer.h>
......@@ -72,8 +72,8 @@
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.lib</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)..\libs\x64\</OutDir>
<IntDir>$(SolutionDir)..\tmp\$(PlatformName)\$(ProjectName)\$(Configuration)\</IntDir>
<OutDir>..\..\hModelProgram\lib\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IntDir>$(SolutionDir)..\tmp\$(PlatformName)\$(ProjectName)\$(Configuration)\</IntDir>
......
......@@ -78,7 +78,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(ProjectDir)..\tmp\$(PlatformName)\$(ProjectName)\$(Configuration)\</IntDir>
<OutDir>$(ProjectDir)..\libs\x64\</OutDir>
<OutDir>..\..\hModelProgram\lib\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
......@@ -167,7 +167,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>SUPPORT_CEF;UILIB_EXPORTS;UILIB_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>.\;..\;..\third_party\cef_wrapper\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.\;..\;..\third_party\cef_wrapper;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
......@@ -177,7 +177,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<AdditionalLibraryDirectories>..\libs\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\hModelProgram\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>nim_libcef.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/IGNORE:4006,4221 %(AdditionalOptions)</AdditionalOptions>
</Lib>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment