/* Copyright (c) 2024 PTC Inc. and/or Its Subsidiary Companies. All Rights Reserved. */ /*--------------------------------------------------------------------*\ Pro/Toolkit includes -- include this first \*--------------------------------------------------------------------*/ #include <ProToolkit.h> #include <ProNcseq.h> #include <ProMenu.h> /*--------------------------------------------------------------------*\ Application macros \*--------------------------------------------------------------------*/ #include "TestError.h" #include "UtilString.h" #include "UtilMessage.h" /*--------------------------------------------------------------------*\ Application data types \*--------------------------------------------------------------------*/ #include "MfgMenu.h" #include "TestMfgNew.h" #include <ProTKRunTime.h> /*====================================================================*\ FUNCTION : ProTestWkcellCreate PURPOSE : ProTestWkcellCreate \*====================================================================*/ ProError ProTestWkcellCreate(MfgMenuChoice *obj_action) { ProMfg mfg_model = NULL; ProSolid mfg_solid = NULL; ProFeature wc_feature; ProAsmcomppath comp_path; ProError status = PRO_TK_NO_ERROR; wchar_t wcell_name[PRO_LINE_SIZE]; int done_quit; static char *menu[] = {"TkMfgWcell","TkMfgWAxs","TkMfgWDQ",""}; Workcell wcell; int id; int ProTestChooseWcellType(Workcell *wcell, int opt); int ProTestWcellDQ(int *done_quit, int opt); wcell.type = PRO_WCELL_LATHE; wcell.n_axis = -(WKCL_AXIS_2); status = ProMenuPush(); TEST_CALL_REPORT ("ProMenuPush", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenuFileRegister((char*)"TkMfgWcell",(char*)"tkmfgwcell.mnu", &id); TEST_CALL_REPORT ("ProMenuPush", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWcell",(char*)"TkMfgWcell", (ProMenubuttonAction)ProMenuHold,NULL,0); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWcell",(char*)"-Lathe", (ProMenubuttonAction)ProTestChooseWcellType, &wcell, PRO_WCELL_LATHE); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWcell",(char*)"-Mill", (ProMenubuttonAction)ProTestChooseWcellType, &wcell, PRO_WCELL_MILL); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWcell",(char*)"-Mill/Turn", (ProMenubuttonAction)ProTestChooseWcellType, &wcell, PRO_WCELL_MILL_N_TRN); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWcell",(char*)"-Wedm", (ProMenubuttonAction)ProTestChooseWcellType, &wcell, PRO_WCELL_WEDM); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenuDatamodeSet((char*)"TkMfgWcell", (ProBoolean)0); TEST_CALL_REPORT ("ProMenuDatamodeSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenuFileRegister((char*)"TkMfgWAxs",(char*)"tkmfgwaxs.mnu", &id); TEST_CALL_REPORT ("ProMenuPush", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWAxs",(char*)"TkMfgWAxs", (ProMenubuttonAction)ProMenuHold,NULL,0); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWAxs",(char*)"-2 Axis", (ProMenubuttonAction)ProTestChooseWcellType, &wcell, WKCL_AXIS_2); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWAxs",(char*)"-3 Axis", (ProMenubuttonAction)ProTestChooseWcellType, &wcell, WKCL_AXIS_3); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWAxs",(char*)"-4 Axis", (ProMenubuttonAction)ProTestChooseWcellType, &wcell, WKCL_AXIS_4); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWAxs",(char*)"-5 Axis", (ProMenubuttonAction)ProTestChooseWcellType, &wcell, WKCL_AXIS_5); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenuDatamodeSet((char*)"TkMfgWAxs", (ProBoolean)0); TEST_CALL_REPORT ("ProMenuDatamodeSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenuFileRegister((char*)"TkMfgWDQ",(char*)"tkmfgwdq.mnu", &id); TEST_CALL_REPORT ("ProMenuFileRegister", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWDQ",(char*)"TkMfgWDQ", (ProMenubuttonAction)ProMenuHold,NULL,0); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWDQ",(char*)"Done", (ProMenubuttonAction)ProTestWcellDQ, &done_quit, MFGTK_DONE); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActionSet((char*)"TkMfgWDQ",(char*)"Quit", (ProMenubuttonAction)ProTestWcellDQ, &done_quit, MFGTK_QUIT); TEST_CALL_REPORT ("ProMenubuttonActionSet", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProCompoundmenuCreate(menu, &id); TEST_CALL_REPORT ("ProCompoundmenuCreate", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWcell",(char*)"-Lathe"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonDeactivate((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonDeactivate", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonDeactivate((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonDeactivate", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenuProcess(menu[0], &id); TEST_CALL_REPORT ("ProMenuProcess", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); if( done_quit == MFGTK_QUIT ) { status = ProMenuPop(); TEST_CALL_REPORT ("ProMenuPop", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgDQ",(char*)"Done"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); return((ProError)0); } /* Choose Wcell name. */ ProUtilMsgPrint((char*)"gen", (char*)"TEST %0s", (char*)"Enter MFG Workcell name: "); if(!ProUtilStringGet(wcell_name, NULL, PRO_LINE_SIZE)) return(PRO_TK_BAD_INPUTS); wcell.wname = wcell_name; status = ProTestGetModels(&mfg_model, &mfg_solid, &comp_path); status = ProTempCreateWkcell(wcell, &wc_feature); ProTKPrintf((char*)"ProTempCreateWkcell: wc_feature = %d\n", wc_feature); /* Return to previous menu. */ status = ProMenuPop(); TEST_CALL_REPORT ("ProMenuPop", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgDQ",(char*)"Done"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgAct",(char*)"-Redefine"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestWkcellCreate", status, status != PRO_TK_NO_ERROR); return ((ProError)1); } /*====================================================================*\ FUNCTION : ProTestChooseWcellType PURPOSE : ProTestChooseWcellType \*====================================================================*/ int ProTestChooseWcellType(Workcell *wcell, int opt) { ProError status; switch(opt) { /* Set mfg. object type. */ case PRO_WCELL_LATHE: status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Mill"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Mill/Turn"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Wedm"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonDeactivate((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonDeactivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonDeactivate((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonDeactivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWcell",(char*)"-Lathe"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); wcell->type = PRO_WCELL_LATHE; wcell->n_axis = -(WKCL_AXIS_2); break; case PRO_WCELL_MILL: status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Lathe"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Mill/Turn"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Wedm"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonDeactivate((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonDeactivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWcell",(char*)"-Mill"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); wcell->type = PRO_WCELL_MILL; wcell->n_axis = -(WKCL_AXIS_3); break; case PRO_WCELL_MILL_N_TRN: status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Lathe"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Mill"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Wedm"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWcell",(char*)"-Mill/Turn"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); wcell->type = PRO_WCELL_MILL_N_TRN; wcell->n_axis = -(WKCL_AXIS_2); break; case PRO_WCELL_WEDM: status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Lathe"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Mill"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWcell",(char*)"-Mill/Turn"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonDeactivate((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonDeactivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonDeactivate((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonDeactivate", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWcell",(char*)"-Wedm"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); wcell->type = PRO_WCELL_WEDM; wcell->n_axis = -(WKCL_AXIS_2); break; case WKCL_AXIS_2: status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); wcell->n_axis = -(WKCL_AXIS_2); break; case WKCL_AXIS_3: status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); wcell->n_axis = -(WKCL_AXIS_3); break; case WKCL_AXIS_4: status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); wcell->n_axis = -(WKCL_AXIS_4); break; case WKCL_AXIS_5: status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-2 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-3 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgWAxs",(char*)"-4 Axis"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonHighlight((char*)"TkMfgWAxs",(char*)"-5 Axis"); TEST_CALL_REPORT ("ProMenubuttonHighlight", "ProTestChooseWcellType", status, status != PRO_TK_NO_ERROR); wcell->n_axis = -(WKCL_AXIS_5); break; default: break; } return(0); } /*====================================================================*\ FUNCTION : ProTestWcellDQ PURPOSE : ProTestWcellDQ \*====================================================================*/ int ProTestWcellDQ(int *done_quit, int opt) { ProError status; switch(opt) { case MFGTK_DONE: status = ProMenuDelete(); TEST_CALL_REPORT ("ProMenuDelete", "ProTestWcellDQ", status, status != PRO_TK_NO_ERROR); status = ProMenuDelete(); TEST_CALL_REPORT ("ProMenuDelete", "ProTestWcellDQ", status, status != PRO_TK_NO_ERROR); status = ProMenuDelete(); TEST_CALL_REPORT ("ProMenuDelete", "ProTestWcellDQ", status, status != PRO_TK_NO_ERROR); *done_quit = MFGTK_DONE; break; case MFGTK_QUIT: status = ProMenuDelete(); TEST_CALL_REPORT ("ProMenuDelete", "ProTestWcellDQ", status, status != PRO_TK_NO_ERROR); status = ProMenuDelete(); TEST_CALL_REPORT ("ProMenuDelete", "ProTestWcellDQ", status, status != PRO_TK_NO_ERROR); status = ProMenuDelete(); TEST_CALL_REPORT ("ProMenuDelete", "ProTestWcellDQ", status, status != PRO_TK_NO_ERROR); *done_quit = MFGTK_QUIT; break; default: break; } return(0); } ProError ProTestWkcellId(ProAppData p_wcell, ProAppData app_data, int ts) { *((int*)app_data) = ((ProModelitem*)p_wcell)->id ; ProTKFprintf(stderr, (char*)"In ProTestWkcellId()\n"); ProTKFprintf(stderr, (char*)"Workcell id = %d\n", ((ProModelitem*)p_wcell)->id ); ProTKFprintf(stderr, (char*)"App data = %d\n", *((int*)app_data)); return PRO_TK_NO_ERROR; } /*====================================================================*\ FUNCTION : ProTestWkcellList PURPOSE : ProTestWkcellList \*====================================================================*/ int ProTestWkcellList( MfgMenuChoice *obj_action ) { ProError status; int wcll_id = -1; status = ProUtilMfgobjAction(obj_action, MFGOBJ_WKCELL, 1, ProTestWkcellId, &wcll_id, 0 ); ProTKFprintf(stderr, (char*)"In ProTestWkcellList()\n"); ProTKFprintf(stderr, (char*)"Workcell id = %d\n", wcll_id); return(0); } /*====================================================================*\ FUNCTION : ProTestWkcellRedefine PURPOSE : ProTestWkcellRedefine \*====================================================================*/ ProError ProTestWkcellRedefine(MfgMenuChoice *obj_action) { ProError status = PRO_TK_NO_ERROR; status = ProMenuPush(); TEST_CALL_REPORT ("ProMenuPush", "ProWkcellRedefine", status, status != PRO_TK_NO_ERROR); ProTestWkcellList(obj_action); /* Return to previous menu. */ status = ProMenuPop(); TEST_CALL_REPORT ("ProMenuPop", "ProTestWkcellRedefine", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonUnhighlight((char*)"TkMfgDQ",(char*)"Done"); TEST_CALL_REPORT ("ProMenubuttonUnhighlight", "ProTestWkcellRedefine", status, status != PRO_TK_NO_ERROR); status = ProMenubuttonActivate((char*)"TkMfgAct",(char*)"-Redefine"); TEST_CALL_REPORT ("ProMenubuttonActivate", "ProTestWkcellRedefine", status, status != PRO_TK_NO_ERROR); return ((ProError)1); }