clear all; close all; clc;

global fid;
% Namapovani cest k dodatecnym souborum.
addpath('../3D modeler/');

% Adresa docasneho souboru temp.
tempScriptFileHfss = 'C:/temp/tmpDataHfss.m';

%Nazev ukladaneho souboru xxx.hfss
hfssSkriptTemp = 'C:/temp/pokus.hfss';

% Vytvoreni docasneho m-file.
fid = fopen(tempScriptFileHfss, 'wt');
%--------------------------------------------------------------------------
HfssNewProject(fid);
HfssInsertDesign(fid,'Muj_Pokus');
HfssBox(fid,'Antena',[0,0,0],[37.7,28.4,0.035],'mm','copper');
HfssBox(fid,'zarez1',[0,13.7,0],[6,1,0.035],'mm','vacuum');
HfssSubtract(fid,'Antena','zarez1');
HfssBox(fid,'zarez2',[18.35,0,0],[1,6,0.035],'mm','vacuum');
HfssSubtract(fid,'Antena','zarez2');
HfssBox(fid,'zarez3',[31.7,13.7,0],[6,1,0.035],'mm','vacuum');
HfssSubtract(fid,'Antena','zarez3');
HfssBox(fid,'zarez4',[18.35,22.4,0],[1,6,0.035],'mm','vacuum');
HfssSubtract(fid,'Antena','zarez4');
HfssBox(fid,'Dielektrikum',[-1,-1,0],[39.7,30.4,-1.6],'mm','FR4_epoxy');
HfssBox(fid,'Ground',[-1,-1,-1.6],[39.7,30.4,-0.035],'mm','copper');
HfssBox(fid,'Port_k',[17.85,16.3,-1.635],[10,10,-2],'mm','copper');
HfssCylinder(fid,'Port1out','Z',[22.85,21.3,-3.635],2,-6, 'mm','copper');
HfssCylinder(fid,'Port1in','Z',[22.85,21.3,-3.635],1.6,-6, 'mm','vacuum');
HfssSubtract(fid,'Port1out','Port1in');
HfssCylinder(fid,'Port_kin','Z',[22.85,21.3,-1.635],1.4,-2, 'mm','vacuum');
HfssSubtract(fid,'Port_k','Port_kin');
HfssCylinder(fid,'Groundin','Z',[22.85,21.3,-1.6],1.4,-0.035, 'mm','vacuum');
HfssSubtract(fid,'Ground','Groundin');
HfssCylinder(fid,'Dielin','Z',[22.85,21.3,0],1.4,-1.6, 'mm','vacuum');
HfssSubtract(fid,'Dielektrikum','Dielin');
HfssCylinder(fid,'Napajeni','Z',[22.85,21.3,0],0.5,-9.635, 'mm','copper');


%Ulozeni vytvreneho projektu
HfssSaveProject(fid,hfssSkriptTemp);