0001
0002
0003
0004 function [comp_no] = showSensorTargetRelation(string_id)
0005
0006 global image_struct;
0007 global roads_struct;
0008 global simulationTime;
0009 global struct_own_forces;
0010 global struct_sensors;
0011 global struct_enemy_comps;
0012 global noOfOwn_forces;
0013 global noOfEnemyCompanies;
0014 global noOfSensors;
0015 global south_enemy;
0016 global north_enemy1;
0017 global north_enemy2;
0018 comp_no = str2num(string_id(4));
0019
0020 if ~isempty(comp_no)
0021 for i = 1:noOfSensors
0022 target_id = struct_sensors(i).target_id;
0023 target_no = str2num(target_id(4));
0024 if ~isempty(target_no)
0025 if target_no == comp_no
0026 sensor_pos = struct_sensors(i).pos;
0027 struct_currentData = getCurrentEsimatedData(1, comp_no);
0028 mean_pos_enemy = mean(struct_currentData.enemy_pos);
0029 plot([sensor_pos(2)+10;mean_pos_enemy(2)],[sensor_pos(1)+5;mean_pos_enemy(1)],'-y', 'LineWidth',2)
0030 plot(mean_pos_enemy(2),mean_pos_enemy(1),'v','LineWidth',2,'MarkerEdgeColor','k', 'MarkerFaceColor','y','MarkerSize',7)
0031 end;
0032 end;
0033 end;
0034 end;
0035