// CLEAN
// LISTCLEAN

/***************************************************************************
                          module.h  -  description
                             -------------------
    begin                : Mon Apr 15 2002
    copyright            : (C) 2002 by Ross Andrews
    email                : randrews@geekfu.org
 ***************************************************************************/

class module;

#ifndef MODULE_H
#define MODULE_H

#include <vector>
#include <string>
#include "rack.h"
#include "station.h"
#include "resultset.h"

using namespace std;

/**
  *@author Ross Andrews
  */

class module {
private:
	string name;
	int idx;
public:
	int getid() const;
	string getname() const;
	rack* operator[] (int);
	rack* operator[] (string);
	void addrack(rack);
	void addkeepalive(rack);

	int acoustics;
	double power,
	       MTL_min,MTL_RFCA_min,
	       MTL_max,MTL_RFCA_max,
	       LTL_min,LTL_RFCA_min,
	       LTL_max,LTL_RFCA_max,
	       MTL_total,LTL_total,
	       CAM_power;
	vector<rack> racks,keepalives;
	station* stn;

	double calc_power_ttl();
	double calc_energy_ttl();

	double calc_middecks_ttl();
	double calc_upmass_ttl();
	double calc_stowage_ttl();
	double calc_crewtrng_ttl();
	double calc_crewtime_ttl();
	double calc_runtime_ttl();

	double calc_MTL_ttl();
	double calc_LTL_ttl();
	double calc_acoustics_ttl();
	double calc_acoustics_ttl_simul();
	double calc_acoustics_crewtend_ttl();

	double calc_energy_crewtend_ttl();
	double calc_MTL_ttl_simul();
	double calc_LTL_ttl_simul();

	double calc_MTL_crewtend_ttl();
	double calc_LTL_crewtend_ttl();

	double calc_keepalive_ttl();

	double calc_nominal_uplink_ttl();
	double calc_peak_uplink_ttl();
	double calc_peak_uplink_duration_ttl();
	double calc_nominal_downlink_ttl();
	double calc_peak_downlink_ttl();
	double calc_peak_downlink_duration_ttl();
	double calc_nominal_1553_ttl();
	double calc_peak_1553_ttl();
	double calc_peak_1553_duration_ttl();
	double calc_nominal_ethernet_ttl();
	double calc_peak_ethernet_ttl();
	double calc_peak_ethernet_duration_ttl();
	double calc_nominal_HRL_ttl();
	double calc_peak_HRL_ttl();
	double calc_peak_HRL_duration_ttl();
	double calc_video_uplink_ttl();
	double calc_video_downlink_ttl();
	double calc_video_rate_ttl();

	double calc_cs_p4_asc_ttl();
	double calc_cs_p4_orb_ttl();
	double calc_cs_p4_desc_ttl();
	double calc_cs_m20_asc_ttl();
	double calc_cs_m20_orb_ttl();
	double calc_cs_m20_desc_ttl();
	double calc_cs_m80_asc_ttl();
	double calc_cs_m80_orb_ttl();
	double calc_cs_m80_desc_ttl();
	double calc_cs_m180_asc_ttl();
	double calc_cs_m180_orb_ttl();
	double calc_cs_m180_desc_ttl();

	module();
	module(MYSQL&,string);
	module(const module&);
	const module& operator=(const module&);
	~module();
};

#endif
