/*====================================================================*\ FILE : TestMain.c PURPOSE : Top level structure of application for testing Pro/TOOLKIT HISTORY.. DATE BUILD AUTHOR MODIFICATIONS 25 Jan 96 G-03-03 Alistair $$1 First version. 21 Feb 96 G-03-04 Michael $$2 Added prodev_menu.h & TestMfg.h 11 Mar 96 G-03-05 dmp $$3 Added selection testing 11 Mar 96 G-03-06 dmp $$4 Added Parameter testing 01-Apr-96 G-03-08 dmp $$5 Added External object testing 19-Apr-96 G-03-11 Alistair $$6 Added Notify 10-Jun-96 G-03-17 mgs,Igor $$7 Added Simplified reps and features 13-Jun-96 G-03-17 mgs $$8 Corrected menu error 13-Jun-96 G-03-18 Steve $$9 Added Section menu item 10-Jul-96 G-03-19 mgs $$10 Added Misc menu item 26-Aug-96 H-01-05 Xuekai $$11 Modify due to change to ProMdl 23-Sep-96 H-01-10 Xuekai $$12 Comment out section and feature creation 30-Sep-96 H-01-11 DXU $$13 Added appdata testing. 09-Oct-96 H-01-12 mgs $$14 Added declarations to fix compile errors 14-Oct-96 H-01-13 Bojan $$15 Add Set Up menu. 21-Oct-96 H-01-14 Steve $$16 Activated Section stuff 25-Oct-96 H-01-14 Bojan $$17 Added Done/Return to part and asm menus. 07-Nov-96 H-01-16 Dxu $$18 added pt_family menu 12-Nov-96 H-01-16 Steve $$19 Changes section func 12-Nov-96 H-01-16 Bojan $$20 Added MfgNew() 15-Nov-96 H-01-17 CHI $$21 Added Done to tkmain menu 19-Nov-96 H-01-17 dmp $$22 Use TOOLKIT menu functions 20-Nov-96 H-01-17 mgs $$23 Obselete pt_mfg (old style) 22-Nov-96 H-01-18 mgs $$24 Use -tkmfg button to call gen elem tree code 17-Dec-96 H-01-21 Igor $$25 Remove -Feature button from part mode Removed -Family table Added Obj Window and View buttons 19-Dec-96 H-01-21 mgs $$26 Removed Family table includes 19-Jan-97 H-01-21 Pavel $$27 Added some functions 19-Jan-97 H-01-21 Alexey $$28 Added some functions 21-Jan-97 H-01-24 Igor $$29 Change include Procore.h to ProCore.h 21-Jan-97 H-01-24 Jerry $$30 Conflict avoidance: changed Misc menu item to -Misc 29-Jan-97 H-01-26 CHI $$31 \n in Welcome msg 05-Mar-97 H-01-27 Igor $$32 use PRO_PATH_SIZE for a path string in ProTestChangeDir() 07-Feb-97 H-01-28 Pavel $$33 Added "-components: button into tkasm.mnu 06-Mar-97 H-01-28 Pavel $$34 Added TkDiagram button into diagram.mnu 28-Mar-97 H-01-30 Pavel $$35 Added TkLayout button into diagram.mnu 20-May-97 H-03-11 Alexey $$36 Added -Fam Table -Collection buttons 22-May-97 H-03-12 Pavel $$37 Added -Relations button 29-May-97 H-03-13 Pavel $$38 Added -LayerR18 button 16-Jun-97 H-03-14 Alexey $$39 Added -Interface button 05-Jul-97 H-03-16 Pavel $$40 Added -TkMold menu 13-Jul-97 H-03-17 Pavel $$41 Added ProTestProcstep call 28-Jul-97 H-03-17 amin $$42 Update arg list for ProCmdAction 15-Sep-97 H-03-22 Pavel $$43 Replace Pro/D on Pro/E 26-Sep-97 H-03-24 Pavel $$44 Added -TkDrawing menu 06-Oct-97 H-03-25 Pavel $$45 Type cast 12-Oct-97 H-03-26 Pavel $$46 Move ProTestMoldLayoutMenu() to TestMoldLayout.c 16-Oct-97 H-03-27 Pavel $$47 Added -SimpRep in part menu 04-Nov-97 H-03-29 Pavel $$48 Corrected TEST_CALL_REPORTs 25-Nov-97 H-03-31 CHI $$49 ProLayerXxx R18->R19 (since H-03 is now R20) 12-Jan-98 H-03-36 ljl $$50 Changed menubar function names ProCmdAddAction() -> ProCmdActionAdd() ProMenuAddPushButton() -> ProMenubarmenuPushbuttonAdd() 20-Jan-98 H-03-38 Pavel $$51 Added Menubar menu 12-Feb-98 H-03-39 aab $$52 Removed printfs 17-Mar-98 H-03-41 Alexey $$53 Call ProUtilCommandLineParse() to retrieve application parameters from command line 27-Aug-98 I-01-18 dpek $$54 Renamed mold layout menu 10-Sep-98 I-01-19 Alexey $$55 Added TkFEM menu 15-Oct-98 I-01-23 Alexey $$56 Added TkCavityLayout menu. Removed #include pd_proto.h 03-Nov-98 I-01-25 Akula $$57 Added a new menu function 10-Nov-98 I-01-26 Pavel $$58 Added -Xsec to part and assembly menus 07-Dec-98 I-01-27 Alexey $$59 Added -TkWelding menu 04-May-99 I-03-09 Alexey $$60 Added -TkMoldProd menu 07-Jun-99 I-03-10 CHI $$61 Allow variant version 02-Jun-99 I-03-10 aab $$62 Added External Analysis registration and menu 29-Jul-99 I-03-12+ CHI $$63 remove call to ProIsPTModeler (obsolete) 27-Sep-99 I-03-16 akh $$64 Fix the message: "TEST %s" -> "TEST %0s" 28-Jul-99 I-03-20 akh $$65 Added -Dimension menu 06-NOV-99 I-03-20 integ $$66 Compile error. 13-Nov-99 I-03-21 Shturm $$67 Fixed access to FEM export menus. 29-Feb-00 J-01-05 CHI $$68 cleanup from #63 \*====================================================================*/ /*--------------------------------------------------------------------*\ Pro/TOOLKIT includes \*--------------------------------------------------------------------*/ #include #include "ProObjects.h" #include "ProMdl.h" #include "ProMenu.h" #include "ProMenuBar.h" #include "ProMessage.h" #include "ProUtil.h" #include "ProCore.h" /*--------------------------------------------------------------------*\ Pro/DEVELOP includes \*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*\ C System includes \*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*\ Application includes \*--------------------------------------------------------------------*/ #include "TestError.h" #include "UtilMessage.h" #include "TestSelect.h" #include "TestParams.h" #include "TestExtobj.h" #include "TestDbms.h" #include "TestNotify.h" #include "TestSimpRep.h" #include "TestSetup.h" #include "TestFeat.h" #include "TestSect.h" #include "TestMisc.h" #include "TestGenedata.h" #include "TestMenu.h" #include "UtilString.h" #include "TestAnalysis.h" /*--------------------------------------------------------------------*\ Application macros \*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*\ Application data types \*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*\ Application global/external data \*--------------------------------------------------------------------*/ /*====================================================================*\ FUNCTION : TestAccessDefault() PURPOSE : enable access to the -Main button \*====================================================================*/ static uiCmdAccessState TestAccessDefault(uiCmdAccessMode access_mode) { return (ACCESS_AVAILABLE); } /*====================================================================*\ FUNCTION : main() PURPOSE : To test ProToolkitMain \*====================================================================*/ int main(int argc, char**argv) { fprintf(stderr, "Welcome to PRO/TOOLKIT -the \"pt_example\" program\n"); ProToolkitMain(argc, argv); return (0); } /*====================================================================*\ FUNCTION : user_initialize() PURPOSE : Pro/DEVELOP standard initialize - define menus. \*====================================================================*/ int user_initialize( int argc, /** Number of arguments **/ char *argv[], /** Pro/E arguments **/ char *proe_vsn, /** Pro/E version **/ char *build, /** Pro/E build **/ wchar_t err_buff[]) /** Error buffer **/ { ProError status; ProPath w_path; int menu_id; int size, a, m, n; double d; char c, str[PRO_PATH_SIZE], path[PRO_PATH_SIZE]; ProComment w_com; int ProTestMain(); int ProTestPart(); int ProTestAsm(); int ProTestDraw(); int ProTestDiagram(); int ProTestLayout(); int ProTestMfg(); int ProTestMfgNew(); int ProTestMoldLayoutMenu(); int ProTestProcstep(); int ProTestWeldMenu(); int ProTestReport(); ProError ProTestFemMeshMenu(); ProError ProTestCavityLayoutMenu(); int ProTestMoldProd(); ProFileName message_file; uiCmdCmdId cmd_id; /*--------------------------------------------------------------------*\ Check the size of wchar_t \*--------------------------------------------------------------------*/ status = ProWcharSizeVerify( sizeof(wchar_t), &size ); TEST_CALL_REPORT( "ProWcharSizeVerify()", "user_initialize()", status, status !=PRO_TK_NO_ERROR ); if( status !=PRO_TK_NO_ERROR ) { sprintf(str,"ERROR wchar_t has size %d - should be %d", sizeof(wchar_t), size ); ProUtilMsgPrint("gen", "TEST %0s", str); printf("%s\n", str); return(-1); } /*--------------------------------------------------------------------*\ Check that the Pro/E version and build are OK \*--------------------------------------------------------------------*/ if(proe_vsn == NULL) { strcpy(str,"Pro/E version set to NULL"); ProUtilMsgPrint("gen", "TEST %0s", str); printf("%s\n",str); ProStringToWstring(err_buff, str); return(-1); } if((sscanf(proe_vsn, "%f", &d) < 1) && /* Customer install */ (sscanf(proe_vsn, "%c-%d-%d", &c, &m, &n) < 3) &&/* Internal build */ (sscanf(proe_vsn, "%c-%d", &c, &m) < 2)) /* temp internal vsn */ { sprintf(str, "Pro/E version invalid : %s", proe_vsn); ProUtilMsgPrint("gen", "TEST %0s", str); printf("%s\n",str); ProStringToWstring(err_buff, str); return(-1); } if(build == NULL) { strcpy(str, "Pro/E build set to NULL"); ProUtilMsgPrint("gen", "TEST %0s", str); printf("%s\n",str); ProStringToWstring(err_buff, str); return(-1); } if(sscanf(build, "%d", &a) < 1) { sprintf(str, "Pro/E build invalid : %s", build); ProUtilMsgPrint("gen", "TEST %0s", str); printf("%s\n",str); ProStringToWstring(err_buff, str); return(-1); } /*--------------------------------------------------------------------*\ Parse the command line setting application parameters \*--------------------------------------------------------------------*/ ProUtilCommandLineParse( argc, argv ); /*--------------------------------------------------------------------*\ Print the input arguments \*--------------------------------------------------------------------*/ printf("\n"); for(a=0;a 4) ProTestErrlogOpen(argv[4], proe_vsn, build); else ProTestErrlogOpen("pt_toolkit", proe_vsn, build); /*--------------------------------------------------------------------*\ Test ProToolkit functions \*--------------------------------------------------------------------*/ TEST_CALL_REPORT("ProToolkitMain()", "user_initialize()", 0, 0); TEST_CALL_REPORT( "ProWcharSizeVerify()", "user_initialize()", status , 0); status = ProToolkitApplExecPathGet( w_path ); TEST_CALL_REPORT( "ProToolkitApplExecPathGet()", "user_initialize()", status, status != PRO_TK_NO_ERROR ); sprintf(str, "Exec path is %0s", ProWstringToString( path, w_path )); ProUtilMsgPrint( "gen", "TEST %0s", str); ProMessageClear(); TEST_CALL_REPORT( "ProMessageClear()", "user_initialize()", 0, 0 ); status = ProToolkitApplTextPathGet( w_path ); TEST_CALL_REPORT( "ProToolkitApplTextPathGet()", "user_initialize()", status, status != PRO_TK_NO_ERROR ); sprintf(str, "Text path is %0s", ProWstringToString( path, w_path )); ProUtilMsgPrint( "gen", "TEST %0s", str); ProMessageClear(); TEST_CALL_REPORT( "ProMessageClear()", "user_initialize()", 0, 0 ); /*---------------------------------------------------------------------*\ Add new button to the menu bar \*---------------------------------------------------------------------*/ status = ProCmdActionAdd("-Main", (uiCmdCmdActFn)ProTestMain, uiProe2ndImmediate, TestAccessDefault, PRO_B_TRUE, PRO_B_TRUE, &cmd_id); TEST_CALL_REPORT("ProCmdActionAdd", "user_initialize", status, status != PRO_TK_NO_ERROR); status = ProMenubarmenuPushbuttonAdd( "Utilities", "-Main", "-Main", "Non-mode-specific Pro/TOOLKIT test commands", "Utilities.psh_util_aux", PRO_B_TRUE, cmd_id, ProStringToWstring(message_file, "gen_msg.txt")); TEST_CALL_REPORT("ProMenubarmenuPushbuttonAdd", "user_initialize", status, status != PRO_TK_NO_ERROR); /*--------------------------------------------------------------------*\ Add to the part menu. \*--------------------------------------------------------------------*/ #ifndef PT_PRODUCTS_BUILD ProMenuFileRegister("part","part.mnu", &menu_id); status = ProMenuAuxfileRegister("part","part.aux", &menu_id); TEST_CALL_REPORT("ProMenuAuxfileRegister()", "user_initialize()", status, status !=PRO_TK_NO_ERROR); ProMenubuttonActionSet("part","-TkPart", (ProMenubuttonAction)ProTestPart, NULL, 0); #else ProMenuFileRegister("jr_part", "jnew_part.mnu", &menu_id); status = ProMenuAuxfileRegister("jr_part", "part.aux", &menu_id); TEST_CALL_REPORT("ProMenuAuxfileRegister()", "user_initialize()", status, status !=PRO_TK_NO_ERROR); ProMenubuttonActionSet("jr_part", "-TkPart", ProTestPart, NULL, 0); #endif /*--------------------------------------------------------------------*\ Add to the assembly menu. \*--------------------------------------------------------------------*/ ProMenuFileRegister("assembly","assembly.mnu", &menu_id); status = ProMenuAuxfileRegister("assembly","assembly.aux", &menu_id); TEST_CALL_REPORT("ProMenuAuxfileRegister()", "user_initialize()", status, status !=PRO_TK_NO_ERROR); ProMenubuttonActionSet("assembly","-TkAsm", (ProMenubuttonAction)ProTestAsm, NULL, 0); /*--------------------------------------------------------------------*\ Add to the diagram menu. \*--------------------------------------------------------------------*/ ProMenuFileRegister("diagram","diagram.mnu", &menu_id); status = ProMenuAuxfileRegister("diagram","diagram.aux", &menu_id); TEST_CALL_REPORT("ProMenuAuxfileRegister()", "user_initialize()", status, status !=PRO_TK_NO_ERROR); ProMenubuttonActionSet("diagram","-TkDiagram", (ProMenubuttonAction)ProTestDiagram, NULL, 0); /*--------------------------------------------------------------------*\ Add to the Layout menu. \*--------------------------------------------------------------------*/ ProMenuFileRegister("layout","layout.mnu", &menu_id); status = ProMenuAuxfileRegister("layout","layout.aux", &menu_id); TEST_CALL_REPORT("ProMenuAuxfileRegister()", "user_initialize()", status, status !=PRO_TK_NO_ERROR); ProMenubuttonActionSet("layout","-TkLayout", (ProMenubuttonAction)ProTestLayout, NULL, 0); /*--------------------------------------------------------------------*\ Add to the manufacturing menu \*--------------------------------------------------------------------*/ ProMenuFileRegister("manufacture","mfg.mnu", &menu_id); status = ProMenuAuxfileRegister("manufacture","mfg.aux", &menu_id); TEST_CALL_REPORT("ProMenuAuxfileRegister()", "user_initialize()", status, status !=PRO_TK_NO_ERROR); ProMenubuttonActionSet("manufacture","-TkMfg", (ProMenubuttonAction)ProTestMfg, NULL,0); ProMenubuttonActionSet("manufacture","-TkMfgNew", (ProMenubuttonAction)ProTestMfgNew, NULL, 0); /*--------------------------------------------------------------------*\ Add to the mold menu \*--------------------------------------------------------------------*/ ProMenuFileRegister("mold","mold.mnu", &menu_id); ProMenuAuxfileRegister("mold","mold.aux", &menu_id); ProMenubuttonActionSet("mold","-TkCavityLayout", (ProMenubuttonAction)ProTestCavityLayoutMenu,NULL,0); /*--------------------------------------------------------------------*\ Add to the mold layout menu \*--------------------------------------------------------------------*/ ProMenuFileRegister("Mold_Layout20", "rmdt.mnu", &menu_id); ProMenuAuxfileRegister("Mold_Layout20", "rmdt.aux", &menu_id); ProMenubuttonActionSet("Mold_Layout20", "-TkMold Layout", (ProMenubuttonAction)ProTestMoldLayoutMenu, NULL, 0); /*--------------------------------------------------------------------*\ Add to the asm#process menu \*--------------------------------------------------------------------*/ ProMenuFileRegister("Asm process", "asmprocess.mnu", &menu_id); ProMenuAuxfileRegister("Asm process", "asmprocess.aux", &menu_id); ProMenubuttonActionSet("Asm process", "-Step Active Set", (ProMenubuttonAction)ProTestProcstep, NULL, 0); /*--------------------------------------------------------------------*\ Add to the drawing menu. \*--------------------------------------------------------------------*/ ProMenuFileRegister("drawing","draw.mnu", &menu_id); status = ProMenuAuxfileRegister("drawing","draw.aux", &menu_id); TEST_CALL_REPORT("ProMenuAuxfileRegister()", "user_initialize()", status, status !=PRO_TK_NO_ERROR); ProMenubuttonActionSet("drawing","-TkDrawing", (ProMenubuttonAction)ProTestDraw, NULL, 0); ProStringToWstring(w_com, "Application pt_examples started"); status = ProTrailfileCommentWrite(w_com); TEST_CALL_REPORT("ProTrailfileCommentWrite()", "user_initialize()", status, status != PRO_TK_NO_ERROR); /*--------------------------------------------------------------------*\ Add to the FEM menu. \*--------------------------------------------------------------------*/ ProMenuFileRegister("assembly","assembly.mnu", &menu_id); status = ProMenuAuxfileRegister("assembly","tk_fem.aux", &menu_id); ProMenubuttonActionSet("assembly","TkFEM", (ProMenubuttonAction)ProTestFemMeshMenu, NULL, 0); /*--------------------------------------------------------------------*\ Add to the welding menu. \*--------------------------------------------------------------------*/ ProMenuFileRegister("welding","welding.mnu", &menu_id); ProMenuAuxfileRegister("welding","welding.aux", &menu_id); ProMenubuttonActionSet("welding","-TkWelding", (ProMenubuttonAction)ProTestWeldMenu, NULL, 0); /*--------------------------------------------------------------------*\ Add to the mold product menu. \*--------------------------------------------------------------------*/ ProMenuFileRegister("MOLD LAYOUT","moldprod.mnu", &menu_id); ProMenuAuxfileRegister("MOLD LAYOUT","moldprod.aux", &menu_id); ProMenubuttonActionSet("MOLD LAYOUT","-TkMoldProd", (ProMenubuttonAction)ProTestMoldProd,NULL,0); /*--------------------------------------------------------------------*\ Add to the report menu. \*--------------------------------------------------------------------*/ ProMenuFileRegister("report","report.mnu", &menu_id); ProMenuAuxfileRegister("report","report.aux", &menu_id); ProMenubuttonActionSet("report","-TkReport", (ProMenubuttonAction)ProTestReport, NULL, 0); /*--------------------------------------------------------------------*\ Register analysis types \*--------------------------------------------------------------------*/ ProTestAnalysisRegister (); /*--------------------------------------------------------------------*\ Add button to Resolve Feat menu \*--------------------------------------------------------------------*/ ProTestResolveFeatMenu (); return(0); } /*====================================================================*\ FUNCTION : user_terminate() PURPOSE : Pro/DEVELOP standard termination \*====================================================================*/ void user_terminate() { ProTestErrlogClose(); } /*====================================================================*\ FUNCTION : ProTestMain() PURPOSE : Define and activate menu of Toolkit Test commands which are not mode-specific and therefore appear below the Main Menu. \*====================================================================*/ int ProTestMain() { int menu_id, action; int ProTestViewMenu(); int ProTestObjWinMenu(); int ProTestChangeDir(); int ProTestMessage(); int ProTestMacro(); int ProTestConfig(); int ProTestMenuBar(); ProMenuFileRegister("TkMain", "tkmain.mnu", &menu_id); ProMenubuttonActionSet("TkMain","-Notify", (ProMenubuttonAction)ProTestNotify, NULL, 0); ProMenubuttonActionSet("TkMain","-Dbms", (ProMenubuttonAction)ProTestDbms, NULL, 0); ProMenubuttonActionSet("TkMain","-Section", (ProMenubuttonAction)ProTestSectionMenuAction, NULL, 0); ProMenubuttonActionSet("TkMain","-Simp Rep", (ProMenubuttonAction)ProTestSRepRetrieve, NULL, 0); ProMenubuttonActionSet("TkMain","-Menus", (ProMenubuttonAction)ProTestMenus, NULL, 0); ProMenubuttonActionSet("TkMain","-MenuBar", (ProMenubuttonAction)ProTestMenuBar, NULL, 0); ProMenubuttonActionSet("TkMain","-Message", (ProMenubuttonAction)ProTestMessage, NULL, 0); ProMenubuttonActionSet("TkMain","-Macro", (ProMenubuttonAction)ProTestMacro, NULL, 0); ProMenubuttonActionSet("TkMain","-Obj Windows", (ProMenubuttonAction)ProTestObjWinMenu, NULL, 0); ProMenubuttonActionSet("TkMain","-View", (ProMenubuttonAction) ProTestViewMenu, NULL, 0); ProMenubuttonActionSet("TkMain","-Change dir", (ProMenubuttonAction)ProTestChangeDir, NULL, 0); ProMenubuttonActionSet("TkMain","-Config Opt", (ProMenubuttonAction)ProTestConfig, NULL, 0); ProMenubuttonActionSet("TkMain","-Done", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenubuttonActionSet("TkMain","TkMain", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenuCreate(PROMENUTYPE_MAIN, "TkMain", &menu_id); ProMenuProcess("", &action); return(0); } /*====================================================================*\ FUNCTION : ProTestPart() PURPOSE : Define and activate menu of Toolkit Test commands for parts \*====================================================================*/ int ProTestPart() { ProMdl part; ProError status; int ProTestFeatures(ProMdl *); int ProTestAnalysis (); int ProTestGeometry(); int ProTestGeneData(); int ProTestMisc(); int ProTestLayerMenu(); int ProTestLayerR19Menu(); int ProTestAnimation(); int ProTestGraphics(); int ProTestPartMaterial(); int ProTestFamlyTabMenu(); int ProTestCollection(); int ProTestRelationsMenu(); int ProTestInterface(); int ProTestXsec(); int ProTestDimensionMenu(); int menu_id, action; status = ProMdlCurrentGet(&part); TEST_CALL_REPORT("ProMdlCurrentGet()", "ProTestPart()", status, status != PRO_TK_NO_ERROR); ProMenuPush(); ProMenuFileRegister("TkPart","tkpart.mnu", &menu_id); ProMenubuttonActionSet("TkPart","TkPart", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenubuttonActionSet("TkPart","-ExtAnalysis", (ProMenubuttonAction)ProTestAnalysis, &part, 0); ProMenubuttonActionSet("TkPart","-Features", (ProMenubuttonAction)ProTestFeatures, &part, 0); ProMenubuttonActionSet("TkPart","-Geometry", (ProMenubuttonAction)ProTestGeometry, &part, 0); ProMenubuttonActionSet("TkPart","-Selection", (ProMenubuttonAction)ProTestSelection, &part, 0); ProMenubuttonActionSet("TkPart","-Parameters", (ProMenubuttonAction)ProTestParams, &part, 0); ProMenubuttonActionSet("TkPart","-Family Tab", (ProMenubuttonAction)ProTestFamlyTabMenu, &part, 0); ProMenubuttonActionSet("TkPart","-Extobj", (ProMenubuttonAction)ProTestExtobj, &part, 0); ProMenubuttonActionSet("TkPart","-Dbms", (ProMenubuttonAction)ProTestDbms, &part, 0); ProMenubuttonActionSet("TkPart","-SimpRep", (ProMenubuttonAction)ProTestSimpRep, &part, 0); ProMenubuttonActionSet("TkPart","-Interface", (ProMenubuttonAction)ProTestInterface, &part, 0); ProMenubuttonActionSet("TkPart","-Set Up", (ProMenubuttonAction)ProTestSetupMnu, &part, 0); ProMenubuttonActionSet("TkPart","-Layer", (ProMenubuttonAction)ProTestLayerMenu, &part, 0); ProMenubuttonActionSet("TkPart","-LayerR19", (ProMenubuttonAction)ProTestLayerR19Menu, &part, 0); ProMenubuttonActionSet("TkPart","-Appdata", (ProMenubuttonAction)ProTestGeneData, &part, 0); ProMenubuttonActionSet("TkPart","-Misc", (ProMenubuttonAction)ProTestMisc, &part, 0); ProMenubuttonActionSet("TkPart","-Animation", (ProMenubuttonAction)ProTestAnimation, NULL, 0); ProMenubuttonActionSet("TkPart","-Graphics", (ProMenubuttonAction)ProTestGraphics, NULL, 0); ProMenubuttonActionSet( "TkPart","-Material", (ProMenubuttonAction)ProTestPartMaterial, &part, 0); ProMenubuttonActionSet( "TkPart","-Collection", (ProMenubuttonAction)ProTestCollection, &part, 0); ProMenubuttonActionSet( "TkPart","-Relations", (ProMenubuttonAction)ProTestRelationsMenu, &part, 0); ProMenubuttonActionSet("TkPart","-Done/Return", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenubuttonActionSet("TkPart","-Xsec", (ProMenubuttonAction)ProTestXsec, &part, 0); ProMenubuttonActionSet("TkPart","-Dimension", (ProMenubuttonAction)ProTestDimensionMenu, &part, 0); ProMenuCreate(PROMENUTYPE_MAIN, "TkPart", &menu_id); ProMenuProcess("", &action); ProMenuPop(); return(0); } /*====================================================================*\ FUNCTION : ProTestAsm() PURPOSE : Define and activate menu of Toolkit Test commands for assemblies. \*====================================================================*/ int ProTestAsm() { ProMdl assembly; ProError status; int ProTestFeatures(ProMdl *); int ProTestGeometry(); int ProTestMisc(); int ProTestLayerMenu(); int ProTestLayerR19Menu(); int ProTestAnimation(); int ProTestAsmFunc(); int ProTestAsmcomppathFunc(); int ProTestAsmcompFunc(); int ProTestGraphics(); int ProTestFamlyTabMenu(); int ProTestCollection(); int ProTestInterface(); int ProTestXsec(); int ProTestDimensionMenu(); int menu_id, action; int ProTestExtrnReferences (ProMdl *model); /* TestExtref.c */ status = ProMdlCurrentGet(&assembly); TEST_CALL_REPORT("ProMdlCurrentGet()", "ProTestAsm()", status, status != PRO_TK_NO_ERROR); ProMenuFileRegister("TkAsm","tkasm.mnu", &menu_id); ProMenubuttonActionSet("TkAsm","TkAsm", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenubuttonActionSet("TkAsm","-Features", (ProMenubuttonAction)ProTestFeatures, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Geometry", (ProMenubuttonAction)ProTestGeometry, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Selection", (ProMenubuttonAction)ProTestSelection, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Parameters", (ProMenubuttonAction)ProTestParams, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Family Tab", (ProMenubuttonAction)ProTestFamlyTabMenu, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Extobj", (ProMenubuttonAction)ProTestExtobj, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Dbms", (ProMenubuttonAction)ProTestDbms, &assembly, 0); ProMenubuttonActionSet("TkAsm","-SimpRep", (ProMenubuttonAction)ProTestSimpRep, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Interface", (ProMenubuttonAction)ProTestInterface, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Set Up", (ProMenubuttonAction)ProTestSetupMnu, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Layer", (ProMenubuttonAction)ProTestLayerMenu, &assembly, 0); ProMenubuttonActionSet("TkAsm","-LayerR19", (ProMenubuttonAction)ProTestLayerR19Menu, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Misc", (ProMenubuttonAction)ProTestMisc, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Expl/Unexpl", (ProMenubuttonAction)ProTestAsmFunc, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Rotate comp", (ProMenubuttonAction)ProTestAsmcomppathFunc, &assembly,0); ProMenubuttonActionSet("TkAsm","-Components", (ProMenubuttonAction)ProTestAsmcompFunc, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Animation", (ProMenubuttonAction)ProTestAnimation, NULL, 0); ProMenubuttonActionSet("TkAsm","-Graphics", (ProMenubuttonAction)ProTestGraphics, NULL, 0); ProMenubuttonActionSet("TkAsm","-Collection", (ProMenubuttonAction)ProTestCollection, &assembly, 0); ProMenubuttonActionSet("TkAsm","-ExtRef", (ProMenubuttonAction)ProTestExtrnReferences, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Xsec", (ProMenubuttonAction)ProTestXsec, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Dimension", (ProMenubuttonAction)ProTestDimensionMenu, &assembly, 0); ProMenubuttonActionSet("TkAsm","-Done/Return", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenuCreate(PROMENUTYPE_MAIN, "TkAsm", &menu_id); ProMenuProcess("", &action); return(0); } /*====================================================================*\ FUNCTION : ProTestDiagram() PURPOSE : Define and activate menu of Toolkit Test commands for diagram \*====================================================================*/ int ProTestDiagram() { ProMdl diagram; ProError status; int ProTestLayerMenu(); int ProTestLayerR19Menu(); int menu_id, action; status = ProMdlCurrentGet(&diagram); TEST_CALL_REPORT("ProMdlCurrentGet()", "ProTestDiagram()", status, status != PRO_TK_NO_ERROR); ProMenuFileRegister("TkDiagram","tkdiagram.mnu", &menu_id); ProMenubuttonActionSet("TkDiagram","TkDiagram", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenubuttonActionSet("TkDiagram","-Layer", (ProMenubuttonAction)ProTestLayerMenu, &diagram, 0); ProMenubuttonActionSet("TkDiagram","-LayerR19", (ProMenubuttonAction)ProTestLayerR19Menu, &diagram, 0); ProMenubuttonActionSet("TkDiagram","Done TkDiagram", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenuCreate(PROMENUTYPE_MAIN, "TkDiagram", &menu_id); ProMenuProcess("", &action); return(0); } int ProTestMfg() { ProMdl mfg; ProError status; int ProTestFeatures(ProMdl *); status = ProMdlCurrentGet(&mfg); status = ProTestFeatures(&mfg); return 0; } /*====================================================================*\ FUNCTION : ProTestLayout() PURPOSE : Define and activate menu of Toolkit Test commands for layout \*====================================================================*/ int ProTestLayout() { ProMdl layout; ProError status; int ProTestLayerMenu(); int ProTestLayerR19Menu(); int menu_id, action; status = ProMdlCurrentGet(&layout); TEST_CALL_REPORT("ProMdlCurrentGet()", "ProTestLayout()", status, status != PRO_TK_NO_ERROR); ProMenuFileRegister("TkLayout","tklayout.mnu", &menu_id); ProMenubuttonActionSet("TkLayout","TkLayout", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenubuttonActionSet("TkLayout","-Parameters", (ProMenubuttonAction)ProTestParams, &layout, 0); ProMenubuttonActionSet("TkLayout","Done TkLayout", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenuCreate(PROMENUTYPE_MAIN, "TkLayout", &menu_id); ProMenuProcess("", &action); return(0); } /*====================================================================*\ FUNCTION : ProTestChangeDir() PURPOSE : Change Pro/E to a new directory \*====================================================================*/ int ProTestChangeDir() { char dir[PRO_PATH_SIZE]; char str[PRO_PATH_SIZE]; ProPath w_dir; static ProPath last_dir; ProError status; ProUtilMsgPrint("gen", "TEST %0s", "Enter a directory name or :"); if (ProUtilStringGet(w_dir, NULL, PRO_LINE_SIZE)==0) return (0); if (ProUtilStrnwscmp("", w_dir, 6)==0) { status = ProDirectoryChange(last_dir); } else { status = ProDirectoryCurrentGet(last_dir); TEST_CALL_REPORT("ProDirectoryCurrentGet()", "ProTestChangeDir()", status, status !=PRO_TK_NO_ERROR); status = ProDirectoryChange(w_dir); } TEST_CALL_REPORT("ProDirectoryChange()", "ProTestChangeDir()", status, 0); if (status == PRO_TK_NO_ERROR) ProUtilMsgPrint("gen", "TEST %0s", "Directory succesfully changed"); else ProUtilMsgPrint("gen", "TEST %0s", "Directory NOT changed"); ProMessageClear(); status = ProDirectoryCurrentGet(w_dir); TEST_CALL_REPORT("ProDirectoryCurrentGet()", "ProTestChangeDir()", status, status !=PRO_TK_NO_ERROR); ProWstringToString(dir, w_dir); sprintf (str, "Current directory is %s", dir); ProUtilMsgPrint("gen", "TEST %0s", str); return(0); } /*====================================================================*\ FUNCTION : ProTestLayout() PURPOSE : Define and activate menu of Toolkit Test commands for mold products \*====================================================================*/ int ProTestMoldProd () { ProMdl mdl; ProError err; int menu_id, action; int ProTestImm (); int ProTestMoldBase (); err = ProMdlCurrentGet(&mdl); TEST_CALL_REPORT("ProMdlCurrentGet()", "ProTestMoldProd()", err, err != PRO_TK_NO_ERROR); ProMenuFileRegister("TkMoldProd","tkmoldprod.mnu", &menu_id); ProMenubuttonActionSet("TkMoldProd","TkMoldProd", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenubuttonActionSet("TkMoldProd","-MoldBase", (ProMenubuttonAction)ProTestMoldBase, mdl, 0); ProMenubuttonActionSet("TkMoldProd","-Imm", (ProMenubuttonAction)ProTestImm, mdl, 0); ProMenuCreate(PROMENUTYPE_MAIN, "TkMoldProd", &menu_id); ProMenuProcess("", &action); return (0); } int ProTestReport() { ProError status; ProMdl model; int action; int ProTestLayerMenu(ProMdl *mod); int ProTestDrwSimpRep(); ProError ProTestDrwTable(ProDrawing drawing); status = ProMdlCurrentGet(&model); TEST_CALL_REPORT("ProMdlCurrentGet()", "ProTestReport()", status, status != PRO_TK_NO_ERROR); ProMenuPush (); ProMenuFileRegister("TkReport","tkreport.mnu", NULL); ProMenubuttonActionSet("TkReport","-Table", (ProMenubuttonAction)ProTestDrwTable, &model, 0); ProMenubuttonActionSet("TkReport","-simp rep", (ProMenubuttonAction)ProTestDrwSimpRep, &model, 0); ProMenubuttonActionSet("TkReport","TkReport", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenubuttonActionSet("TkReport","-Done/Return", (ProMenubuttonAction)ProMenuDelete, NULL, 0); ProMenuCreate(PROMENUTYPE_MAIN, "TkReport", NULL); ProMenuProcess("", &action); ProMenuPop(); return (0); }