/** * \brief OIL job exit function. * * This function is called to notify the RIP that a job has completed and * that the resources claimed by the job can now be freed. It requires that * the system be in one of \c OIL_Sys_JobCancel, \c OIL_Sys_JobActive or * \c OIL_Sys_Inactive states when the function is entered.\n * This function: * \arg requests that the RIP end the current job; * \arg discards remaining pages in the job; * \arg cleans up any partial pages; * \arg deletes the job; * \arg configures the RIP according to the settings in the next job, if any, and * \arg places the system into the next requested state, if it is not already inactive. * * This function does not cause the RIP to exit. * * \param[in] eNextState The system state that is required by the end of the call. * \return Returns TRUE if the post-job cleanup is successful and the OIL is * placed in the requested state, FALSE otherwise. */ int JobExit(OIL_eTySystemState eNextState) { char szJobName[OIL_MAX_JOBNAME_LENGTH]; int GPSPlotCloseretval; int GPSSinCloseretval ; int GPSSoutCloseretval; int GPSSoutFlushretval; int GPSSoutWriteretval; long len,i; int fin = GPS_INTERP_FIN_NORMAL, uel_found=1; HQASSERT(OIL_Sys_JobCancel == g_SystemState.eCurrentState || OIL_Sys_JobActive == g_SystemState.eCurrentState || OIL_Sys_Inactive == g_SystemState.eCurrentState, "job_exit entered in invalid state"); GG_SHOW(GG_SHOW_OIL, "JobExit:\n"); /* release resources */ while (g_ulGGtiming_pagecount != 0) { /* wait - until all the pages have been output */ OIL_RelinquishTimeSlice(); } /* free(g_pstCurrentJob); */ { if (!SwLeJobEnd()) { /* Report this error */ GG_SHOW(GG_SHOW_OIL, "job_exit: Failed to finish job \n"); } } if(OIL_Sys_Inactive != g_SystemState.eCurrentState) { g_SystemState.eCurrentState = eNextState; } /* At this point RIPping must have completed and oil should have received data for all pages from the RIP*/ g_pstCurrentJob->eJobStatus = OIL_Job_RipDone; /* keep the jobname safe for use in timing log before deleting job */ strcpy(szJobName, g_pstCurrentJob->szJobName); /* Wait for all pages to be removed */ while(g_pstCurrentJob->pPage!=NULL) { OIL_RelinquishTimeSlice(); } /* check for incomplete pages which can be a result of job cancel */ if (g_pstCurrentPage) { DeleteOILPage(g_pstCurrentPage); g_pstCurrentPage = 0; } if(event_Cancel_flag == TRUE) { gpsInterpNotifyState(&gps_client, GPS_INTERP_STATE_FLUSHING); gpsFrameCancel(&gps_client,gps_frameid); gpsPlotCancel(&gps_client, PlotSet_plotid); fin = GPS_INTERP_FIN_CANCEL; } #ifndef PMS_OIL_MERGE_DISABLE_JS /***********Call to gpsflush and gpswrite for buffer1***************************/ if(*buffer1!=NULL) { if(host_outBuff) { GPSSoutFlushretval=GPS_SoutFlush(host_outBuff); if(GPSSoutFlushretval==0) { printf("GPS_SoutFlush : Success\n"); } else { printf("GPS_SoutFlush : Failed\n"); } } len=0; for(i=0;buffer1[i]!='\0';i++) len++; printf(" 1 size of hostbuff = %d\n",sizeof(host_outBuff)); GPSSoutWriteretval=GPS_SoutWrite(host_outBuff,buffer1,len,GPS_HOST_NONBLOCK); if(GPSSoutWriteretval >= 0) { printf("GPS_SoutWrite : Success\n"); } else { printf("GPS_SoutWrite : Failed\n"); } } /***********Call to gpsflush and gpswrite for buff2***************************/ if(*buffer2!=NULL) { if(host_outBuff) { GPSSoutFlushretval=GPS_SoutFlush(host_outBuff); if(GPSSoutFlushretval==0) { printf("GPS_SoutFlush : Success\n"); } else { printf("GPS_SoutFlush : Failed\n"); } } printf(" 2 size of hostbuff = %d\n",sizeof(host_outBuff)); len=0; for(i=0;buffer2[i]!='\0';i++) len++; GPSSoutWriteretval=GPS_SoutWrite(host_outBuff,buffer2,len,GPS_HOST_NONBLOCK); if(GPSSoutWriteretval >= 0) { printf("GPS_SoutWrite : Success\n"); } else { printf("GPS_SoutWrite : Failed\n"); } } /***********Call to gpsflush and gpswrite for buff3***************************/ if(*buffer3!=NULL) { if(host_outBuff) { GPSSoutFlushretval=GPS_SoutFlush(host_outBuff); if(GPSSoutFlushretval==0) { printf("GPS_SoutFlush : Success\n"); } else { printf("GPS_SoutFlush : Failed\n"); } } printf(" 3 size of hostbuff = %d\n",sizeof(host_outBuff)); len=0; for(i=0;buffer3[i]!='\0';i++) len++; GPSSoutWriteretval=GPS_SoutWrite(host_outBuff,buffer3,len,GPS_HOST_NONBLOCK); if(GPSSoutWriteretval >= 0) { printf("GPS_SoutWrite : Success\n"); } else { printf("GPS_SoutWrite : Failed\n"); } } /***********Call to gpsflush and gpswrite for buff4***************************/ if(*buffer4!=NULL) { if(host_outBuff) { GPSSoutFlushretval=GPS_SoutFlush(host_outBuff); if(GPSSoutFlushretval==0) { printf("GPS_SoutFlush : Success\n"); } else { printf("GPS_SoutFlush : Failed\n"); } } printf(" 4 size of hostbuff = %d\n",sizeof(host_outBuff)); len=0; for(i=0;buffer4[i]!='\0';i++) len++; GPSSoutWriteretval=GPS_SoutWrite(host_outBuff,buffer4,len,GPS_HOST_NONBLOCK); if(GPSSoutWriteretval >= 0) { printf("GPS_SoutWrite : Success\n"); } else { printf("GPS_SoutWrite : Failed\n"); } } /***********Call to gpsflush and gpswrite for buff5***************************/ if(*buffer5!=NULL) { if(host_outBuff) { GPSSoutFlushretval=GPS_SoutFlush(host_outBuff); if(GPSSoutFlushretval==0) { printf("GPS_SoutFlush : Success\n"); } else { printf("GPS_SoutFlush : Failed\n"); } } printf(" 5 size of hostbuff = %d\n",sizeof(host_outBuff)); len=0; for(i=0;buffer5[i]!='\0';i++) len++; GPSSoutWriteretval=GPS_SoutWrite(host_outBuff,buffer5,len,GPS_HOST_NONBLOCK); if(GPSSoutWriteretval >= 0) { printf("GPS_SoutWrite : Success\n"); } else { printf("GPS_SoutWrite : Failed\n"); } } /***********Call to GpsPlotclose***************************/ /* AppendJob = True. Don't close the Output channel, next job uses same. AppendJob = False. Close the Output channel, job ends here. */ if(AppendJob == 0) { GPSPlotCloseretval = GPS_PlotClose(gps_client, PlotSet_plotid); if(GPSPlotCloseretval>=0) { printf("GPS_PlotClose : Success\n"); } else { printf("GPS_PlotClose : Failed\n"); } PlotSet_plotid = -1; /***********Call to GpsSinclose***************************/ if (host_inBuff || host_outBuff) { GPSSinCloseretval=GPS_SinClose(host_inBuff); if(GPSSinCloseretval==0) { printf("GPS_SinClose : Success\n"); host_inBuff = NULL; } else { printf("GPS_SinClose : Failed\n"); } /***********Call to GpsSoutclose***************************/ GPSSoutCloseretval=GPS_SoutClose(host_outBuff); if(GPSSoutCloseretval==0) { printf("GPS_SoutClose : Success\n"); host_outBuff = NULL; } else { printf("GPS_SoutClose : Failed\n"); } /***********Call to GpsInterpfinishProcdata***************************/ GPS_InterpFinishProcData(gps_client, 1, fin, uel_found); } else { gpsInterpFinishTestprint(gps_client, jobid); } /*************Call to gpsInterpNotifyState()*************************************/ GPS_InterpNotifyState(gps_client, GPS_INTERP_STATE_FLUSHING); // Review - it should be GPS_INTERP_STATE_IDLE ? } #endif /* Delete the job */ DeleteOILJob(g_pstCurrentJob->uJobId); g_pstCurrentJob = NULL; /* Reconfigure the features */ g_ConfigurableFeatures.g_ePaperSelectMode = g_NextJobConfiguration.g_ePaperSelectMode; g_ConfigurableFeatures.g_uGGShow = g_NextJobConfiguration.g_uGGShow; /* print out the timing data */ if(g_bLogTiming) { GGglobal_timing_dumplog((unsigned char*)szJobName); } /* reset data for next job */ GGglobal_timing(SW_TRACE_OIL_RESET, 0); current_pdlid=0; g_tJob.eTestPage = OIL_TESTPAGE_NONE; /* return TRUE if now in requested state */ return (g_SystemState.eCurrentState == eNextState); }
void GPS_InterpNotifyState(gwmsg_client_t *client, int number) { printf("------------------------------------- \n"); printf("Call gpsInterpNotifyState\n"); return gpsInterpNotifyState(client, number); }