Ejemplo n.º 1
0
void Call_gps_InterpNotifyState(int state)
{
 
  switch(state)
  {
  case OIL_Sys_Uninitialised:
  case OIL_Sys_Inactive:
  case OIL_Sys_Active :
  case OIL_Sys_Suspended:
        		GPS_InterpNotifyState(gps_client, GPS_INTERP_STATE_IDLE);
		        break;
  case OIL_Sys_JobActive:
			 GPS_InterpNotifyState(gps_client, GPS_INTERP_STATE_PROCESSING);
		         break;
  case OIL_Sys_JobCancel:
			 GPS_InterpNotifyState(gps_client, GPS_INTERP_STATE_FLUSHING);
		         break;
  default :
                 break;
  }
}
Ejemplo n.º 2
0
/**
 * \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);
}
Ejemplo n.º 3
0
int  Get_Data_From_GPS(int hostid_in, int hostid_out,int jobid)
{
    int GPSGetPaperInfoRetVal;
    int GPSPdlTableval;
    int GPSGetPrtStatus2val;
    int gps_notify=0;
    int ret;
    int GPSBitSWRetVal = 0;
    int GPSGetModelInfoRetVal;
    int GPSGetHddInfo2RetVal;
    int GPSPlotPrepRetVal;
    int GPSPlotOpenRetVal;

    long pdl_offset; int pdl_num ;
    int prt_res;
    int hdd_status;
    char * modelinfovalue;
    simhandle_t *hsim;
    gps_hostbuf_p host_inBuff, host_outBuff;
    gps_prtstatus2_t prtStatus;
    varvalue_t gps_paperId;
    gps_hddinfo2_t hddinfo;	
    gps_plotprepareparam_t plotPrepare;


    if ((hsim = __gps_getsimhandle()) == (simhandle_t *)0)
		return(-1);


    /************************** Call to gpsGetPaperInfo() *************************/
    
    ret = _var_getbyname(hsim, "GPS_PENV_VAR_ID_APLPAGESIZE", &gps_paperId);
       
    GPSGetPaperInfoRetVal = GPS_GetPaperInfo(gps_client, gps_paperId, &gpsPaperInfo, gps_notify);
	
	if(GPSGetPaperInfoRetVal)
		{
			printf("GPS_GetPaperInfo : SUCCESS\n");
		}
		else
		{
			printf("GPS_GetPaperInfo : FAILED\n");
		}	
    /*************Call to gpsInterpNotifyState()*************************************/
        GPS_InterpNotifyState(gps_client, GPS_INTERP_STATE_PROCESSING);
    
    /*************Call to gpsSinOpen*************************************************/
    
    host_inBuff = GPS_SinOpen(gps_client, hostid_in);
	if(host_inBuff)
	{
		printf("GPS_SinOpen : Successful\n");
	}
	else
	{
		printf("GPS_SinOpen : Failed\n");
	}

  /*************Call to gpsSoutOpen*************************************************/

    host_outBuff = GPS_SoutOpen(gps_client, hostid_out);
	if(host_outBuff)
	{
		printf("GPS_SoutOpen : Successful\n");
	}
	else
	{
		printf("GPS_SoutOpen : Failed\n");
	}

    /*************Call to gpsGetBitSw*************************************************/

    GPSBitSWRetVal = GPS_GetBitSw(gps_client,BIT_SW_004); /* bit number randomly given as BIT_SW_004 */
	
    if((GPSBitSWRetVal = BIT_SW_001) || (GPSBitSWRetVal <= BIT_SW_016))
		printf("GPS_getBitSW is success\n");
	else
		printf("GPS_getBitSW is failed\n");

     /*************Call to gpsPdlTable*************************************************/

    GPSPdlTableval = GPS_GetPdlTable(gps_client, &pdl_offset, &pdl_num);
	if(!GPSPdlTableval)
	{
		printf("GetPdlTable : Successful\n");
	}

     /*************Call to gpsPrtStatus2*************************************************/
    
    GPSGetPrtStatus2val = GPS_GetPrtStatus2(gps_client, &prtStatus, gps_notify, &prt_res);
	if(GPSGetPrtStatus2val)
	{
		printf("GetPrtStatus2 : Success\n");
	}

	/*************Call to gpsGetModelInfo*************************************************/

    GPSGetModelInfoRetVal = GPS_GetModelInfo(gps_client, 0, 1,	"color_prm_val", "COLOR", 32, modelinfovalue);
	if(GPSGetModelInfoRetVal== 0)
	     printf("GPS_GetModelInfo: Search Successful\n");
	else
	     printf("GPS_GetModelInfo: Search Failed\n"); 
    /*Either key or category not found, buffer overflow, illegal param, init error */

    /*************Call to gpsGetHddInfo2*************************************************/


	GPSGetHddInfo2RetVal = GPS_gpsGetHddInfo2( gps_client, GPS_HDD_TMP, hdd_status, hddinfo );
	
    if(GPSGetHddInfo2RetVal)
		printf("GPS_gpsGetHddInfo2 is success\n");
	else 
	    printf("GPS_gpsGetHddInfo2 is failed\n");

    /*************Call to gpsPlotPrepare*************************************************/
	
	GPSPlotPrepRetVal = GPS_PlotPrepare(gps_client,jobid, &plotPrepare);
	if(GPSPlotPrepRetVal)
	{
		printf("GPS_PlotPrepare : Success\n");
	}
	else 
	{
		printf("GPS_PlotPrepare : Failed\n");
	}

    /*************Call to gpsPlotOpen*************************************************/

	GPSPlotOpenRetVal = GPS_PlotOpen(gps_client, jobid, GPS_PLOT_NORMAL);
	if(GPSPlotOpenRetVal >= 0)
	{
		printf("GPS_PlotOpen : Success\n");
	}
	else
	{
		printf("GPS_PlotOpen : Failed\n");
	}

        return 0;


}
Ejemplo n.º 4
0
int Get_Data_From_GPS()
{
    int GPSGetPaperInfoRetVal;
    int GPSPdlTableval;
    int GPSGetPrtStatus2val;
    int gps_notify=0;
    int ret;
    int GPSBitSWRetVal = 0;
    int GPSGetModelInfoRetVal;
    int GPSGetHddInfo2RetVal;
    int GPSPlotPrepRetVal;
    int GPSPlotOpenRetVal;

    long pdl_offset; int pdl_num ;
    int prt_res;
    int hdd_status;
    char * modelinfovalue;
    simhandle_t *hsim;
    gps_prtstatus2_t prtStatus;
    varvalue_t gps_paperId;
    gps_hddinfo2_t hddinfo;	
    gps_plotprepareparam_t plotPrepare;    

    gps_pageparam_shm_t*param;
    int                GPSPlotSetPageParamShmretval;
    int                PlotSet_result;

	long maxsize[2];
	int f_id = GPS_PRMINFO_GET_COLOR_MODEL;
	int status;
	int retGPSPrmInfo;

    if ((hsim = __gps_getsimhandle()) == (simhandle_t *)0)
		return(-1);


    /************************** Call to gpsGetPaperInfo() *************************/
    
    ret = _var_getbyname(hsim, "GPS_PENV_VAR_ID_APLPAGESIZE", &gps_paperId);
       
    GPSGetPaperInfoRetVal = GPS_GetPaperInfo(gps_client, gps_paperId.u.int_value, &gpsPaperInfo, gps_notify);
	
	if(GPSGetPaperInfoRetVal)
		{
			printf("GPS_GetPaperInfo : SUCCESS\n");
		}
		else
		{
			printf("GPS_GetPaperInfo : FAILED\n");
		}	
    /*************Call to gpsInterpNotifyState()*************************************/
        GPS_InterpNotifyState(gps_client, GPS_INTERP_STATE_PROCESSING);

      
    
    /*************Call to gpsGetBitSw*************************************************/

    GPSBitSWRetVal = GPS_GetBitSw(gps_client,BIT_SW_004); /* bit number randomly given as BIT_SW_004 */
	
    if((GPSBitSWRetVal = BIT_SW_001) || (GPSBitSWRetVal <= BIT_SW_016))
		printf("GPS_getBitSW is success\n");
	else
		printf("GPS_getBitSW is failed\n");

     /*************Call to gpsPdlTable*************************************************/

    GPSPdlTableval = GPS_GetPdlTable(gps_client, &pdl_offset, &pdl_num);
	if(!GPSPdlTableval)
	{
		printf("GetPdlTable : Successful\n");
	}

	     /*************Call to gpsPrmInfo*************************************************/

    retGPSPrmInfo = GPS_GetPrmInfo( gps_client, f_id, &status, sizeof(long)*2, maxsize );
    if(retGPSPrmInfo == 1)
              printf("GPS_GetPrmInfo: SUCCESS \n");
    else
              printf("GPS_GetPrmInfo: FAILED \n");

        if(status == GPS_PRMINFO_SUCCESS)
              printf("GPS_GetPrmInfo: STATUS SUCCESS\n");
    else
              printf("GPS_GetPrmInfo:STATUS FAILED\n");

      switch(maxsize[0])
          {
            case GPS_CM_BW_MACHINE: //B&W
                  g_tSystemInfo.eDefaultColMode = OIL_Mono;
                  break;
                case GPS_CM_FULL_COLOR_MACHINE: // Color
                  g_tSystemInfo.eDefaultColMode = OIL_CMYK_Composite; // revisit OIL_eColorMode
                  break;
                case GPS_CM_TWIN_COLOR_MACHINE:  //two-color
                  g_tSystemInfo.eDefaultColMode = OIL_CMYK_Separations; // revisit OIL_eColorMode
                  break;
                default:
                  g_tSystemInfo.eDefaultColMode = OIL_Mono;
                  break;
          }

     /*************Call to gpsPrtStatus2*************************************************/
    
    GPSGetPrtStatus2val = GPS_GetPrtStatus2(gps_client, &prtStatus, gps_notify, &prt_res);
	if(GPSGetPrtStatus2val)
	{
		printf("GetPrtStatus2 : Success\n");
	}

	/*************Call to gpsGetModelInfo*************************************************/

    GPSGetModelInfoRetVal = GPS_GetModelInfo(gps_client, 0, 1,	"color_prm_val", "COLOR", 32, modelinfovalue);
	if(GPSGetModelInfoRetVal== 0)
	     printf("GPS_GetModelInfo: Search Successful\n");
	else
	     printf("GPS_GetModelInfo: Search Failed\n"); 
    /*Either key or category not found, buffer overflow, illegal param, init error */

    /*************Call to gpsGetHddInfo2*************************************************/


	GPSGetHddInfo2RetVal = GPS_gpsGetHddInfo2( gps_client, GPS_HDD_TMP, hdd_status, hddinfo );
	
    if(GPSGetHddInfo2RetVal)
		printf("GPS_gpsGetHddInfo2 is success\n");
	else 
	    printf("GPS_gpsGetHddInfo2 is failed\n");

    /*************Call to gpsPlotPrepare*************************************************/
	
	GPSPlotPrepRetVal = GPS_PlotPrepare(gps_client,jobid, &plotPrepare);
	if(GPSPlotPrepRetVal)
	{
		printf("GPS_PlotPrepare : Success\n");
	}
	else 
	{
		printf("GPS_PlotPrepare : Failed\n");
	}

    /*************Call to gpsPlotOpen*************************************************/

	GPSPlotOpenRetVal = GPS_PlotOpen(gps_client, jobid, GPS_PLOT_NORMAL);
    if(GPSPlotOpenRetVal >= 0)
	{
		printf("GPS_PlotOpen : Success\n");
	}
	else
	{
		printf("GPS_PlotOpen : Failed\n");
	}
     /*************************Call to gpsPloSetPageParamShm**************************/
    GPSPlotSetPageParamShmretval = GPS_PlotSetPageParamShm(gps_client, PlotSet_plotid, &param, &PlotSet_result);
	if(PlotSet_result)
	{
		printf("GPS_PlotSetPageParamShm : Success\n");
	}
    else
    {
		printf("GPS_PlotSetPageParamShm : Failed\n");
	}


        return 0;
}