static void initialize() { struct ts_parsed_s *input_buffer; FILE *input; use_enthalpy = 1; constants_init(); time_increment = 1./5000.; ts_parse_init(); scio_init(scio_input, sizeof (scio_input) / sizeof (scio_input[0])); /* * Read until EOF */ input = stdin; input_buffer = NULL; for (;;) { input_buffer = ts_parse(input, input_buffer); if (!input_buffer) break; scio_input_line(input_buffer); } scio_term(); pressure_init += atmosphere_pressure; pressure_final += atmosphere_pressure; }
//--------------------------------------------------------------------------------------------------------- // Create tsreader then get video duration. Returns info in tsreader struct that must be free-d externally // // TODO: Decode PAT etc // struct TS_reader *tsinfo(char *filename, struct TS_settings *settings) { int file; struct TS_reader *tsreader ; unsigned pkt_num ; tsreader = tsreader_new(filename) ; if (!tsreader) { //fprintf(stderr,"ERROR %s: %s\n",filename,dvb_error_str(dvb_error_code)); return(NULL); } // only support the following standard settings - NO CALLBACKS (so no need for hook data)! tsreader->debug = settings->debug ; pkt_num = 1300 ; if (tsreader->tsstate->total_pkts <= 2*pkt_num) { // Short file - parse the lot tsreader_setpos(tsreader, 0, SEEK_SET, tsreader->tsstate->total_pkts) ; ts_parse(tsreader) ; } else { // parse data - start tsreader_setpos(tsreader, 0, SEEK_SET, 1300) ; ts_parse(tsreader) ; // parse data - end tsreader_setpos(tsreader, -1300, SEEK_END, 1300) ; ts_parse(tsreader) ; } // update the timing tsreader_set_timing(tsreader) ; return tsreader ; }
static void initialize() { struct ts_parsed_s *input_buffer; FILE *input; constants_init(); fuel_init(); chamber_init(); ts_parse_init(); scio_init(scio_input, sizeof (scio_input) / sizeof (scio_input[0])); /* * Read until EOF */ input = stdin; input_buffer = NULL; for (;;) { input_buffer = ts_parse(input, input_buffer); if (!input_buffer) break; scio_input_line(input_buffer); } scio_term(); injector_area = pi/4. * injectordia * injectordia; injector_count = 1; nozzle_throat_area = pi/4. * noz_t_dia * noz_t_dia; nozzle_exit_area = pi/4. * noz_e_dia * noz_e_dia; /* * calculate the mass of fuel remaining. */ grain_diameter = grain_core + .002; fuel_mass = fuel_density * pi / 4. * grain_length * (grain_diameter * grain_diameter - grain_core * grain_core); /*xxx*/if(0)chamber_pressure = 240 * 6894.7573; }
static void parse_input() { struct ts_parsed_s *input_buffer; FILE *input; ts_parse_init(); scio_init(scio_input, sizeof (scio_input) / sizeof (scio_input[0])); /* * Read until EOF */ input = stdin; input_buffer = NULL; for (;;) { input_buffer = ts_parse(input, input_buffer); if (!input_buffer) break; scio_input_line(input_buffer); } scio_term(); }