Добавил информацию о типе объекта. Просто фиксы
This commit is contained in:
@@ -15,7 +15,13 @@ from django.views.generic import CreateView, DeleteView, UpdateView
|
||||
from ..forms import GeoForm, ObjItemForm, ParameterForm
|
||||
from ..mixins import CoordinateProcessingMixin, FormMessageMixin, RoleRequiredMixin
|
||||
from ..models import Geo, Modulation, ObjItem, Polarization, Satellite
|
||||
from ..utils import parse_pagination_params
|
||||
from ..utils import (
|
||||
format_coordinate,
|
||||
format_coords_display,
|
||||
format_frequency,
|
||||
format_symbol_rate,
|
||||
parse_pagination_params,
|
||||
)
|
||||
|
||||
|
||||
class DeleteSelectedObjectsView(RoleRequiredMixin, View):
|
||||
@@ -323,13 +329,10 @@ class ObjItemListView(LoginRequiredMixin, View):
|
||||
mirrors_list = list(obj.geo_obj.mirrors.values_list('name', flat=True))
|
||||
|
||||
if obj.geo_obj.coords:
|
||||
longitude = obj.geo_obj.coords.coords[0]
|
||||
latitude = obj.geo_obj.coords.coords[1]
|
||||
lon = f"{longitude}E" if longitude > 0 else f"{abs(longitude)}W"
|
||||
lat = f"{latitude}N" if latitude > 0 else f"{abs(latitude)}S"
|
||||
geo_coords = f"{lat} {lon}"
|
||||
geo_coords = format_coords_display(obj.geo_obj.coords)
|
||||
|
||||
satellite_name = "-"
|
||||
satellite_id = None
|
||||
frequency = "-"
|
||||
freq_range = "-"
|
||||
polarization_name = "-"
|
||||
@@ -347,18 +350,11 @@ class ObjItemListView(LoginRequiredMixin, View):
|
||||
if hasattr(param.id_satellite, "name")
|
||||
else "-"
|
||||
)
|
||||
satellite_id = param.id_satellite.id
|
||||
|
||||
frequency = (
|
||||
f"{param.frequency:.3f}" if param.frequency is not None else "-"
|
||||
)
|
||||
freq_range = (
|
||||
f"{param.freq_range:.3f}" if param.freq_range is not None else "-"
|
||||
)
|
||||
bod_velocity = (
|
||||
f"{param.bod_velocity:.0f}"
|
||||
if param.bod_velocity is not None
|
||||
else "-"
|
||||
)
|
||||
frequency = format_frequency(param.frequency)
|
||||
freq_range = format_frequency(param.freq_range)
|
||||
bod_velocity = format_symbol_rate(param.bod_velocity)
|
||||
snr = f"{param.snr:.0f}" if param.snr is not None else "-"
|
||||
|
||||
if hasattr(param, "polarization") and param.polarization:
|
||||
@@ -396,8 +392,8 @@ class ObjItemListView(LoginRequiredMixin, View):
|
||||
has_sigma = True
|
||||
first_sigma = param.sigma_parameter.first()
|
||||
if first_sigma:
|
||||
sigma_freq = f"{first_sigma.transfer_frequency:.3f}" if first_sigma.transfer_frequency else "-"
|
||||
sigma_range = f"{first_sigma.freq_range:.3f}" if first_sigma.freq_range else "-"
|
||||
sigma_freq = format_frequency(first_sigma.transfer_frequency)
|
||||
sigma_range = format_frequency(first_sigma.freq_range)
|
||||
sigma_pol = first_sigma.polarization.name if first_sigma.polarization else "-"
|
||||
sigma_pol_short = sigma_pol[0] if sigma_pol and sigma_pol != "-" else "-"
|
||||
sigma_info = f"{sigma_freq}/{sigma_range}/{sigma_pol_short}"
|
||||
@@ -407,6 +403,7 @@ class ObjItemListView(LoginRequiredMixin, View):
|
||||
"id": obj.id,
|
||||
"name": obj.name or "-",
|
||||
"satellite_name": satellite_name,
|
||||
"satellite_id": satellite_id,
|
||||
"frequency": frequency,
|
||||
"freq_range": freq_range,
|
||||
"polarization": polarization_name,
|
||||
|
||||
Reference in New Issue
Block a user