/*

   Copyright (C) 2002  Claudio Girardi <in3otd@qsl.net>

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

   This program 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 General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
   USA.

 */

#ifndef _C_MICROSTRIP_H_
#define _C_MICROSTRIP_H_

#include "transcalc.h"
#include "units.h"
#include "convert.h"

/* type = 0 substrate param
   type = 1 component param
   type = 2 physical param
   type = 3 electrical param
 */

/**
  * struct _c_microstrip - coupled microstrips
  *
  * @er: relative dielectric constant
  * @mur: relative magnetic permeability
  * @h: height of substrate
  * @ht: height to the top of box
  * @t: thickness of top metal
  * @sigma: conductivity of the metal
  * @tand: dielectric loss tangent
  * @rough: roughness of top metal
  * @f: frequency of operation
  * @w: width of lines
  * @w_t_e: even-mode thickness-corrected line width
  * @w_t_o: odd-mode thickness-corrected line width
  * @l: length of lines
  * @s: spacing of lines
  * @Z0_e_0: static even-mode impedance
  * @Z0_o_0: static odd-mode impedance
  * @Z0e: even-mode impedance
  * @Z0o: odd-mode impedance
  * @c_e: even-mode capacitance
  * @c_o: odd-mode capacitance
  * @ang_l_e: even-mode electrical length as angle
  * @ang_l_o: odd-mode electrical length as angle
  * @er_eff_e: even-mode effective dielectric constant
  * @er_eff_o: odd-mode effective dielectric constant
  * @er_eff_e_0: static even-mode effective dielectric constant
  * @er_eff_o_0: static odd-mode effective dielectric constant
  * @er_eff: FIXME: dummy
  * @mur_eff: effective mag. permeability
  * @w_eff: effective width of line
  * @atten_dielectric_e: even-mode dielectric losses [dB]
  * @atten_cond_e: even-mode conductors losses [dB]
  * @atten_dielectric_o: odd-mode dielectric losses [dB]
  * @atten_cond_o: odd-mode conductors losses [dB]
  * @skindepth: skin depth in mils
  *
  * coupled microstrip struct
  */
typedef struct _c_microstrip
{
  gfloat er;			/* dielectric constant */
  gfloat mur;			/* mag. permeability */
  gfloat h;			/* height of substrate */
  gfloat ht;			/* height to the top of box */
  gfloat t;			/* thickness of top metal */
  gfloat sigma;			/* Conductivity of the metal */
  gfloat tand;			/* Dielectric Loss Tangent */
  gfloat rough;			/* Roughness of top metal */
  gfloat f;			/* Frequency of operation */
  gfloat w;			/* width of lines */
  gfloat w_t_e;			/* even-mode thickness-corrected line width */
  gfloat w_t_o;			/* odd-mode thickness-corrected line width */
  gfloat l;			/* length of lines */
  gfloat s;			/* spacing of lines */
  gfloat Z0_e_0;		/* static even-mode impedance */
  gfloat Z0_o_0;		/* static odd-mode impedance */
  gfloat Z0e;			/* even-mode impedance */
  gfloat Z0o;			/* odd-mode impedance */
  gfloat c_e;			/* even-mode capacitance */
  gfloat c_o;			/* odd-mode capacitance */
  gfloat ang_l_e;		/* even-mode electrical length in angle */
  gfloat ang_l_o;		/* odd-mode electrical length in angle */
  gfloat er_eff_e;		/* even-mode effective dielectric constant */
  gfloat er_eff_o;		/* odd-mode effective dielectric constant */
  gfloat er_eff_e_0;		/* static even-mode effective dielectric constant */
  gfloat er_eff_o_0;		/* static odd-mode effective dielectric constant */
  gfloat er_eff;		/* FIXME: dummy */
  gfloat mur_eff;		/* Effective mag. permeability */
  gfloat w_eff;			/* Effective width of line */
  gfloat atten_dielectric_e;	/* even-mode dielectric losses (dB) */
  gfloat atten_cond_e;		/* even-mode conductors losses (dB) */
  gfloat atten_dielectric_o;	/* odd-mode dielectric losses (dB) */
  gfloat atten_cond_o;		/* odd-mode conductors losses (dB) */
  gfloat skindepth;		/* Skin depth in mils */
}
c_microstrip;

/*
   gfloat ereff (microstrip *);
   gfloat mur_eff (microstrip *);
   gfloat w_eff (microstrip *);
   gfloat er_eff_freq (microstrip *);
   gfloat alpha_c (microstrip *);
   gfloat alpha_c_roughness (microstrip *);
   gfloat alpha_dielectric (microstrip *);
   gfloat char_impedance_ht (microstrip *);
   gfloat char_impedance (microstrip *);
   gfloat synth_width (microstrip *);
   gfloat skin_depth (microstrip *);
   gfloat ereff_dispersion (microstrip *);
   gfloat Z0_dispersion (microstrip *);
   void dispersion (microstrip *);
   void error_mes (gchar *);
   void get_microstrip_sub (trans_win *, microstrip *);
   void get_microstrip_comp (trans_win *, microstrip *);
   void get_microstrip_phys (trans_win *, microstrip *);
   void get_microstrip_elec (trans_win *, microstrip *);
   void analyze_microstrip (GtkWidget *, trans_win *);
   void synthesize_microstrip (GtkWidget *, trans_win *);
 */
void c_microstrip_win(GtkWidget *);



extern void setup_transgui(int, GtkWidget *, trans_win *);
extern void setstatus(GtkWidget *, trans_win *);

#endif /* _C_MICROSTRIP_H_ */
