##// END OF EJS Templates
Update Views y several improvements
Update Views y several improvements

File last commit:

r316:0d39f71bbf42
r316:0d39f71bbf42
Show More
views.py
1821 lines | 55.9 KiB | text/x-python | PythonLexer
Juan C. Espinoza
Fix experiment views (summary & verify)...
r239 import ast
import json
Juan C. Espinoza
Update Views y several improvements
r316 import hashlib
Juan C. Espinoza
Improve operation & search views
r306 from datetime import datetime, timedelta
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 from django.shortcuts import render, redirect, get_object_or_404, HttpResponse
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 from django.utils.safestring import mark_safe
Fiorella Quino
Task #487: Operation. Views: radar_play y radar_stop. Models: RunningExperiment. Attributes: status. Methods: get_status(), status_color()...
r84 from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 from django.db.models import Q
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30 from django.contrib import messages
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 from django.http.request import QueryDict
Juan C. Espinoza
Update Views y several improvements
r316 from django.contrib.auth.decorators import login_required, user_passes_test
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
Juan C. Espinoza
Updating base models and views ...
r6
Juan C. Espinoza
Update several views and models in main app...
r85 from .forms import CampaignForm, ExperimentForm, DeviceForm, ConfigurationForm, LocationForm, UploadFileForm, DownloadFileForm, OperationForm, NewForm
Juan C. Espinoza
Add Change IP function for DDS Device...
r219 from .forms import OperationSearchForm, FilterForm, ChangeIpForm
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fix mix experiment and scheduler
r311 from .tasks import task_start
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196
Juan C. Espinoza
Fix Mix RC configurations...
r238 from apps.rc.forms import RCConfigurationForm, RCLineCode, RCMixConfigurationForm
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 from apps.dds.forms import DDSConfigurationForm
Miguel Urco
Campaign has been added to RadarSys Model...
r13 from apps.jars.forms import JARSConfigurationForm
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 from apps.cgs.forms import CGSConfigurationForm
Miguel Urco
Campaign has been added to RadarSys Model...
r13 from apps.abs.forms import ABSConfigurationForm
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 from apps.usrp.forms import USRPConfigurationForm
Fiorella Quino
import Params in main app...
r295 from .utils import Params
Miguel Urco
Campaign has been added to RadarSys Model...
r13
Fiorella Quino
experimento_start view function modificated...
r252 from .models import Campaign, Experiment, Device, Configuration, Location, RunningExperiment, DEV_STATES
Juan C. Espinoza
Updating base models and views ...
r6 from apps.cgs.models import CGSConfiguration
Fiorella Quino
Task #559: Vista de Summary (main: urls, views, experiment.html, experiment_summary.html)...
r151 from apps.jars.models import JARSConfiguration, EXPERIMENT_TYPE
Miguel Urco
Campaign has been added to RadarSys Model...
r13 from apps.usrp.models import USRPConfiguration
Juan C. Espinoza
Updating base models and views ...
r6 from apps.abs.models import ABSConfiguration
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 from apps.rc.models import RCConfiguration, RCLine, RCLineType
Juan C. Espinoza
Updating base models and views ...
r6 from apps.dds.models import DDSConfiguration
Juan C. Espinoza
Proyecto base en Django (refs #259) ...
r0
Fix mix experiment and scheduler
r311 from radarsys.celery import app
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Miguel Urco
Campaign has been added to RadarSys Model...
r13 CONF_FORMS = {
'rc': RCConfigurationForm,
'dds': DDSConfigurationForm,
'jars': JARSConfigurationForm,
'cgs': CGSConfigurationForm,
'abs': ABSConfigurationForm,
'usrp': USRPConfigurationForm,
}
CONF_MODELS = {
Juan C. Espinoza
Updating base models and views ...
r6 'rc': RCConfiguration,
'dds': DDSConfiguration,
'jars': JARSConfiguration,
'cgs': CGSConfiguration,
'abs': ABSConfiguration,
Miguel Urco
Campaign has been added to RadarSys Model...
r13 'usrp': USRPConfiguration,
Juan C. Espinoza
Updating base models and views ...
r6 }
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 MIX_MODES = {
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 '0': 'P',
'1': 'S',
}
MIX_OPERATIONS = {
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 '0': 'OR',
'1': 'XOR',
'2': 'AND',
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 '3': 'NAND',
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 }
Juan C. Espinoza
Update Views y several improvements
r316
def is_developer(user):
groups = [str(g.name) for g in user.groups.all()]
return 'Developer' in groups or user.is_staff
def is_operator(user):
groups = [str(g.name) for g in user.groups.all()]
return 'Operator' in groups or user.is_staff
def has_been_modified(model):
prev_hash = model.hash
new_hash = hashlib.sha256(str(model.parms_to_dict)).hexdigest()
if prev_hash != new_hash:
model.hash = new_hash
model.save()
return True
return False
Juan C. Espinoza
Updating base models and views ...
r6 def index(request):
Juan C. Espinoza
Update Views y several improvements
r316 kwargs = {'no_sidebar': True}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return render(request, 'index.html', kwargs)
Juan C. Espinoza
Update views and templates of main app...
r89
Miguel Urco
Location model added to RadarSys...
r41 def locations(request):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 page = request.GET.get('page')
order = ('name',)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
kwargs = get_paginator(Location, page, order)
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 kwargs['keys'] = ['name', 'description']
kwargs['title'] = 'Radar System'
Miguel Urco
Location model added to RadarSys...
r41 kwargs['suptitle'] = 'List'
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 kwargs['no_sidebar'] = True
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 return render(request, 'base_list.html', kwargs)
Miguel Urco
Location model added to RadarSys...
r41
Juan C. Espinoza
Update views and templates of main app...
r89
Miguel Urco
Location model added to RadarSys...
r41 def location(request, id_loc):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 location = get_object_or_404(Location, pk=id_loc)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 kwargs = {}
kwargs['location'] = location
kwargs['location_keys'] = ['name', 'description']
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 kwargs['title'] = 'Location'
kwargs['suptitle'] = 'Details'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 return render(request, 'location.html', kwargs)
Fiorella Quino
Task #487: Operation View. Se puede seleccionar una de las 5 ultimas Campañas o se puede buscar entre todas las existentes....
r69
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
Location model added to RadarSys...
r41 def location_new(request):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 if request.method == 'GET':
form = LocationForm()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 if request.method == 'POST':
form = LocationForm(request.POST)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 if form.is_valid():
form.save()
return redirect('url_locations')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 kwargs = {}
kwargs['form'] = form
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 kwargs['title'] = 'Radar System'
Miguel Urco
Location model added to RadarSys...
r41 kwargs['suptitle'] = 'New'
kwargs['button'] = 'Create'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 return render(request, 'base_edit.html', kwargs)
Miguel Urco
Location model added to RadarSys...
r41
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
Location model added to RadarSys...
r41 def location_edit(request, id_loc):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 location = get_object_or_404(Location, pk=id_loc)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'GET':
Miguel Urco
Location model added to RadarSys...
r41 form = LocationForm(instance=location)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Miguel Urco
Location model added to RadarSys...
r41 form = LocationForm(request.POST, instance=location)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 if form.is_valid():
form.save()
return redirect('url_locations')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 kwargs = {}
kwargs['form'] = form
kwargs['title'] = 'Location'
kwargs['suptitle'] = 'Edit'
kwargs['button'] = 'Update'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 return render(request, 'base_edit.html', kwargs)
Miguel Urco
Location model added to RadarSys...
r41
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
Location model added to RadarSys...
r41 def location_delete(request, id_loc):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 location = get_object_or_404(Location, pk=id_loc)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Location model added to RadarSys...
r41 if request.user.is_staff:
location.delete()
return redirect('url_locations')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update views and templates of main app...
r89 messages.error(request, 'Not enough permission to delete this object')
return redirect(location.get_absolute_url())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update views and templates of main app...
r89 kwargs = {
Juan C. Espinoza
Update Views y several improvements
r316 'title': 'Delete',
'suptitle': 'Location',
'object': location,
'delete': True
}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update views and templates of main app...
r89 return render(request, 'confirm.html', kwargs)
Miguel Urco
Location model added to RadarSys...
r41
Miguel Urco
Campaign has been added to RadarSys Model...
r13 def devices(request):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 page = request.GET.get('page')
Juan C. Espinoza
Update Views y several improvements
r316 order = ('location', 'device_type')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 filters = request.GET.copy()
kwargs = get_paginator(Device, page, order, filters)
form = FilterForm(initial=request.GET, extra_fields=['tags'])
kwargs['keys'] = ['device_type', 'location',
'ip_address', 'port_address', 'actions']
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['title'] = 'Device'
kwargs['suptitle'] = 'List'
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 kwargs['no_sidebar'] = True
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['form'] = form
kwargs['add_url'] = reverse('url_add_device')
filters.pop('page', None)
kwargs['q'] = urlencode(filters)
kwargs['menu'] = 'device'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 return render(request, 'base_list.html', kwargs)
Juan C. Espinoza
Actualizacion de templates y modelos base #263...
r2
Juan C. Espinoza
Update views and templates of main app...
r89
Miguel Urco
Campaign has been added to RadarSys Model...
r13 def device(request, id_dev):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 device = get_object_or_404(Device, pk=id_dev)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Actualizacion de templates y modelos base #263...
r2 kwargs = {}
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['device'] = device
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['device_keys'] = ['device_type',
'ip_address', 'port_address', 'description']
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['title'] = 'Device'
kwargs['suptitle'] = 'Details'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return render(request, 'device.html', kwargs)
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
views name were changed ...
r19 def device_new(request):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 if request.method == 'GET':
form = DeviceForm()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 if request.method == 'POST':
form = DeviceForm(request.POST)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 if form.is_valid():
form.save()
return redirect('url_devices')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs = {}
kwargs['form'] = form
kwargs['title'] = 'Device'
kwargs['suptitle'] = 'New'
kwargs['button'] = 'Create'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 return render(request, 'base_edit.html', kwargs)
Juan C. Espinoza
Updating base models and views ...
r6
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
views name were changed ...
r19 def device_edit(request, id_dev):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 device = get_object_or_404(Device, pk=id_dev)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'GET':
Miguel Urco
Campaign has been added to RadarSys Model...
r13 form = DeviceForm(instance=device)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Miguel Urco
Campaign has been added to RadarSys Model...
r13 form = DeviceForm(request.POST, instance=device)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Actualizacion de templates y modelos base #263...
r2 if form.is_valid():
form.save()
Juan C. Espinoza
Update views and templates of main app...
r89 return redirect(device.get_absolute_url())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs = {}
kwargs['form'] = form
kwargs['title'] = 'Device'
kwargs['suptitle'] = 'Edit'
kwargs['button'] = 'Update'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 return render(request, 'base_edit.html', kwargs)
Juan C. Espinoza
Updating base models and views ...
r6
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
views name were changed ...
r19 def device_delete(request, id_dev):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 device = get_object_or_404(Device, pk=id_dev)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
delete interface added to views...
r18 if request.user.is_staff:
device.delete()
return redirect('url_devices')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update views and templates of main app...
r89 messages.error(request, 'Not enough permission to delete this object')
return redirect(device.get_absolute_url())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update views and templates of main app...
r89 kwargs = {
Juan C. Espinoza
Update Views y several improvements
r316 'title': 'Delete',
'suptitle': 'Device',
'object': device,
'delete': True
}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update views and templates of main app...
r89 return render(request, 'confirm.html', kwargs)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Juan C. Espinoza
Add Change IP function for DDS Device...
r219 def device_change_ip(request, id_dev):
device = get_object_or_404(Device, pk=id_dev)
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Juan C. Espinoza
Add Change IP function for DDS Device...
r219
if request.user.is_staff:
device.change_ip(**request.POST.dict())
Juan C. Espinoza
Update RC control methods, add change_ip for RC, fix win_reference for sub-baudio...
r236 level, message = device.message.split('|')
messages.add_message(request, level, message)
Juan C. Espinoza
Add Change IP function for DDS Device...
r219 else:
Juan C. Espinoza
Update Views y several improvements
r316 messages.error(
request, 'Not enough permission to delete this object')
Juan C. Espinoza
Add Change IP function for DDS Device...
r219 return redirect(device.get_absolute_url())
kwargs = {
Juan C. Espinoza
Update Views y several improvements
r316 'title': 'Device',
'suptitle': 'Change IP',
'object': device,
'previous': device.get_absolute_url(),
'form': ChangeIpForm(initial={'ip_address': device.ip_address}),
'message': ' ',
}
Juan C. Espinoza
Add Change IP function for DDS Device...
r219
return render(request, 'confirm.html', kwargs)
Miguel Urco
Campaign has been added to RadarSys Model...
r13 def campaigns(request):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 page = request.GET.get('page')
order = ('start_date',)
filters = request.GET.copy()
kwargs = get_paginator(Campaign, page, order, filters)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 form = FilterForm(initial=request.GET, extra_fields=[
'range_date', 'tags', 'template'])
kwargs['keys'] = ['name', 'start_date', 'end_date', 'actions']
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['title'] = 'Campaign'
kwargs['suptitle'] = 'List'
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 kwargs['no_sidebar'] = True
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 kwargs['form'] = form
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['add_url'] = reverse('url_add_campaign')
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 filters.pop('page', None)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 kwargs['q'] = urlencode(filters)
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 return render(request, 'base_list.html', kwargs)
Miguel Urco
Campaign has been added to RadarSys Model...
r13
Juan C. Espinoza
Update views and templates of main app...
r89
Miguel Urco
Campaign has been added to RadarSys Model...
r13 def campaign(request, id_camp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 campaign = get_object_or_404(Campaign, pk=id_camp)
Miguel Urco
Models changed:...
r53 experiments = Experiment.objects.filter(campaign=campaign)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 form = CampaignForm(instance=campaign)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs = {}
kwargs['campaign'] = campaign
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['campaign_keys'] = ['template', 'name',
'start_date', 'end_date', 'tags', 'description']
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update views and templates of main app...
r89 kwargs['experiments'] = experiments
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['experiment_keys'] = [
'name', 'radar_system', 'start_time', 'end_time']
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['title'] = 'Campaign'
kwargs['suptitle'] = 'Details'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['form'] = form
kwargs['button'] = 'Add Experiment'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return render(request, 'campaign.html', kwargs)
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
views name were changed ...
r19 def campaign_new(request):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 kwargs = {}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 if request.method == 'GET':
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 if 'template' in request.GET:
Juan C. Espinoza
Update Views y several improvements
r316 if request.GET['template'] == '0':
form = NewForm(initial={'create_from': 2},
Juan C. Espinoza
Update several views and models in main app...
r85 template_choices=Campaign.objects.filter(template=True).values_list('id', 'name'))
else:
kwargs['button'] = 'Create'
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['experiments'] = Configuration.objects.filter(
experiment=request.GET['template'])
Juan C. Espinoza
Update several views and models in main app...
r85 kwargs['experiment_keys'] = ['name', 'start_time', 'end_time']
Juan C. Espinoza
Update new and edit "views"...
r91 camp = Campaign.objects.get(pk=request.GET['template'])
form = CampaignForm(instance=camp,
Juan C. Espinoza
Update Views y several improvements
r316 initial={'name': '{}_{:%Y%m%d}'.format(camp.name, datetime.now()),
'template': False})
Juan C. Espinoza
Update several views and models in main app...
r85 elif 'blank' in request.GET:
kwargs['button'] = 'Create'
form = CampaignForm()
else:
form = NewForm()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 if request.method == 'POST':
Juan C. Espinoza
Update several views and models in main app...
r85 kwargs['button'] = 'Create'
post = request.POST.copy()
experiments = []
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 for id_exp in post.getlist('experiments'):
exp = Experiment.objects.get(pk=id_exp)
new_exp = exp.clone(template=False)
experiments.append(new_exp)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 post.setlist('experiments', [])
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 form = CampaignForm(post)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 if form.is_valid():
Juan C. Espinoza
Update Views y several improvements
r316 campaign = form.save(commit=False)
campaign.author = request.user
Juan C. Espinoza
Update several views and models in main app...
r85 for exp in experiments:
campaign.experiments.add(exp)
campaign.save()
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return redirect('url_campaign', id_camp=campaign.id)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['form'] = form
kwargs['title'] = 'Campaign'
kwargs['suptitle'] = 'New'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return render(request, 'campaign_edit.html', kwargs)
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
views name were changed ...
r19 def campaign_edit(request, id_camp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 campaign = get_object_or_404(Campaign, pk=id_camp)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'GET':
Miguel Urco
Campaign has been added to RadarSys Model...
r13 form = CampaignForm(instance=campaign)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Juan C. Espinoza
Update new and edit "views"...
r91 exps = campaign.experiments.all().values_list('pk', flat=True)
post = request.POST.copy()
new_exps = post.getlist('experiments')
post.setlist('experiments', [])
form = CampaignForm(post, instance=campaign)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 if form.is_valid():
Juan C. Espinoza
Update new and edit "views"...
r91 camp = form.save()
for id_exp in new_exps:
if int(id_exp) in exps:
exps.pop(id_exp)
else:
exp = Experiment.objects.get(pk=id_exp)
if exp.template:
camp.experiments.add(exp.clone(template=False))
else:
camp.experiments.add(exp)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update new and edit "views"...
r91 for id_exp in exps:
camp.experiments.remove(Experiment.objects.get(pk=id_exp))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return redirect('url_campaign', id_camp=id_camp)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs = {}
kwargs['form'] = form
kwargs['title'] = 'Campaign'
kwargs['suptitle'] = 'Edit'
kwargs['button'] = 'Update'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return render(request, 'campaign_edit.html', kwargs)
Juan C. Espinoza
Updating base models and views ...
r6
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
views name were changed ...
r19 def campaign_delete(request, id_camp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 campaign = get_object_or_404(Campaign, pk=id_camp)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Miguel Urco
delete interface added to views...
r18 if request.user.is_staff:
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 for exp in campaign.experiments.all():
for conf in Configuration.objects.filter(experiment=exp):
conf.delete()
exp.delete()
Miguel Urco
delete interface added to views...
r18 campaign.delete()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
delete interface added to views...
r18 return redirect('url_campaigns')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update views and templates of main app...
r89 messages.error(request, 'Not enough permission to delete this object')
return redirect(campaign.get_absolute_url())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update views and templates of main app...
r89 kwargs = {
Juan C. Espinoza
Update Views y several improvements
r316 'title': 'Delete',
'suptitle': 'Campaign',
'object': campaign,
'delete': True
}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update views and templates of main app...
r89 return render(request, 'confirm.html', kwargs)
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Fiorella Quino
Export Campaign ...
r100 def campaign_export(request, id_camp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Export Campaign ...
r100 campaign = get_object_or_404(Campaign, pk=id_camp)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 content = campaign.parms_to_dict()
Fiorella Quino
Export Campaign ...
r100 content_type = 'application/json'
Juan C. Espinoza
Update Views y several improvements
r316 filename = '%s_%s.json' % (campaign.name, campaign.id)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Export Campaign ...
r100 response = HttpResponse(content_type=content_type)
Juan C. Espinoza
Update Views y several improvements
r316 response['Content-Disposition'] = 'attachment; filename="%s"' % filename
Fiorella Quino
Main files have been updated...
r266 response.write(json.dumps(content, indent=2))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Export Campaign ...
r100 return response
Miguel Urco
delete interface added to views...
r18
Fiorella Quino
Import Experiment Function...
r108
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Fiorella Quino
Import Experiment Function...
r108 def campaign_import(request, id_camp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 campaign = get_object_or_404(Campaign, pk=id_camp)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 if request.method == 'GET':
file_form = UploadFileForm()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 if request.method == 'POST':
file_form = UploadFileForm(request.POST, request.FILES)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 if file_form.is_valid():
Juan C. Espinoza
Update Views y several improvements
r316 new_camp = campaign.dict_to_parms(
json.load(request.FILES['file']), CONF_MODELS)
messages.success(
request, "Parameters imported from: '%s'." % request.FILES['file'].name)
Fiorella Quino
Main files have been updated...
r266 return redirect(new_camp.get_absolute_url_edit())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 messages.error(request, "Could not import parameters from file")
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 kwargs = {}
kwargs['title'] = 'Campaign'
kwargs['form'] = file_form
kwargs['suptitle'] = 'Importing file'
kwargs['button'] = 'Import'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 return render(request, 'campaign_import.html', kwargs)
Miguel Urco
Campaign has been added to RadarSys Model...
r13 def experiments(request):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 page = request.GET.get('page')
order = ('location',)
filters = request.GET.copy()
Juan C. Espinoza
Update Views y several improvements
r316 if 'my experiments' in filters:
filters.pop('my experiments', None)
filters['mine'] = request.user.id
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 kwargs = get_paginator(Experiment, page, order, filters)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 fields = ['tags', 'template']
if request.user.is_authenticated:
fields.append('my experiments')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 form = FilterForm(initial=request.GET, extra_fields=fields)
kwargs['keys'] = ['name', 'radar_system',
'start_time', 'end_time', 'actions']
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['title'] = 'Experiment'
kwargs['suptitle'] = 'List'
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 kwargs['no_sidebar'] = True
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 kwargs['form'] = form
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['add_url'] = reverse('url_add_experiment')
filters = request.GET.copy()
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 filters.pop('page', None)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 kwargs['q'] = urlencode(filters)
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 return render(request, 'base_list.html', kwargs)
Miguel Urco
Campaign has been added to RadarSys Model...
r13
Juan C. Espinoza
Update views and templates of main app...
r89
Miguel Urco
Campaign has been added to RadarSys Model...
r13 def experiment(request, id_exp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 experiment = get_object_or_404(Experiment, pk=id_exp)
Fiorella Quino
Main files have been updated...
r266
Juan C. Espinoza
Update Views y several improvements
r316 configurations = Configuration.objects.filter(
experiment=experiment, type=0)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs = {}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['experiment_keys'] = ['template', 'radar_system',
'name', 'freq', 'start_time', 'end_time']
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['experiment'] = experiment
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['configuration_keys'] = ['name', 'device__ip_address',
'device__port_address', 'device__status']
Juan C. Espinoza
Update new and edit "views"...
r91 kwargs['configurations'] = configurations
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['title'] = 'Experiment'
kwargs['suptitle'] = 'Details'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC models, views, templates & statics...
r45 kwargs['button'] = 'Add Configuration'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 ###### SIDEBAR ######
kwargs.update(sidebar(experiment=experiment))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return render(request, 'experiment.html', kwargs)
Juan C. Espinoza
Update several views and models in main app...
r85
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Juan C. Espinoza
- Update rc app...
r79 def experiment_new(request, id_camp=None):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if not is_developer(request.user):
messages.error(
request, 'Developer required, to create new Experiments')
return redirect('index')
Juan C. Espinoza
Update several views and models in main app...
r85 kwargs = {}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 if request.method == 'GET':
Juan C. Espinoza
Update several views and models in main app...
r85 if 'template' in request.GET:
Juan C. Espinoza
Update Views y several improvements
r316 if request.GET['template'] == '0':
form = NewForm(initial={'create_from': 2},
Juan C. Espinoza
Update several views and models in main app...
r85 template_choices=Experiment.objects.filter(template=True).values_list('id', 'name'))
else:
kwargs['button'] = 'Create'
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['configurations'] = Configuration.objects.filter(
experiment=request.GET['template'])
kwargs['configuration_keys'] = ['name', 'device__name',
'device__ip_address', 'device__port_address']
exp = Experiment.objects.get(pk=request.GET['template'])
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 form = ExperimentForm(instance=exp,
Fiorella Quino
Main files have been updated...
r266 initial={'name': '{}_{:%y%m%d}'.format(exp.name, datetime.now()),
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 'template': False})
Juan C. Espinoza
Update several views and models in main app...
r85 elif 'blank' in request.GET:
kwargs['button'] = 'Create'
form = ExperimentForm()
else:
form = NewForm()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Updating base models and views ...
r6 if request.method == 'POST':
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 form = ExperimentForm(request.POST)
Juan C. Espinoza
Updating base models and views ...
r6 if form.is_valid():
Juan C. Espinoza
Update Views y several improvements
r316 experiment = form.save(commit=False)
experiment.author = request.user
experiment.save()
Juan C. Espinoza
Update several views and models in main app...
r85
if 'template' in request.GET:
Juan C. Espinoza
Update Views y several improvements
r316 configurations = Configuration.objects.filter(
experiment=request.GET['template'], type=0)
Juan C. Espinoza
Update several views and models in main app...
r85 for conf in configurations:
conf.clone(experiment=experiment, template=False)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return redirect('url_experiment', id_exp=experiment.id)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['form'] = form
Juan C. Espinoza
Updating base models and views ...
r6 kwargs['title'] = 'Experiment'
kwargs['suptitle'] = 'New'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return render(request, 'experiment_edit.html', kwargs)
Juan C. Espinoza
Updating base models and views ...
r6
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
views name were changed ...
r19 def experiment_edit(request, id_exp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 experiment = get_object_or_404(Experiment, pk=id_exp)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 if request.method == 'GET':
form = ExperimentForm(instance=experiment)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Miguel Urco
Campaign has been added to RadarSys Model...
r13 form = ExperimentForm(request.POST, instance=experiment)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Updating base models and views ...
r6 if form.is_valid():
Miguel Urco
Campaign has been added to RadarSys Model...
r13 experiment = form.save()
return redirect('url_experiment', id_exp=experiment.id)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs = {}
kwargs['form'] = form
kwargs['title'] = 'Experiment'
kwargs['suptitle'] = 'Edit'
kwargs['button'] = 'Update'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return render(request, 'experiment_edit.html', kwargs)
Juan C. Espinoza
Actualizacion de templates y modelos base #263...
r2
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
views name were changed ...
r19 def experiment_delete(request, id_exp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 experiment = get_object_or_404(Experiment, pk=id_exp)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Miguel Urco
delete interface added to views...
r18 if request.user.is_staff:
Juan C. Espinoza
Update new and edit "views"...
r91 for conf in Configuration.objects.filter(experiment=experiment):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 conf.delete()
Miguel Urco
delete interface added to views...
r18 experiment.delete()
Juan C. Espinoza
Update several views and models in main app...
r85 return redirect('url_experiments')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update new and edit "views"...
r91 messages.error(request, 'Not enough permission to delete this object')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 return redirect(experiment.get_absolute_url())
Juan C. Espinoza
Update new and edit "views"...
r91 kwargs = {
Juan C. Espinoza
Update Views y several improvements
r316 'title': 'Delete',
'suptitle': 'Experiment',
'object': experiment,
'delete': True
}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update new and edit "views"...
r91 return render(request, 'confirm.html', kwargs)
Miguel Urco
delete interface added to views...
r18
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Fiorella Quino
Export Campaign ...
r100 def experiment_export(request, id_exp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Export Campaign ...
r100 experiment = get_object_or_404(Experiment, pk=id_exp)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 content = experiment.parms_to_dict()
Fiorella Quino
Export Campaign ...
r100 content_type = 'application/json'
Juan C. Espinoza
Update Views y several improvements
r316 filename = '%s_%s.json' % (experiment.name, experiment.id)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Export Campaign ...
r100 response = HttpResponse(content_type=content_type)
Juan C. Espinoza
Update Views y several improvements
r316 response['Content-Disposition'] = 'attachment; filename="%s"' % filename
Fiorella Quino
Main files have been updated...
r266 response.write(json.dumps(content, indent=2))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Export Campaign ...
r100 return response
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Fiorella Quino
Import Experiment Function...
r108 def experiment_import(request, id_exp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 experiment = get_object_or_404(Experiment, pk=id_exp)
Fiorella Quino
Import Experiment Function...
r108 configurations = Configuration.objects.filter(experiment=experiment)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 if request.method == 'GET':
file_form = UploadFileForm()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 if request.method == 'POST':
file_form = UploadFileForm(request.POST, request.FILES)
Fiorella Quino
import/export functions have been updated...
r243
Fiorella Quino
Import Experiment Function...
r108 if file_form.is_valid():
Juan C. Espinoza
Update Views y several improvements
r316 new_exp = experiment.dict_to_parms(
json.load(request.FILES['file']), CONF_MODELS)
messages.success(
request, "Parameters imported from: '%s'." % request.FILES['file'].name)
Fiorella Quino
Main files have been updated...
r266 return redirect(new_exp.get_absolute_url_edit())
Fiorella Quino
Import Experiment Function...
r108
messages.error(request, "Could not import parameters from file")
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 kwargs = {}
kwargs['title'] = 'Experiment'
kwargs['form'] = file_form
kwargs['suptitle'] = 'Importing file'
kwargs['button'] = 'Import'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 kwargs.update(sidebar(experiment=experiment))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Import Experiment Function...
r108 return render(request, 'experiment_import.html', kwargs)
Fiorella Quino
Export Campaign ...
r100
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 def experiment_start(request, id_exp):
Fiorella Quino
main views updated...
r241
Fiorella Quino
Main files have been updated...
r266 exp = get_object_or_404(Experiment, pk=id_exp)
Fiorella Quino
experiment_start view has been updated ...
r251
Fiorella Quino
experimento_start view function modificated...
r252 if exp.status == 2:
Fiorella Quino
Main files have been updated...
r266 messages.warning(request, 'Experiment {} already runnnig'.format(exp))
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 else:
Fiorella Quino
Main files have been updated...
r266 exp.status = exp.start()
Juan C. Espinoza
Update Views y several improvements
r316 if exp.status == 0:
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 messages.error(request, 'Experiment {} not start'.format(exp))
Juan C. Espinoza
Update Views y several improvements
r316 if exp.status == 2:
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 messages.success(request, 'Experiment {} started'.format(exp))
Fiorella Quino
Main files have been updated...
r266
Fiorella Quino
experimento_start view function modificated...
r252 exp.save()
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240
return redirect(exp.get_absolute_url())
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 def experiment_stop(request, id_exp):
Fiorella Quino
main views updated...
r241
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 exp = get_object_or_404(Experiment, pk=id_exp)
Fiorella Quino
task for monitoring devices status from experiment...
r254
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 if exp.status == 2:
Fiorella Quino
Main files have been updated...
r266 exp.status = exp.stop()
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 exp.save()
Fiorella Quino
Main files have been updated...
r266 messages.success(request, 'Experiment {} stopped'.format(exp))
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240 else:
Fiorella Quino
main views updated...
r241 messages.error(request, 'Experiment {} not running'.format(exp))
Juan C. Espinoza
Add start, stop methods to experiment, fix RC dat export file...
r240
return redirect(exp.get_absolute_url())
Fiorella Quino
Main files have been updated...
r266 def experiment_status(request, id_exp):
exp = get_object_or_404(Experiment, pk=id_exp)
exp.get_status()
return redirect(exp.get_absolute_url())
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 def experiment_mix(request, id_exp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 experiment = get_object_or_404(Experiment, pk=id_exp)
Juan C. Espinoza
Update Views y several improvements
r316 rc_confs = [conf for conf in RCConfiguration.objects.filter(
experiment=id_exp,
type=0,
mix=False)]
if len(rc_confs) < 2:
messages.warning(
request, 'You need at least two RC Configurations to make a mix')
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 return redirect(experiment.get_absolute_url())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 mix_confs = RCConfiguration.objects.filter(experiment=id_exp, mix=True)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 if mix_confs:
mix = mix_confs[0]
else:
mix = RCConfiguration(experiment=experiment,
device=rc_confs[0].device,
ipp=rc_confs[0].ipp,
clock_in=rc_confs[0].clock_in,
clock_divider=rc_confs[0].clock_divider,
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 mix=True,
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 parameters='')
mix.save()
Fiorella Quino
main views updated...
r241
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 line_type = RCLineType.objects.get(name='mix')
for i in range(len(rc_confs[0].get_lines())):
line = RCLine(rc_configuration=mix, line_type=line_type, channel=i)
Fiorella Quino
main views updated...
r241 line.save()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
main views updated...
r241 initial = {'name': mix.name,
'result': parse_mix_result(mix.parameters),
'delay': 0,
Juan C. Espinoza
Update Views y several improvements
r316 'mask': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 }
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'GET':
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 form = RCMixConfigurationForm(confs=rc_confs, initial=initial)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 result = mix.parameters
if '{}|'.format(request.POST['experiment']) in result:
messages.error(request, 'Configuration already added')
else:
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 if 'operation' in request.POST:
operation = MIX_OPERATIONS[request.POST['operation']]
else:
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 operation = ' '
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 mode = MIX_MODES[request.POST['mode']]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 if result:
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 result = '{}-{}|{}|{}|{}|{}'.format(mix.parameters,
Juan C. Espinoza
Update Views y several improvements
r316 request.POST['experiment'],
mode,
operation,
float(
request.POST['delay']),
parse_mask(
request.POST.getlist('mask'))
)
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 else:
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 result = '{}|{}|{}|{}|{}'.format(request.POST['experiment'],
Juan C. Espinoza
Update Views y several improvements
r316 mode,
operation,
float(request.POST['delay']),
parse_mask(
request.POST.getlist('mask'))
)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 mix.parameters = result
mix.save()
mix.update_pulses()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 initial['result'] = parse_mix_result(result)
initial['name'] = mix.name
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 form = RCMixConfigurationForm(initial=initial, confs=rc_confs)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 kwargs = {
Juan C. Espinoza
Update Views y several improvements
r316 'title': 'Experiment',
'suptitle': 'Mix Configurations',
'form': form,
'extra_button': 'Delete',
'button': 'Add',
'cancel': 'Back',
'previous': experiment.get_absolute_url(),
'id_exp': id_exp,
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106
Juan C. Espinoza
Update Views y several improvements
r316 }
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 return render(request, 'experiment_mix.html', kwargs)
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 def experiment_mix_delete(request, id_exp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fix mix experiment and scheduler
r311 conf = RCConfiguration.objects.get(experiment=id_exp, mix=True, type=0)
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 values = conf.parameters.split('-')
conf.parameters = '-'.join(values[:-1])
conf.save()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 return redirect('url_mix_experiment', id_exp=id_exp)
Fiorella Quino
main views updated...
r241 def experiment_summary(request, id_exp):
Fiorella Quino
Task #784: Permisos de usuarios, staff_member_required se cambio por user_passes_test...
r214
Juan C. Espinoza
Update Views y several improvements
r316 experiment = get_object_or_404(Experiment, pk=id_exp)
configurations = Configuration.objects.filter(
experiment=experiment, type=0)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Task #559: Vista de Summary (main: urls, views, experiment.html, experiment_summary.html)...
r151 kwargs = {}
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['experiment_keys'] = ['radar_system',
'name', 'freq', 'start_time', 'end_time']
Fiorella Quino
Task #559: Vista de Summary (main: urls, views, experiment.html, experiment_summary.html)...
r151 kwargs['experiment'] = experiment
Juan C. Espinoza
Fix experiment views (summary & verify)...
r239 kwargs['configurations'] = []
Fiorella Quino
Task #559: Vista de Summary (main: urls, views, experiment.html, experiment_summary.html)...
r151 kwargs['title'] = 'Experiment Summary'
kwargs['suptitle'] = 'Details'
kwargs['button'] = 'Verify Parameters'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 c_vel = 3.0*(10**8) # m/s
ope_freq = experiment.freq*(10**6) # 1/s
radar_lambda = c_vel/ope_freq # m
Fiorella Quino
Main files have been updated...
r266 kwargs['radar_lambda'] = radar_lambda
Juan C. Espinoza
Update Views y several improvements
r316 ipp = None
nsa = 1
Fiorella Quino
Main files have been updated...
r266 code_id = 0
tx_line = {}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 for configuration in configurations.filter(device__device_type__name = 'rc'):
Fiorella Quino
Main files have been updated...
r266
Juan C. Espinoza
Update Views y several improvements
r316 if configuration.mix:
continue
conf = {'conf': configuration}
conf['keys'] = []
conf['NTxs'] = configuration.ntx
conf['keys'].append('NTxs')
ipp = configuration.ipp
conf['IPP'] = ipp
conf['keys'].append('IPP')
lines = configuration.get_lines(line_type__name='tx')
for tx_line in lines:
tx_params = json.loads(tx_line.params)
conf[tx_line.get_name()] = '{} Km'.format(tx_params['pulse_width'])
conf['keys'].append(tx_line.get_name())
delays = tx_params['delays']
if delays not in ('', '0'):
n = len(delays.split(','))
taus = '{} Taus: {}'.format(n, delays)
else:
taus = '-'
conf['Taus ({})'.format(tx_line.get_name())] = taus
conf['keys'].append('Taus ({})'.format(tx_line.get_name()))
for code_line in configuration.get_lines(line_type__name='codes'):
code_params = json.loads(code_line.params)
code_id = code_params['code']
if tx_line.pk == int(code_params['TX_ref']):
conf['Code ({})'.format(tx_line.get_name())] = '{}:{}'.format(RCLineCode.objects.get(pk=code_params['code']),
'-'.join(code_params['codes']))
conf['keys'].append('Code ({})'.format(tx_line.get_name()))
for windows_line in configuration.get_lines(line_type__name='windows'):
win_params = json.loads(windows_line.params)
if tx_line.pk == int(win_params['TX_ref']):
windows = ''
nsa = win_params['params'][0]['number_of_samples']
for i, params in enumerate(win_params['params']):
windows += 'W{}: Ho={first_height} km DH={resolution} km NSA={number_of_samples}<br>'.format(
i, **params)
conf['Window'] = mark_safe(windows)
conf['keys'].append('Window')
kwargs['configurations'].append(conf)
for configuration in configurations.filter(device__device_type__name = 'jars'):
conf = {'conf': configuration}
conf['keys'] = []
conf['Type of Data'] = EXPERIMENT_TYPE[configuration.exp_type][1]
conf['keys'].append('Type of Data')
channels_number = configuration.channels_number
exp_type = configuration.exp_type
fftpoints = configuration.fftpoints
filter_parms = json.loads(configuration.filter_parms)
spectral_number = configuration.spectral_number
acq_profiles = configuration.acq_profiles
cohe_integr = configuration.cohe_integr
profiles_block = configuration.profiles_block
conf['Num of Profiles'] = acq_profiles
conf['keys'].append('Num of Profiles')
conf['Prof per Block'] = profiles_block
conf['keys'].append('Prof per Block')
conf['Blocks per File'] = configuration.raw_data_blocks
conf['keys'].append('Blocks per File')
if exp_type == 0: # Short
bytes_ = 2
b = nsa*2*bytes_*channels_number
else: # Float
bytes_ = 4
channels = channels_number + spectral_number
b = nsa*2*bytes_*fftpoints*channels
codes_num = 7
if code_id == 2:
Fiorella Quino
Main files have been updated...
r266 codes_num = 7
Juan C. Espinoza
Update Views y several improvements
r316 elif code_id == 12:
codes_num = 15
#Jars filter values:
clock = float(filter_parms['clock'])
filter_2 = int(filter_parms['cic_2'])
filter_5 = int(filter_parms['cic_5'])
filter_fir = int(filter_parms['fir'])
Fs_MHz = clock/(filter_2*filter_5*filter_fir)
#Jars values:
if ipp is not None:
IPP_units = ipp/0.15*Fs_MHz
IPP_us = IPP_units / Fs_MHz
IPP_s = IPP_units / (Fs_MHz * (10**6))
Ts = 1/(Fs_MHz*(10**6))
Va = radar_lambda/(4*Ts*cohe_integr)
rate_bh = ((nsa-codes_num)*channels_number*2 *
bytes_/IPP_us)*(36*(10**8)/cohe_integr)
rate_gh = rate_bh/(1024*1024*1024)
conf['Time per Block'] = IPP_s * profiles_block * cohe_integr
conf['keys'].append('Time per Block')
conf['Acq time'] = IPP_s * acq_profiles
conf['keys'].append('Acq time')
conf['Data rate'] = str(rate_gh)+" (GB/h)"
conf['keys'].append('Data rate')
conf['Va (m/s)'] = Va
conf['keys'].append('Va (m/s)')
conf['Vrange (m/s)'] = 3/(2*IPP_s*cohe_integr)
conf['keys'].append('Vrange (m/s)')
kwargs['configurations'].append(conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Task #559: Vista de Summary (main: urls, views, experiment.html, experiment_summary.html)...
r151 ###### SIDEBAR ######
kwargs.update(sidebar(experiment=experiment))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Task #559: Vista de Summary (main: urls, views, experiment.html, experiment_summary.html)...
r151 return render(request, 'experiment_summary.html', kwargs)
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Juan C. Espinoza
sync repo...
r157 def experiment_verify(request, id_exp):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 experiment = get_object_or_404(Experiment, pk=id_exp)
Fiorella Quino
Main files have been updated...
r266 experiment_data = experiment.parms_to_dict()
Juan C. Espinoza
Update Views y several improvements
r316 configurations = Configuration.objects.filter(
experiment=experiment, type=0)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 kwargs = {}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['experiment_keys'] = ['template',
'radar_system', 'name', 'start_time', 'end_time']
Juan C. Espinoza
sync repo...
r157 kwargs['experiment'] = experiment
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['configuration_keys'] = ['name', 'device__ip_address',
'device__port_address', 'device__status']
Juan C. Espinoza
sync repo...
r157 kwargs['configurations'] = configurations
kwargs['experiment_data'] = experiment_data
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 kwargs['title'] = 'Verify Experiment'
kwargs['suptitle'] = 'Parameters'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 kwargs['button'] = 'Update'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 jars_conf = False
Juan C. Espinoza
Update Views y several improvements
r316 rc_conf = False
dds_conf = False
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 for configuration in configurations:
#-------------------- JARS -----------------------:
if configuration.device.device_type.name == 'jars':
jars_conf = True
Fiorella Quino
Task #566: Verify Parameters...
r229 jars = configuration
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['jars_conf'] = jars_conf
filter_parms = json.loads(jars.filter_parms)
Juan C. Espinoza
sync repo...
r157 kwargs['filter_parms'] = filter_parms
#--Sampling Frequency
Juan C. Espinoza
Update Views y several improvements
r316 clock = filter_parms['clock']
filter_2 = filter_parms['cic_2']
filter_5 = filter_parms['cic_5']
filter_fir = filter_parms['fir']
Juan C. Espinoza
sync repo...
r157 samp_freq_jars = clock/filter_2/filter_5/filter_fir
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 kwargs['samp_freq_jars'] = samp_freq_jars
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['jars'] = configuration
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 #--------------------- RC ----------------------:
Juan C. Espinoza
Fix experiment views (summary & verify)...
r239 if configuration.device.device_type.name == 'rc' and not configuration.mix:
Juan C. Espinoza
sync repo...
r157 rc_conf = True
Fiorella Quino
Task #566: Verify Parameters...
r229 rc = configuration
Fiorella Quino
main views updated...
r241
Juan C. Espinoza
sync repo...
r157 rc_parms = configuration.parms_to_dict()
Fiorella Quino
main views updated...
r241
Juan C. Espinoza
Fix experiment views (summary & verify)...
r239 win_lines = rc.get_lines(line_type__name='windows')
if win_lines:
dh = json.loads(win_lines[0].params)['params'][0]['resolution']
Juan C. Espinoza
sync repo...
r157 #--Sampling Frequency
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 samp_freq_rc = 0.15/dh
Juan C. Espinoza
sync repo...
r157 kwargs['samp_freq_rc'] = samp_freq_rc
Fiorella Quino
main views updated...
r241
Juan C. Espinoza
Fix experiment views (summary & verify)...
r239 kwargs['rc_conf'] = rc_conf
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['rc'] = configuration
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 #-------------------- DDS ----------------------:
if configuration.device.device_type.name == 'dds':
dds_conf = True
Fiorella Quino
Task #566: Verify Parameters...
r229 dds = configuration
Juan C. Espinoza
sync repo...
r157 dds_parms = configuration.parms_to_dict()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 kwargs['dds_conf'] = dds_conf
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['dds'] = configuration
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 #------------Validation------------:
#Clock
if dds_conf and rc_conf and jars_conf:
Fiorella Quino
Main files have been updated...
r266 if float(filter_parms['clock']) != float(rc_parms['configurations']['byId'][str(rc.pk)]['clock_in']) and float(rc_parms['configurations']['byId'][str(rc.pk)]['clock_in']) != float(dds_parms['configurations']['byId'][str(dds.pk)]['clock']):
Juan C. Espinoza
sync repo...
r157 messages.warning(request, "Devices don't have the same clock.")
elif rc_conf and jars_conf:
Fiorella Quino
Main files have been updated...
r266 if float(filter_parms['clock']) != float(rc_parms['configurations']['byId'][str(rc.pk)]['clock_in']):
Juan C. Espinoza
sync repo...
r157 messages.warning(request, "Devices don't have the same clock.")
elif rc_conf and dds_conf:
Fiorella Quino
Main files have been updated...
r266 if float(rc_parms['configurations']['byId'][str(rc.pk)]['clock_in']) != float(dds_parms['configurations']['byId'][str(dds.pk)]['clock']):
Juan C. Espinoza
sync repo...
r157 messages.warning(request, "Devices don't have the same clock.")
Fiorella Quino
Main files have been updated...
r266 if float(samp_freq_rc) != float(dds_parms['configurations']['byId'][str(dds.pk)]['frequencyA']):
Juan C. Espinoza
Update Views y several improvements
r316 messages.warning(
request, "Devices don't have the same Frequency A.")
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Task #566: Verify Parameters...
r229 #------------POST METHOD------------:
if request.method == 'POST':
if request.POST['suggest_clock']:
try:
suggest_clock = float(request.POST['suggest_clock'])
except:
messages.warning(request, "Invalid value in CLOCK IN.")
return redirect('url_verify_experiment', id_exp=experiment.id)
else:
suggest_clock = ""
if suggest_clock:
if rc_conf:
rc.clock_in = suggest_clock
rc.save()
if jars_conf:
Juan C. Espinoza
Update Views y several improvements
r316 filter_parms = jars.filter_parms
filter_parms = ast.literal_eval(filter_parms)
Fiorella Quino
Task #566: Verify Parameters...
r229 filter_parms['clock'] = suggest_clock
jars.filter_parms = json.dumps(filter_parms)
jars.save()
kwargs['filter_parms'] = filter_parms
if dds_conf:
dds.clock = suggest_clock
dds.save()
if request.POST['suggest_frequencyA']:
try:
suggest_frequencyA = float(request.POST['suggest_frequencyA'])
except:
messages.warning(request, "Invalid value in FREQUENCY A.")
return redirect('url_verify_experiment', id_exp=experiment.id)
else:
suggest_frequencyA = ""
if suggest_frequencyA:
if jars_conf:
Juan C. Espinoza
Update Views y several improvements
r316 filter_parms = jars.filter_parms
filter_parms = ast.literal_eval(filter_parms)
Fiorella Quino
Task #566: Verify Parameters...
r229 filter_parms['fch'] = suggest_frequencyA
jars.filter_parms = json.dumps(filter_parms)
jars.save()
kwargs['filter_parms'] = filter_parms
if dds_conf:
dds.frequencyA_Mhz = request.POST['suggest_frequencyA']
dds.save()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
sync repo...
r157 kwargs.update(sidebar(experiment=experiment))
return render(request, 'experiment_verify.html', kwargs)
Fiorella Quino
Task #559: Vista de Summary (main: urls, views, experiment.html, experiment_summary.html)...
r151
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 def parse_mix_result(s):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 values = s.split('-')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 html = 'EXP MOD OPE DELAY MASK\r\n'
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 if not values or values[0] in ('', ' '):
return mark_safe(html)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 for i, value in enumerate(values):
if not value:
continue
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 pk, mode, operation, delay, mask = value.split('|')
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 conf = RCConfiguration.objects.get(pk=pk)
Juan C. Espinoza
Update Views y several improvements
r316 if i == 0:
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 html += '{:20.18}{:3}{:4}{:9}km{:>6}\r\n'.format(
Juan C. Espinoza
Update Views y several improvements
r316 conf.name,
mode,
' ',
delay,
mask)
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 else:
Juan C. Espinoza
Fix mix RC configurations for different ipp's...
r112 html += '{:20.18}{:3}{:4}{:9}km{:>6}\r\n'.format(
Juan C. Espinoza
Update Views y several improvements
r316 conf.name,
mode,
operation,
delay,
mask)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 return mark_safe(html)
Juan C. Espinoza
Update Views y several improvements
r316
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 def parse_mask(l):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 values = []
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 for x in range(16):
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 if '{}'.format(x) in l:
values.append(1)
else:
values.append(0)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 values.reverse()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 return int(''.join([str(x) for x in values]), 2)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106
Miguel Urco
Campaign has been added to RadarSys Model...
r13 def dev_confs(request):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 page = request.GET.get('page')
Juan C. Espinoza
Update Views y several improvements
r316 order = ('programmed_date', )
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 filters = request.GET.copy()
Juan C. Espinoza
Update Views y several improvements
r316 if 'my configurations' in filters:
filters.pop('my configurations', None)
filters['mine'] = request.user.id
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 kwargs = get_paginator(Configuration, page, order, filters)
Juan C. Espinoza
Update Views y several improvements
r316 fields = ['tags', 'template', 'historical']
if request.user.is_authenticated:
fields.append('my configurations')
form = FilterForm(initial=request.GET, extra_fields=fields)
kwargs['keys'] = ['name', 'experiment',
'type', 'programmed_date', 'actions']
Miguel Urco
sidebar_devices updated...
r14 kwargs['title'] = 'Configuration'
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['suptitle'] = 'List'
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 kwargs['no_sidebar'] = True
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 kwargs['form'] = form
Juan C. Espinoza
Update Views y several improvements
r316 kwargs['add_url'] = reverse('url_add_dev_conf', args=[0])
filters = request.GET.copy()
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 filters.pop('page', None)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 kwargs['q'] = urlencode(filters)
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 return render(request, 'base_list.html', kwargs)
Miguel Urco
Campaign has been added to RadarSys Model...
r13
Juan C. Espinoza
Update views and templates of main app...
r89
Miguel Urco
Campaign has been added to RadarSys Model...
r13 def dev_conf(request, id_conf):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 conf = get_object_or_404(Configuration, pk=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 return redirect(conf.get_absolute_url())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Juan C. Espinoza
- Update rc app...
r79 def dev_conf_new(request, id_exp=0, id_dev=0):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if not is_developer(request.user):
messages.error(
request, 'Developer required, to create new configurations')
return redirect('index')
Juan C. Espinoza
- Update rc app...
r79 initial = {}
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 kwargs = {}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if id_exp != 0:
Juan C. Espinoza
- Update rc app...
r79 initial['experiment'] = id_exp
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if id_dev != 0:
Juan C. Espinoza
- Update rc app...
r79 initial['device'] = id_dev
Miguel Urco
Campaign has been added to RadarSys Model...
r13
if request.method == 'GET':
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 if id_dev:
kwargs['button'] = 'Create'
Juan C. Espinoza
- Update rc app...
r79 device = Device.objects.get(pk=id_dev)
DevConfForm = CONF_FORMS[device.device_type.name]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 initial['name'] = request.GET['name']
form = DevConfForm(initial=initial)
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 else:
if 'template' in request.GET:
Juan C. Espinoza
Update Views y several improvements
r316 if request.GET['template'] == '0':
choices = [(conf.pk, '{}'.format(conf))
for conf in Configuration.objects.filter(template=True)]
form = NewForm(initial={'create_from': 2},
Juan C. Espinoza
- Improve display name for Devices & Configurations...
r121 template_choices=choices)
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 else:
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 kwargs['button'] = 'Create'
Juan C. Espinoza
Update Views y several improvements
r316 conf = Configuration.objects.get(
pk=request.GET['template'])
Juan C. Espinoza
- Fix input form for delays in RCLine...
r119 id_dev = conf.device.pk
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 DevConfForm = CONF_FORMS[conf.device.device_type.name]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 form = DevConfForm(instance=conf,
Fiorella Quino
Main files have been updated...
r266 initial={'name': '{}_{:%y%m%d}'.format(conf.name, datetime.now()),
Juan C. Espinoza
- Add sequence mode in mix configurations....
r116 'template': False,
Juan C. Espinoza
Update Views y several improvements
r316 'experiment': id_exp})
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 elif 'blank' in request.GET:
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 kwargs['button'] = 'Create'
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 form = ConfigurationForm(initial=initial)
else:
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 form = NewForm()
Juan C. Espinoza
Updating base models and views ...
r6 if request.method == 'POST':
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 device = Device.objects.get(pk=request.POST['device'])
Miguel Urco
template attribute added to RadarSys Models...
r47 DevConfForm = CONF_FORMS[device.device_type.name]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
- Update rc app...
r79 form = DevConfForm(request.POST)
Fiorella Quino
Task #99: Modulo web del JARS + kwargs['button'] (main)...
r122 kwargs['button'] = 'Create'
Juan C. Espinoza
Updating base models and views ...
r6 if form.is_valid():
Juan C. Espinoza
Update Views y several improvements
r316 conf = form.save(commit=False)
conf.author = request.user
conf.save()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if 'template' in request.GET and conf.device.device_type.name == 'rc':
lines = RCLine.objects.filter(
rc_configuration=request.GET['template'])
Juan C. Espinoza
Update main app (view to mix RC configurations)...
r106 for line in lines:
line.clone(rc_configuration=conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Main files have been updated...
r266 new_lines = conf.get_lines()
for line in new_lines:
line_params = json.loads(line.params)
if 'TX_ref' in line_params:
ref_line = RCLine.objects.get(pk=line_params['TX_ref'])
Juan C. Espinoza
Update Views y several improvements
r316 line_params['TX_ref'] = ['{}'.format(
l.pk) for l in new_lines if l.get_name() == ref_line.get_name()][0]
Fiorella Quino
Main files have been updated...
r266 line.params = json.dumps(line_params)
line.save()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 return redirect('url_dev_conf', id_conf=conf.pk)
Juan C. Espinoza
- Update rc app...
r79 kwargs['id_exp'] = id_exp
Juan C. Espinoza
Updating base models and views ...
r6 kwargs['form'] = form
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs['title'] = 'Configuration'
Juan C. Espinoza
Updating base models and views ...
r6 kwargs['suptitle'] = 'New'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
DDS new conf: default values (dev_conf_edit.html) (views.py)...
r99 if id_dev != 0:
device = Device.objects.get(pk=id_dev)
Juan C. Espinoza
- Fix input form for delays in RCLine...
r119 kwargs['device'] = device.device_type.name
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 return render(request, 'dev_conf_edit.html', kwargs)
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
views name were changed ...
r19 def dev_conf_edit(request, id_conf):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 conf = get_object_or_404(Configuration, pk=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 DevConfForm = CONF_FORMS[conf.device.device_type.name]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'GET':
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 form = DevConfForm(instance=conf)
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 form = DevConfForm(request.POST, instance=conf)
Miguel Urco
Campaign has been added to RadarSys Model...
r13 if form.is_valid():
form.save()
return redirect('url_dev_conf', id_conf=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Campaign has been added to RadarSys Model...
r13 kwargs = {}
kwargs['form'] = form
kwargs['title'] = 'Device Configuration'
kwargs['suptitle'] = 'Edit'
kwargs['button'] = 'Update'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30 ###### SIDEBAR ######
Juan C. Espinoza
Update several views and models in main app...
r85 kwargs.update(sidebar(conf=conf))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update new and edit "views"...
r91 return render(request, '%s_conf_edit.html' % conf.device.device_type.name, kwargs)
Miguel Urco
Campaign has been added to RadarSys Model...
r13
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
Models changed:...
r53 def dev_conf_start(request, id_conf):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 conf = get_object_or_404(Configuration, pk=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if conf.start_device():
messages.success(request, conf.message)
else:
messages.error(request, conf.message)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC model, RC api for testing...
r185 #conf.status_device()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 return redirect(conf.get_absolute_url())
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
Models changed:...
r53 def dev_conf_stop(request, id_conf):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30 conf = get_object_or_404(Configuration, pk=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if conf.stop_device():
messages.success(request, conf.message)
else:
messages.error(request, conf.message)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC model, RC api for testing...
r185 #conf.status_device()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 return redirect(conf.get_absolute_url())
Juan C. Espinoza
Update views and templates of main app...
r89
Miguel Urco
Models changed:...
r53 def dev_conf_status(request, id_conf):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 conf = get_object_or_404(Configuration, pk=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if conf.status_device():
messages.success(request, conf.message)
else:
messages.error(request, conf.message)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 return redirect(conf.get_absolute_url())
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Fiorella Quino
Main files have been updated...
r266 def dev_conf_reset(request, id_conf):
conf = get_object_or_404(Configuration, pk=id_conf)
if conf.reset_device():
messages.success(request, conf.message)
else:
messages.error(request, conf.message)
return redirect(conf.get_absolute_url())
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30 def dev_conf_write(request, id_conf):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30 conf = get_object_or_404(Configuration, pk=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update RC model, RC api for testing...
r185 if conf.write_device():
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211 messages.success(request, conf.message)
Juan C. Espinoza
Update Views y several improvements
r316 if has_been_modified(conf):
conf.clone(type=1, template=False)
Miguel Urco
Models changed:...
r53 else:
messages.error(request, conf.message)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve operation & search views
r306 return redirect(get_object_or_404(Configuration, pk=id_conf).get_absolute_url())
Miguel Urco
Models changed:...
r53
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
Models changed:...
r53 def dev_conf_read(request, id_conf):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 conf = get_object_or_404(Configuration, pk=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 DevConfForm = CONF_FORMS[conf.device.device_type.name]
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'GET':
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 parms = conf.read_device()
Juan C. Espinoza
Update RC model, RC api for testing...
r185 #conf.status_device()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if not parms:
messages.error(request, conf.message)
return redirect(conf.get_absolute_url())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 form = DevConfForm(initial=parms, instance=conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Miguel Urco
Models changed:...
r53 form = DevConfForm(request.POST, instance=conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if form.is_valid():
Miguel Urco
DDS commands working...
r57 form.save()
return redirect(conf.get_absolute_url())
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 messages.error(request, "Parameters could not be saved")
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 kwargs = {}
kwargs['id_dev'] = conf.id
kwargs['form'] = form
kwargs['title'] = 'Device Configuration'
kwargs['suptitle'] = 'Parameters read from device'
kwargs['button'] = 'Save'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 ###### SIDEBAR ######
Juan C. Espinoza
Update several views and models in main app...
r85 kwargs.update(sidebar(conf=conf))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 return render(request, '%s_conf_edit.html' % conf.device.device_type.name, kwargs)
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30 def dev_conf_import(request, id_conf):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30 conf = get_object_or_404(Configuration, pk=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 DevConfForm = CONF_FORMS[conf.device.device_type.name]
Miguel Urco
Models changed:...
r53 if request.method == 'GET':
file_form = UploadFileForm()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if request.method == 'POST':
file_form = UploadFileForm(request.POST, request.FILES)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if file_form.is_valid():
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Main files have been updated...
r266 data = conf.import_from_file(request.FILES['file'])
Juan C. Espinoza
Update Views y several improvements
r316 parms = Params(data=data).get_conf(
dtype=conf.device.device_type.name)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if parms:
Fiorella Quino
Main files have been updated...
r266
Miguel Urco
Models changed:...
r53 form = DevConfForm(initial=parms, instance=conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 kwargs = {}
kwargs['id_dev'] = conf.id
kwargs['form'] = form
kwargs['title'] = 'Device Configuration'
kwargs['suptitle'] = 'Parameters imported'
kwargs['button'] = 'Save'
kwargs['action'] = conf.get_absolute_url_edit()
kwargs['previous'] = conf.get_absolute_url()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 ###### SIDEBAR ######
Juan C. Espinoza
Update several views and models in main app...
r85 kwargs.update(sidebar(conf=conf))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 messages.success(
request, "Parameters imported from: '%s'." % request.FILES['file'].name)
Fiorella Quino
Main files have been updated...
r266
Juan C. Espinoza
- Update rc app...
r79 return render(request, '%s_conf_edit.html' % conf.device.device_type.name, kwargs)
Miguel Urco
Models changed:...
r53
messages.error(request, "Could not import parameters from file")
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 kwargs = {}
kwargs['id_dev'] = conf.id
kwargs['title'] = 'Device Configuration'
kwargs['form'] = file_form
kwargs['suptitle'] = 'Importing file'
kwargs['button'] = 'Import'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 kwargs.update(sidebar(conf=conf))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 return render(request, 'dev_conf_import.html', kwargs)
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30 def dev_conf_export(request, id_conf):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30 conf = get_object_or_404(Configuration, pk=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if request.method == 'GET':
Miguel Urco
DDS commands working...
r57 file_form = DownloadFileForm(conf.device.device_type.name)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if request.method == 'POST':
Juan C. Espinoza
Update Views y several improvements
r316 file_form = DownloadFileForm(
conf.device.device_type.name, request.POST)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 if file_form.is_valid():
Juan C. Espinoza
Update Views y several improvements
r316 fields = conf.export_to_file(
format=file_form.cleaned_data['format'])
Fiorella Quino
Task #1068: Export racp and jars files function has been implemented...
r276 if not fields['content']:
messages.error(request, conf.message)
return redirect(conf.get_absolute_url_export())
Miguel Urco
Models changed:...
r53 response = HttpResponse(content_type=fields['content_type'])
Juan C. Espinoza
Update Views y several improvements
r316 response['Content-Disposition'] = 'attachment; filename="%s"' % fields['filename']
Miguel Urco
Models changed:...
r53 response.write(fields['content'])
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 return response
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 messages.error(request, "Could not export parameters")
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 kwargs = {}
kwargs['id_dev'] = conf.id
kwargs['title'] = 'Device Configuration'
kwargs['form'] = file_form
kwargs['suptitle'] = 'Exporting file'
kwargs['button'] = 'Export'
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Models changed:...
r53 return render(request, 'dev_conf_export.html', kwargs)
Miguel Urco
Buttons "Import", "Export, "Read" and "Write" added to Configuration View...
r30
Juan C. Espinoza
Update views and templates of main app...
r89
Juan C. Espinoza
Update Views y several improvements
r316 @login_required
Miguel Urco
views name were changed ...
r19 def dev_conf_delete(request, id_conf):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Miguel Urco
Views: Display "Page not found (404)" in case there is no object with the given pk....
r20 conf = get_object_or_404(Configuration, pk=id_conf)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 if request.method == 'POST':
Miguel Urco
delete interface added to views...
r18 if request.user.is_staff:
conf.delete()
Juan C. Espinoza
Update new and edit "views"...
r91 return redirect('url_dev_confs')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update new and edit "views"...
r91 messages.error(request, 'Not enough permission to delete this object')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 return redirect(conf.get_absolute_url())
Juan C. Espinoza
Update new and edit "views"...
r91 kwargs = {
Juan C. Espinoza
Update Views y several improvements
r316 'title': 'Delete',
'suptitle': 'Configuration',
'object': conf,
'delete': True
}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update new and edit "views"...
r91 return render(request, 'confirm.html', kwargs)
Juan C. Espinoza
Updates to models, views & forms for CR...
r25
Juan C. Espinoza
Update several views and models in main app...
r85
def sidebar(**kwargs):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 side_data = {}
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 conf = kwargs.get('conf', None)
experiment = kwargs.get('experiment', None)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 if not experiment:
experiment = conf.experiment
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 if experiment:
side_data['experiment'] = experiment
campaign = experiment.campaign_set.all()
if campaign:
side_data['campaign'] = campaign[0]
Juan C. Espinoza
Update Views y several improvements
r316 experiments = campaign[0].experiments.all().order_by('name')
Juan C. Espinoza
Update several views and models in main app...
r85 else:
experiments = [experiment]
configurations = experiment.configuration_set.filter(type=0)
side_data['side_experiments'] = experiments
Juan C. Espinoza
Update Views y several improvements
r316 side_data['side_configurations'] = configurations.order_by(
'device__device_type__name')
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update several views and models in main app...
r85 return side_data
Juan C. Espinoza
Update base template: main menu...
r46
Juan C. Espinoza
Update Views y several improvements
r316
def get_paginator(model, page, order, filters={}, n=8):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 kwargs = {}
query = Q()
if isinstance(filters, QueryDict):
filters = filters.dict()
[filters.pop(key) for key in filters.keys() if filters[key] in ('', ' ')]
filters.pop('page', None)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve operation & search views
r306 fields = [f.name for f in model._meta.get_fields()]
Juan C. Espinoza
Fix dev_confs view...
r186 if 'template' in filters:
filters['template'] = True
Juan C. Espinoza
Improve operation & search views
r306 if 'historical' in filters:
filters.pop('historical')
filters['type'] = 1
elif 'type' in fields:
filters['type'] = 0
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 if 'start_date' in filters:
filters['start_date__gte'] = filters.pop('start_date')
if 'end_date' in filters:
filters['start_date__lte'] = filters.pop('end_date')
if 'tags' in filters:
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 tags = filters.pop('tags')
Juan C. Espinoza
Fix dev_confs view...
r186 if 'tags' in fields:
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 query = query | Q(tags__icontains=tags)
Juan C. Espinoza
Update Views y several improvements
r316 if 'label' in fields:
query = query | Q(label__icontains=tags)
Juan C. Espinoza
Fix dev_confs view...
r186 if 'location' in fields:
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 query = query | Q(location__name__icontains=tags)
Juan C. Espinoza
Fix dev_confs view...
r186 if 'device' in fields:
query = query | Q(device__device_type__name__icontains=tags)
Juan C. Espinoza
Update Views y several improvements
r316 query = query | Q(device__location__name__icontains=tags)
if 'device_type' in fields:
query = query | Q(device_type__name__icontains=tags)
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138
Juan C. Espinoza
Update Views y several improvements
r316 if 'mine' in filters:
filters['author_id'] = filters['mine']
filters.pop('mine')
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 object_list = model.objects.filter(query, **filters).order_by(*order)
paginator = Paginator(object_list, n)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 try:
objects = paginator.page(page)
except PageNotAnInteger:
objects = paginator.page(1)
except EmptyPage:
objects = paginator.page(paginator.num_pages)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 kwargs['objects'] = objects
kwargs['offset'] = (int(page)-1)*n if page else 0
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Improve Search view (filters and paginator added), add base_list template, delete unused templates...
r138 return kwargs
Juan C. Espinoza
Update base template: main menu...
r46
Juan C. Espinoza
Update Views y several improvements
r316
Fiorella Quino
Task #487: Vista de Operacion...
r50 def operation(request, id_camp=None):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
kwargs = {}
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 kwargs['title'] = 'Radars Operation'
Juan C. Espinoza
Improve RC pulses plot and Operation view...
r175 kwargs['no_sidebar'] = True
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 campaigns = Campaign.objects.filter(start_date__lte=datetime.now(),
end_date__gte=datetime.now()).order_by('-start_date')
Juan C. Espinoza
Fix prints for python 3...
r174
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 if id_camp:
Juan C. Espinoza
Update Views y several improvements
r316 campaign = get_object_or_404(Campaign, pk=id_camp)
form = OperationForm(
initial={'campaign': campaign.id}, campaigns=campaigns)
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 kwargs['campaign'] = campaign
else:
Juan C. Espinoza
Improve operation & search views
r306 # form = OperationForm(campaigns=campaigns)
kwargs['campaigns'] = campaigns
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172 return render(request, 'operation.html', kwargs)
Fiorella Quino
Task #487: Operation View. Se puede seleccionar una de las 5 ultimas Campañas o se puede buscar entre todas las existentes....
r69 #---Experiment
Fiorella Quino
Task #487: Vista Operation segun nuevo modelo....
r81 keys = ['id', 'name', 'start_time', 'end_time', 'status']
Fiorella Quino
Task #487: Vista de Operacion...
r50 kwargs['experiment_keys'] = keys[1:]
kwargs['experiments'] = experiments
#---Radar
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211 kwargs['locations'] = campaign.get_experiments_by_radar()
kwargs['form'] = form
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Task #487: Operation View. Se puede seleccionar una de las 5 ultimas Campañas o se puede buscar entre todas las existentes....
r69 return render(request, 'operation.html', kwargs)
Juan C. Espinoza
Update views and templates of main app...
r89
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211 @login_required
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 def radar_start(request, id_camp, id_radar):
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Juan C. Espinoza
Update Views y several improvements
r316 campaign = get_object_or_404(Campaign, pk=id_camp)
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 experiments = campaign.get_experiments_by_radar(id_radar)[0]['experiments']
Juan C. Espinoza
Improve operation & search views
r306 now = datetime.now()
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 for exp in experiments:
Juan C. Espinoza
Improve operation & search views
r306 start = datetime.combine(datetime.now().date(), exp.start_time)
Fix mix experiment and scheduler
r311 end = datetime.combine(datetime.now().date(), exp.end_time)
Juan C. Espinoza
Improve operation & search views
r306 if end < start:
end += timedelta(1)
Juan C. Espinoza
Update Views y several improvements
r316
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 if exp.status == 2:
Juan C. Espinoza
Update Views y several improvements
r316 messages.warning(
request, 'Experiment {} already running'.format(exp))
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 continue
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 if exp.status == 3:
Juan C. Espinoza
Update Views y several improvements
r316 messages.warning(
request, 'Experiment {} already programmed'.format(exp))
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 continue
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Juan C. Espinoza
Improve operation & search views
r306 if start > campaign.end_date or start < campaign.start_date:
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 messages.warning(request, 'Experiment {} out of date'.format(exp))
continue
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Juan C. Espinoza
Improve operation & search views
r306 if now > start and now <= end:
Fix mix experiment and scheduler
r311 exp.status = 3
exp.save()
task = task_start.delay(exp.id)
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 exp.status = task.wait()
Juan C. Espinoza
Update Views y several improvements
r316 if exp.status == 0:
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 messages.error(request, 'Experiment {} not start'.format(exp))
Juan C. Espinoza
Update Views y several improvements
r316 if exp.status == 2:
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 messages.success(request, 'Experiment {} started'.format(exp))
else:
Juan C. Espinoza
Update Views y several improvements
r316 task = task_start.apply_async(
(exp.pk, ), eta=start+timedelta(hours=5))
Fix mix experiment and scheduler
r311 exp.task = task.id
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 exp.status = 3
Juan C. Espinoza
Update Views y several improvements
r316 messages.success(
request, 'Experiment {} programmed to start at {}'.format(exp, start))
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 exp.save()
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 return HttpResponseRedirect(reverse('url_operation', args=[id_camp]))
Fiorella Quino
Task #487: Operation. Views: radar_play y radar_stop. Models: RunningExperiment. Attributes: status. Methods: get_status(), status_color()...
r84
Fiorella Quino
Task 487: Operation View gets status from database and radar_refresh button updates status...
r88
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211 @login_required
Fiorella Quino
Task #487: Operation. Views: radar_play y radar_stop. Models: RunningExperiment. Attributes: status. Methods: get_status(), status_color()...
r84 def radar_stop(request, id_camp, id_radar):
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211
Juan C. Espinoza
Update Views y several improvements
r316 campaign = get_object_or_404(Campaign, pk=id_camp)
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211 experiments = campaign.get_experiments_by_radar(id_radar)[0]['experiments']
for exp in experiments:
Fix mix experiment and scheduler
r311 if exp.task:
app.control.revoke(exp.task)
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 if exp.status == 2:
Fix mix experiment and scheduler
r311 exp.stop()
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211 messages.warning(request, 'Experiment {} stopped'.format(exp))
Fix mix experiment and scheduler
r311 exp.status = 1
exp.save()
Juan C. Espinoza
Update several views and models in main app...
r85
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 return HttpResponseRedirect(reverse('url_operation', args=[id_camp]))
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Fiorella Quino
Task 487: Operation View gets status from database and radar_refresh button updates status...
r88
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211 @login_required
Fiorella Quino
Task 487: Operation View gets status from database and radar_refresh button updates status...
r88 def radar_refresh(request, id_camp, id_radar):
Juan C. Espinoza
Update code for django 1.10, python 3 and latest third party packages, review operation view ...
r172
Juan C. Espinoza
Update Views y several improvements
r316 campaign = get_object_or_404(Campaign, pk=id_camp)
Fiorella Quino
Task #784: Nivel de Permisos de Usuario...
r211 experiments = campaign.get_experiments_by_radar(id_radar)[0]['experiments']
for exp in experiments:
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 exp.get_status()
Fiorella Quino
Task 487: Operation View gets status from database and radar_refresh button updates status...
r88
Juan C. Espinoza
Add scheduler for campaigns/experiments using celery #718, fix views and models bugs...
r196 return HttpResponseRedirect(reverse('url_operation', args=[id_camp]))
Fiorella Quino
media root...
r282
def real_time(request):
graphic_path = "/home/fiorella/Pictures/catwbeanie.jpg"
kwargs = {}
kwargs['title'] = 'CLAIRE'
kwargs['suptitle'] = 'Real Time'
kwargs['no_sidebar'] = True
kwargs['graphic_path'] = graphic_path
kwargs['graphic1_path'] = 'http://www.bluemaize.net/im/girls-accessories/shark-beanie-11.jpg'
Fix mix experiment and scheduler
r311 return render(request, 'real_time.html', kwargs)