stk串口导入卫星文件并仿真
连接并打开场景
con2 = actxserver('STK11.application');
root = con2.Personality2;
con2.Visible = 1;
root.Load('D:\STK_Job\Try4\some_stellite.sc');
ss = root.CurrentScenario;
添加chain
%chain = ss.Children.New('eChain', 'SenToSat');%建立chain连接,这里省略了一个
chain = ss.Children.GetElements('eChain').Item('SenToSat');%建立上次的连接句柄
chain2 = ss.Children.GetElements('eChain').Item('SenToSat2');
建立上次全部的卫星的访问,并导入到Chain
eSatellite = 'eSatellite';
for j = 1:33
satnamegetmy = ['sat_',num2str(j)];
satnameget = ['sat_',num2str(j)];
eval([satnamegetmy,' = ss.Children.GetElements(eSatellite).Item(satnameget)']);
end
for i = 1:33
sat = ['sat_',num2str(i)];
eval(['chain.Objects.AddObject(',sat,')']);
end
建立上次的测控站sensor访问,并导入chain,以下是已经建立站,直接用句柄
ck2021 = ss.Children.GetElements('eFacility').Item('ck2021');
sensor = ck2021.Children.GetElements('eSensor').Item('sensor');
% chain.Objects.AddObject(sensor);
Constellation = ss.Children.GetElements('eConstellation').Item('my33satlite');
stk Report生成文件
不需要再进行Connect连接
objPath = 'Scenario/some_stellite/Chain/SenToSat2';
rptStyle = 'Access Data';
[sec2Data,sec2Names] = stkReport(objPath, rptStyle);