commit 19c4643c27e8ddd2698efc4ccd9b1b71a0eb3b3b Author: hongcj Date: Tue Jun 3 16:07:44 2025 +0800 first commit diff --git a/.vs/ConsoleApplication1/v14/.suo b/.vs/ConsoleApplication1/v14/.suo new file mode 100644 index 0000000..0af5f40 Binary files /dev/null and b/.vs/ConsoleApplication1/v14/.suo differ diff --git a/.vs/ConsoleApplication1/v16/.suo b/.vs/ConsoleApplication1/v16/.suo new file mode 100644 index 0000000..5c3ce3e Binary files /dev/null and b/.vs/ConsoleApplication1/v16/.suo differ diff --git a/.vs/ConsoleApplication1/v16/Browse.VC.db b/.vs/ConsoleApplication1/v16/Browse.VC.db new file mode 100644 index 0000000..87b6b00 Binary files /dev/null and b/.vs/ConsoleApplication1/v16/Browse.VC.db differ diff --git a/ConsoleApplication1.sdf b/ConsoleApplication1.sdf new file mode 100644 index 0000000..13e050e Binary files /dev/null and b/ConsoleApplication1.sdf differ diff --git a/ConsoleApplication1.sln b/ConsoleApplication1.sln new file mode 100644 index 0000000..e54d4bc --- /dev/null +++ b/ConsoleApplication1.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication1", "ConsoleApplication1\ConsoleApplication1.vcxproj", "{39CA478E-D529-44AC-B217-FEA59F529DA6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {39CA478E-D529-44AC-B217-FEA59F529DA6}.Debug|x64.ActiveCfg = Debug|x64 + {39CA478E-D529-44AC-B217-FEA59F529DA6}.Debug|x64.Build.0 = Debug|x64 + {39CA478E-D529-44AC-B217-FEA59F529DA6}.Debug|x86.ActiveCfg = Debug|Win32 + {39CA478E-D529-44AC-B217-FEA59F529DA6}.Debug|x86.Build.0 = Debug|Win32 + {39CA478E-D529-44AC-B217-FEA59F529DA6}.Release|x64.ActiveCfg = Release|x64 + {39CA478E-D529-44AC-B217-FEA59F529DA6}.Release|x64.Build.0 = Release|x64 + {39CA478E-D529-44AC-B217-FEA59F529DA6}.Release|x86.ActiveCfg = Release|Win32 + {39CA478E-D529-44AC-B217-FEA59F529DA6}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ConsoleApplication1/ConsoleApplication1.cpp b/ConsoleApplication1/ConsoleApplication1.cpp new file mode 100644 index 0000000..cdd3bee --- /dev/null +++ b/ConsoleApplication1/ConsoleApplication1.cpp @@ -0,0 +1,11 @@ +// ConsoleApplication1.cpp : ̨Ӧóڵ㡣 +// + +#include "stdafx.h" + + +int main() +{ + return 0; +} + diff --git a/ConsoleApplication1/ConsoleApplication1.vcxproj b/ConsoleApplication1/ConsoleApplication1.vcxproj new file mode 100644 index 0000000..14bddc6 --- /dev/null +++ b/ConsoleApplication1/ConsoleApplication1.vcxproj @@ -0,0 +1,179 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {39CA478E-D529-44AC-B217-FEA59F529DA6} + Win32Proj + ConsoleApplication1 + 8.1 + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Use + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE; IPLIB=none ;%(PreprocessorDefinitions) + true + C:\Siemens\Teamcenter13\include_cpp;C:\Siemens\Teamcenter13\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + C:\Siemens\Teamcenter13\lib\*.lib;%(AdditionalDependencies) + libuser_exits.ar.lib;%(IgnoreSpecificDefaultLibraries) + + + + + Level3 + NotUsing + MaxSpeed + true + true + NDEBUG; _CONSOLE ;IPLIB=none ;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + D:\WorkEnvironment\tc12ITK\dflittk\include;D:\WorkEnvironment\tc12ITK\dflittk\include_cpp;Z:\TC_install\105\c\tclib\include_cpp;Z:\TC_install\105\c\tclib\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + Z:\TC_install\105\c\tclib\lib\*.lib;D:\WorkEnvironment\tc12ITK\dflittk\lib\*.lib;%(AdditionalDependencies) + $(OutDir)ConsoleApplication1.dll + libuser_exits.ar.lib + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + \ No newline at end of file diff --git a/ConsoleApplication1/ConsoleApplication1.vcxproj.filters b/ConsoleApplication1/ConsoleApplication1.vcxproj.filters new file mode 100644 index 0000000..777d4d1 --- /dev/null +++ b/ConsoleApplication1/ConsoleApplication1.vcxproj.filters @@ -0,0 +1,63 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + \ No newline at end of file diff --git a/ConsoleApplication1/ConsoleApplication1.vcxproj.user b/ConsoleApplication1/ConsoleApplication1.vcxproj.user new file mode 100644 index 0000000..abe8dd8 --- /dev/null +++ b/ConsoleApplication1/ConsoleApplication1.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ConsoleApplication1/ReadMe.txt b/ConsoleApplication1/ReadMe.txt new file mode 100644 index 0000000..67d138c --- /dev/null +++ b/ConsoleApplication1/ReadMe.txt @@ -0,0 +1,30 @@ +======================================================================== + 控制台应用程序:ConsoleApplication1 项目概述 +======================================================================== + +应用程序向导已为您创建了此 ConsoleApplication1 应用程序。 + +本文件概要介绍组成 ConsoleApplication1 应用程序的每个文件的内容。 + + +ConsoleApplication1.vcxproj + 这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +ConsoleApplication1.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 + +ConsoleApplication1.cpp + 这是主应用程序源文件。 + +///////////////////////////////////////////////////////////////////////////// +其他标准文件: + +StdAfx.h, StdAfx.cpp + 这些文件用于生成名为 ConsoleApplication1.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。 + +///////////////////////////////////////////////////////////////////////////// +其他注释: + +应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/CL.command.1.tlog b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/CL.command.1.tlog new file mode 100644 index 0000000..59ed519 Binary files /dev/null and b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/CL.command.1.tlog differ diff --git a/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/CL.read.1.tlog b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/CL.read.1.tlog new file mode 100644 index 0000000..11accf3 Binary files /dev/null and b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/CL.read.1.tlog differ diff --git a/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/CL.write.1.tlog b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/CL.write.1.tlog new file mode 100644 index 0000000..8d9d08c Binary files /dev/null and b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/CL.write.1.tlog differ diff --git a/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/ConsoleApplication1.lastbuildstate b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/ConsoleApplication1.lastbuildstate new file mode 100644 index 0000000..60caa6c --- /dev/null +++ b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/ConsoleApplication1.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit +Release|Win32|C:\vs2015\Projects\ConsoleApplication1\| diff --git a/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/link.command.1.tlog b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/link.command.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/link.command.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/link.read.1.tlog b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/link.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/link.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/link.write.1.tlog b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/link.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/link.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/unsuccessfulbuild b/ConsoleApplication1/Release/ConsoleA.39CA478E.tlog/unsuccessfulbuild new file mode 100644 index 0000000..e69de29 diff --git a/ConsoleApplication1/Release/ConsoleApplication1.Build.CppClean.log b/ConsoleApplication1/Release/ConsoleApplication1.Build.CppClean.log new file mode 100644 index 0000000..9319dfc --- /dev/null +++ b/ConsoleApplication1/Release/ConsoleApplication1.Build.CppClean.log @@ -0,0 +1,12 @@ +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\consoleapplication1.pch +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\vc140.pdb +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\stdafx.obj +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\consoleapplication1.obj +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\connor_test.obj +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\connor_handler.obj +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\consolea.39ca478e.tlog\cl.command.1.tlog +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\consolea.39ca478e.tlog\cl.read.1.tlog +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\consolea.39ca478e.tlog\cl.write.1.tlog +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\consolea.39ca478e.tlog\link.command.1.tlog +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\consolea.39ca478e.tlog\link.read.1.tlog +c:\vs2015\projects\consoleapplication1\consoleapplication1\release\consolea.39ca478e.tlog\link.write.1.tlog diff --git a/ConsoleApplication1/Release/ConsoleApplication1.log b/ConsoleApplication1/Release/ConsoleApplication1.log new file mode 100644 index 0000000..289d34c --- /dev/null +++ b/ConsoleApplication1/Release/ConsoleApplication1.log @@ -0,0 +1,64 @@ +生成启动时间为 2022/10/24 16:46:31。 + 1>项目“C:\vs2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.vcxproj”在节点 2 上(Rebuild 个目标)。 + 1>ClCompile: + C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe /c /IC:\Siemens\Teamcenter13\include_cpp /IC:\Siemens\Teamcenter13\include /Zi /nologo /W3 /WX- /sdl /O2 /Oi /Oy- /GL /D WIN32 /D NDEBUG /D _CONSOLE /D IPLIB=none /D _WINDLL /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Yc"stdafx.h" /Fp"Release\ConsoleApplication1.pch" /Fo"Release\\" /Fd"Release\vc140.pdb" /Gd /TP /analyze- /errorReport:prompt stdafx.cpp + stdafx.cpp + C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe /c /IC:\Siemens\Teamcenter13\include_cpp /IC:\Siemens\Teamcenter13\include /Zi /nologo /W3 /WX- /sdl /O2 /Oi /Oy- /GL /D WIN32 /D NDEBUG /D _CONSOLE /D IPLIB=none /D _WINDLL /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Release\\" /Fd"Release\vc140.pdb" /Gd /TP /analyze- /errorReport:prompt connor_handler.cpp connor_test.cpp ConsoleApplication1.cpp + connor_handler.cpp + 1>C:\Siemens\Teamcenter13\include\pom/pom/pom.h(801): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + 1>C:\Siemens\Teamcenter13\include\pom/pom/pom.h(5415): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + 1>c:\vs2015\projects\consoleapplication1\consoleapplication1\connor_handler.h(9): warning C4067: 预处理器指令后有意外标记 - 应输入换行符 + 1>connor_handler.cpp(28): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\string.h(119): note: 参见“strcpy”的声明 + 1>connor_handler.cpp(37): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\string.h(119): note: 参见“strcpy”的声明 + 1>connor_handler.cpp(121): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\string.h(119): note: 参见“strcpy”的声明 + 1>connor_handler.cpp(130): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\string.h(119): note: 参见“strcpy”的声明 + 1>connor_handler.cpp(218): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\string.h(119): note: 参见“strcpy”的声明 + 1>connor_handler.cpp(227): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\string.h(119): note: 参见“strcpy”的声明 + 1>connor_handler.cpp(285): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\string.h(119): note: 参见“strcpy”的声明 + 1>connor_handler.cpp(283): warning C4996: 'strtok': This function or variable may be unsafe. Consider using strtok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\string.h(453): note: 参见“strtok”的声明 + 1>connor_handler.cpp(292): warning C4996: 'strtok': This function or variable may be unsafe. Consider using strtok_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\string.h(453): note: 参见“strtok”的声明 + connor_test.cpp + 1>C:\Siemens\Teamcenter13\include\pom/pom/pom.h(801): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + 1>C:\Siemens\Teamcenter13\include\pom/pom/pom.h(5415): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + 1>c:\vs2015\projects\consoleapplication1\consoleapplication1\connor_handler.h(9): warning C4067: 预处理器指令后有意外标记 - 应输入换行符 + 1>connor_test.cpp(15): warning C4101: “now”: 未引用的局部变量 + 1>connor_test.cpp(14): warning C4101: “temp2”: 未引用的局部变量 + 1>connor_test.cpp(14): warning C4101: “expire_date”: 未引用的局部变量 + 1>connor_test.cpp(14): warning C4101: “date_buf”: 未引用的局部变量 + 1>connor_test.cpp(16): warning C4101: “p”: 未引用的局部变量 + 1>connor_test.cpp(14): warning C4101: “env”: 未引用的局部变量 + 1>connor_test.cpp(14): warning C4101: “temp1”: 未引用的局部变量 + ConsoleApplication1.cpp + Link: + C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\vs2015\Projects\ConsoleApplication1\Release\ConsoleApplication1.dll" /INCREMENTAL:NO /NOLOGO "C:\Siemens\Teamcenter13\lib\*.lib" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NODEFAULTLIB:libuser_exits.ar.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /Debug /PDB:"C:\vs2015\Projects\ConsoleApplication1\Release\ConsoleApplication1.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG:incremental /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\vs2015\Projects\ConsoleApplication1\Release\ConsoleApplication1.lib" /MACHINE:X86 /SAFESEH /DLL Release\connor_handler.obj + Release\connor_test.obj + Release\ConsoleApplication1.obj + Release\stdafx.obj + 正在创建库 C:\vs2015\Projects\ConsoleApplication1\Release\ConsoleApplication1.lib 和对象 C:\vs2015\Projects\ConsoleApplication1\Release\ConsoleApplication1.exp + 1>connor_handler.obj : error LNK2001: 无法解析的外部符号 __imp__EPM_ask_root_task + 1>connor_handler.obj : error LNK2001: 无法解析的外部符号 __imp__AOM_set_value_string + 1>connor_handler.obj : error LNK2001: 无法解析的外部符号 __imp__EPM_ask_attachments + 1>connor_handler.obj : error LNK2001: 无法解析的外部符号 __imp__EMH_store_error_s1 + 1>connor_handler.obj : error LNK2001: 无法解析的外部符号 __imp__TC_printf + 1>connor_handler.obj : error LNK2001: 无法解析的外部符号 __imp__EMH_ask_error_text + 1>connor_handler.obj : error LNK2001: 无法解析的外部符号 __imp__AOM_ask_value_string + 1>connor_handler.obj : error LNK2001: 无法解析的外部符号 __imp__MEM_free + 1>connor_handler.obj : error LNK2001: 无法解析的外部符号 __imp__ITEM_ask_item_of_rev + 1>connor_handler.obj : error LNK2001: 无法解析的外部符号 __imp__ITK_ask_argument_named_value + 1>connor_test.obj : error LNK2001: 无法解析的外部符号 __imp__EPM_register_action_handler + 1>connor_test.obj : error LNK2001: 无法解析的外部符号 __imp__EPM_register_rule_handler + 1>C:\vs2015\Projects\ConsoleApplication1\Release\ConsoleApplication1.dll : fatal error LNK1120: 12 个无法解析的外部命令 + 1>已完成生成项目“C:\vs2015\Projects\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.vcxproj”(Rebuild 个目标)的操作 - 失败。 + +生成失败。 + +已用时间 00:00:08.54 diff --git a/ConsoleApplication1/Release/ConsoleApplication1.obj b/ConsoleApplication1/Release/ConsoleApplication1.obj new file mode 100644 index 0000000..6e5ee5e Binary files /dev/null and b/ConsoleApplication1/Release/ConsoleApplication1.obj differ diff --git a/ConsoleApplication1/Release/ConsoleApplication1.pch b/ConsoleApplication1/Release/ConsoleApplication1.pch new file mode 100644 index 0000000..6c01736 Binary files /dev/null and b/ConsoleApplication1/Release/ConsoleApplication1.pch differ diff --git a/ConsoleApplication1/Release/connor_handler.obj b/ConsoleApplication1/Release/connor_handler.obj new file mode 100644 index 0000000..c063625 Binary files /dev/null and b/ConsoleApplication1/Release/connor_handler.obj differ diff --git a/ConsoleApplication1/Release/connor_test.obj b/ConsoleApplication1/Release/connor_test.obj new file mode 100644 index 0000000..d7f19ef Binary files /dev/null and b/ConsoleApplication1/Release/connor_test.obj differ diff --git a/ConsoleApplication1/Release/stdafx.obj b/ConsoleApplication1/Release/stdafx.obj new file mode 100644 index 0000000..1adba28 Binary files /dev/null and b/ConsoleApplication1/Release/stdafx.obj differ diff --git a/ConsoleApplication1/Release/vc140.pdb b/ConsoleApplication1/Release/vc140.pdb new file mode 100644 index 0000000..eb83f41 Binary files /dev/null and b/ConsoleApplication1/Release/vc140.pdb differ diff --git a/ConsoleApplication1/connor_handler.cpp b/ConsoleApplication1/connor_handler.cpp new file mode 100644 index 0000000..c0e7b5e --- /dev/null +++ b/ConsoleApplication1/connor_handler.cpp @@ -0,0 +1,893 @@ +#include "connor_handler.h" +#include "stdafx.h" + + + +#include +#include + +#include + + + + + + + + + + + +/** +*жijǷ +*objtag ҪжϵĶ +*type_name ͵ +*/ +int checkIsTypeOrSubtype(tag_t objtag, char * type_name) { + //printf("жǷ%s\n", type_name); + tag_t type = NULLTAG; + ITKCALL(TCTYPE_ask_object_type(objtag, &type)); + tag_t item_type = NULLTAG; + ITKCALL(TCTYPE_find_type(type_name, "", &item_type)); + int is_type = 0; + if (item_type != NULLTAG) { + //printf("ҵ%s\n", type_name); + logical isok = FALSE; + ITKCALL(TCTYPE_is_type_of(type, item_type, &isok)); + if (isok) { + //printf("%s༰\n", type_name); + is_type = 1; + } + else { + //printf("%s༰\n", type_name); + is_type = 0; + } + } + else { + //printf("ûҵ%s\n", type_name); + } + return is_type; +} + + +// жϵĹϵļǷиù(bom,rev) +int hasThisGx(tag_t t_wl_bom, tag_t t_gx_rev) { + + tag_t t_wl_rev = NULL; + char *obj_str = NULL; + ITKCALL(AOM_ask_value_tag(t_wl_bom, "bl_line_object", &t_wl_rev)); + ITKCALL(AOM_ask_value_string(t_gx_rev, "item_id", &obj_str)); + + char *object_string = NULL; + tag_t ch_obj_rev = NULLTAG; + int ch_all_obj_num = 0; + tag_t *ch_all_obj = NULLTAG; + ITKCALL(AOM_ask_value_tags(t_wl_rev, "LB2_WLYGX", &ch_all_obj_num, &ch_all_obj)); + //ITKCALL(AOM_ask_value_tags(t_wl_rev, "IMAN_specification", &ch_all_obj_num, &ch_all_obj)); + for (int m = 0; m < ch_all_obj_num; m++) + { + char *object_string = NULL; + ITKCALL(AOM_ask_value_string(ch_all_obj[m], "item_id", &object_string)); + //printf("ӵid:%s\n", object_string); + if (strcmp(obj_str, object_string) == 0) + { + return 1; // У1 + } + + } + return 0; // ûУ0 +} + +// жϵĹϵļǷиù򣨴rev,rev +int hasThisGx2(tag_t t_wl_rev, tag_t t_gx_rev) { + + char *obj_str = NULL; + ITKCALL(AOM_ask_value_string(t_gx_rev, "item_id", &obj_str)); + + char *object_string = NULL; + tag_t ch_obj_rev = NULLTAG; + int ch_all_obj_num = 0; + tag_t *ch_all_obj = NULLTAG; + ITKCALL(AOM_ask_value_tags(t_wl_rev, "LB2_WLYGX", &ch_all_obj_num, &ch_all_obj)); + //ITKCALL(AOM_ask_value_tags(t_wl_rev, "IMAN_specification", &ch_all_obj_num, &ch_all_obj)); + for (int m = 0; m < ch_all_obj_num; m++) + { + char *object_string = NULL; + ITKCALL(AOM_ask_value_string(ch_all_obj[m], "item_id", &object_string)); + //printf("ӵid:%s\n", object_string); + if (strcmp(obj_str, object_string) == 0) + { + return 1; // У1 + } + + } + return 0; // ûУ0 +} + + +// ѹӽϵĹϵļ(bom,rev) + +void setGxInWl(tag_t wl_rev_line, tag_t gx_rev) { + + tag_t gx_item = NULL; // 汾Ĺ + ITKCALL(AOM_ask_value_tag(gx_rev, "items_tag", &gx_item)); + + tag_t wl_rev = NULL; + AOM_ask_value_tag(wl_rev_line, "bl_line_object", &wl_rev); + tag_t cs_type = NULLTAG; + ITKCALL(GRM_find_relation_type("LB2_WLYGX", &cs_type)); + + printf("ʼӹϵ\n"); + tag_t relation = NULLTAG; + ITKCALL(GRM_create_relation(wl_rev, gx_item, cs_type, NULLTAG, &relation)); + ITKCALL(GRM_save_relation(relation)); + printf("ӹϵ\n"); +} + +// ѹӽϵĹϵļ(rev,rev) + +void setGxInWl2(tag_t wl_rev, tag_t gx_rev) { + + tag_t gx_item = NULL; // 汾Ĺ + ITKCALL(AOM_ask_value_tag(gx_rev, "items_tag", &gx_item)); + + tag_t cs_type = NULLTAG; + ITKCALL(GRM_find_relation_type("LB2_WLYGX", &cs_type)); + + printf("ʼӹϵ\n"); + tag_t relation = NULLTAG; + ITKCALL(GRM_create_relation(wl_rev, gx_item, cs_type, NULLTAG, &relation)); + ITKCALL(GRM_save_relation(relation)); + printf("ӹϵ\n"); +} + +// жϺ͵ǰĹϵDzMEtarget +int isMEtarget(tag_t is_wl_rev) { + char *rev_string = NULL; + ITKCALL(AOM_UIF_ask_value(is_wl_rev, "bl_occ_type", &rev_string)); + if (strcmp(rev_string, "METarget") == 0) + { + return 1; + } + return 0; +} + +// ϰ汾µijϵļգrev:ϰ汾guanxi:ϵļͣ +void kakaka(tag_t rev, tag_t guanxi) { + + int num = 0; // ϵļĶ + tag_t *revs = NULLTAG; // ϵļĶб + GRM_list_secondary_objects_only(rev, guanxi,&num,&revs); + for (int i = 0; i < num; i++) + { + tag_t gx_relation = NULLTAG; + GRM_find_relation(rev, revs[i], guanxi, &gx_relation); + GRM_delete_relation(gx_relation); + } + +} + + +// LB_copy_gx +int LB_copy_gx(EPM_action_message_t msg) { + int att_cnt = 0, *arg_num = NULL; + tag_t task = NULLTAG, rootTask_tag = NULLTAG, *attachments = NULL; + char *arg = NULL, *argflag = NULL, **argvalue = NULL; + char type[128] = "", name[128] = ""; + char *str = "MEProcessRevision"; + + char *sType = NULL; + + tag_t type_tag = NULLTAG; + task = msg.task; + + + + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + + for (int i = 0; i < att_cnt; i++) + { + int is_type = 0; //ǰǷҪ + int c_num = 0; //ǰ϶汾 + int *c_level = NULL; + tag_t *p_tags = NULLTAG; //ǰи + tag_t *c_tags = NULLTAG; //ǰӶ + int cc_num = 0; //Ӷ + char *c_arg = NULL; //ǰӶid + char *blOccType = NULL; + is_type = checkIsTypeOrSubtype(attachments[i], str); //жǷ + + tag_t rev_tag = attachments[i]; + char* obj_str = NULL; + ITKCALL(AOM_ask_value_string(rev_tag, "object_string", &obj_str)); + + + + if (is_type) + { + printf("ǰĹΪ%s\n", obj_str); + + // жϸùǷĿ + tag_t *me_tags = NULLTAG; //յĿ + int me_num = 0; //յĿϵ + AOM_ask_value_tags(rev_tag, "IMAN_METarget", &me_num, &me_tags); + + + // Ŀ + for (int tt = 0; tt < me_num; tt++) + { + tag_t gx_gx_type = NULLTAG; + ITKCALL(GRM_find_relation_type("LB2_WLYGX", &gx_gx_type)); + // µָϵļĶȫе + printf("ʼ"); + kakaka(me_tags[tt], gx_gx_type); + printf(""); + } + + + int bvr_count = 0; + tag_t ebom_window = NULLTAG; + tag_t *bvr_list = NULL, bom_line = NULLTAG; + ITKCALL(ITEM_rev_list_bom_view_revs(rev_tag, &bvr_count, &bvr_list)); + if (bvr_count == 0) + { + //printf("BOMûͼ----%s\n", obj_str); + continue; + } + ITKCALL(BOM_create_window(&ebom_window)); + ITKCALL(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); + int child_cnt = 0; + tag_t *child_lines = NULL; + ITKCALL(BOM_line_ask_child_lines(bom_line, &child_cnt, &child_lines)); + if (child_cnt < 1) + { + //printf("BOMûӼ----%s\n", obj_str); + ITKCALL(BOM_close_window(ebom_window)); + continue; + } + + // еĹ,йϵ + for (int t = 0; t < child_cnt; t++) + { + // ù汾 + tag_t child_lines_rev = NULL; + AOM_ask_value_tag(child_lines[t], "bl_line_object", &child_lines_rev); + + char *str2 = "MEOPRevision"; + if (!checkIsTypeOrSubtype(child_lines_rev, str2)) + { + continue; + } + + // жϸùǷĿ + int wl_cnt = 0; + tag_t *wl_lines = NULL; + + // е + ITKCALL(BOM_line_ask_child_lines(child_lines[t], &wl_cnt, &wl_lines)); + + // ϣжǷĿ + for (int tt = 0; tt < wl_cnt; tt++) + { + // METarget + if (isMEtarget(wl_lines[tt])) { + tag_t gx_gx_type = NULLTAG; + ITKCALL(GRM_find_relation_type("LB2_WLYGX", &gx_gx_type)); + // µָϵļĶȫе + tag_t wl_rev = NULL; + ITKCALL(AOM_ask_value_tag(wl_lines[tt], "bl_line_object", &wl_rev)); + printf("ʼ"); + kakaka(wl_rev, gx_gx_type); + printf(""); + } + } + + } + + + int isME = 0; + // еĹ,йϵ + for (int t = 0; t < child_cnt; t++) + { + + // ù汾 + tag_t child_lines_rev = NULL; + AOM_ask_value_tag(child_lines[t], "bl_line_object", &child_lines_rev); + + char *str2 = "MEOPRevision"; + if (!checkIsTypeOrSubtype(child_lines_rev, str2)) + { + continue; + } + + + // жϸùǷĿ + int wl_cnt = 0; + tag_t *wl_lines = NULL; + + // е + ITKCALL(BOM_line_ask_child_lines(child_lines[t], &wl_cnt, &wl_lines)); + + int isME = 0; + // ϣжǷĿ + for (int tt = 0; tt < wl_cnt; tt++) + { + // METarget,áжbomǷиù򡱺 + if (isMEtarget(wl_lines[tt])) { + isME = 1; + // УжһĿϣûУ + // wl_lines[tt]:Ŀ child_lines_rev:ǰ汾 + if (hasThisGx(wl_lines[tt], child_lines_rev)) { + //printf("ùĿиù\n"); + } + else + { + // ĿûУ͹ȥ + //printf("ùĿûиù򣬹\n"); + setGxInWl(wl_lines[tt], child_lines_rev); + } + + } + } + + if (isME) + { + continue; + } + + int tx = t + 1; + // + for (tx; tx < child_cnt; tx++) + { + //printf("%d\n", tx); + char *cs = NULL; + AOM_ask_value_string(child_lines[tx], "object_string", &cs); + //printf("һǣ%s\n", cs); + + // ѯµĿ + + int next_child_cnt = 0; + tag_t *next_child_lines = NULL; + ITKCALL(BOM_line_ask_child_lines(child_lines[tx], &next_child_cnt, &next_child_lines)); + //printf("һBOM%d\n", next_child_cnt); + if (next_child_cnt < 1) + { + continue; + } + int next_isME = 0; + for (int next_t = 0; next_t < next_child_cnt; next_t++) + { + + // METarget,áжbomǷиù򡱺 + if (isMEtarget(next_child_lines[next_t])) { + next_isME = 1; + // УжһĿϣûУ + if (hasThisGx(next_child_lines[next_t], child_lines_rev)) { + //printf("ùĺĿиù\n"); + } + else + { + // ĿûУ͹ȥ + setGxInWl(next_child_lines[next_t], child_lines_rev); + //printf("ùĺĿûиù򣬹\n"); + } + } + } + if (next_isME == 1) + { + break; + } + //printf("ùȻûĿ\n"); + } + + // ûĿϣӹĿ + if (tx == child_cnt) + { + // me_num յĿϵ + for ( int m = 0; m < me_num; m++) + { + // me_tags յĿ + if (hasThisGx2(me_tags[m], child_lines_rev)) { + printf("ùĹյĿиù\n"); + } + else + { + // ĿûУ͹ȥ + setGxInWl2(me_tags[m], child_lines_rev); + printf("ùĹյĿûиù򣬹\n"); + } + } + } + + + } + ITKCALL(BOM_close_window(ebom_window)); + } + } + + + return ITK_ok; + + +} + +int LB2_Check_Code_Version_Rule(EPM_rule_message_t msg) { + int att_cnt = 0, *arg_num = NULL; + tag_t task = NULLTAG, rootTask_tag = NULLTAG, *attachments = NULL; + char *arg = NULL, *argflag = NULL, **argvalue = NULL; + char type[128] = "", name[128] = ""; + char *str = "LB2_SXMRevision"; + + char *sType = NULL; + + tag_t type_tag = NULLTAG; + task = msg.task; + + + + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); // ȡѡеж + + for (int i = 0; i < att_cnt; i++) + { + // ÿһ + + tag_t rev_tag = attachments[i]; + char* obj_str = NULL; + ITKCALL(AOM_ask_value_string(rev_tag, "object_string", &obj_str)); + printf("ǰΪ%s\n", obj_str); + int ch_num = 0; // Ӷ + tag_t *ch_obj = NULLTAG; // Ӷ + //ITKCALL(AOM_ask_value_tags(rev_tag, "ps_children", &ch_num, &ch_obj)); + + int is_type = 0; //ǰǷҪ + is_type = checkIsTypeOrSubtype(rev_tag, str); //жǷ + + char* s_rjlx = "A"; // + char* dmbb = NULL; // 汾 + char* rjlx = NULL; // + + + + if (is_type) + { + //printf("Ƿд\n"); + int dnum = 0; // 汾 + tag_t* lxd_tag_forms; // 汾 + ITKCALL(AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &dnum, &lxd_tag_forms)); // ȡ汾 + if (dnum == 0) + { + continue; + + } + tag_t lxdform = lxd_tag_forms[0]; + + char message[512] = "\0"; + strcat(message, obj_str); // Ϣ + + ITKCALL(AOM_ask_value_string(lxdform, "lb2_rjlx", &rjlx)); // ȡ + if (strcmp(rjlx, s_rjlx) == 0) // Aͣһ + { + //printf("A\n"); + ITKCALL(AOM_ask_value_string(lxdform, "lb2_dmbb", &dmbb)); // ȡ汾 + printf("ȡĴ汾Ϊ%s\n", dmbb); + char* c_dmbb = dmbb; + //printf("ƹĴ汾Ϊ%s\n", c_dmbb); + char *buf[10], *p; + int k = 0; + p = NULL; + /* + ָͬһַһεʱַ׵ַڶǷָ + ķָǿո񣬼 buf = "hello;world;123"㻹԰ ";" ָbuf + ʱڶд ";" + */ + int pi = 0; + p = strtok(c_dmbb, "."); + while (p) + { + if (pi == 3) + { + strcat(message, "汾[N.M.M]ʽ"); // Ϣ + + // * + EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + return EPM_nogo; + } + buf[pi] = p; + ++pi; + + // ٴε÷ָʱָҪΪNULL, Ҳĵһַָstr + // ڶҪ͵һεʱķָһ + p = strtok(NULL, "."); + } + for (k = 0; k < 3; ++k) + { + //printf("ָĴ汾Ϊ%s\n", buf[k]); + + int bb = atoi(buf[k]); + if (k == 0 && (bb <1 || bb > 255)) + { + strcat(message, "һַΧҪ1~255"); // Ϣ + + // * + EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + return EPM_nogo; + } + if (k == 1 && (bb <0 || bb > 255)) + { + strcat(message, "ڶַΧҪ0~255"); // Ϣ + + // * + EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + return EPM_nogo; + } + if (k == 2 && (bb <0 || bb > 255)) + { + strcat(message, "ַΧҪ0~255"); // Ϣ + + // * + EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + return EPM_nogo; + } + } + } + else + { + //printf("\n"); + ITKCALL(AOM_ask_value_string(lxdform, "lb2_dmbb", &dmbb)); // ȡ汾 + // 汾 + //printf("汾Ϊ%s\n",dmbb); + int strLen = strlen(dmbb); + //printf("汾Ϊ%d\n", strLen); + if (strLen > 3) + { + + int strLen2 = strlen(rjlx); // ͳ + + int l; + //жǰַǷ + for (l = 0; l < strLen2; l++) + { + if (!(rjlx[l] == dmbb[l])) + { + strcat(message, "еĴ汾δͿͷ"); + // + EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + return EPM_nogo; + } + } + // ȥ֮ijȲ + if (l + 3 != strLen) + { + strcat(message, "еĴ汾[]ָʽ"); + // + EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + return EPM_nogo; + } + //жϺַǷ + for (; l < strLen; l++) + { + if (dmbb[l] < '0' || dmbb[l] > '9') + { + strcat(message, "еĴ汾λָʽ"); + // + EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + return EPM_nogo; + } + } + } + else + { + strcat(message, "еĴ汾[]+ָʽ"); + // + EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + return EPM_nogo; + } + } + + } + + // ǰѡжӶ + //for (int j = 0; j < ch_num; j++) + //{ + // tag_t ch_tag = ch_obj[j]; + // is_type = checkIsTypeOrSubtype(ch_tag, str); //жǷ + // char* ch_str = NULL; + // ITKCALL(AOM_ask_value_string(ch_tag, "object_string", &ch_str)); + + // int chnum = 0; // 汾 + // tag_t* ch_tag_forms; // 汾 + // ITKCALL(AOM_ask_value_tags(ch_tag, "IMAN_master_form_rev", &chnum, &ch_tag_forms)); // ȡ汾 + // tag_t chform = ch_tag_forms[0]; + + // if (is_type) + // { + // char message[512] = "\0"; + // strcat(message, ch_str); // Ϣ + + // ITKCALL(AOM_ask_value_string(chform, "lb2_rjlx", &rjlx)); // ȡ + // if (strcmp(rjlx, s_rjlx) == 0) // Aͣһ + // { + // ITKCALL(AOM_ask_value_string(chform, "lb2_dmbb", &dmbb)); // ȡ汾 + // printf("ȡĴ汾Ϊ%s\n", dmbb); + // char* c_dmbb = dmbb; + // printf("ƹĴ汾Ϊ%s\n", c_dmbb); + // char *buf[10], *p; + // int k = 0; + // p = NULL; + // /* + // ָͬһַһεʱַ׵ַڶǷָ + // ķָǿո񣬼 buf = "hello;world;123"㻹԰ ";" ָbuf + // ʱڶд ";" + // */ + // int pi = 0; + // p = strtok(c_dmbb, "."); + // while (p) + // { + // if (pi == 3) + // { + // strcat(message, "汾[N.M.M]ʽ"); // Ϣ + + // // * + // EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + // return EPM_nogo; + // } + // buf[pi] = p; + // ++pi; + + // // ٴε÷ָʱָҪΪNULL, Ҳĵһַָstr + // // ڶҪ͵һεʱķָһ + // p = strtok(NULL, "."); + // } + // for (k = 0; k < 3; ++k) + // { + // //printf("ָĴ汾Ϊ%s\n", buf[k]); + + // int bb = atoi(buf[k]); + // if (k == 0 && (bb <1 || bb > 255)) + // { + // strcat(message, "һַΧҪ1~255"); // Ϣ + + // // * + // EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + // return EPM_nogo; + // } + // if (k == 1 && (bb <0 || bb > 255)) + // { + // strcat(message, "ڶַΧҪ0~255"); // Ϣ + + // // * + // EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + // return EPM_nogo; + // } + // if (k == 2 && (bb <0 || bb > 255)) + // { + // strcat(message, "ַΧҪ0~255"); // Ϣ + + // // * + // EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + // return EPM_nogo; + // } + // } + // } + // else + // { + // ITKCALL(AOM_ask_value_string(ch_tag, "lb2_dmbb", &dmbb)); // ȡ汾 + // // 汾 + // int strLen = strlen(dmbb); + // if (strLen > 3) + // { + + // int strLen2 = strlen(rjlx); // ͳ + + // int l; + // //жǰַǷ + // for (l = 0; l < strLen2; l++) + // { + // if (!(rjlx[l] == dmbb[l])) + // { + // strcat(message, "еĴ汾δͿͷ"); + // // + // EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + // return EPM_nogo; + // } + // } + // // ȥ֮ijȲ + // if (l+3 != strLen) + // { + // strcat(message, "еĴ汾[]ָʽ"); + // // + // EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + // return EPM_nogo; + // } + // //жϺַǷ + // for (; l < strLen; l++) + // { + // if (dmbb[l] < '0' || dmbb[l] > '9') + // { + // strcat(message, "еĴ汾λָʽ"); + // // + // EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + // return EPM_nogo; + // } + // } + // } + // else + // { + // strcat(message, "еĴ汾[]+ָʽ"); + // // + // EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + // return EPM_nogo; + // } + // } + + // } + + //} + + + + } + return EPM_go; +} +// ITKCALL(WSOM_ask_object_type2(c_tags[i], &sType)); // ˷ҲֱӻӶ + +int LB2_Dub_Check_Code_Version(EPM_rule_message_t msg) { + int att_cnt = 0, *arg_num = NULL; + tag_t task = NULLTAG, rootTask_tag = NULLTAG, *attachments = NULL; + char *arg = NULL, *argflag = NULL, **argvalue = NULL; + char type[128] = "", name[128] = ""; + + char *sType = NULL; + + tag_t type_tag = NULLTAG; + task = msg.task; + + + + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); // ȡѡеж + + for (int i = 0; i < att_cnt; i++) + { + // ÿһ + + tag_t rev_tag = attachments[i]; + char* obj_str = NULL; + ITKCALL(AOM_ask_value_string(rev_tag, "object_string", &obj_str)); + //int ch_num = 0; // Ӷ + //tag_t *ch_obj = NULLTAG; // Ӷ + //ITKCALL(AOM_ask_value_tags(rev_tag, "ps_children", &ch_num, &ch_obj)); + + int is_type = 0; //ǰǷҪ + is_type = checkIsTypeOrSubtype(rev_tag, "LB2_SXMRevision"); //жǷ + + //printf("ǰİ汾ǣ%s\n",obj_str); + + char message[512] = "\0"; + strcat(message, obj_str); // Ϣ + strcat(message, "[汾]ʷֵظͨ"); // Ϣ + + + + if (is_type) + { + int dnum = 0; // 汾 + tag_t* lxd_tag_forms; // 汾 + AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &dnum, &lxd_tag_forms); // ȡ汾 + if (dnum < 1) + { + printf("ǰѡеİ汾ûа汾жϣ\n"); + continue; // ǰѡеİ汾ûа汾жϣ + } + tag_t lxdform = lxd_tag_forms[0]; + + char* dmbb = NULL; // 汾 + ITKCALL(AOM_ask_value_string(lxdform, "lb2_dmbb", &dmbb)); // ȡ汾 + //printf("汾Ϊ%s\n", dmbb); + + + + // ȡǰ汾itemitemÿһ汾汾Ƿظ + tag_t item_tag = NULL; + tag_t* item_tag_revs = NULL; + int snum = 0; + ITEM_ask_item_of_rev(rev_tag, &item_tag); + ITKCALL(AOM_ask_value_tags(item_tag, "revision_list", &snum, &item_tag_revs)); // ȡа汾 + + int sum = 0; // ͵ǰ汾ͬİ汾; + + // ÿһ汾󣬻ȡ汾 + for (int k = 0; k < snum; k++) + { + tag_t ch_rev = item_tag_revs[k]; + int ch_num = 0; // 汾 + tag_t* ch_forms; // 汾 + ITKCALL(AOM_ask_value_tags(ch_rev, "IMAN_master_form_rev", &ch_num, &ch_forms)); // ȡ汾 + if (ch_num < 1) + { + continue; + } + tag_t chform = ch_forms[0]; + char* ch_dmbb = NULL; // 汾 + ITKCALL(AOM_ask_value_string(chform, "lb2_dmbb", &ch_dmbb)); // ȡ汾 + // İ汾͵ǰ汾ͬһһ򲻸ͨ + if (strcmp(ch_dmbb, dmbb) == 0) + { + sum = sum + 1; + } + } + if (sum > 1) + { + + EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + return EPM_nogo; + } + + + } + + + //for (int j = 0; j < ch_num; j++) + //{ + // tag_t rev_tag = ch_obj[j]; + // int is_type = 0; //ǰǷҪ + // is_type = checkIsTypeOrSubtype(rev_tag, str); //жǷ + + // char* ch_str = NULL; + // ITKCALL(AOM_ask_value_string(rev_tag, "object_string", &ch_str)); + + // if (is_type) + // { + // char message[512] = "\0"; + // strcat(message, ch_str); // Ϣ + // strcat(message, "[汾]ʷֵظͨ"); // Ϣ + + // int sum = 0; // ͵ǰ汾ͬİ汾; + // int dnum = 0; // 汾 + // tag_t* lxd_tag_forms; // 汾 + // ITKCALL(AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &dnum, &lxd_tag_forms)); // ȡ汾 + // tag_t lxdform = lxd_tag_forms[0]; + + // char* dmbb = NULL; // 汾 + // ITKCALL(AOM_ask_value_string(lxdform, "lb2_dmbb", &dmbb)); // ȡ汾 + // // ȡǰ汾itemitemÿһ汾汾Ƿظ + // tag_t item_tag = NULL; + // ITKCALL(AOM_ask_value_tag(rev_tag, "items_tag", &item_tag)); + // tag_t* item_tag_revs = NULL; + // int item_rev_num = 0; // item İ汾 + // ITKCALL(AOM_ask_value_tags(item_tag, "IMAN_master_form_rev", &item_rev_num, &item_tag_revs)); // ȡitemа汾 + + // // ÿһ汾󣬻ȡ汾 + // for (int k = 0; k < item_rev_num; k++) + // { + // tag_t ch_rev = item_tag_revs[k]; + // int ch_num = 0; // 汾 + // tag_t* ch_forms; // 汾 + // ITKCALL(AOM_ask_value_tags(ch_rev, "IMAN_master_form_rev", &ch_num, &ch_forms)); // ȡ汾 + // tag_t chform = ch_forms[0]; + // char* ch_dmbb = NULL; // 汾 + // ITKCALL(AOM_ask_value_string(chform, "lb2_dmbb", &ch_dmbb)); // ȡ汾 + // // İ汾͵ǰ汾ͬһһ򲻸ͨ + // if (strcmp(ch_dmbb, dmbb) == 0) + // { + // sum = sum + 1; + // } + // } + // if (sum > 1) + // { + // EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + // return EPM_nogo; + // } + // } + //} + } + + return EPM_go; +} + + + + + diff --git a/ConsoleApplication1/connor_handler.h b/ConsoleApplication1/connor_handler.h new file mode 100644 index 0000000..2153716 --- /dev/null +++ b/ConsoleApplication1/connor_handler.h @@ -0,0 +1,47 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include ; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int LB_copy_gx(EPM_action_message_t mag); + +int LB2_Check_Code_Version_Rule(EPM_rule_message_t mag); + +int LB2_Dub_Check_Code_Version(EPM_rule_message_t mag); + + diff --git a/ConsoleApplication1/connor_test.cpp b/ConsoleApplication1/connor_test.cpp new file mode 100644 index 0000000..3770824 --- /dev/null +++ b/ConsoleApplication1/connor_test.cpp @@ -0,0 +1,152 @@ +#include +#include +#include +#include +#include "connor_test.h" +#include "stdafx.h" +#include "sjjjy.h" +#include + +//̵õ +// ׼עṩ̵÷handler TC_save_msg + +extern DLLAPI int USERSERVICE_custom_register_handlers(int *decision, va_list args) +{ + char * operation = va_arg(args, char*); + printf("operation============================================================%s\n", operation); + int ifail = ITK_ok, n = 0; + char date_buf[80], *expire_date, env[512], temp1[512], temp2[512]; + time_t now; + struct tm *p; + + *decision = ALL_CUSTOMIZATIONS; + + int status = ITK_ok; + + + //action handler + (ifail = EPM_register_action_handler("Connor_AVIC_TransToPDF", "Connor_AVIC_TransToPDF", (EPM_action_handler_t)Connor_AVIC_TransToPDF)); + if (ifail == 0) { + printf("Registering action handler Connor_AVIC_TransToPDF successful\n"); + } + else { + printf("Registering action handler Connor_AVIC_TransToPDF failed %d\n", ifail); + } + + (ifail = EPM_register_action_handler("Connor_AVIC_Set_Property", "Connor_AVIC_Set_Property", (EPM_action_handler_t)Connor_AVIC_Set_Property)); + if (ifail == 0) { + printf("Registering action handler 1)Connor_AVIC_Set_Property successful\n"); + } + else { + printf("Registering action handler 1)Connor_AVIC_Set_Property failed %d\n", ifail); + } + + (ifail = EPM_register_action_handler("Connor_AVIC_Check_XYSX", "Connor_AVIC_Check_XYSX", (EPM_action_handler_t)Connor_AVIC_Check_XYSX)); + if (ifail == 0) { + printf("Registering action handler Connor_AVIC_Check_XYSX successful\n"); + } + else { + printf("Registering action handler Connor_AVIC_Check_XYSX failed %d\n", ifail); + } + + (ifail = EPM_register_action_handler("Connor_AVIC_Check_GetInfo", "Connor_AVIC_Check_GetInfo", (EPM_action_handler_t)Connor_AVIC_Check_GetInfo)); + if (ifail == 0) { + printf("Registering action handler Connor_AVIC_Check_GetInfo successful\n"); + } + else { + printf("Registering action handler Connor_AVIC_Check_GetInfo failed %d\n", ifail); + } + + + return ifail; +} +extern "C" int POM_AM__set_application_bypass(logical bypass); +int Connor_open_bypass(void* returnValue) +{ + POM_AM__set_application_bypass(true); + return 0; +} + +int Connor_close_bypass(void* returnValue) +{ + POM_AM__set_application_bypass(false); + return 0; +} +extern DLLAPI int USERSERVICE_custom_register_methods(int *decision, va_list args) +{ + + int + status = ITK_ok, + numberOfArguments = 0, + returnValueType = NULL, + *argumentList = NULL; + USER_function_t functionPtr; + METHOD_id_t mth_tag; + + //· + { + numberOfArguments = 1; + functionPtr = Connor_open_bypass; + argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int)); + argumentList[0] = USERARG_STRING_TYPE; + returnValueType = USERARG_VOID_TYPE; + char* mth_name = (char*)malloc(1 + sizeof(char) * strlen("CONNOR_open_bypass")); + tc_strcpy(mth_name, "CONNOR_open_bypass"); + ITKCALL(status = USERSERVICE_register_method(mth_name, functionPtr, numberOfArguments, + argumentList, returnValueType)); + MEM_free(argumentList); + if (status == ITK_ok) + { + printf("Method: %s\n", mth_name); + } + else + { + printf("Method register failed [%d]: %s\n", status, mth_name); + } + } + + //· + { + numberOfArguments = 1; + functionPtr = Connor_close_bypass; + argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int)); + argumentList[0] = USERARG_STRING_TYPE; + returnValueType = USERARG_VOID_TYPE; + char* mth_name = (char*)malloc(1 + sizeof(char) * strlen("CONNOR_close_bypass")); + tc_strcpy(mth_name, "CONNOR_close_bypass"); + ITKCALL(status = USERSERVICE_register_method(mth_name, functionPtr, numberOfArguments, + argumentList, returnValueType)); + MEM_free(argumentList); + if (status == ITK_ok) + { + printf("Method: %s\n", mth_name); + } + else + { + printf("Method register failed [%d]: %s\n", status, mth_name); + } + } + + + + numberOfArguments = 1; + functionPtr = TransToPDF; + argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int)); + argumentList[0] = USERARG_STRING_TYPE; + returnValueType = USERARG_VOID_TYPE, + status = USERSERVICE_register_method("TransToPDF", functionPtr, numberOfArguments,argumentList, returnValueType); + MEM_free(argumentList); + if (status == ITK_ok) + { + fprintf(stdout, "\n Registering TransToPDF finished\n"); + } + else + { + fprintf(stdout, "\n Registering TransToPDF failed %d\n", status); + } + + return ITK_ok; +} + + + diff --git a/ConsoleApplication1/connor_test.h b/ConsoleApplication1/connor_test.h new file mode 100644 index 0000000..3c48f4f --- /dev/null +++ b/ConsoleApplication1/connor_test.h @@ -0,0 +1,20 @@ + +#ifndef EPM_REGISTER_HANDLER_CUSTOM +#define EPM_REGISTER_HANDLER_CUSTOM + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + extern DLLAPI int USERSERVICE_custom_register_handlers(int *, va_list); + extern DLLAPI int USERSERVICE_custom_register_methods(int *decision, va_list args); + //USERSERVICE_custom_register_methods + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/ConsoleApplication1/main_lib.cpp b/ConsoleApplication1/main_lib.cpp new file mode 100644 index 0000000..4aff5ae --- /dev/null +++ b/ConsoleApplication1/main_lib.cpp @@ -0,0 +1,45 @@ +/** +* @headerfile tcua ͷļ +*/ + +#include +#include "connor_test.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + + + /** + * @fn extern "C" DLLAPI int liborigin_register_callbacks + * @return usually return ITK_ok + * @brief liborigin customization entry + * ˺й淶дdllƼ"_"ͷ + */ + DLLAPI int ConsoleApplication1_register_callbacks() + { + int ifail = ITK_ok; + TC_write_syslog("*******************************************************************************\n"); + TC_write_syslog("* ConsoleApplication1 register_callbacks is starting *\n"); + TC_write_syslog("*******************************************************************************\n"); + + fprintf(stdout, "\n ConsoleApplication1 עɹ\n"); + + + ITKCALL(ifail = CUSTOM_register_exit("ConsoleApplication1", "USERSERVICE_register_methods", + (CUSTOM_EXIT_ftn_t)USERSERVICE_custom_register_methods)); + fprintf(stdout, "\n ConsoleApplication1 registering USERSERVICE_custom_register_methods completed!\n"); + + + ITKCALL(ifail = CUSTOM_register_exit("ConsoleApplication1", "USER_gs_shell_init_module", + (CUSTOM_EXIT_ftn_t)USERSERVICE_custom_register_handlers)); + fprintf(stdout, "\n ConsoleApplication1 registering USERSERVICE_custom_register_handlers completed!\n"); + + + return ifail; + } + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/ConsoleApplication1/sjjjy.cpp b/ConsoleApplication1/sjjjy.cpp new file mode 100644 index 0000000..e20512a --- /dev/null +++ b/ConsoleApplication1/sjjjy.cpp @@ -0,0 +1,2498 @@ +#include "connor_handler.h" +#include "stdafx.h" +#include "ae/dataset.h" +#include "sa/sa.h" +#include +#include +#include +#include +#include +#include +#include "sjjjy.h" +#include +#include +#include
+#include +#include +#include +#include +#include +#include +#include +#include +#ifdef WIN32 +#include +#include +#include +#include +#else +#include +#endif + + +#include "tc_log.h" +#define ITK_err 919821 + + +extern "C" int POM_AM__set_application_bypass(logical bypass); + +using namespace std; + + +string getNum(int num) { + char str[3] = ""; + sprintf(str, "%02d", num); + return str; +} + +string getNow(char* format) { + time_t now = time(NULL); + tm* tm_t = localtime(&now); + string str = ""; + if (tc_strcmp(format, "yyyyMMdd") == 0) { + str.append(to_string(tm_t->tm_year + 1900)).append(getNum(tm_t->tm_mon + 1)).append(getNum(tm_t->tm_mday)); + } + else if (tc_strcmp(format, "LOG") == 0) {//yyyy-MM-dd HH:mi:ss + str.append(to_string(tm_t->tm_year + 1900)).append("-") + .append(getNum(tm_t->tm_mon + 1)).append("-") + .append(getNum(tm_t->tm_mday)).append(" ") + .append(getNum(tm_t->tm_hour)).append(":") + .append(getNum(tm_t->tm_min)).append(":") + .append(getNum(tm_t->tm_sec)); + } + return str; +} +/** +*жijǷ +*objtag ҪжϵĶ +*type_name ͵ +*/ +int checkIsTypeOrSubtype2(tag_t objtag, char * type_name) { + //printf("жǷ%s\n", type_name); + tag_t type = NULLTAG; + ITKCALL(TCTYPE_ask_object_type(objtag, &type)); + tag_t item_type = NULLTAG; + ITKCALL(TCTYPE_find_type(type_name, "", &item_type)); + int is_type = 0; + if (item_type != NULLTAG) { + //printf("ҵ%s\n", type_name); + logical isok = FALSE; + ITKCALL(TCTYPE_is_type_of(type, item_type, &isok)); + if (isok) { + //printf("%s༰\n", type_name); + is_type = 1; + } + else { + //printf("%s༰\n", type_name); + is_type = 0; + } + } + else { + //printf("ûҵ%s\n", type_name); + } + return is_type; +} + +/** +*vector ȥ +*/ +void DeleteDuplicated(vector &name) +{ + sort(name.begin(), name.end()); + name.erase(unique(name.begin(), name.end()), name.end()); +} + +int LB2_Check_WJBH(EPM_action_message_t msg) { + int att_cnt = 0, *arg_num = NULL; // att_cntѡеĶ + tag_t task = NULLTAG, rootTask_tag = NULLTAG, *attachments = NULL; + char *arg = NULL, *argflag = NULL, **argvalue = NULL; + char type[128] = "", name[128] = ""; + char *str = "MEProcessRevision"; + + char *sType = NULL; + + tag_t type_tag = NULLTAG; + task = msg.task; + + char message[2048] = "\0"; // Ϣ + int flag = 0; // ڱǷظ + + // òѯһȡѯ + tag_t query_tag1 = NULLTAG; + ITKCALL(QRY_find2("ļѯ", &query_tag1)); + tag_t query_tag2 = NULLTAG; + ITKCALL(QRY_find2("ղѯ", &query_tag2)); + tag_t query_tag3 = NULLTAG; + ITKCALL(QRY_find2("ѯ", &query_tag3)); + + if (query_tag1 == NULLTAG) + { + printf("δҵļѯ\n"); + return EPM_nogo; + } + if (query_tag2 == NULLTAG) + { + printf("δҵղѯ\n"); + return EPM_nogo; + } + if (query_tag3 == NULLTAG) + { + printf("δҵѯ\n"); + return EPM_nogo; + } + + + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + + POM_AM__set_application_bypass(true); // · + + for (int i = 0; i < att_cnt; i++) + { + tag_t rev_tag = attachments[i]; + char* obj_str = NULL; // + ITKCALL(AOM_ask_value_string(rev_tag, "object_string", &obj_str)); + printf("ǰǣ%s\n", obj_str); + //char* obj_id = NULL; // id + //ITKCALL(AOM_ask_value_string(rev_tag, "item_id", &obj_id)); + + vector < string > vec; + char *gxkbh[99]; // "lb2_gxkbh"ֵ + int index = 0; + //ITKCALL(AOM_set_value_strings(rev_tag, "lb2_gxkbh", 1, )); + + int sjj_num = 0; // 淶ϵļµĶ + tag_t *sjj_obj = NULLTAG; // 淶ϵļµĶ + + if (checkIsTypeOrSubtype2(attachments[i], "MEOPRevision") || + checkIsTypeOrSubtype2(attachments[i], "MEProcessRevision") ) { + printf("ǰΪհ汾汾\n"); + // IMAN_specification 淶ϵļ + ITKCALL(AOM_ask_value_tags(rev_tag, "IMAN_specification", &sjj_num, &sjj_obj)); + // ļÿһҳĶ + for (int j = 0; j < sjj_num; j++) + { + char* sjj_type = NULL; + ITKCALL(AOM_ask_value_string(sjj_obj[j], "object_type", &sjj_type)); + printf("ǰݼǣ%s\n", sjj_type); + //char* sjj_id = NULL; + //ITKCALL(AOM_ask_value_string(sjj_obj[j], "item_id", &sjj_id)); + // ǷݼʼԸ + if (strcmp(sjj_type, "MSExcelX") == 0 || strcmp(sjj_type, "LB2_CAD") == 0) + { + char *lb2_gxkbh = NULL; + // ȻȡݼµָԵֵ + ITKCALL(AOM_ask_value_string(sjj_obj[j], "lb2_gxkbh", &lb2_gxkbh)); + + // Ϊյֵȥ + if (strcmp(lb2_gxkbh, "") != 0) + { + // ַ鸳ֵַ齫Ƕlb2_gxkbhֵ + //gxkbh[index] = lb2_gxkbh; + //index++; + + int bbq = 0; + + if (vec.size() > 0 ) + { + vector< string >::iterator itBegin = vec.begin(); // ʼ + vector< string >::iterator itEnd = vec.end(); // + + while (itBegin != itEnd) + { + + + const char* p = (*itBegin).data(); + //printf("vecУ%s,ǰַǣ%s\n", p, lb2_gxkbh); + if (strcmp(p, lb2_gxkbh) == 0) + { + bbq = 1; + break; + + } + itBegin++; + } + } + + + if (bbq == 0) + { + vec.push_back(lb2_gxkbh); + + // vecûвأеĻ + char **cxtjz = (char **)MEM_alloc(sizeof(char *) * 1); // ѯֵ + cxtjz[0] = lb2_gxkbh; + char **cxtj1 = (char **)MEM_alloc(sizeof(char *) * 1); // ѯs + char **cxtj2 = (char **)MEM_alloc(sizeof(char *) * 1); + char **cxtj3 = (char **)MEM_alloc(sizeof(char *) * 1); + cxtj1[0] = "򿨱"; + cxtj2[0] = "򿨱"; + cxtj3[0] = "򿨱"; + + // òѯڶѯ󣬲ѯѯֵֵ + int n1 = 0, n2 = 0, n3 = 0; + tag_t *results = NULLTAG; + ITKCALL(QRY_execute(query_tag1, 1, cxtj1, cxtjz, &n1, &results)); + ITKCALL(QRY_execute(query_tag2, 1, cxtj2, cxtjz, &n2, &results)); + ITKCALL(QRY_execute(query_tag3, 1, cxtj3, cxtjz, &n3, &results)); + + //printf("%sֱ%d,%d,%d\n", lb2_gxkbh, n1, n2, n3); + //printf("%s\n", message); + + // һ1Ϊظ + if (n1>1 || n2>1 || n3>1) + { + strcat(message, obj_str); // Ϣ + strcat(message, "ļ"); // Ϣ + strcat(message, lb2_gxkbh); // Ϣ + strcat(message, "ظ;"); // Ϣ + flag = 1; + } + //printf("%s\n", message); + } + + + + + } + } + } + } + else if (checkIsTypeOrSubtype2(attachments[i], "LB2_GYWDRevision")) { + // IMAN_specification 淶ϵļ + ITKCALL(AOM_ask_value_tags(rev_tag, "LB2_FMWJ", &sjj_num, &sjj_obj)); + // ļÿһҳĶ + for (int j = 0; j < sjj_num; j++) + { + char* sjj_type = NULL; + ITKCALL(AOM_ask_value_string(sjj_obj[j], "object_type", &sjj_type)); + //char* sjj_id = NULL; + //ITKCALL(AOM_ask_value_string(sjj_obj[j], "item_id", &sjj_id)); + // ǷݼʼԸ + if (strcmp(sjj_type, "MSExcelX") == 0 || strcmp(sjj_type, "LB2_CAD") == 0) + { + char *lb2_gxkbh = NULL; + // ȻȡݼµָԵֵ + ITKCALL(AOM_ask_value_string(sjj_obj[j], "lb2_gxkbh", &lb2_gxkbh)); + + // Ϊյֵȥ + if (strcmp(lb2_gxkbh, "") != 0) + { + // ַ鸳ֵַ齫Ƕlb2_gxkbhֵ + //gxkbh[index] = lb2_gxkbh; + //index++; + + int bbq = 0; + + if (vec.size() > 0 ) + { + vector< string >::iterator itBegin = vec.begin(); // ʼ + vector< string >::iterator itEnd = vec.end(); // + + while (itBegin != itEnd) + { + + + const char* p = (*itBegin).data(); + if (strcmp(p, lb2_gxkbh) == 0) + { + bbq = 1; + break; + + } + itBegin++; + } + } + + if (bbq == 0) + { + vec.push_back(lb2_gxkbh); + + // vecûвŲأеĻ + char **cxtjz = (char **)MEM_alloc(sizeof(char *) * 1); // ѯֵ + cxtjz[0] = lb2_gxkbh; + char **cxtj1 = (char **)MEM_alloc(sizeof(char *) * 1); // ѯs + char **cxtj2 = (char **)MEM_alloc(sizeof(char *) * 1); + char **cxtj3 = (char **)MEM_alloc(sizeof(char *) * 1); + cxtj1[0] = "򿨱"; + cxtj2[0] = "򿨱"; + cxtj3[0] = "򿨱"; + + // òѯڶѯ󣬲ѯѯֵֵ + int n1 = 0, n2 = 0, n3 = 0; + tag_t *results = NULLTAG; + ITKCALL(QRY_execute(query_tag1, 1, cxtj1, cxtjz, &n1, &results)); + ITKCALL(QRY_execute(query_tag2, 1, cxtj2, cxtjz, &n2, &results)); + ITKCALL(QRY_execute(query_tag3, 1, cxtj3, cxtjz, &n3, &results)); + + // һ1Ϊظ + if (n1>1 || n2>1 || n3>1) + { + printf("ʼımessage\n"); + strcat(message, obj_str); // Ϣ + strcat(message, "ļ"); // Ϣ + strcat(message, lb2_gxkbh); // Ϣ + strcat(message, "ظ;"); // Ϣ + flag = 1; + } + } + } + } + } + } + + // Ըֵ + if (vec.size() > 0 ) + { + //DeleteDuplicated(vec); // ȶȥ + char** urls = (char **)MEM_alloc(sizeof(char *) * 1); + for (size_t i = 0; i < vec.size(); i++) { + urls[i] = (char*)vec[i].c_str(); + } + tag_t items_tag = NULL; + ITKCALL(AOM_ask_value_tag(rev_tag, "items_tag", &items_tag)); + char * stt = NULL; + ITKCALL(AOM_ask_value_string(items_tag, "object_string", &stt)); + AOM_lock(items_tag); + + ITKCALL(AOM_set_value_strings(items_tag, "lb2_gxkbh", vec.size(), urls)); + AOM_save(items_tag); + AOM_unlock(items_tag); + + AOM_refresh(items_tag, false); + + + // print + for (size_t j = 0; j < vec.size(); j++) { + // ƶ char* ָ + printf("%s\n", urls[j]); + printf("-----------------------ָ-------------\n"); + } + + } + + } + + POM_AM__set_application_bypass(false); // · + + // ˵ظֵ + if (flag ==1) + { + //POM_AM__set_application_bypass(false); // · + printf("ʼ\n"); + //EMH_store_error_s1(EMH_severity_information, EMH_USER_error_base, message); + + EMH_store_error_s1(EMH_severity_error, EMH_USER_error_base, message); + return 1; + + } + + + return ITK_ok; +} + +int import_dataset_file_binary(tag_t dataset, const char* temp_path, const char* ref_name, char* ext, char* fullfilename, char* original_name) +{ + int ifail = ITK_ok; + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor = NULL; + AOM_refresh(dataset, FALSE); + char* new_file_name = NULL; + char new_ds_name[WSO_name_size_c + 1] = ""; + char* filename = NULL; + new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + filename = strrchr(fullfilename, '\\') + 1; + if (filename == NULL) + return ITK_ok; + ITKCALL(ifail = IMF_import_file(fullfilename, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + + if (new_file_tag == NULL) { + printf("ʧ\n"); + return 0; + } + + ITKCALL(ifail = IMF_set_original_file_name2(new_file_tag, original_name)); + + ITKCALL(ifail = IMF_close_file(file_descriptor)); + ITKCALL(ifail = AOM_save(new_file_tag)); + AOM_unlock(new_file_tag); + ITKCALL(ifail = AOM_refresh(new_file_tag, FALSE)); + // + ITKCALL(ifail = AOM_lock(dataset)); + if (ifail != ITK_ok) { return ifail; } + ITKCALL(ifail = RES_checkout2(dataset, "import file", NULL, temp_path, 2)); + if (ifail != ITK_ok) { return ifail; } + ITKCALL(ifail = AE_remove_dataset_named_ref2(dataset, ref_name)); + if (ifail != ITK_ok) { return ifail; } + ITKCALL(ifail = AOM_save(dataset)); + ITKCALL(ifail = AE_add_dataset_named_ref2(dataset, ref_name, AE_PART_OF, new_file_tag)); + AOM_save(dataset); + ITKCALL(ifail = RES_checkin(dataset)); + AOM_unlock(dataset); + //ITKCALL( AOM_refresh( dataset, FALSE ) ); + return ifail; +} + +string GbkToUtf8(const char *src_str) { + int len = MultiByteToWideChar(CP_ACP, 0, src_str, -1, NULL, 0); + wchar_t* wstr = new wchar_t[len + 1]; + memset(wstr, 0, len + 1); + MultiByteToWideChar(CP_ACP, 0, src_str, -1, wstr, len); + len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); + char* str = new char[len + 1]; + memset(str, 0, len + 1); + WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL); + string strTemp = str; + if (wstr) delete[] wstr; + if (str) delete[] str; + return strTemp; +} + +string Utf8ToGbk(const char *src_str) { + int len = MultiByteToWideChar(CP_UTF8, 0, src_str, -1, NULL, 0); + wchar_t* wszGBK = new wchar_t[len + 1]; + memset(wszGBK, 0, len * 2 + 2); + MultiByteToWideChar(CP_UTF8, 0, src_str, -1, wszGBK, len); + len = WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, NULL, 0, NULL, NULL); + char* szGBK = new char[len + 1]; + memset(szGBK, 0, len + 1); + WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, szGBK, len, NULL, NULL); + string strTemp(szGBK); + if (wszGBK) delete[] wszGBK; + if (szGBK) delete[] szGBK; + return strTemp; +} + +void delchar(char* str, char c) +{ + int i = 0;//str[i]ʾԭַ + int j = 0;//str[j]ʾɾַַָ + while (str[i] != '\0') + { + //տʼָָԭַԪصַ + //ַָָҪɾַʱ + //strĿռַ˵strַָڶӦַ + if (str[i] != c) + { + str[j++] = str[i];//str[j++]Ҳһֱߵ + } + //str[i]жǷΪҪɾַָǾ͸str[j] + i++; + } + //һ'\0' + str[j] = str[i]; +} + + +void Split(string strArg, string spliter, vector &ans) +{ + ans.clear(); + size_t index0 = 0; + string one_arg; + if (strArg.find_first_not_of(' ') == string::npos) + strArg = ""; + while (strArg.size() > 0) + { + index0 = strArg.find_first_of(spliter); + if (index0 != string::npos) + { + one_arg = strArg.substr(0, index0); + strArg = strArg.substr(index0 + 1); + ans.push_back(one_arg); + } + else + { + ans.push_back(strArg); + break; + } + } +} +char *remove_suffix(char *file) { + char *last_dot = strrchr(file, '.'); + if (last_dot != NULL && strrchr(file, '\\') < last_dot) + *last_dot = '\0'; + return file; +} + + + + +int TransToPDF(void *returnValue) { + char * messageUser = NULL, *sType = NULL; + tag_t rev = NULLTAG, task = NULLTAG, *doc_tags = NULLTAG; + int doc_num = 0, spec_num = 0; + + string log_path = "";// getenv("temp"); + log_path.append("D:\\Siemens\\PDFTransLogs\\").append(getNow("yyyyMMdd")).append(".log"); + CreateLogFile(log_path.c_str()); + + USERARG_get_string_argument(&messageUser); + ITK__convert_uid_to_tag(messageUser, &rev); + char *os = NULL; + ITKCALL(AOM_ask_value_string(rev, "object_string", &os)); + WriteLog("%s ʼִת %s", getNow("LOG"), os); + ITKCALL(AOM_ask_value_tags(rev, "IMAN_specification", &spec_num, &doc_tags)); + for (int i = 0; i < spec_num; i++) + { + char *type = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &type)); + if (strcmp(type, "MSWordX") == 0) { + char *name = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_name", &name)); + char f = name[0]; + if (f > 47 && f < 58) { + doc_num = 2; + } + } + } + if (spec_num > 0) + { + WriteLog("ʼִļ"); + for (int i = 0; i < spec_num; i++) + { + char *type = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &type)); + if (strcmp(type, "MSWordX") == 0) + { + char *name = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_name", &name)); + if (doc_num > 1) { + char f = name[0]; + if (f < 48 || f > 57) { + continue; + } + } + WriteLog("type=%s\n", type); + tag_t spec_dataset_rev = NULLTAG, ref_object = NULLTAG; + AE_reference_type_t reference_type; + ITKCALL(AE_ask_dataset_latest_rev(doc_tags[i], &spec_dataset_rev)); + char ref_name[WSO_name_size_c + 1] = "word"; + ITKCALL(AE_ask_dataset_named_ref2(spec_dataset_rev, ref_name, &reference_type, &ref_object)); + WriteLog("ʼжtype"); + if (reference_type == AE_PART_OF) + { + char *pathname = NULL; + ITKCALL(IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname)); + char *origin_file_name = NULL; + ITKCALL(IMF_ask_original_file_name2(ref_object, &origin_file_name)); + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, "docx", 0); + char *temp_dir = getenv("temp"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, temp_dir); + strcat(temp_file, "\\"); + strcat(temp_file, new_file_name); + ITKCALL(IMF_export_file(ref_object, temp_file)); + WriteLog("ʼִcmd"); + char cmd[256] = ""; + strcpy(cmd, "D:\\Siemens\\Teamcenter12\\portal\\plugins\\plug\\SubstMacros-MSWord.wsf"); + strcat(cmd, " \""); + strcat(cmd, temp_file); + strcat(cmd, "\" "); + strcat(cmd, "D:\\Siemens\\Teamcenter12\\bin\\PDF.config.txt"); + strcat(cmd, " D:\\11.pdf"); + WriteLog("\n%s\n", cmd); + system(cmd); + WriteLog("cmdִ"); + tag_t *word_tags = NULLTAG; + int word_num = NULL; + ITKCALL(AOM_ask_value_tags(rev, "IMAN_Rendering", &word_num, &word_tags)); + tag_t pdf = NULLTAG; + for (int n = 0; n < word_num; n++) { + char *type2 = NULL; + char *pdfname = NULL; + ITKCALL(AOM_ask_value_string(word_tags[n], "object_type", &type2)); + //string newtype = Utf8ToGbk(type2); + //type2 = (char*)newtype.data(); + WriteLog("typeֵΪ%s:", type2); + + ITKCALL(AOM_ask_value_string(word_tags[n], "object_name", &pdfname)); + char *name1 = NULL; + char *name2 = NULL; + name1 = remove_suffix(pdfname); + name2 = remove_suffix(name); + if (strcmp(type2, "PDF") == 0) { + if (strcmp(name1, name2) == 0) { + pdf = word_tags[n]; + break; + } + else { + //ITKCALL(AOM_delete_from_parent(word_tags[n], rev)); + } + } + } + if (pdf == NULLTAG) { + WriteLog("ûҵPDFݼʼд %s\n", name); + int rfCount; + tag_t pdfTypeTag = NULLTAG, tool = NULLTAG, relationTag, *rfTags, newrelation; + + ITKCALL(AE_find_datasettype2("PDF", &pdfTypeTag)); + ITKCALL(AE_create_dataset_with_id(pdfTypeTag, name, "", "", "A", &pdf)); + ITKCALL(AE_ask_datasettype_def_tool(pdfTypeTag, &tool)); + ITKCALL(AE_set_dataset_tool(pdf, tool)); + ITKCALL(AE_set_dataset_format2(pdf, "PDF_Reference")); + ITKCALL(AOM_save(pdf)); + if (pdf == NULLTAG) { + WriteLog("ʧ\n"); + } + else { + WriteLog("ɹ\n"); + ITKCALL(GRM_find_relation_type("IMAN_Rendering", &relationTag)); + if (relationTag == NULLTAG) { + WriteLog("1111111111111111111111111111111"); + } + ITKCALL(GRM_list_secondary_objects_only(rev, relationTag, &rfCount, &rfTags)); + ITKCALL(GRM_create_relation(rev, pdf, relationTag, NULLTAG, &newrelation)); + ITKCALL(GRM_save_relation(newrelation)); + ITKCALL(AOM_unload(rev)); + ITKCALL(AOM_refresh(rev, true)); + } + } + + if (pdf != NULL) { + WriteLog("ѾPDFݼʼд %s\n", name); + /*ITKCALL(import_dataset_file_binary(pdf, "/tmp/", "PDF_Reference", "pdf", "D:\\11.pdf", strcat(name, ".pdf"))); + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor; + char failname[SS_MAXPATHLEN] = ""; + strcat(failname, name); + strcat(failname, ".pdf"); + ifstream f(failname); + if (f.good()) { + WriteLog("remove: %s\n", failname); + remove(failname); + } + ITKCALL(IMF_import_file("D:\\11.pdf", failname, SS_BINARY, &new_file_tag, &file_descriptor)); + ITKCALL(IMF_set_original_file_name2(new_file_tag, name)); + ITKCALL(IMF_close_file(file_descriptor)); + ITKCALL(AOM_save(new_file_tag)); + ITKCALL(AOM_unlock(new_file_tag)); + //WriteLog("complete import file \n"); + ITKCALL(AOM_lock(pdf)); + //ITKCALL(AE_remove_dataset_named_ref_by_tag2(pdf, "PDF_Reference", ref_object)); + ITKCALL(AE_remove_dataset_named_ref2(pdf, "PDF_Reference")); + //ITKCALL(AE_replace_dataset_named_ref(spec_dataset_rev,ref_object,ref_name,AE_PART_OF,new_file_tag)); + ITKCALL(AE_add_dataset_named_ref2(pdf, "PDF_Reference", AE_PART_OF, new_file_tag));*/ + ITKCALL(import_dataset_file_binary(pdf, "/tmp/", "PDF_Reference", "pdf", "D:\\11.pdf", strcat(name, ".pdf"))); + ITKCALL(AOM_save(pdf)); + ITKCALL(AOM_unlock(pdf)); + + ITKCALL(remove("D:\\11.pdf")); + WriteLog("ɾɹ"); + } + else { + WriteLog("ǰ汾ûIMAN_Renderingļ"); + } + } + } + else if (strcmp(type, "MSExcelX") == 0) { + if (doc_num > 1) { + char *name = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_name", &name)); + char f = name[0]; + if (f < 48 || f > 57) { + continue; + } + } + WriteLog("type=%s\n", type); + tag_t spec_dataset_rev = NULLTAG, ref_object = NULLTAG; + AE_reference_type_t reference_type; + AE_ask_dataset_latest_rev(doc_tags[i], &spec_dataset_rev); + char ref_name[WSO_name_size_c + 1] = "excel"; + AE_ask_dataset_named_ref2(spec_dataset_rev, ref_name, &reference_type, &ref_object); + if (reference_type == AE_PART_OF) + { + char *pathname = NULL; + ITKCALL(IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname)); + char *origin_file_name = NULL; + IMF_ask_original_file_name2(ref_object, &origin_file_name); + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, "xlsx", 0); + char *temp_dir = getenv("temp"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, temp_dir); + strcat(temp_file, "\\"); + strcat(temp_file, new_file_name); + + IMF_export_file(ref_object, temp_file); + char *name = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_name", &name)); + char cmd[256] = ""; + strcpy(cmd, "D:\\Siemens\\Teamcenter12\\portal\\plugins\\plug\\SubstMacros-MSExcel.wsf"); + strcat(cmd, " \""); + strcat(cmd, temp_file); + strcat(cmd, "\" "); + strcat(cmd, "D:\\Siemens\\Teamcenter12\\bin\\PDF.config.txt"); + strcat(cmd, " D:\\11.pdf"); + WriteLog("\n%s\n", cmd); + system(cmd); + WriteLog("cmdִ"); + tag_t *word_tags = NULLTAG; + int word_num = NULL; + ITKCALL(AOM_ask_value_tags(rev, "IMAN_Rendering", &word_num, &word_tags)); + tag_t pdf = NULLTAG; + for (int n = 0; n < word_num; n++) { + char *type2 = NULL; + char *pdfname = NULL; + ITKCALL(AOM_ask_value_string(word_tags[n], "object_type", &type2)); + ITKCALL(AOM_ask_value_string(word_tags[n], "object_name", &pdfname)); + char *name1 = NULL; + char *name2 = NULL; + name1 = remove_suffix(pdfname); + name2 = remove_suffix(name); + if (strcmp(type2, "PDF") == 0 && strcmp(name1, name2) == 0) { + pdf = word_tags[n]; + break; + } + } + if (pdf == NULLTAG) { + WriteLog("ûҵPDFݼʼд\n", name); + int rfCount; + tag_t pdfTypeTag = NULLTAG, tool = NULLTAG, relationTag, *rfTags, newrelation; + + ITKCALL(AE_find_datasettype2("PDF", &pdfTypeTag)); + ITKCALL(AE_create_dataset_with_id(pdfTypeTag, name, "", "", "A", &pdf)); + ITKCALL(AE_ask_datasettype_def_tool(pdfTypeTag, &tool)); + ITKCALL(AE_set_dataset_tool(pdf, tool)); + ITKCALL(AE_set_dataset_format2(pdf, "PDF_Reference")); + ITKCALL(AOM_save(pdf)); + if (pdf == NULLTAG) { + WriteLog("ʧ\n"); + } + else { + WriteLog("ɹ\n"); + POM_AM__set_application_bypass(true); // · + ITKCALL(GRM_find_relation_type("IMAN_Rendering", &relationTag)); + if (relationTag == NULLTAG) { + WriteLog("1111111111111111111"); + } + ITKCALL(GRM_list_secondary_objects_only(rev, relationTag, &rfCount, &rfTags)); + ITKCALL(GRM_create_relation(rev, pdf, relationTag, NULLTAG, &newrelation)); + ITKCALL(GRM_save_relation(newrelation)); + ITKCALL(AOM_unload(rev)); + ITKCALL(AOM_refresh(rev, true)); + POM_AM__set_application_bypass(false); // · + } + } + + if (pdf != NULL) { + WriteLog("ѾPDFݼʼд %s\n", name); + import_dataset_file_binary(pdf, "/tmp/", "PDF_Reference", "pdf", "D:\\11.pdf", strcat(name, ".pdf")); + remove("D:\\11.pdf"); + } + + } + } + } + + } + else { + WriteLog("ûҵļ"); + } + //WriteLog("123456789"); + WriteLog("תɡ"); + CloseLog(); + return ITK_ok; +} + + +int Connor_AVIC_Check_XYSX(EPM_action_message_t msg) { + int att_cnt = 0; + int doc_num = 0; + tag_t rootTask_tag = NULLTAG; + tag_t task = NULLTAG; + tag_t *attachments = NULLTAG; + tag_t *doc_tags = NULLTAG; + string error; + char *arg = NULL, *argflag = NULL ,*argvalue = NULL; + int arg_cnt = TC_number_of_arguments(msg.arguments); + char *Target = NULL, *Form = NULL, *CheckProperty = NULL; + task = msg.task; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (strcmp(argflag, "Target") == 0) { + if (argvalue != NULL) + { + printf("ȡTargetֵ:%s\n", argvalue); + Target = argvalue; + + } + } + if (strcmp(argflag, "Form") == 0) { + if (argvalue != NULL) + { + printf("ȡFormֵ:%s\n", argvalue); + Form = argvalue; + } + } + if (strcmp(argflag, "CheckProperty") == 0) { + if (argvalue != NULL) + { + printf("ȡCheckPropertyֵ:%s\n", argvalue); + CheckProperty = argvalue; + } + } + } + if (strcmp(Target, "target") == 0) { + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num, &doc_tags)); + } + else if (strcmp(Target, "reference") == 0) { + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_reference_attachment, &doc_num, &doc_tags)); + } + else { + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + ITKCALL(AOM_ask_value_tags(attachments[0], Target, &doc_num, &doc_tags)); + } + if (doc_num > 0) + { + printf("ʼִ\n"); + for (int i = 0; i < doc_num; i++) + { + char *type = NULL; + AOM_refresh(doc_tags[i], FALSE); + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &type)); + printf("Ŀtype:%s\n",type); + if (strcmp(type, Form) == 0) { + char *value1 = NULL; + char *value2 = NULL; + printf("ʼַָ%s\n", CheckProperty); + vector ans; + Split(CheckProperty, ";", ans); + if (ans.size() == 0) { + error = GbkToUtf8("ֵ[CheckProperty]"); + EMH_store_error_s1(EMH_severity_user_error, ITK_err, error.c_str()); + return 1; + } + int count = 0; + for (int j = 0; j < ans.size(); j++) { + value1 = (char*)ans[j].c_str(); + printf("value1:%s\n", value1); + vector vec1; + char *key1 = NULL; + char *val1 = NULL; + char *getValue = NULL; + Split(value1, "=", vec1); + if (vec1.size() != 2 ) { + error = GbkToUtf8("ֵ[CheckProperty]"); + EMH_store_error_s1(EMH_severity_user_error, ITK_err, error.c_str()); + return 1; + } + key1 = (char*)vec1[0].c_str(); + val1 = (char*)vec1[1].c_str(); + printf("key:%s\n", key1); + printf("value:%s\n", val1); + if (key1 == NULL || val1 == NULL) { + error = GbkToUtf8("ֵ[CheckProperty]"); + EMH_store_error_s1(EMH_severity_user_error, ITK_err, error.c_str()); + return 1; + } + else { + AOM_refresh(doc_tags[i], FALSE); + ITKCALL(AOM_ask_value_string(doc_tags[i], key1, &getValue)); + printf("getValue:%s\n", getValue); + if (strcmp(getValue, val1) == 0) { + count++; + } + else { + continue; + } + } + + } + printf("count:%d\s", count); + printf("ans.size():%d\s", ans.size()); + if (count == ans.size()) { + error = GbkToUtf8("BOMдϣڱȷǷͨ"); + EMH_store_error_s1(EMH_severity_user_error, ITK_err, error.c_str()); + return 1; + } + + } + } + } + else { + error = GbkToUtf8("̹ϵûжӦļ"); + EMH_store_error_s1(EMH_severity_user_error, ITK_err, error.c_str()); + return 1; + } + } + return 0; +} + + + + + +int Connor_AVIC_Set_Property(EPM_action_message_t msg) { + printf("·.....\n"); + POM_AM__set_application_bypass(true); // · + int att_cnt = 0; + int doc_num = 0; + tag_t rootTask_tag = NULLTAG; + tag_t task = NULLTAG; + tag_t *attachments = NULLTAG; + tag_t *doc_tags = NULLTAG; + logical isneed = false; + char *arg = NULL, *argflag = NULL ,*argvalue = NULL, + typeClass[TCTYPE_class_name_size_c + 1] = "\0"; + int arg_cnt = TC_number_of_arguments(msg.arguments); + char *Target = NULL, *Form = NULL, *CheckProperty = NULL; + task = msg.task; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (strcmp(argflag, "Target") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + Target = argvalue; + + } + } + if (strcmp(argflag, "Form") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + Form = argvalue; + } + } + if (strcmp(argflag, "CheckProperty") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + CheckProperty = argvalue; + } + } + } + if (strcmp(Target, "target") == 0) { + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &doc_num, &doc_tags)); + } + else if (strcmp(Target, "reference") == 0) { + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_reference_attachment, &doc_num, &doc_tags)); + } + else { + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + ITKCALL(AOM_ask_value_tags(attachments[0], Target, &doc_num, &doc_tags)); + } + + + if (doc_num > 0) + { + printf("ʼִ"); + for (int i = 0; i < doc_num; i++) + { + char *type = NULL; + + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &type)); + printf("type%s:",type); + if (strcmp(type, Form) == 0) { + char *key = NULL; + char *value = NULL; + printf("ʼַָ"); + vector ans; + Split(CheckProperty,"=",ans); + if (ans.size()>1) { + key = (char*)ans[0].c_str(); + value = (char*)ans[1].c_str(); + printf("key%s:", key); + printf("value%s:", value); + if (key == NULL || value == NULL) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", "ֵ"); + return 1; + } + else { + //ITKCALL(sscanf(CheckProperty, "%[^=]=%s", key, value)); + AOM_lock(doc_tags[i]); + ITKCALL(AOM_set_value_string(doc_tags[i], key, value)); + AOM_save(doc_tags[i]); + AOM_unlock(doc_tags[i]); + } + } + } + } + } + } + printf("·.....\n"); + POM_AM__set_application_bypass(false); // · + + return 0; +} + + +// жַǷΪַ +int isChineseChar(unsigned char c1, unsigned char c2, unsigned char c3) { + return (c1 >= 0xE0 && c1 <= 0xEF) && (c2 >= 0x80 && c2 <= 0xBF) && (c3 >= 0x80 && c3 <= 0xBF); +} + +// ַеַ滻Ϊ» +void replaceSpecialChars2(char* str) { + char* src = str; + char* dst = str; + while (*src) { + if (isalnum((unsigned char)*src) || *src == '_' || *src == '-') { + *dst++ = *src; + } + else if ((unsigned char)*src >= 0x80) { // ַֽģ + if (isChineseChar((unsigned char)*src, (unsigned char)*(src + 1), (unsigned char)*(src + 2))) { + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src; + } + else { + *dst++ = '_'; + } + } + else { + *dst++ = '_'; + } + src++; + } + *dst = '\0'; +} +void replaceSpecialChars(char* str) { + char* src = str; + char* dst = str; + char* dotPos = strrchr(str, '.'); // ҵһŵλ + + while (*src) { + if (dotPos && src >= dotPos) { + // ǰַڵֱ֮Ӹ + *dst++ = *src; + } + else { + if (isalnum((unsigned char)*src) || *src == '_' || *src == '-') { + *dst++ = *src; + } + else if ((unsigned char)*src >= 0x80) { // ַֽģ + if (isChineseChar((unsigned char)*src, (unsigned char)*(src + 1), (unsigned char)*(src + 2))) { + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src; + } + else { + *dst++ = '_'; + } + } + else { + *dst++ = '_'; + } + } + src++; + } + *dst = '\0'; +} + + + +#define MAX_BUFFER_SIZE 10000 + +size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) { + size_t totalSize = size * nmemb; + char* buffer = (char*)userp; + size_t currentLength = strlen(buffer); + + // ʣռֹ + if (currentLength + totalSize > MAX_BUFFER_SIZE) { + printf("Error: Response too large for buffer!\n"); + return 0; + } + + // ׷ݵ + strncat(buffer, (char*)contents, totalSize - 1); // 1Ϊ˱'\0'λ + buffer[currentLength + totalSize - 1] = '\0'; // ӽ + + return totalSize; +} + +char* sendPostRequest(const char* jsonPayload, const char* url) { + CURL* curl; + CURLcode res; + char readBuffer[MAX_BUFFER_SIZE]; + memset(readBuffer, 0, MAX_BUFFER_SIZE); + curl = curl_easy_init(); + if (curl) { + curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); + struct curl_slist* headers = NULL; + + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, readBuffer); + + headers = curl_slist_append(headers, "Content-Type: application/json"); + headers = curl_slist_append(headers, "Cookie: JSESSIONID=64EF3E9DDE22D9A15B9586AC83E60F15"); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); + + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, jsonPayload); + + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); // ֹ֤Զ֤ + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); // ֹ֤ + res = curl_easy_perform(curl); + + if (res != CURLE_OK) { + fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); + return NULL; + } + + curl_slist_free_all(headers); + curl_easy_cleanup(curl); + } + else { + printf("Failed to initialize curl.\n"); + return NULL; + } + + return readBuffer; +} + +bool isFileEmpty(const std::string& filePath) { + std::FILE* file = std::fopen(filePath.c_str(), "rb"); + if (!file) { + throw std::runtime_error("Failed to open file"); + } + + // Seek to the end of the file + if (std::fseek(file, 0, SEEK_END) != 0) { + std::fclose(file); + throw std::runtime_error("Failed to seek in file"); + } + + // Get the current position, which is now the end of the file + long fileSize = std::ftell(file); + + std::fclose(file); + + return fileSize == 0; +} + +void checkAndRemoveFile(const std::string& path) { + // ֱɾǵǰϵͳĬϱ룩 + if (_access(path.c_str(), 0) != -1) { + if (remove(path.c_str()) == 0) { + std::cout << "ļɾɹ: " << path << std::endl; + return; // ɹɾֱӷ + } + else { + perror("ļɾʧ"); + } + } + + // ʹ GBK · + std::string gbkPath = Utf8ToGbk(path.c_str()); + if (_access(gbkPath.c_str(), 0) != -1) { + if (remove(gbkPath.c_str()) == 0) { + std::cout << "ļɾɹ: " << gbkPath << std::endl; + return; // ɹɾֱӷ + } + else { + perror("ļɾʧ"); + } + } + + // Խ GBK תΪ UTF-8 ٴμ + std::string utf8Path = GbkToUtf8(path.c_str()); + if (_access(utf8Path.c_str(), 0) != -1) { + if (remove(utf8Path.c_str()) == 0) { + std::cout << "ļɾɹ: " << utf8Path << std::endl; + return; // ɹɾֱӷ + } + else { + perror("ļɾʧ"); + } + } + + // ļ + std::cout << "ļ: " << path << std::endl; +} + +int Connor_AVIC_TransToPDF(EPM_action_message_t mag) { + POM_AM__set_application_bypass(true); // · + int att_cnt = 0, * arg_num = NULL; // att_cntѡеĶ + int spec_num = 0, doc_num = 0; + tag_t task = NULLTAG, rootTask_tag = NULLTAG, * attachments = NULL, rev_class_id = NULLTAG; + tag_t* doc_tags = NULLTAG; + char* arg = NULL, * argflag = NULL, ** argvalue = NULL, * type = NULL; + char* str = "MEProcessRevision"; + char* sType = NULL; + + string log_path = "";// getenv("temp"); + log_path.append("D:\\Siemens\\PDFTransLogs\\").append(getNow("yyyyMMdd")).append(".log"); + CreateLogFile(log_path.c_str()); + WriteLog("ʼжǷΪ汾"); + ITKCALL(POM_class_id_of_class("ItemRevision", &rev_class_id)); + tag_t type_tag = NULLTAG; + task = mag.task; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + if (att_cnt > 0) { + for (int a = 0; a < att_cnt; a++) { + logical answer = false; + tag_t sub_class_id = NULLTAG; + ITKCALL(POM_class_of_instance(attachments[a], &sub_class_id)); + ITKCALL(POM_is_descendant(rev_class_id, sub_class_id, &answer)); + if (!answer) { + continue; + } + WriteLog("ȡ淶ϵ"); + ITKCALL(AOM_ask_value_tags(attachments[a], "IMAN_specification", &spec_num, &doc_tags)); + + char* os = NULL; + ITKCALL(AOM_ask_value_string(attachments[a], "object_string", &os)); + WriteLog("%s ʼִת %s", getNow("LOG"), os); + WriteLog("ѭ淶ϵ"); + vector filePaths; + char* uid; + POM_tag_to_uid(attachments[a], &uid); + if (spec_num == 0) { + continue; + } + for (int i = 0; i < spec_num; i++) + { + char* type = NULL; + char* documType = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &type)); + + if (strcmp(type, "MSWord") == 0 || strcmp(type, "MSWordX") == 0) { + documType = "word"; + } + else if (strcmp(type, "MSExcelX") == 0 || strcmp(type, "MSExcel") == 0) { + documType = "excel"; + } + else { + continue; + } + char* duid = NULL; + ITK__convert_tag_to_uid(doc_tags[i], &duid); + printf("uid:%s\n", duid); + + char* lastName = NULL; + int refCount = 0; + tag_t* refTags; + //ITKCALL(ifail = AE_ask_dataset_named_ref2(doc_tags[i], ref_name, &reference_type, &ref_object)); + ITKCALL(AOM_ask_value_tags(doc_tags[i], "ref_list", &refCount, &refTags)); + if (refCount > 0) { + ITKCALL(AOM_ask_value_string(refTags[0], "original_file_name", &lastName)); + replaceSpecialChars(lastName); + } + else { + printf("ûҵݼ\n"); + continue; + } + char* ruid = NULL; + ITK__convert_tag_to_uid(refTags[0], &ruid); + printf("ruid:%s\n", ruid); + + char sendname[SS_MAXPATHLEN] = ""; + strcat(sendname, "D:/WORDEXCELFOLDER/"); + strcat(sendname, lastName); + + // ļǷ + checkAndRemoveFile(sendname); + + + tag_t ref_object = NULLTAG; + printf("1"); + AE_reference_type_t reference_type; + printf("2"); + //char ref_name[WSO_name_size_c + 1] = "excel"; + ITKCALL(AE_ask_dataset_named_ref2(doc_tags[i], documType, &reference_type, &ref_object)); + printf("3"); + if (reference_type == AE_PART_OF) + { + ITKCALL(IMF_export_file(ref_object, sendname)); + // µַ + char* newSendname = new char[strlen(sendname) + 1]; + strcpy(newSendname, sendname); + + filePaths.push_back(newSendname); + } + } + //json + std::string jsonPayload = "{ \"revId\": \""; + jsonPayload += uid; + jsonPayload += "\", \"filePaths\": ["; + + for (size_t b = 0; b < filePaths.size(); ++b) { + jsonPayload += "\""; + jsonPayload += filePaths[b]; + jsonPayload += "\""; + if (b < filePaths.size() - 1) { + jsonPayload += ", "; + } + } + + jsonPayload += "] }"; + + printf("\njsonPayload:%s\n", jsonPayload.c_str()); + + //Post + const char* url = "http://127.0.0.1:13022/api/TransToPDFMQ"; + char* response = sendPostRequest(jsonPayload.c_str(), url); + if (response) { + WriteLog("POSTͳɹӦ: %s", response); + } + else { + WriteLog("POSTʧ"); + } + + } + POM_AM__set_application_bypass(false); // · + WriteLog("תɡ"); + CloseLog(); + return ITK_ok; + + } +} + + + + +int Connor_AVIC_TransToPDF2(EPM_action_message_t mag) { + POM_AM__set_application_bypass(true); // · + int att_cnt = 0, *arg_num = NULL; // att_cntѡеĶ + int spec_num = NULL, doc_num = 0; + tag_t task = NULLTAG, rootTask_tag = NULLTAG, *attachments = NULL, rev_class_id = NULLTAG; + tag_t *doc_tags = NULLTAG; + char *arg = NULL, *argflag = NULL, **argvalue = NULL, *type = NULL; + char *str = "MEProcessRevision"; + char *sType = NULL; + + string log_path = "";// getenv("temp"); + log_path.append("D:\\Siemens\\PDFTransLogs\\").append(getNow("yyyyMMdd")).append(".log"); + CreateLogFile(log_path.c_str()); + WriteLog("ʼжǷΪ汾"); + ITKCALL(POM_class_id_of_class("ItemRevision", &rev_class_id)); + tag_t type_tag = NULLTAG; + task = mag.task; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + if (att_cnt>0) { + for (int a = 0; a < att_cnt;a++) { + logical answer = false; + tag_t sub_class_id = NULLTAG; + ITKCALL(POM_class_of_instance(attachments[a], &sub_class_id)); + ITKCALL(POM_is_descendant(rev_class_id, sub_class_id, &answer)); + if (!answer) { + continue; + } + WriteLog("ȷΪ汾󣬼"); + try { + WriteLog("ȡ淶ϵ"); + ITKCALL(AOM_ask_value_tags(attachments[a], "IMAN_specification", &spec_num, &doc_tags)); + } + catch(...){ + continue; + } + char *os = NULL; + ITKCALL(AOM_ask_value_string(attachments[a], "object_string", &os)); + WriteLog("%s ʼִת %s", getNow("LOG"), os); + WriteLog("ѭ淶ϵ"); + for (int i = 0; i < spec_num; i++) + { + char *type = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &type)); + WriteLog("жݼǷMSWordX"); + if (strcmp(type, "MSWordX") == 0) { + + char *name = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_name", &name)); + WriteLog("ȡݼǷֿͷ %s", name); + char f = name[0]; + if (f > 47 && f < 58) { + WriteLog("ֿͷ"); + doc_num = 2; + } + else { + WriteLog("ֿͷ"); + } + } + } + //ITKCALL(AOM_ask_value_tags(attachments[0],"root_target_attachment", &doc_num, &doc_tags)); + if (spec_num > 0) + { + WriteLog("ʼִļ"); + for (int i = 0; i < spec_num; i++) + { + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_type", &type)); + WriteLog("ȡΪMSWordXʼִ"); + if (strcmp(type, "MSWordX") == 0) + { + WriteLog("doc_num %d", doc_num); + WriteLog("жǷֿͷ"); + if (doc_num > 1) { + char *name = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_name", &name)); + char f = name[0]; + if (f < 48 || f > 57) { + WriteLog("Ʋֿͷֱ˳ǰѭ"); + continue; + } + } + //ȡݼ + char* lastName = NULL; + int refCount = 0; + tag_t* refTags; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "ref_list", &refCount,&refTags)); + if (refCount>0) { + ITKCALL(AOM_ask_value_string(refTags[0], "original_file_name", &lastName)); + replaceSpecialChars(lastName); + } + else { + printf("ûҵ"); + } + WriteLog("type=%s\n", type); + tag_t spec_dataset_rev = NULLTAG, ref_object = NULLTAG; + AE_reference_type_t reference_type; + ITKCALL(AE_ask_dataset_latest_rev(doc_tags[i], &spec_dataset_rev)); + char ref_name[WSO_name_size_c + 1] = "word"; + ITKCALL(AE_ask_dataset_named_ref2(spec_dataset_rev, ref_name, &reference_type, &ref_object)); + WriteLog("ʼжtype"); + if (reference_type == AE_PART_OF) + { + char *pathname = ""; + ITKCALL(IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname)); + char *origin_file_name = ""; + ITKCALL(IMF_ask_original_file_name2(ref_object, &origin_file_name)); + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, "docx", 0); + char *temp_dir = getenv("temp"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, temp_dir); + strcat(temp_file, "\\"); + strcat(temp_file, new_file_name); + ITKCALL(IMF_export_file(ref_object, temp_file)); + char *name = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_name", &name)); + WriteLog("ʼִcmd"); + char cmd[256] = ""; + strcpy(cmd, "D:\\Siemens\\Teamcenter12\\portal\\plugins\\plug\\SubstMacros-MSWord.wsf"); + strcat(cmd, " \""); + strcat(cmd, temp_file); + strcat(cmd, "\" "); + strcat(cmd, "D:\\Siemens\\Teamcenter12\\bin\\PDF.config.txt"); + strcat(cmd, " D:\\11.pdf"); + WriteLog("\n%s\n", cmd); + system(cmd); + WriteLog("cmdִ"); + tag_t *word_tags = NULLTAG; + int word_num = NULL; + + ITKCALL(AOM_ask_value_tags(attachments[a], "IMAN_Rendering", &word_num, &word_tags)); + tag_t pdf = NULLTAG; + for (int n = 0; n < word_num; n++) { + char *type = ""; + char *pdfname = ""; + ITKCALL(AOM_ask_value_string(word_tags[n], "object_type", &type)); + string newtype = Utf8ToGbk(type); + type = (char*)newtype.data(); + WriteLog("typeֵΪ%s:", type); + + ITKCALL(AOM_ask_value_string(word_tags[n], "object_name", &pdfname)); + char *name1 = NULL; + char *name2 = NULL; + name1 = pdfname; + name2 = name; + if (strcmp(type, "PDF") == 0 && strcmp(name1, name2) == 0) { + pdf = word_tags[n]; + break; + } + } + if (pdf == NULLTAG) { + WriteLog("ûҵPDFݼʼд\n", lastName); + int rfCount; + tag_t pdfTypeTag = NULLTAG, tool = NULLTAG, relationTag, *rfTags, newrelation; + + ITKCALL(AE_find_datasettype2("PDF", &pdfTypeTag)); + ITKCALL(AE_create_dataset_with_id(pdfTypeTag, lastName, "", "", "A", &pdf)); + ITKCALL(AE_ask_datasettype_def_tool(pdfTypeTag, &tool)); + AOM_lock(pdf); + ITKCALL(AE_set_dataset_tool(pdf, tool)); + ITKCALL(AE_set_dataset_format2(pdf, "PDF_Reference")); + ITKCALL(AOM_save(pdf)); + AOM_unlock(pdf); + if (pdf == NULLTAG) { + WriteLog("ʧ\n"); + } + else { + WriteLog("ɹ\n"); + ITKCALL(GRM_find_relation_type("IMAN_Rendering", &relationTag)); + if (relationTag == NULLTAG) { + WriteLog("1111111111111111111111111111111"); + } + ITKCALL(GRM_list_secondary_objects_only(attachments[a], relationTag, &rfCount, &rfTags)); + ITKCALL(GRM_create_relation(attachments[a], pdf, relationTag, NULLTAG, &newrelation)); + ITKCALL(GRM_save_relation(newrelation)); + //ITKCALL(AOM_unload(attachments[a])); + //ITKCALL(AOM_refresh(attachments[a], true)); + } + } + + if (pdf != NULL) { + WriteLog("ѾPDFݼʼд %s\n", lastName); + char namefix[256] = ""; + strcpy(namefix, lastName); + strcat(namefix, ".pdf"); + ITKCALL(import_dataset_file_binary(pdf, "/tmp/", "PDF_Reference", "pdf", "D:\\11.pdf", namefix)); + ITKCALL(remove("D:\\11.pdf")); + WriteLog("ɾɹ"); + + tag_t assign_user = NULL_TAG; + tag_t o_group_tag = NULL_TAG; + AOM_ask_owner(attachments[a], &assign_user); + AOM_ask_group(attachments[a], &o_group_tag); + //AOM_lock(pdf); + AOM_set_ownership(pdf, assign_user, o_group_tag); + //AOM_save(pdf); + //AOM_unlock(pdf); + //AOM_refresh(pdf, TRUE); + } + else { + WriteLog("ǰ汾ûIMAN_Renderingļ"); + } + } + } + else if (strcmp(type, "MSExcelX") == 0) { + if (doc_num > 1) { + char *name = NULL; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_name", &name)); + char f = name[0]; + if (f < 48 || f > 57) { + continue; + } + } + //ȡݼ + char* lastName = NULL; + int refCount = 0; + tag_t* refTags; + ITKCALL(AOM_ask_value_tags(doc_tags[i], "ref_list", &refCount, &refTags)); + if (refCount > 0) { + ITKCALL(AOM_ask_value_string(refTags[0], "original_file_name", &lastName)); + replaceSpecialChars(lastName); + } + else { + printf("ûҵ"); + } + WriteLog("type=%s\n", type); + tag_t spec_dataset_rev = NULLTAG, ref_object = NULLTAG; + AE_reference_type_t reference_type; + ITKCALL(AE_ask_dataset_latest_rev(doc_tags[i], &spec_dataset_rev)); + char ref_name[WSO_name_size_c + 1] = "excel"; + ITKCALL(AE_ask_dataset_named_ref2(spec_dataset_rev, ref_name, &reference_type, &ref_object)); + if (reference_type == AE_PART_OF) + { + char *pathname = ""; + ITKCALL(IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname)); + char *origin_file_name = ""; + ITKCALL(IMF_ask_original_file_name2(ref_object, &origin_file_name)); + char new_ds_name[WSO_name_size_c + 1] = ""; + char *new_file_name = USER_new_file_name(new_ds_name, ref_name, "xlsx", 0); + char *temp_dir = getenv("temp"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, temp_dir); + strcat(temp_file, "\\"); + strcat(temp_file, new_file_name); + + ITKCALL(IMF_export_file(ref_object, temp_file)); + char *name = ""; + ITKCALL(AOM_ask_value_string(doc_tags[i], "object_name", &name)); + char cmd[256] = ""; + strcpy(cmd, "D:\\Siemens\\Teamcenter12\\portal\\plugins\\plug\\SubstMacros-MSExcel.wsf"); + strcat(cmd, " \""); + strcat(cmd, temp_file); + strcat(cmd, "\" "); + + strcat(cmd, "D:\\Siemens\\Teamcenter12\\bin\\PDF.config.txt"); + strcat(cmd, " D:\\11.pdf"); + WriteLog("\n%s\n", cmd); + system(cmd); + WriteLog("cmdִ"); + tag_t *word_tags = NULLTAG; + int word_num = NULL; + ITKCALL(AOM_ask_value_tags(attachments[a], "IMAN_Rendering", &word_num, &word_tags)); + tag_t pdf = NULLTAG; + for (int n = 0; n < word_num; n++) { + char *type = ""; + char *pdfname = ""; + ITKCALL(AOM_ask_value_string(word_tags[n], "object_type", &type)); + ITKCALL(AOM_ask_value_string(word_tags[n], "object_name", &pdfname)); + char *name1 = NULL; + char *name2 = NULL; + name1 = pdfname; + name2 = name; + if (strcmp(type, "PDF") == 0 && strcmp(name1, name2) == 0) { + pdf = word_tags[n]; + break; + } + } + if (pdf == NULLTAG) { + WriteLog("ûҵPDFݼʼд\n", lastName); + int rfCount; + tag_t pdfTypeTag = NULLTAG, tool = NULLTAG, relationTag, *rfTags, newrelation; + + ITKCALL(AE_find_datasettype2("PDF", &pdfTypeTag)); + ITKCALL(AE_create_dataset_with_id(pdfTypeTag, lastName, "", "", "A", &pdf)); + ITKCALL(AE_ask_datasettype_def_tool(pdfTypeTag, &tool)); + AOM_lock(pdf); + ITKCALL(AE_set_dataset_tool(pdf, tool)); + ITKCALL(AE_set_dataset_format2(pdf, "PDF_Reference")); + ITKCALL(AOM_save(pdf)); + AOM_unlock(pdf); + if (pdf == NULLTAG) { + WriteLog("ʧ\n"); + } + else { + WriteLog("ɹ\n"); + ITKCALL(GRM_find_relation_type("IMAN_Rendering", &relationTag)); + if (relationTag == NULLTAG) { + WriteLog("1111111111111111111"); + } + ITKCALL(GRM_list_secondary_objects_only(attachments[a], relationTag, &rfCount, &rfTags)); + ITKCALL(GRM_create_relation(attachments[a], pdf, relationTag, NULLTAG, &newrelation)); + ITKCALL(GRM_save_relation(newrelation)); + //ITKCALL(AOM_unload(attachments[a])); + //ITKCALL(AOM_refresh(attachments[a], true)); + } + } + + if (pdf != NULL) { + WriteLog("ѾPDFݼʼд %s\n", lastName); + char namefix[256] = ""; + // ȥַ + + strcpy(namefix, lastName); + strcat(namefix, ".pdf"); + import_dataset_file_binary(pdf, "/tmp/", "PDF_Reference", "pdf", "D:\\11.pdf", namefix); + remove("D:\\11.pdf"); + + tag_t assign_user = NULL_TAG; + tag_t o_group_tag = NULL_TAG; + AOM_ask_owner(attachments[a], &assign_user); + AOM_ask_group(attachments[a], &o_group_tag); + //AOM_lock(pdf); + AOM_set_ownership(pdf, assign_user, o_group_tag); + + //AOM_save(pdf); + //AOM_unlock(pdf); + + //AOM_refresh(pdf, TRUE); + + } + + } + } + } + } + else + { + WriteLog("ûҵļ"); + } + //WriteLog("123456789"); + + } + } + POM_AM__set_application_bypass(false); // · + WriteLog("תɡ"); + CloseLog(); + return ITK_ok; + +} +void recursionBOM(tag_t top_line, int level, vector& bomline) { + if (level <= 0) { // ﵽָ㼶ֹͣݹ + return; + } + int count; + tag_t* children_line; + ITKCALL(BOM_line_ask_all_child_lines(top_line, &count, &children_line)); + if (count > 0) { + for (int i = 0; i < count; i++) { + bomline.push_back(children_line[i]); // Ӷ bomline + // ݹãӶ level-1 + recursionBOM(children_line[i], level - 1, bomline); + } + } +} + +bool vec_find(vector ids, char* id) { + for (int i = 0; i < ids.size(); i++) { + if (tc_strcmp(ids[i], id) == 0) { + return true; + } + } + return false; +} + +int Connor_AVIC_Check_GetInfo(EPM_action_message_t msg) { + printf("*******************************************************************************\n"); + printf("* Connor_AVIC_Check_GetInfo is comming 0328-03 *\n"); + printf("*******************************************************************************\n"); + int att_cnt = 0; // att_cntѡеĶ + int doc_num = NULL; + tag_t task = NULLTAG, rootTask_tag = NULLTAG, * attachments = NULL; + tag_t* doc_tags = NULLTAG; + task = msg.task; + char* description = "", * type = "Ac5_XYJinfo_FM"; + int arg_cnt = TC_number_of_arguments(msg.arguments); + char* Relation = NULL, * CheckProperty = NULL, * Form = NULL, * ChangeProperty = NULL, * Check = NULL, * name = "üϢ"; + char* arg = NULL, * argflag = NULL, * argvalue = NULL; + task = msg.task; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + tag_t getform = NULLTAG; + vector propertiesList; + vector valueList; + int result = 0; + vector proList; + bool checkBool = true; + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + ITKCALL(AOM_ask_value_tags(attachments[0], "IMAN_specification", &doc_num, &doc_tags)); + + ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); + if (arg_cnt > 0) + { + for (int i = 0; i < arg_cnt; i++) + { + arg = TC_next_argument(msg.arguments); + ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); + if (tc_strcmp(argflag, "Relation") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + Relation = argvalue; + + } + } + if (tc_strcmp(argflag, "CheckProperty") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + CheckProperty = argvalue; + } + Split(CheckProperty, ";", propertiesList); + } + if (tc_strcmp(argflag, "Check") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + Check = argvalue; + } + } + if (tc_strcmp(argflag, "Form") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + Form = argvalue; + } + } + if (tc_strcmp(argflag, "ChangeProperty") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + ChangeProperty = argvalue; + } + Split(ChangeProperty, ";", proList); + + } + if (tc_strcmp(argflag, "Floor") == 0) { + if (argvalue != NULL) + { + printf("ȡֵ%s:", argvalue); + char* Floor = argvalue; + sscanf(Floor, "%d", &result); + } + + } + } + printf("ʼȡ\n"); + int count = 0; + tag_t* cpp = NULLTAG; + ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_reference_attachment, &count, &cpp)); + for (int t = 0; t < count; t++) { + char* formtype = NULL; + ITKCALL(AOM_ask_value_string(cpp[t], "object_type", &formtype)); + if (tc_strcmp(formtype, Form) == 0) { + getform = cpp[t]; + break; + } + } + printf("ʼжChangeProperty\n"); + int changeCount = 0; + for (int m = 0; m < proList.size(); m++) { + vector changeList; + Split(proList[m], "=", changeList); + char* changeValue; + ITKCALL(AOM_get_value_string(getform, changeList[0].c_str(), &changeValue)); + printf("ʼȽ%s%sֵ\n", changeValue, changeList[1].c_str()); + if (tc_strcmp(changeValue, changeList[1].c_str()) == 0) { + printf("\n"); + changeCount++; + } + } + if (changeCount == proList.size()) { + //ʾǵһȡüϢٽü + //checkBool = false; + } + printf("ʼжcheck\n"); + vector checks; + vector flags; + Split(Check, ";", checks); + for (int b = 0; b < checks.size(); b++) { + vector check1; + Split(checks[b], "=", check1); + char* val = NULL; + ITKCALL(AOM_ask_value_string(getform, check1[0].c_str(), &val)); + printf("ֵ%s:", val); + if (tc_strcmp(val, check1[1].c_str()) == 0) { + flags.push_back(true); + } + } + if (flags.size() == checks.size()) { + printf("checkжͨ\n"); + return 0; + } + vector ids, objnames, guiges, jishus, shengcs, biaojis, paihaos, yuanyins; + for (int t = 0; t < att_cnt; t++) { + char* atta_type = NULL; + ITKCALL(AOM_ask_value_string(attachments[t], "object_type", &atta_type)); + printf("atta_type==%s\n", atta_type); + if (tc_strstr(atta_type, "Revision") == NULL || tc_strstr(atta_type, "Master") != NULL + || tc_strstr(atta_type, "BOMView") != NULL) { + continue; + } + //BOMWindow + tag_t top_line = NULLTAG, window = NULLTAG; + printf("BOMWindow\n"); + ITKCALL(BOM_create_window(&window)); + //öBOM + printf("öBOM\n"); + ITKCALL(BOM_set_window_top_line(window, NULLTAG, attachments[t], NULLTAG, &top_line)); + tag_t* children_line = NULLTAG; + char* id = NULL, *objname = NULL, *guige = NULL, *jishu = NULL, *shengc = NULL, *biaoji = NULL, *paihao = NULL, *yuanyin = NULL; + char* type1 = "item", *type2 = "itemrevision", *type3 = "revmaster"; + printf("ȡBOM\n"); + if (result != 0) { + //ȡFloorֵʼݹBom + vector bomline; + // bomline бִݹĽ + recursionBOM(top_line, result, bomline); + count = bomline.size(); + children_line = new tag_t[bomline.size()]; + // bomlineеֵchildren_line + memcpy(children_line, bomline.data(), bomline.size() * sizeof(tag_t)); + } + else { + ITKCALL(BOM_line_ask_all_child_lines(top_line, &count, &children_line)); + } + for (int j = 0; j < count; j++) { + char* typestr = NULL; + tag_t revobj = NULL; + tag_t itemobj = NULL; + printf("bomlineȡ汾"); + ITKCALL(AOM_ask_value_tag(children_line[j], "bl_line_object", &revobj)); + printf("ȡitem"); + ITKCALL(AOM_ask_value_tag(revobj, "items_tag", &itemobj)); + printf("ȡ"); + ITKCALL(AOM_ask_value_string(itemobj, "object_type", &typestr)); + printf("typestr%s:", typestr); + printf("ʼѭȡpropertiesList"); + for (int n = 0; n < propertiesList.size(); n++) { + tag_t obj = NULL; + Split(propertiesList[n], "=", valueList); + printf("value%s:", valueList[0].c_str()); + printf("ж"); + if (tc_strcmp(typestr, valueList[0].c_str()) == 0) { + printf("ж"); + if (tc_strcmp(type1, valueList[1].c_str()) == 0) { + ITKCALL(AOM_ask_value_tag(revobj, "items_tag", &obj)); + } + else if (tc_strcmp(type2, valueList[1].c_str()) == 0) { + obj = revobj; + } + else if (tc_strcmp(type3, valueList[1].c_str()) == 0) { + tag_t* formobj = NULLTAG; + int numobj = 0; + ITKCALL(AOM_ask_value_tags(revobj, "IMAN_master_form_rev", &numobj, &formobj)); + obj = formobj[0]; + } + char* getvalue = NULL; + ITKCALL(AOM_ask_value_string(obj, valueList[2].c_str(), &getvalue)); + printf("ʼȡvalueֵ%s", getvalue); + if (tc_strcmp(getvalue, valueList[3].c_str()) == 0) { + printf("ȡü"); + //ȡüϢ + char* id = NULL, *objname = NULL, *guige = NULL, *jishu = NULL, *shengc = NULL, *biaoji = NULL, *paihao = NULL, *yuanyin = NULL; + tag_t itemobj = NULL; + tag_t revisionobj = NULL; + tag_t* fromobj1 = NULL; + tag_t formobj2 = NULL; + ITKCALL(AOM_ask_value_tag(children_line[j], "bl_line_object", &revisionobj)); + ITKCALL(AOM_ask_value_tag(revisionobj, "items_tag", &itemobj)); + ITKCALL(AOM_ask_value_string(itemobj, "item_id", &id)); + printf("id==%s\n", id); + if (vec_find(ids, id)) { + // ȥһ + continue; + } + printf("ids.push_back(id)"); + int numobj = 0; + ITKCALL(AOM_ask_value_tags(revisionobj, "IMAN_master_form_rev", &numobj, &fromobj1)); + formobj2 = fromobj1[0]; + ITKCALL(AOM_ask_value_string(itemobj, "item_id", &id)); + ITKCALL(AOM_ask_value_string(itemobj, "object_name", &objname)); + ITKCALL(AOM_ask_value_string(formobj2, "ac5_Specifications", &guige)); + ITKCALL(AOM_ask_value_string(formobj2, "ac5_TechnicalConditions", &jishu)); + ITKCALL(AOM_ask_value_string(formobj2, "ac5_Manufacturer", &shengc)); + ITKCALL(AOM_ask_value_string(formobj2, "ac5_SelectionMarkers", &biaoji)); + ITKCALL(AOM_ask_value_string(formobj2, "ac5_Brand", &paihao)); + ITKCALL(AOM_ask_value_string(formobj2, "ac5_Reason", &yuanyin)); + ids.push_back(id); + objnames.push_back(objname); + guiges.push_back(guige); + jishus.push_back(jishu); + shengcs.push_back(shengc); + biaojis.push_back(biaoji); + paihaos.push_back(paihao); + yuanyins.push_back(yuanyin); + } + } + } + } + ITKCALL(BOM_close_window(window)); + } + + printf("ids==%zd\n", ids.size()); + if (ids.size() > 0) { + printf("checkBool==%d\n", checkBool); + if (checkBool) { + printf("\n"); + AOM_lock(getform); + printf("֮ǰУɾ\n"); + int tableNum1 = 0; + tag_t* tableTags1; + ITKCALL(AOM_ask_table_rows(getform, "ac5_XYJinfo", &tableNum1, &tableTags1)); + for (int p = tableNum1 - 1; p >= 0; p--) { + tag_t rowTable = tableTags1[p]; + char* idRow; + ITKCALL(AOM_ask_value_string(rowTable, "ac5_ID", &idRow)); + // жǷidsУɾ + printf("idRow==%s\n", idRow); + if (!vec_find(ids, idRow)) { + // ɾ + printf("delete\n"); + ITKCALL(AOM_delete_table_rows(getform, "ac5_XYJinfo", p, 1)); + } + } + AOM_save(getform); + int tableNum2 = 0; + tag_t* tableTags2; + ITKCALL(AOM_ask_table_rows(getform, "ac5_XYJinfo", &tableNum2, &tableTags2)); + printf("delete:%d==%d\n", tableNum1, tableNum2); + + printf("жǷݻDz\n"); + int tableNum = 0; + tag_t* tableTags; + ITKCALL(AOM_ask_table_rows(getform, "ac5_XYJinfo", &tableNum, &tableTags)); + for (int d = 0; d < ids.size(); d++) { + //жǷѾһ + printf("ж%sǷѾڱ\n", ids[d]); + bool isTableRow = false; + for (int p = 0; p < tableNum; p++) { + tag_t rowTable = tableTags[p]; + char* idRow; + ITKCALL(AOM_ask_value_string(rowTable, "ac5_ID", &idRow)); + printf("Ƚϱ%sǷ\n", idRow); + if (tc_strcmp(idRow, ids[d]) == 0) { + printf("ʼ\n"); + AOM_lock(rowTable); + ITKCALL(AOM_set_value_string(rowTable, "ac5_ID", ids[d])); + ITKCALL(AOM_set_value_string(rowTable, "ac5_Objectname", objnames[d])); + ITKCALL(AOM_set_value_string(rowTable, "ac5_Specifications", guiges[d])); + ITKCALL(AOM_set_value_string(rowTable, "ac5_TechnicalConditions", jishus[d])); + ITKCALL(AOM_set_value_string(rowTable, "ac5_Manufacturer", shengcs[d])); + ITKCALL(AOM_set_value_string(rowTable, "ac5_SelectionMarkers", biaojis[d])); + ITKCALL(AOM_set_value_string(rowTable, "ac5_Brand", paihaos[d])); + ITKCALL(AOM_set_value_string(rowTable, "ac5_Reason", yuanyins[d])); + isTableRow = true; + AOM_save(rowTable); + AOM_unlock(rowTable); + break; + } + } + if (isTableRow) { + continue; + } + printf("ʼ\n"); + //µ + tag_t* tableRow = NULL; + ITKCALL(AOM_insert_table_rows(getform, "ac5_XYJinfo", 0, 1, &tableRow)); + AOM_lock(tableRow[0]); + ITKCALL(AOM_set_value_string(tableRow[0], "ac5_ID", ids[d])); + ITKCALL(AOM_set_value_string(tableRow[0], "ac5_Objectname", objnames[d])); + ITKCALL(AOM_set_value_string(tableRow[0], "ac5_Specifications", guiges[d])); + ITKCALL(AOM_set_value_string(tableRow[0], "ac5_TechnicalConditions", jishus[d])); + ITKCALL(AOM_set_value_string(tableRow[0], "ac5_Manufacturer", shengcs[d])); + ITKCALL(AOM_set_value_string(tableRow[0], "ac5_SelectionMarkers", biaojis[d])); + ITKCALL(AOM_set_value_string(tableRow[0], "ac5_Brand", paihaos[d])); + ITKCALL(AOM_set_value_string(tableRow[0], "ac5_Reason", yuanyins[d])); + AOM_save(tableRow[0]); + AOM_unlock(tableRow[0]); + + } + for (int m = 0; m < proList.size(); m++) { + vector changeList; + Split(proList[m], "=", changeList); + ITKCALL(AOM_set_value_string(getform, changeList[0].c_str(), changeList[1].c_str())); + } + AOM_save(getform); + AOM_unlock(getform); + int tableNum3 = 0; + tag_t* tableTags3; + ITKCALL(AOM_ask_table_rows(getform, "ac5_XYJinfo", &tableNum3, &tableTags3)); + printf("ac5_XYJinfo==%d\n", tableNum3); + } + printf("BOMдϣڱȷǷͨ\n"); + string error = GbkToUtf8("BOMдϣڱȷǷͨ"); + ITKCALL(EMH_store_error_s1(EMH_severity_user_error, ITK_err, error.c_str())); + return 1; + } + else { + //޸ ձ + printf("޸ ձ\n"); + AOM_lock(getform); + ITKCALL(AOM_set_value_string(getform, "ac5_XYJorNot", "false")); + + + int tableNum1 = 0; + tag_t* tableTags1; + ITKCALL(AOM_ask_table_rows(getform, "ac5_XYJinfo", &tableNum1, &tableTags1)); + if (tableNum1 > 0) { + ITKCALL(AOM_delete_table_rows(getform, "ac5_XYJinfo", 0, tableNum1)); + } + AOM_save(getform); + AOM_unlock(getform); + } + + + return ITK_ok; + } +} + + + +//int Connor_AVIC_Check_GetInfo(EPM_action_message_t msg) { +// int att_cnt = 0; // att_cntѡеĶ +// int doc_num = NULL; +// tag_t task = NULLTAG, rootTask_tag = NULLTAG, * attachments = NULL; +// tag_t* doc_tags = NULLTAG; +// task = msg.task; +// char* description = "", * type = "Ac5_XYJinfo_FM"; +// int arg_cnt = TC_number_of_arguments(msg.arguments); +// char* Relation = NULL, * CheckProperty = NULL, * Form = NULL, * ChangeProperty = NULL, * Check = NULL, * name = "üϢ"; +// int result; +// char* arg = NULL, * argflag = NULL, * argvalue = NULL; +// task = msg.task; +// ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); +// tag_t getform = NULLTAG; +// vector propertiesList; +// vector valueList; +// +// vector proList; +// +// ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); +// ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); +// ITKCALL(AOM_ask_value_tags(attachments[0], "IMAN_specification", &doc_num, &doc_tags)); +// +// ITKCALL(EPM_ask_root_task(task, &rootTask_tag)); +// if (arg_cnt > 0) +// { +// for (int i = 0; i < arg_cnt; i++) +// { +// arg = TC_next_argument(msg.arguments); +// ITKCALL(ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue)); +// if (strcmp(argflag, "Relation") == 0) { +// if (argvalue != NULL) +// { +// printf("ȡֵ%s:", argvalue); +// Relation = argvalue; +// +// } +// } +// if (strcmp(argflag, "CheckProperty") == 0) { +// if (argvalue != NULL) +// { +// printf("ȡֵ%s:", argvalue); +// CheckProperty = argvalue; +// } +// Split(CheckProperty, ";", propertiesList); +// } +// if (strcmp(argflag, "Check") == 0) { +// if (argvalue != NULL) +// { +// printf("ȡֵ%s:", argvalue); +// Check = argvalue; +// } +// } +// if (strcmp(argflag, "Form") == 0) { +// if (argvalue != NULL) +// { +// printf("ȡֵ%s:", argvalue); +// Form = argvalue; +// } +// } +// if (strcmp(argflag, "ChangeProperty") == 0) { +// if (argvalue != NULL) +// { +// printf("ȡֵ%s:", argvalue); +// ChangeProperty = argvalue; +// } +// Split(ChangeProperty, ";", proList); +// +// } +// if (strcmp(argflag, "Floor") == 0) { +// if (argvalue != NULL) +// { +// printf("ȡֵ%s:", argvalue); +// char* Floor = argvalue; +// sscanf(Floor, "%d", &result); +// } +// +// } +// } +// printf("ʼȡ\n"); +// int count = 0; +// tag_t* cpp = NULLTAG; +// ITKCALL(EPM_ask_attachments(rootTask_tag, EPM_reference_attachment, &count, &cpp)); +// for (int t = 0; t < count; t++) { +// char* formtype = NULL; +// ITKCALL(AOM_ask_value_string(cpp[t], "object_type", &formtype)); +// if (strcmp(formtype, Form) == 0) { +// getform = cpp[t]; +// break; +// } +// } +// printf("ʼжcheck\n"); +// vector checks; +// vector flags; +// Split(Check, ";", checks); +// for (int b = 0; b < checks.size(); b++) { +// vector check1; +// Split(checks[b], "=", check1); +// char* val = NULL; +// ITKCALL(AOM_ask_value_string(getform, check1[0].c_str(), &val)); +// printf("ֵ%s:", val); +// if (strcmp(val, check1[1].c_str()) == 0) { +// flags.push_back(true); +// } +// } +// if (flags.size() == checks.size()) { +// printf("checkжͨ\n"); +// return 0; +// } +// //BOMWindow +// tag_t top_line = NULLTAG, window = NULLTAG; +// printf("BOMWindow\n"); +// ITKCALL(BOM_create_window(&window)); +// //öBOM +// printf("öBOM\n"); +// ITKCALL(BOM_set_window_top_line(window, NULLTAG, attachments[0], NULLTAG, &top_line)); +// tag_t* children_line = NULLTAG; +// char* id = NULL, * objname = NULL, * guige = NULL, * jishu = NULL, * shengc = NULL, * biaoji = NULL, * paihao = NULL, * yuanyin = NULL; +// char* type1 = "item", * type2 = "itemrevision", * type3 = "revmaster"; +// vector ids, objnames, guiges, jishus, shengcs, biaojis, paihaos, yuanyins; +// printf("ȡBOM\n"); +// //ΪݹȡBOM㼶 +// ITKCALL(BOM_line_ask_all_child_lines(top_line, &count, &children_line)); +// for (int j = 0; j < count; j++) { +// char* typestr = NULL; +// tag_t revobj = NULL; +// tag_t itemobj = NULL; +// printf("bomlineȡ汾"); +// ITKCALL(AOM_ask_value_tag(children_line[j], "bl_line_object", &revobj)); +// printf("ȡitem"); +// ITKCALL(AOM_ask_value_tag(revobj, "items_tag", &itemobj)); +// printf("ȡ"); +// ITKCALL(AOM_ask_value_string(itemobj, "object_type", &typestr)); +// printf("typestr%s:", type); +// printf("ʼѭȡpropertiesList"); +// for (int n = 0; n < propertiesList.size(); n++) { +// tag_t obj = NULL; +// Split(propertiesList[n], "=", valueList); +// printf("value%s:", valueList[0].c_str()); +// printf("ж"); +// if (strcmp(typestr, valueList[0].c_str()) == 0) { +// printf("ж"); +// if (strcmp(type1, valueList[1].c_str()) == 0) { +// ITKCALL(AOM_ask_value_tag(revobj, "items_tag", &obj)); +// } +// else if (strcmp(type2, valueList[1].c_str()) == 0) { +// obj = revobj; +// } +// else if (strcmp(type3, valueList[1].c_str()) == 0) { +// tag_t* formobj = NULLTAG; +// int numobj = 0; +// ITKCALL(AOM_ask_value_tags(revobj, "IMAN_master_form_rev", &numobj, &formobj)); +// obj = formobj[0]; +// } +// char* getvalue = NULL; +// ITKCALL(AOM_ask_value_string(obj, valueList[2].c_str(), &getvalue)); +// printf("ʼȡvalueֵ%s", getvalue); +// if (strcmp(getvalue, valueList[3].c_str()) == 0) { +// printf("ȡü"); +// //ȡüϢ +// char* id = NULL, * objname = NULL, * guige = NULL, * jishu = NULL, * shengc = NULL, * biaoji = NULL, * paihao = NULL, * yuanyin = NULL; +// tag_t itemobj = NULL; +// tag_t revisionobj = NULL; +// tag_t* fromobj1 = NULL; +// tag_t formobj2 = NULL; +// ITKCALL(AOM_ask_value_tag(children_line[j], "bl_line_object", &revisionobj)); +// ITKCALL(AOM_ask_value_tag(revisionobj, "items_tag", &itemobj)); +// int numobj = 0; +// ITKCALL(AOM_ask_value_tags(revisionobj, "IMAN_master_form_rev", &numobj, &fromobj1)); +// formobj2 = fromobj1[0]; +// ITKCALL(AOM_ask_value_string(itemobj, "item_id", &id)); +// ITKCALL(AOM_ask_value_string(itemobj, "object_name", &objname)); +// ITKCALL(AOM_ask_value_string(formobj2, "ac5_Specifications", &guige)); +// ITKCALL(AOM_ask_value_string(formobj2, "ac5_TechnicalConditions", &jishu)); +// ITKCALL(AOM_ask_value_string(formobj2, "ac5_Manufacturer", &shengc)); +// ITKCALL(AOM_ask_value_string(formobj2, "ac5_SelectionMarkers", &biaoji)); +// ITKCALL(AOM_ask_value_string(formobj2, "ac5_Brand", &paihao)); +// ITKCALL(AOM_ask_value_string(formobj2, "ac5_Reason", &yuanyin)); +// ids.push_back(id); +// objnames.push_back(objname); +// guiges.push_back(guige); +// jishus.push_back(jishu); +// shengcs.push_back(shengc); +// biaojis.push_back(biaoji); +// paihaos.push_back(paihao); +// yuanyins.push_back(yuanyin); +// } +// } +// } +// } +// if (ids.size() > 0) { +// printf(""); +// AOM_lock(getform); +// tag_t* tableRow = NULL; +// for (int d = 0; d < ids.size(); d++) { +// ITKCALL(AOM_insert_table_rows(getform, "ac5_XYJinfo", 0, 1, &tableRow)); +// +// ITKCALL(AOM_set_value_string(tableRow[0], "ac5_ID", ids[d])); +// ITKCALL(AOM_set_value_string(tableRow[0], "ac5_Objectname", objnames[d])); +// ITKCALL(AOM_set_value_string(tableRow[0], "ac5_Specifications", guiges[d])); +// ITKCALL(AOM_set_value_string(tableRow[0], "ac5_TechnicalConditions", jishus[d])); +// ITKCALL(AOM_set_value_string(tableRow[0], "ac5_Manufacturer", shengcs[d])); +// ITKCALL(AOM_set_value_string(tableRow[0], "ac5_SelectionMarkers", biaojis[d])); +// ITKCALL(AOM_set_value_string(tableRow[0], "ac5_Brand", paihaos[d])); +// ITKCALL(AOM_set_value_string(tableRow[0], "ac5_Reason", yuanyins[d])); +// } +// +// for (int m = 0; m < proList.size(); m++) { +// vector changeList; +// Split(proList[m], "=", changeList); +// ITKCALL(AOM_set_value_string(getform, changeList[0].c_str(), changeList[1].c_str())); +// } +// AOM_save(getform); +// AOM_unlock(getform); +// string error = GbkToUtf8("BOMдϣڱȷǷͨ"); +// EMH_store_error_s1(EMH_severity_user_error, ITK_err, error.c_str()); +// return 1; +// } +// +// +// return ITK_ok; +// } +//} + + + +//int Cust_Add_BOMLine_Post(METHOD_message_t* msg, va_list args) +//{ +// int customError = ITK_ok, pref_count = 0; +// char *parentId = NULL, *ptype = NULL, *revId = NULL, *ctype = NULL, **prefs = NULL; +// tag_t parentRev = NULLTAG, *master = NULLTAG, *revmaster = NULLTAG; +// +// WriteLog("*******************************************************************************\n"); +// WriteLog("* Cust_Add_BOMLine_Post is comming *\n"); +// WriteLog("*******************************************************************************\n"); +// +// /*va_list largs; +// va_copy( largs, args ); +// new_schedule_tag = va_arg( largs, tag_t ); +// isNew = va_arg( largs, logical ); +// va_end( largs );*/ +// va_list largs; +// va_copy(largs, args); +// tag_t parent = va_arg(largs, tag_t); +// tag_t item = va_arg(largs, tag_t); +// tag_t rev = va_arg(largs, tag_t); +// tag_t bom_view = va_arg(largs, tag_t); +// char *occurrence_type = va_arg(largs, char*); +// tag_t *new_bom_line = va_arg(largs, tag_t *); +// tag_t gde = va_arg(largs, tag_t); +// tag_t occ_create_input = va_arg(largs, tag_t); +// va_end(largs); +// //ж϶ǷBOM +// int sub_cnt = 0, count = 0; +// tag_t *sub_lines = NULL, target = NULLTAG; +// ITKCALL(BOM_line_ask_child_lines(parent, &sub_cnt, &sub_lines)); +// //WriteLog("sub_cnt:%d\n", sub_cnt); +// for (int j = 0; j < sub_cnt; j++) { +// char *type = NULL; +// ITKCALL(AOM_ask_value_tag(sub_lines[j], "bl_item", &target)); +// ITKCALL(AOM_ask_value_string(target, "object_type", &type)); +// //WriteLog("type:%s == %s\n", type, ctype); +// if (strcmp(type, ctype) == 0) { +// count++; +// } +// } +// if (count>0) { +// //BOM +// //жǷѡ +// ITKCALL(PREF_ask_char_values("Connor_AVIC_Check_XYLJ", &pref_count, &prefs)); +// if (pref_count == 0) { +// WriteLog("δѡConnor_NHL_Bomlimit"); +// return customError; +// } +// else { +// char *typestr = ""; +// ITKCALL(AOM_ask_value_string(item, "object_type", &typestr)); +// int num = 0; +// for (int j = 0; j < pref_count; j++) { +// if (strcmp(prefs[j], typestr) == 0) { +// num++; +// } +// } +// if (num>0) { +// //ѡ +// //if (strcmp("XY", valueform)) { +// // //ڣʵ +// +// //} +// //else { +// // char *id = ""; +// // ITKCALL(AOM_ask_value_string(rev, "item_id", &id)); +// // char * error = strcat(id, "Ϊϣ"); +// // EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); +// //} +// int revcount = 0; +// tag_t *revs = NULLTAG; +// ITKCALL(AOM_ask_value_tags(item, "revision_list", &revcount,&revs)); +// int xycount = 0; +// int jycount = 0; +// vectorXYids;//XYverctor +// vectorJYids;//JYverctor +// for (int n = 0; n < revcount;n++) { +// tag_t form = NULLTAG; +// ITKCALL(AOM_ask_value_tag(revs[n], "IMAN_master_form_rev", &form)); +// if (form != NULLTAG) { +// char *valueform = ""; +// ITKCALL(AOM_ask_value_string(form, "ac5_SelectionMarkers", &valueform)); +// char *item_id = ""; +// ITKCALL(AOM_ask_value_string(revs[n], "item_id", &item_id)); +// if (strcat(valueform,"XY") == 0) { +// xycount++; +// XYids.push_back(item_id); +// } +// if (strcat(valueform, "JY") == 0) { +// jycount++; +// JYids.push_back(item_id); +// } +// } +// } +// if (jycount == revcount) { +// char *id = ""; +// ITKCALL(AOM_ask_value_string(rev, "item_id", &id)); +// char * error = strcat(id, "дڽID1ID2ID3"); +// EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); +// } +// if (xycount>0 && jycount>0) { +// +// } +// tag_t form = NULLTAG; +// ITKCALL(AOM_ask_value_tag(rev, "IMAN_master_form_rev", &form)); +// if (form != NULLTAG) { +// char *valueform = ""; +// ITKCALL(AOM_ask_value_string(form, "ac5_SelectionMarkers", &valueform)); +// if (valueform != NULL) { +// if (strcmp("JY", valueform)==0) { +// char *id = ""; +// ITKCALL(AOM_ask_value_string(rev, "item_id", &id)); +// char * error = strcat(id, "дڽID1ID2ID3"); +// EMH_store_error_s2(EMH_severity_error, ITK_err, "ʾ", error); +// } +// else { +// return 0; +// } +// } +// else { +// return 0; +// } +// } +// +// } +// } +// } +// else { +// //BOM +// //жǷѡ +// ITKCALL(PREF_ask_char_values("Connor_AVIC_Check_XYLJ", &pref_count, &prefs)); +// if (pref_count == 0) { +// WriteLog("δѡConnor_NHL_Bomlimit"); +// return customError; +// } +// else { +// char *typestr = ""; +// ITKCALL(AOM_ask_value_string(item, "object_type", &typestr)); +// int num = 0; +// for (int j = 0; j < pref_count; j++) { +// if (strcmp(prefs[j], typestr) == 0) { +// num++; +// } +// } +// if (num>0) { +// //Ѵ +// tag_t form = NULLTAG; +// ITKCALL(AOM_ask_value_tag(rev, "IMAN_master_form_rev", &form)); +// if (form != NULLTAG) { +// char *valueform = ""; +// ITKCALL(AOM_ask_value_string(form, "ac5_SelectionMarkers", &valueform)); +// if (valueform != NULL) { +// if (strcmp("XY", valueform)==0 || strcmp("JY", valueform)==0) { +// if (strcmp("XY", valueform)==0) { +// //ڣʵ +// } +// else { +// char *id = ""; +// ITKCALL(AOM_ask_value_string(rev, "item_id", &id)); +// char * error = strcat(id, "Ϊϣ"); +// EMH_store_error_s2(EMH_severity_error,ITK_err,"ʾ", error); +// } +// } +// else { +// return 0; +// } +// } +// else { +// return 0; +// } +// } +// else { +// return 0; +// } +// } +// else { +// // +// return 0; +// } +// } +// } +//} \ No newline at end of file diff --git a/ConsoleApplication1/sjjjy.h b/ConsoleApplication1/sjjjy.h new file mode 100644 index 0000000..f0921f8 --- /dev/null +++ b/ConsoleApplication1/sjjjy.h @@ -0,0 +1,53 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include ; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int Connor_AVIC_TransToPDF(EPM_action_message_t mag); + +int Connor_AVIC_Set_Property(EPM_action_message_t mag); + +int Connor_AVIC_Check_XYSX(EPM_action_message_t mag); + +int Connor_AVIC_Check_GetInfo(EPM_action_message_t mag); + +int TransToPDF(void *returnValue); + +//int Cust_Add_BOMLine_Post(METHOD_message_t* msg, va_list args); + diff --git a/ConsoleApplication1/stdafx.cpp b/ConsoleApplication1/stdafx.cpp new file mode 100644 index 0000000..cda7f95 --- /dev/null +++ b/ConsoleApplication1/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : ֻ׼ļԴļ +// ConsoleApplication1.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + +// TODO: STDAFX.H κĸͷļ +//ڴļ diff --git a/ConsoleApplication1/stdafx.h b/ConsoleApplication1/stdafx.h new file mode 100644 index 0000000..baa4bbc --- /dev/null +++ b/ConsoleApplication1/stdafx.h @@ -0,0 +1,15 @@ +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ +// + +#pragma once + +#include "targetver.h" + +#include +#include + + + +// TODO: ڴ˴óҪͷļ diff --git a/ConsoleApplication1/targetver.h b/ConsoleApplication1/targetver.h new file mode 100644 index 0000000..416cebf --- /dev/null +++ b/ConsoleApplication1/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h õ߰汾 Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// _WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/ConsoleApplication1/tc_log.cxx b/ConsoleApplication1/tc_log.cxx new file mode 100644 index 0000000..44caf19 --- /dev/null +++ b/ConsoleApplication1/tc_log.cxx @@ -0,0 +1,128 @@ +/** +* @file common_itk_util.cpp +* @brief itk warpper utility function +* @author James +* @history +* =================================================================================== +* Date Name Description of Change +* 18-July-2008 Ray +*/ +#include +#include +#include + +#include +// +#ifdef WIN32 +#include +#include +#else +//#include +#endif +// +#include "tc_log.h" +using namespace std; + +#define ARGS_LENGTH 200 +#define MAX_PRINTLINE_LENGTH 2000 +#define MAX_PATH_LENGTH 2000 +#define MAX_ARGUMENT_LENGTH 400 +#define MAX_PARAMNAME_LENGTH 50 +#define MAX_FILE_EXT_LENGTH 10 +#define TRUE_FLAG 1 +#define FALSE_FLAG 0 +#define DETAILLOG 1 + +#define DOFREE(obj) \ +{ \ + if(obj) \ + { \ + MEM_free(obj); \ + obj = NULL; \ + } \ +} + + +FILE* lidy_logFile = NULL; +char *log_path = NULL; + +void CreateLogFile(const char* lidy_logFileName) +{ + int i=0; + + lidy_logFile = NULL; + if (log_path) { + MEM_free(log_path); + log_path = NULL; + } + + log_path = (char*)MEM_alloc((strlen(lidy_logFileName) + 1) * sizeof(char*)); + strcpy(log_path, lidy_logFileName); + + //get lidy_logFileName + //sprintf(lidy_logFileName, "%s", lidy_logFileName); + printf("log file name: %s\n", lidy_logFileName); + + + //create log file + if((lidy_logFile = fopen(lidy_logFileName, "a"))==NULL) + { + printf("log file create failed\n"); + } + +} + +void WriteLog(const char* format, ...) +{ + va_list arg; + char tmp[8192]; + + if(lidy_logFile) + { + //get the message + memset(tmp, 0, sizeof(tmp)); + va_start(arg, format); + vsprintf(tmp, format, arg); + va_end(arg); + + //----------print to command window for trace--------// + printf("%s\n", tmp); + + //print message to log file + fprintf(lidy_logFile, "%s\n", tmp); + fflush(lidy_logFile); + } + else + { + printf("*!Error!*: Log File Not Exist\n"); + } +} + +void CloseLog(void) +{ + if(lidy_logFile) + { + fclose(lidy_logFile); + lidy_logFile = NULL; + } + + if (log_path) { + MEM_free(log_path); + log_path = NULL; + } +} + +void log_open(void) { + if (log_path) { + if ((lidy_logFile = fopen(log_path, "a")) == NULL) { + printf("log file create failed\n"); + } + } +} + +void log_close(void) { + if (lidy_logFile) { + fclose(lidy_logFile); + lidy_logFile = NULL; + } +} diff --git a/ConsoleApplication1/tc_log.h b/ConsoleApplication1/tc_log.h new file mode 100644 index 0000000..c418a63 --- /dev/null +++ b/ConsoleApplication1/tc_log.h @@ -0,0 +1,37 @@ +/** +* @file common_itk_util.h +* @brief itk warpper utility function +* @author Ray +* @history +* =================================================================================== +* Date Name Description of Change +* 09-July-2008 Ray +*/ +#include +#include +#include +using namespace std; + +#ifndef TC_LOG_H +#define TC_LOG_H + +#ifdef __cplusplus +extern "C" { +#endif + +void CreateLogFile(const char* logFileName); +void WriteLog(const char* format, ...); +void CloseLog(void); +void log_open(void); +void log_close(void); +//string getNow(char* format); +//int FindDatasetReferenceExt( tag_t datasettype, const char *datasettype_ref, char ext[10] ); +//int CompareDate( date_t date1, date_t date2 ); +//int GetRandomTempFile( char tempFile[256] ); +//logical IsItemRevisionType( char object_type[WSO_name_size_c + 1] ); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/CL.command.1.tlog b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/CL.command.1.tlog new file mode 100644 index 0000000..cf88ac4 Binary files /dev/null and b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/CL.command.1.tlog differ diff --git a/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/CL.read.1.tlog b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/CL.read.1.tlog new file mode 100644 index 0000000..8e35a08 Binary files /dev/null and b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/CL.read.1.tlog differ diff --git a/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/CL.write.1.tlog b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/CL.write.1.tlog new file mode 100644 index 0000000..13b47a9 Binary files /dev/null and b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/CL.write.1.tlog differ diff --git a/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/ConsoleApplication1.lastbuildstate b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/ConsoleApplication1.lastbuildstate new file mode 100644 index 0000000..23987b9 --- /dev/null +++ b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/ConsoleApplication1.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit +Release|x64|D:\Project\105\ConsoleApplication1\| diff --git a/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/ConsoleApplication1.write.1u.tlog b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/ConsoleApplication1.write.1u.tlog new file mode 100644 index 0000000..39c8490 Binary files /dev/null and b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/ConsoleApplication1.write.1u.tlog differ diff --git a/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/link.command.1.tlog b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/link.command.1.tlog new file mode 100644 index 0000000..9193b36 Binary files /dev/null and b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/link.command.1.tlog differ diff --git a/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/link.read.1.tlog b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/link.read.1.tlog new file mode 100644 index 0000000..ee56419 Binary files /dev/null and b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/link.read.1.tlog differ diff --git a/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/link.write.1.tlog b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/link.write.1.tlog new file mode 100644 index 0000000..9458d93 Binary files /dev/null and b/ConsoleApplication1/x64/Release/ConsoleA.39CA478E.tlog/link.write.1.tlog differ diff --git a/ConsoleApplication1/x64/Release/ConsoleApplication1.Build.CppClean.log b/ConsoleApplication1/x64/Release/ConsoleApplication1.Build.CppClean.log new file mode 100644 index 0000000..9999e9e --- /dev/null +++ b/ConsoleApplication1/x64/Release/ConsoleApplication1.Build.CppClean.log @@ -0,0 +1,33 @@ +z:\tc_install\105\c\consoleapplication1\consoleapplication1\x64\release\consoleapplication1.pch +z:\tc_install\105\c\consoleapplication1\consoleapplication1\x64\release\vc140.pdb +z:\tc_install\105\c\consoleapplication1\consoleapplication1\x64\release\stdafx.obj +z:\tc_install\105\c\consoleapplication1\consoleapplication1\x64\release\tc_log.obj +z:\tc_install\105\c\consoleapplication1\consoleapplication1\x64\release\sjjjy.obj +z:\tc_install\105\c\consoleapplication1\consoleapplication1\x64\release\main_lib.obj +z:\tc_install\105\c\consoleapplication1\consoleapplication1\x64\release\consoleapplication1.obj +z:\tc_install\105\c\consoleapplication1\consoleapplication1\x64\release\connor_test.obj +z:\tc_install\105\c\consoleapplication1\consoleapplication1\x64\release\connor_handler.obj +z:\tc_install\105\c\consoleapplication1\x64\release\consoleapplication1.lib +z:\tc_install\105\c\consoleapplication1\x64\release\consoleapplication1.exp +z:\tc_install\105\c\consoleapplication1\x64\release\consoleapplication1.dll +z:\tc_install\105\c\consoleapplication1\x64\release\consoleapplication1.ipdb +z:\tc_install\105\c\consoleapplication1\x64\release\consoleapplication1.iobj +z:\tc_install\105\c\consoleapplication1\x64\release\consoleapplication1.pdb +d:\project\105\consoleapplication1\consoleapplication1\x64\release\connor_handler.obj +d:\project\105\consoleapplication1\consoleapplication1\x64\release\connor_test.obj +d:\project\105\consoleapplication1\consoleapplication1\x64\release\consoleapplication1.obj +d:\project\105\consoleapplication1\consoleapplication1\x64\release\main_lib.obj +d:\project\105\consoleapplication1\consoleapplication1\x64\release\sjjjy.obj +d:\project\105\consoleapplication1\consoleapplication1\x64\release\stdafx.obj +d:\project\105\consoleapplication1\consoleapplication1\x64\release\tc_log.obj +d:\project\105\consoleapplication1\consoleapplication1\x64\release\consoleapplication1.pch +d:\project\105\consoleapplication1\consoleapplication1\x64\release\vc140.pdb +d:\project\105\consoleapplication1\x64\release\consoleapplication1.pdb +d:\project\105\consoleapplication1\x64\release\consoleapplication1.dll +d:\project\105\consoleapplication1\consoleapplication1\x64\release\consolea.39ca478e.tlog\cl.command.1.tlog +d:\project\105\consoleapplication1\consoleapplication1\x64\release\consolea.39ca478e.tlog\cl.read.1.tlog +d:\project\105\consoleapplication1\consoleapplication1\x64\release\consolea.39ca478e.tlog\cl.write.1.tlog +d:\project\105\consoleapplication1\consoleapplication1\x64\release\consolea.39ca478e.tlog\consoleapplication1.write.1u.tlog +d:\project\105\consoleapplication1\consoleapplication1\x64\release\consolea.39ca478e.tlog\link.command.1.tlog +d:\project\105\consoleapplication1\consoleapplication1\x64\release\consolea.39ca478e.tlog\link.read.1.tlog +d:\project\105\consoleapplication1\consoleapplication1\x64\release\consolea.39ca478e.tlog\link.write.1.tlog diff --git a/ConsoleApplication1/x64/Release/ConsoleApplication1.log b/ConsoleApplication1/x64/Release/ConsoleApplication1.log new file mode 100644 index 0000000..e02554e --- /dev/null +++ b/ConsoleApplication1/x64/Release/ConsoleApplication1.log @@ -0,0 +1,49 @@ + stdafx.cpp + connor_handler.cpp +D:\WorkEnvironment\tc12ITK\dflittk\include\pom/pom/pom.h(806): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc12ITK\dflittk\include\pom/pom/pom.h(5417): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +d:\project\105\consoleapplication1\consoleapplication1\connor_handler.h(9): warning C4067: 预处理器指令后有意外标记 - 应输入换行符 +connor_handler.cpp(541): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 +connor_handler.cpp(546): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 + connor_test.cpp +D:\WorkEnvironment\tc12ITK\dflittk\include\pom/pom/pom.h(806): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc12ITK\dflittk\include\pom/pom/pom.h(5417): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +d:\project\105\consoleapplication1\consoleapplication1\sjjjy.h(9): warning C4067: 预处理器指令后有意外标记 - 应输入换行符 +connor_test.cpp(19): warning C4101: “now”: 未引用的局部变量 +connor_test.cpp(18): warning C4101: “temp2”: 未引用的局部变量 +connor_test.cpp(18): warning C4101: “expire_date”: 未引用的局部变量 +connor_test.cpp(18): warning C4101: “date_buf”: 未引用的局部变量 +connor_test.cpp(20): warning C4101: “p”: 未引用的局部变量 +connor_test.cpp(18): warning C4101: “env”: 未引用的局部变量 +connor_test.cpp(18): warning C4101: “temp1”: 未引用的局部变量 +connor_test.cpp(84): warning C4101: “mth_tag”: 未引用的局部变量 + ConsoleApplication1.cpp + main_lib.cpp +D:\WorkEnvironment\tc12ITK\dflittk\include\pom/pom/pom.h(806): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc12ITK\dflittk\include\pom/pom/pom.h(5417): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + sjjjy.cpp +D:\WorkEnvironment\tc12ITK\dflittk\include\pom/pom/pom.h(806): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc12ITK\dflittk\include\pom/pom/pom.h(5417): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +d:\project\105\consoleapplication1\consoleapplication1\connor_handler.h(9): warning C4067: 预处理器指令后有意外标记 - 应输入换行符 +d:\project\105\consoleapplication1\consoleapplication1\sjjjy.h(9): warning C4067: 预处理器指令后有意外标记 - 应输入换行符 +sjjjy.cpp(358): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 +sjjjy.cpp(160): warning C4101: “gxkbh”: 未引用的局部变量 +sjjjy.cpp(907): warning C4129: “s”: 不可识别的字符转义序列 +sjjjy.cpp(908): warning C4129: “s”: 不可识别的字符转义序列 +sjjjy.cpp(908): warning C4477: 'printf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'unsigned __int64' + sjjjy.cpp(908): note: consider using '%zd' in the format string +sjjjy.cpp(1887): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 + tc_log.cxx +D:\WorkEnvironment\tc12ITK\dflittk\include\pom/pom/pom.h(806): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +D:\WorkEnvironment\tc12ITK\dflittk\include\pom/pom/pom.h(5417): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 +tc_log.cxx(59): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据 + 正在创建库 D:\Project\105\ConsoleApplication1\x64\Release\ConsoleApplication1.lib 和对象 D:\Project\105\ConsoleApplication1\x64\Release\ConsoleApplication1.exp + 正在生成代码 +d:\project\105\consoleapplication1\consoleapplication1\sjjjy.cpp(1155): warning C4172: 返回局部变量或临时变量的地址: readBuffer +d:\project\105\consoleapplication1\consoleapplication1\sjjjy.cpp(1355): warning C4715: “Connor_AVIC_TransToPDF”: 不是所有的控件路径都返回值 +d:\project\105\consoleapplication1\consoleapplication1\sjjjy.cpp(2087): warning C4715: “Connor_AVIC_Check_GetInfo”: 不是所有的控件路径都返回值 + 471 of 473 functions (99.6%) were compiled, the rest were copied from previous compilation. + 0 functions were new in current compilation + 0 functions had inline decision re-evaluated but remain unchanged + 已完成代码的生成 + ConsoleApplication1.vcxproj -> D:\Project\105\ConsoleApplication1\x64\Release\ConsoleApplication1.dll diff --git a/ConsoleApplication1/x64/Release/ConsoleApplication1.obj b/ConsoleApplication1/x64/Release/ConsoleApplication1.obj new file mode 100644 index 0000000..ffe6bb6 Binary files /dev/null and b/ConsoleApplication1/x64/Release/ConsoleApplication1.obj differ diff --git a/ConsoleApplication1/x64/Release/ConsoleApplication1.pch b/ConsoleApplication1/x64/Release/ConsoleApplication1.pch new file mode 100644 index 0000000..1262e18 Binary files /dev/null and b/ConsoleApplication1/x64/Release/ConsoleApplication1.pch differ diff --git a/ConsoleApplication1/x64/Release/ConsoleApplication1.vcxproj.FileListAbsolute.txt b/ConsoleApplication1/x64/Release/ConsoleApplication1.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/ConsoleApplication1/x64/Release/connor_handler.obj b/ConsoleApplication1/x64/Release/connor_handler.obj new file mode 100644 index 0000000..469247b Binary files /dev/null and b/ConsoleApplication1/x64/Release/connor_handler.obj differ diff --git a/ConsoleApplication1/x64/Release/connor_test.obj b/ConsoleApplication1/x64/Release/connor_test.obj new file mode 100644 index 0000000..662d677 Binary files /dev/null and b/ConsoleApplication1/x64/Release/connor_test.obj differ diff --git a/ConsoleApplication1/x64/Release/main_lib.obj b/ConsoleApplication1/x64/Release/main_lib.obj new file mode 100644 index 0000000..1f5add9 Binary files /dev/null and b/ConsoleApplication1/x64/Release/main_lib.obj differ diff --git a/ConsoleApplication1/x64/Release/sjjjy.obj b/ConsoleApplication1/x64/Release/sjjjy.obj new file mode 100644 index 0000000..c6ab06e Binary files /dev/null and b/ConsoleApplication1/x64/Release/sjjjy.obj differ diff --git a/ConsoleApplication1/x64/Release/stdafx.obj b/ConsoleApplication1/x64/Release/stdafx.obj new file mode 100644 index 0000000..3880285 Binary files /dev/null and b/ConsoleApplication1/x64/Release/stdafx.obj differ diff --git a/ConsoleApplication1/x64/Release/tc_log.obj b/ConsoleApplication1/x64/Release/tc_log.obj new file mode 100644 index 0000000..373877f Binary files /dev/null and b/ConsoleApplication1/x64/Release/tc_log.obj differ diff --git a/ConsoleApplication1/x64/Release/vc140.pdb b/ConsoleApplication1/x64/Release/vc140.pdb new file mode 100644 index 0000000..fb26ac9 Binary files /dev/null and b/ConsoleApplication1/x64/Release/vc140.pdb differ diff --git a/Release/ConsoleApplication1.exp b/Release/ConsoleApplication1.exp new file mode 100644 index 0000000..57bfb32 Binary files /dev/null and b/Release/ConsoleApplication1.exp differ diff --git a/Release/ConsoleApplication1.lib b/Release/ConsoleApplication1.lib new file mode 100644 index 0000000..29f9e43 Binary files /dev/null and b/Release/ConsoleApplication1.lib differ diff --git a/ipch/CONSOLEAPPLICATION1-1a054b9d/CONSOLEAPPLICATION1-91974ffc.ipch b/ipch/CONSOLEAPPLICATION1-1a054b9d/CONSOLEAPPLICATION1-91974ffc.ipch new file mode 100644 index 0000000..4424151 Binary files /dev/null and b/ipch/CONSOLEAPPLICATION1-1a054b9d/CONSOLEAPPLICATION1-91974ffc.ipch differ diff --git a/x64/Release/ConsoleApplication1.dll b/x64/Release/ConsoleApplication1.dll new file mode 100644 index 0000000..33dab55 Binary files /dev/null and b/x64/Release/ConsoleApplication1.dll differ diff --git a/x64/Release/ConsoleApplication1.exp b/x64/Release/ConsoleApplication1.exp new file mode 100644 index 0000000..62f4039 Binary files /dev/null and b/x64/Release/ConsoleApplication1.exp differ diff --git a/x64/Release/ConsoleApplication1.iobj b/x64/Release/ConsoleApplication1.iobj new file mode 100644 index 0000000..571a74c Binary files /dev/null and b/x64/Release/ConsoleApplication1.iobj differ diff --git a/x64/Release/ConsoleApplication1.ipdb b/x64/Release/ConsoleApplication1.ipdb new file mode 100644 index 0000000..9f27ebf Binary files /dev/null and b/x64/Release/ConsoleApplication1.ipdb differ diff --git a/x64/Release/ConsoleApplication1.lib b/x64/Release/ConsoleApplication1.lib new file mode 100644 index 0000000..8efcb21 Binary files /dev/null and b/x64/Release/ConsoleApplication1.lib differ diff --git a/x64/Release/ConsoleApplication1.pdb b/x64/Release/ConsoleApplication1.pdb new file mode 100644 index 0000000..ede2e03 Binary files /dev/null and b/x64/Release/ConsoleApplication1.pdb differ