Changeset - fea8bac851bf
[Not reviewed]
default
0 3 1
Nathan Brink (binki) - 16 years ago 2009-07-26 09:16:13
ohnobinki@ohnopublishing.net
moved struct blendjob and frameset to header
4 files changed with 73 insertions and 31 deletions:
0 comments (0 inline, 0 general)
src/server/Makefile.am
Show inline comments
 
COMMON_SOURCES =  slavefuncs.c slavefuncs.h blendjob.h
 

	
 
bin_PROGRAMS = distrend distrenslave
 
distrend_SOURCES = distrend.c slavefuncs.c slavefuncs.h
 
distrend_SOURCES = distrend.c ${COMMON_SOURCES}
 
distrend_LDADD = @DISTLIBS_LIBS@ @top_builddir@/src/common/libdistrencommon.la
 
distrend_CFLAGS = @DISTLIBS_CFLAGS@ -I@top_srcdir@/src/common
 

	
 
distrenslave_SOURCES = slave.c slavefuncs.c slavefuncs.h 
 
distrenslave_SOURCES = slave.c ${COMMON_SOURCES}
 
distrenslave_LDADD = @DISTLIBS_LIBS@ @top_builddir@/src/common/libdistrencommon.la
 
distrenslave_CFLAGS = @DISTLIBS_CFLAGS@ -I@top_srcdir@/src/common
src/server/blendjob.h
Show inline comments
 
new file 100644
 
/*
 
  Copyright 2009 Nathan Phillip Brink, Ethan Zonca, Matthew Orlando
 

	
 
  This file is a part of DistRen.
 

	
 
  DistRen is free software: you can redistribute it and/or modify
 
  it under the terms of the GNU Affero General Public License as published by
 
  the Free Software Foundation, either version 3 of the License, or
 
  (at your option) any later version.
 

	
 
  DistRen is distributed in the hope that it will be useful,
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  GNU Affero General Public License for more details.
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
*/
 

	
 
#ifndef _DISTREN_BLENDJOB_H
 
#define _DISTREN_BLENDJOB_H
 

	
 
/**
 
   This file stores the blendjob and frameset structs and prototypes for some functions to manipulate/use these.
 
 */
 

	
 
#include <time.h> /* clock_t */
 

	
 
typedef unsigned int jobnum_t;
 

	
 
/**
 
   Stores Blender Job Info
 
*/
 
struct blendjob {
 
  struct blendjob *next; /*< next will be NULL unless if there is another blendjob */
 
  char *name;
 
  char *submitter;
 
  char *email;
 
  jobnum_t jobnum;
 
  int priority;  // 1 is lowest, 10 is highest, 0 means the job is done
 
  int percent_done;
 
  int completed_frames; // number of completed frames for stats/etc
 
  int assigned_frames; // number of assigned frames (that are not yet completed) for stats/etc
 
  int total_frames; // how many frames are in the animation for stats/etc (unassigned frames)
 
  int avg_render_time; // average seconds it took to render a frame
 
  unsigned int time_remaining; // estimated seconds remaining till render is complete (up to 49, 710 days)
 
							   // we can have the client computer convert it into days, hours, etc if they wish to view it
 
  struct frameset *frameset;
 
};
 

	
 

	
 

	
 
/**
 
   Frameset Structure
 
*/
 
struct frameset {
 
  int num; /*< frame number to render */
 
  char slave_name; /*< user that frame is assigned to */
 
  int status; /*< status of frame, 0= unassigned, 1= taken, 2= done */
 
  clock_t start_time; /*< time the frame was started */
 
  int time_to_render; /*< the total seconds it took to render the frame */
 
}; /* Frameset array is generated by status_report_generator() */
 

	
 

	
 
#endif
src/server/distrend.c
Show inline comments
 
@@ -52,6 +52,8 @@
 

	
 
#include "execio.h"
 
#include "options.h"
 
#include "blendjob.h"
 

	
 
#include <confuse.h>
 
#include <stdio.h>
 
#include <stdlib.h>
 
@@ -62,7 +64,6 @@
 

	
 

	
 

	
 
typedef unsigned int jobnum_t;
 

	
 
/* ******************* Structs ************************ */
 

	
 
@@ -96,34 +97,6 @@ struct general_info {
 
	unsigned int total_frames_rendered; //
 
} general_info;
 

	
 
// Stores Blender Job Info
 
struct blendjob {
 
  struct blendjob *next; /* next will be NULL unless if there is another blendjob */
 
  char *name;
 
  char *submitter;
 
  char *email;
 
  jobnum_t jobnum;
 
  int priority;  // 1 is lowest, 10 is highest, 0 means the job is done
 
  int percent_done;
 
  int completed_frames; // number of completed frames for stats/etc
 
  int assigned_frames; // number of assigned frames (that are not yet completed) for stats/etc
 
  int total_frames; // how many frames are in the animation for stats/etc (unassigned frames)
 
  int avg_render_time; // average seconds it took to render a frame
 
  unsigned int time_remaining; // estimated seconds remaining till render is complete (up to 49, 710 days)
 
							   // we can have the client computer convert it into days, hours, etc if they wish to view it
 
  struct frameset *frameset;
 
};
 

	
 

	
 
// Frameset Structure
 
struct frameset {
 
	int num; // frame number to render
 
	char slave_name; // user that frame is assigned to
 
	int status; // status of frame, 0= unassigned, 1= taken, 2= done
 
	clock_t start_time; // time the frame was started
 
	int time_to_render; // the total seconds it took to render the frame
 
}; // Frameset array is generated by status_report_generator function
 
                         // Using this method to save memory, because if animation starts on a high frame number, it would waste a lot of RAM on empty structures
 

	
 

	
 
/*
src/server/slavefuncs.h
Show inline comments
 
@@ -19,6 +19,7 @@
 

	
 
#ifndef _DISTREN_SLAVEFUNCS_H
 
#define _DISTREN_SLAVEFUNCS_H
 
#include "blendjob.h"
 

	
 
void registeruser(char *username, char *email);
 
void loginuser(char *username);
0 comments (0 inline, 0 general)