Changeset - 1178a5f04f94
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-25 21:38:23

main() updates, needs attention
1 file changed with 10 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -290,24 +290,26 @@ void frame_num_struct_builder(struct ble
 
	  job->frameset[counter].num = counter + startframe;
 

	
 
	highest_jobnum++; // After it has created the job, it adds one to the highest_jobnum interger
 
}
 

	
 

	
 

	
 
/**
 
  Frame Finder: matches your computer up with a lovely frame to render
 
  TODO: Major issue here, the client needs to know the frame number, AND the job number!
 
  Notice that this function starts by looking at the oldest job first
 

	
 
	TODO: Link this up with the main() function to check if there are frames available or not and provide jobnum/framenum to the client
 

	
 
  @return 0 success, other: error
 
*/
 
int frame_finder(struct blendjob *head, struct blendjob **job, struct frameset **frame)
 
{
 
  int your_frame;  // your_frame is an interger value that will be given to the client as the frame number to render
 

	
 
  unsigned short int found;
 
  unsigned short int priority;
 

	
 
  struct blendjob *blendjob_ptr;
 

	
 
  found = 0;
 
@@ -502,28 +504,32 @@ int main(int argc, char *argv[])
 

	
 
      /* Somewhat Pseudo-code for basic server operation, should be more event-driven */
 

	
 
      start_data();
 
      status_report_generator(); // TODO: Add correct args
 
      blend_frame_watchdog();	 // TODO: Add correct args
 

	
 

	
 
      int framenum;
 
      int jobnum;
 

	
 
      /* If the client is idle (meaning a client without the "busy" status connected via ssh) */
 
      	if(clientstatus == idle && iteration > 0){
 
      		framenum = frame_finder(); // give framefinder args, framefinder should return job number and frame number
 
      		jobnum = frame_finder();
 
      		remotio_send_to_client(framenum);
 
      	if(clientstatus == "idle"){
 
      		framenum / jobnum = frame_finder(); // give framefinder args, framefinder should return job number and frame number somehow
 
				if(frame_finder returns "didn't get a frame"){
 
					fprinf(stderr,"No frames are available to render at this time");
 
				}
 
				else(){
 
					remotio_send_to_client(framenum);
 
				}
 
      	}
 
      /* If the client's status changes from running to idle */
 
      	if(clientstatus == DISTREN_REQUEST_DONEFRAME && iteration == 0){
 
      		finish_frame(jobnum, framenumprevious); // make it finish the previous frame or something.
 
      		frame_finder() ==> returns jobnum/framenum that are sent to slave, "render jobnum framenum"
 
      	}
 

	
 
      /* End Somewhat Pseudo-code */
 

	
 

	
 
      distrend_action_free(action);
 
    }
0 comments (0 inline, 0 general)