Commit b811b242 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

+ change histogram window

parent f011ed42
__author__ = "Elphel"
__copyright__ = "Copyright 2016, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Oleg K Dzhimiev"
__email__ = "oleg@elphel.com"
__status__ = "Development"
import os
import subprocess
class Download:
def __init__(self,partition,skip=0,n=0):
self.partition = partition
self.dl_ssd_switch_timeout = 20 #seconds
self.dl_blocksize = 20 #Megabytes
self.dl_blockcount = 500
self.dl_skip = skip
self.dl_chunks = n
def shout(self,cmd):
#subprocess.call prints to console
#subprocess.call(cmd,shell=True)
ret_str = ""
try:
ret_str = subprocess.check_output(cmd,shell=True)
except subprocess.CalledProcessError as e:
ret_str = str(e.returncode)
self.disable = True
return ret_str
def get_dir_name(self):
print(self.partition[-4:])
pattern = "ata-"
cmd = "ls /dev/disk/by-id/ -all | grep '"+pattern+"' | grep '"+self.partition[-4:]+"'"
res = self.shout(cmd)
for name in res.split(" "):
if name[0:len(pattern)]==pattern:
return name[len(pattern):]
return ""
def run(self):
dirname = self.get_dir_name()
print(dirname)
if not os.path.isdir(dirname):
os.mkdir(dirname)
\ No newline at end of file
......@@ -21,13 +21,13 @@ usage = """Help:
if len(sys.argv)>1:
print("Downloading footage from Eyesis4Pi internal SSDs to "+sys.argv[1])
if not os.path.isdir(""):
else:
print usage
sys.exit()
C1 = x393_downloader.x393_downloader(ip="192.168.0.163")
C1 = x393_downloader.x393_downloader(ip="192.168.0.161")
#C1.get_serialno("local")
C1.download()
......
#!/usr/bin/env python
# Download Eyesis4Pi footage from:
# * standalone SSDs connected using a docking station or enclosure or else, raw partition, camera can be powered off
# ** All information is in the Exif headers, so no need to match SSDs to subcameras
# * camera's internal SSD, raw partition, camera is powered on.
#
__author__ = "Elphel"
__copyright__ = "Copyright 2016, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Oleg K Dzhimiev"
__email__ = "oleg@elphel.com"
__status__ = "Development"
import argparse
import os
import sys
import time
import x393
# TODO: Download imu logs
ssd_detect_timeout = 20
cams = [
{"user":"root","ip":"192.168.0.38","imu_log":0},
]
dirs = []
#http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[38;5;214m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
BOLDWHITE = '\033[1;37m'
UNDERLINE = '\033[4m'
usage = """
help:
1. To locate a newly connected SSD device, run:
$ dmesg
[] scsi 0:0:0:0: Direct-Access ATA Crucial_CT250MX2 MU02 PQ: 0 ANSI: 5
[] ata1.00: Enabling discard_zeroes_data
[] sd 0:0:0:0: Attached scsi generic sg0 type 0
[] sd 0:0:0:0: [sdb] 488397168 512-byte logical blocks: (250 GB/232 GiB)
[] sd 0:0:0:0: [sdb] 4096-byte physical blocks
[] sd 0:0:0:0: [sdb] Write Protect is off
[] sd 0:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[] sd 0:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[] ata1.00: Enabling discard_zeroes_data
[] sdb: sdb1 sdb2
[] ata1.00: Enabling discard_zeroes_data
[] sd 0:0:0:0: [sda] Attached SCSI disk
2. To locate a raw partition on the disk, run:
$ sudo blkid
/dev/sdb1: UUID="ffffffff-ffff-ffff-ffff-ffffffffffff" TYPE="ext4" PARTUUID="ffffffff-ffff-ffff-ffff-ffffffffffff"
/dev/sdb2: PARTUUID="ffffffff-ffff-ffff-ffff-ffffffffffff"
* raw partition will have PARTUUID only
examples:\n
I.
* SSD is connected to PC using a docking station/enclosure/etc.
* The data is on the raw partition /dev/sdb2
* Destination path: /data/footage/test
Download:
* Whole partition in 10GB chunks:
{1}${0} -p /dev/sdb2 /data/footage/test{2}
* Whole partition in 1GB chunks:
{1}${0} -p /dev/sdb2 -bc 50 /data/footage/test{2}
* 5GB in 1GB chunks, skip the first 3GBs:
{1}${0} -p /dev/sdb2 -bc 50 -s 3 -n 5 /data/footage/test{2}
Note: Repeat for any other SSDs of the multi-camera system
II.
* internal SSD, camera is powered on
* The data is on the raw partition /dev/sdb2
* Destination path: /data/footage/test
Download:
* Whole partition in 10GB chunks:
{1}${0} --internalSSD -c root@192.168.0.9 -p /dev/sdb2 /data/footage/test{2}
* Whole partition in 1GB chunks:
{1}${0} --internalSSD -c root@192.168.0.9 -p /dev/sdb2 -bc 50 /data/footage/test{2}
* 5GB in 1GB chunks, skip the first 3GBs:
{1}${0} --internalSSD -c root@192.168.0.9 -p /dev/sdb2 -bc 50 -s 3 -n 5 /data/footage/test{2}
""".format(sys.argv[0],bcolors.OKGREEN,bcolors.ENDC)
parser = argparse.ArgumentParser(description=usage,formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("-c","--camera", default="root@192.168.0.9", help="provide camera ip address if downloading data from internal SSD, default = root@192.168.0.9")
parser.add_argument("-p","--partition",help="partition name, example: /dev/sdb2")
parser.add_argument("-s","--skip",type=int,default=0, help="Number of chunks to skip from the beginning")
parser.add_argument("-n","--n",type=int,default=0,help="Number of chunks to download")
parser.add_argument("-bs",type=int,default=20,help="block size in MB, default = 20")
parser.add_argument("-bc",type=int,default=512,help="Number of blocks of size [bs] in a single chunk, default = 512, so the default chunk size is 10GB")
parser.add_argument("dest",help="desitnation directory: /data/footage/test")
args = parser.parse_args()
# init checks all connections
for cam in cams:
cam['obj'] = x393.Camera(cam['user'],cam['ip'])
pc = x393.PC()
# get raw partitions
for cam in cams:
d = cam['obj'].first_found_raw_partition_name()
if d!="undefined":
dirs.append(d)
else:
raise Exception(cam['user']+"@"+cam['ip']+" : error: already switched or raw partition not found")
print(cam['user']+"@"+cam['ip']+": raw partition name: "+d)
# switch ssd to pc for all (not caring which cable is in)
for cam in cams:
cam['obj'].ssd_to_pc()
# download
plist = []
all_downloaded = False
for i in range(len(cams)):
raw_input(bcolors.OKGREEN+"Connect camera(eSATA) to PC. Press Enter to continue..."+bcolors.ENDC)
t = 0
while not all_downloaded:
plist = pc.list_partitions()
for d in dirs:
for p in plist:
if d==p[0]:
pc.download(args.dest,"/dev/"+p[1],d,args.bs,args.bc,args.skip,args.n)
dirs.delete(d)
if len(dirs)!=0:
print("wait for the next ssd")
else:
all_downloaded = True
break
print("Waiting for disks to show up:")
print(dirs)
t = t + 1
time.sleep(1)
if t>ssd_detect_timeout:
print(bcolors.FAIL+"PC: Error: Disks were not found:")
print(dirs)
print(bcolors.ENDC)
break
#cam['rp_name'].ssd_to_pc()
# ssd to camera for all
for cam in cams:
cam['obj'].ssd_to_camera()
x393.Download(args.dest,args.partition,args.bs,args.bc,args.skip,args.n)
#!/usr/bin/env python
# Download footage from ssd's raw partition:
# * standalone SSDs connected using a docking station or enclosure or else, raw partition, camera can be powered off
# ** All information is in the Exif headers, so no need to match SSDs to subcameras
# * camera's internal SSD, raw partition, camera is powered on.
#
__author__ = "Elphel"
__copyright__ = "Copyright 2016, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Oleg K Dzhimiev"
__email__ = "oleg@elphel.com"
__status__ = "Development"
import argparse
import os
import sys
import time
import x393
from x393 import bcolors
usage = """
help:
1. To locate a newly connected SSD device, run:
$ dmesg
[] scsi 0:0:0:0: Direct-Access ATA Crucial_CT250MX2 MU02 PQ: 0 ANSI: 5
[] ata1.00: Enabling discard_zeroes_data
[] sd 0:0:0:0: Attached scsi generic sg0 type 0
[] sd 0:0:0:0: [sdb] 488397168 512-byte logical blocks: (250 GB/232 GiB)
[] sd 0:0:0:0: [sdb] 4096-byte physical blocks
[] sd 0:0:0:0: [sdb] Write Protect is off
[] sd 0:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[] sd 0:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[] ata1.00: Enabling discard_zeroes_data
[] sdb: sdb1 sdb2
[] ata1.00: Enabling discard_zeroes_data
[] sd 0:0:0:0: [sda] Attached SCSI disk
2. To locate a raw partition on the disk, run:
$ sudo blkid
/dev/sdb1: UUID="ffffffff-ffff-ffff-ffff-ffffffffffff" TYPE="ext4" PARTUUID="ffffffff-ffff-ffff-ffff-ffffffffffff"
/dev/sdb2: PARTUUID="ffffffff-ffff-ffff-ffff-ffffffffffff"
* raw partition will have PARTUUID only
examples:\n
I.
* SSD is connected to PC using a docking station/enclosure/etc.
* The data is on the raw partition /dev/sdb2
* Destination path: /data/footage/test
Download:
* Whole partition in 10GB chunks:
{1}${0} -p /dev/sdb2 /data/footage/test{2}
* Whole partition in 1GB chunks:
{1}${0} -p /dev/sdb2 -bc 50 /data/footage/test{2}
* 5GB in 1GB chunks, skip the first 3GBs:
{1}${0} -p /dev/sdb2 -bc 50 -s 3 -n 5 /data/footage/test{2}
Note: Repeat for any other external SSDs of the multi-camera system
""".format(sys.argv[0],bcolors.OKGREEN,bcolors.ENDC)
parser = argparse.ArgumentParser(description=usage,formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("-p","--partition",default="",help="partition name, example: /dev/sdb2")
parser.add_argument("-s","--skip",type=int,default=0, help="Number of chunks to skip from the beginning")
parser.add_argument("-n","--n",type=int,default=0,help="Number of chunks to download")
parser.add_argument("-bs",type=int,default=20,help="block size in MB, default = 20")
parser.add_argument("-bc",type=int,default=512,help="Number of blocks of size [bs] in a single chunk, default = 512, so the default chunk size is 10GB")
parser.add_argument("dest",help="desitnation directory: /data/footage/test")
args = parser.parse_args()
if args.partition!="":
pc = x393.PC()
if args.n==0:
args.bc = 512*1000
args.n = 1
pc.download(args.dest,args.partition,args.bs,args.bc,args.skip,args.n)
else:
print(bcolors.WARNING+"Please specify a partition"+bcolors.ENDC)
print(usage)
#!/usr/bin/env python
# Download footage from ssd's raw partition:
# * standalone SSDs connected using a docking station or enclosure or else, raw partition, camera can be powered off
# ** All information is in the Exif headers, so no need to match SSDs to subcameras
# * camera's internal SSD, raw partition, camera is powered on.
#
__author__ = "Elphel"
__copyright__ = "Copyright 2016, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Oleg K Dzhimiev"
__email__ = "oleg@elphel.com"
__status__ = "Development"
import argparse
import os
import sys
import time
import x393
from x393 import bcolors
# TODO: Download imu logs
ssd_detect_timeout = 20
usage = """
keys:
To access camera without a password run:
$ ssh-copy-id root@192.168.0.9
To create keys, run:
$ ssh-keygen
examples:\n
I.
* internal SSD, camera is powered on
* The data is on the raw partition /dev/sdb2
* Destination path: /data/footage/test
Download:
* Whole partition in 10GB chunks:
{1}${0} -c root@192.168.0.9 -p /dev/sdb2 /data/footage/test{2}
* Whole partition in 1GB chunks:
{1}${0} -c root@192.168.0.9 -p /dev/sdb2 -bc 50 /data/footage/test{2}
* 5GB in 1GB chunks, skip the first 3GBs:
{1}${0} -c root@192.168.0.9 -p /dev/sdb2 -bc 50 -s 3 -n 5 /data/footage/test{2}
II. multiple cameras modes:
* "eyesis4pi"
* Whole partition in 10GB chunks:
{1}${0} -m eyesis4pi /data/footage/test{2}
""".format(sys.argv[0],bcolors.OKGREEN,bcolors.ENDC)
parser = argparse.ArgumentParser(description=usage,formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("-c","--camera", default="", help="provide camera ip address if downloading data from internal SSD, default = root@192.168.0.9")
parser.add_argument("-m","--mode",default="",help="preset for multiple cameras, available modes: 'eyesis4pi'")
parser.add_argument("-s","--skip",type=int,default=0, help="Number of chunks to skip from the beginning")
parser.add_argument("-n","--n",type=int,default=0,help="Number of chunks to download")
parser.add_argument("-bs",type=int,default=20,help="block size in MB, default = 20")
parser.add_argument("-bc",type=int,default=512,help="Number of blocks of size [bs] in a single chunk, default = 512, so the default chunk size is 10GB")
parser.add_argument("dest",help="desitnation directory: /data/footage/test")
args = parser.parse_args()
cams = []
dirs = []
if args.camera!="":
tmp = args.camera.split("@")
if len(tmp)==2:
cams = [{"user":tmp[0],"ip":tmp[1],"imu_log":0}]
elif args.mode=="eyesis4pi":
cams = [
{"user":"root","ip":"192.168.0.161","imu_log":0},
{"user":"root","ip":"192.168.0.162","imu_log":0},
{"user":"root","ip":"192.168.0.163","imu_log":0}
]
else:
cams = [{"user":"root","ip":"192.168.0.9","imu_log":0}]
print("running default: "+cams[0]['user']+"@"+cams[0]['ip'])
# init checks all connections
for cam in cams:
cam['obj'] = x393.Camera(cam['user'],cam['ip'])
if cam['obj'].disable:
print(bcolors.WARNING+"Will skip "+cam['user']+"@"+cam['ip']+bcolors.ENDC)
cams[:] = [tmp for tmp in cams if not tmp['obj'].disable]
if len(cams)==0:
print(usage)
pc = x393.PC()
# get raw partitions
for cam in cams:
d = cam['obj'].first_found_raw_partition_name()
if d!="undefined":
dirs.append(d)
print(cam['user']+"@"+cam['ip']+": raw partition name: "+d)
else:
cam['disable']=1
print(bcolors.FAIL+cam['user']+"@"+cam['ip']+" : error: already switched or raw partition not found"+bcolors.ENDC)
#raise Exception(cam['user']+"@"+cam['ip']+" : error: already switched or raw partition not found")
# no need
cams[:] = [tmp for tmp in cams if tmp.get('disable')!=1]
# switch ssd to pc for all (not caring which cable is in)
for cam in cams:
cam['obj'].ssd_to_pc()
# download
plist = []
all_downloaded = False
for i in range(len(cams)):
raw_input(bcolors.OKGREEN+"Connect camera (eSATA) to PC (eSATA/SATA). Press Enter to continue..."+bcolors.ENDC)
t = 0
while not all_downloaded:
plist = pc.list_partitions()
for d in dirs:
for p in plist:
if d==p[0]:
pc.download(args.dest,"/dev/"+p[1],d,args.bs,args.bc,args.skip,args.n)
dirs.delete(d)
if len(dirs)!=0:
print("wait for the next ssd")
else:
all_downloaded = True
break
print("Waiting for disks to show up:")
print(dirs)
t = t + 1
time.sleep(1)
if t>ssd_detect_timeout:
print(bcolors.FAIL+"PC: Error: Disks were not found:")
print(dirs)
print(bcolors.ENDC)
break
#cam['rp_name'].ssd_to_pc()
# ssd to camera for all
for cam in cams:
cam['obj'].ssd_to_camera()
print("Done")
\ No newline at end of file
__author__ = "Elphel"
__copyright__ = "Copyright 2016, Elphel, Inc."
__license__ = "GPL"
__version__ = "3.0+"
__maintainer__ = "Oleg K Dzhimiev"
__email__ = "oleg@elphel.com"
__status__ = "Development"
import os
import re
import subprocess
import time
def shout(cmd):
#subprocess.call prints to console
#subprocess.call(cmd,shell=True)
ret_str = ""
try:
ret_str = subprocess.check_output(cmd,shell=True)
except subprocess.CalledProcessError as e:
ret_str = str(e.returncode)
return ret_str
#http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[38;5;214m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
BOLDWHITE = '\033[1;37m'
UNDERLINE = '\033[4m'
class Camera:
def __init__(self,user="root",ip="192.168.0.9"):
self.user = user
self.ip = ip
self.sshcmd = "ssh "+user+"@"+ip
self.disable = False
self.pattern = "ata-"
self.check_connection()
def check_connection(self):
check = shout(self.sshcmd+" 'dmesg'")
if check.strip() == str(255):
self.disable = True
else:
print(self.user+"@"+self.ip+": connection ok")
def ssd_to_pc(self):
self.unmount_all()
self.unload_ahci_driver()
self.mux_ssd_to_esata()
print(self.user+"@"+self.ip+": Enabled connection: internal SSD <-> PC")
def ssd_to_camera(self):
self.load_ahci_driver()
self.mux_ssd_to_cpu()
print(self.user+"@"+self.ip+": Enabled connection: internal SSD <-> Camera")
def partition_name(self,partition=""):
if partition!="":
res = shout(self.sshcmd+" 'ls -all /dev/disk/by-id | grep '"+self.pattern+"' | grep '"+partition[-4:]+"''")
if res!="1":
for name in res.split(" "):
if name[0:len(self.pattern)]==self.pattern:
return name[len(self.pattern):]
return "undefined"
def list_partitions(self):
res = shout(self.sshcmd+" 'cat /proc/partitions'")
plist = []
for line in res.splitlines():
s0 = re.search('sd[a-z][0-9]',line)
if s0:
plist.append(s0.group(0))
else:
s0 = re.search('sd[a-z]',line)
if s0:
plist.append(s0.group(0))
return plist
def list_mounted_partitions(self):
res = shout(self.sshcmd+" 'df -h'")
df_list = []
for line in res.splitlines():
s0 = re.search('sd[a-z][0-9]',line)
if s0:
df_list.append(s0.group(0))
return df_list
# combine with list_partitions?
def list_blkid(self):
res = shout(self.sshcmd+" 'blkid'")
blist = []
for line in res.splitlines():
s0 = re.search('sd[a-z][0-9]',line)
if s0:
s1 = re.search('TYPE=',line)
if s1:
blist.append(s0.group(0))
return blist
def list_raw_partitions(self):
plist = self.list_partitions()
blist = self.list_blkid()
for p in plist:
if p in blist:
plist.remove(p)
plist.remove(p[0:-1])
return plist
def first_found_raw_partition(self):
plist = self.list_raw_partitions()
if len(plist)!=0:
return "/dev/"+plist[0]
else:
return ""
def first_found_raw_partition_name(self):
p = self.first_found_raw_partition()
return self.partition_name(p)
def mux_ssd_to_esata(self):
shout(self.sshcmd+" '/usr/local/bin/x393sata_control.py set_esata_ssd'")
def mux_ssd_to_cpu(self):
shout(self.sshcmd+" '/usr/local/bin/x393sata_control.py set_zynq_ssd'")
def device_partitions(self,device):
test = shout(self.sshcmd+" 'ls /dev/disk/by-id/ -all'")
return test
def unmount_all(self):
blist = self.list_mounted_partitions()
if len(blist)==0:
print("umount: ok")
else:
for b in blist:
print("umounting /dev/"+b)
self.unmount("/dev/"+b)
def unmount(self,partition):
shout(self.sshcmd+" 'umount "+partition+"'")
def unload_ahci_driver(self):
shout(self.sshcmd+" 'rmmod ahci_elphel'")
def load_ahci_driver(self):
subprocess.Popen(self.sshcmd+" 'modprobe ahci_elphel'",shell=True)
time.sleep(1)
shout(self.sshcmd+" 'echo 1 > /sys/devices/soc0/amba@0/80000000.elphel-ahci/load_module'")
class PC():
def __init__(self):
self.pattern = "ata-"
def list_partitions(self):
res = shout("ls /dev/disk/by-id/ -all | grep '"+self.pattern+"'")
plist = []
for line in res.splitlines():
items = line.split(" ")
for name in items:
if name[0:len(self.pattern)]==self.pattern:
item = items[-1].split("/")
plist.append([name[len(self.pattern):],item[-1]])
return plist
def is_raw(self,part):
res = shout("sudo blkid | grep "+str(part))
typ = "TYPE="
s0 = re.search(typ,res)
if s0:
fstype = ""
pars = res.split(" ")
for par in pars:
if par[0:len(typ)]==typ:
fstype = par[len(typ):]
break
print(part+" partition has a filesystem: "+fstype)
raise Exception(bcolors.FAIL+"Partition has a filesystem ("+fstype+"): mount and copy files manually"+bcolors.ENDC)
def download(self,dest,part,dl_bs=20,dl_bc=512,dl_skip=0,dl_n=0):
self.is_raw(part)
print("Getting raw partition data from "+part)
if not os.path.isdir(dest):
os.mkdir(dest)
dirname = self.partname(part)
if dirname!="":
dirname = dest+"/"+dirname
if not os.path.isdir(dirname):
os.mkdir(dirname)
for i in range(0,dl_n+dl_skip):
fname = dirname+"/"+"file_"+str(i)+".img"
skip = i*(dl_bc-1)
if i>=dl_skip:
shout("sudo dd if="+part+" "+" of="+fname+" bs="+str(dl_bs)+"M count="+str(dl_bc)+" skip="+str(skip))
def partname(self,partition):
cmd = "ls /dev/disk/by-id/ -all | grep '"+self.pattern+"' | grep '"+partition[-4:]+"'"
res = shout(cmd)
for name in res.split(" "):
if name[0:len(self.pattern)]==self.pattern:
return name[len(self.pattern):]
return ""
......@@ -24,7 +24,7 @@ class x393_downloader:
self.dl_ssd_switch_timeout = 20 #seconds
self.dl_blocksize = 20 #Megabytes
self.dl_blockcount = 50
self.dl_chunks = 10
self.dl_chunks = 70
#ping and check access
self.check_connection()
......
......@@ -202,6 +202,17 @@
</tr>
</table>
<br/>
<div>
<div>AutoExp window</div>
<div id="ae_radio">
<input type="radio" id="ae_radio1" name="ae_radio" onclick="set_ae_window('all')" checked="checked" /><label for="ae_radio1">all</label>
<input type="radio" id="ae_radio2" name="ae_radio" onclick="set_ae_window('center top')" /><label for="ae_radio2">center top</label>
<input type="radio" id="ae_radio3" name="ae_radio" onclick="set_ae_window('center bot')" /><label for="ae_radio3">center bot</label>
<input type="radio" id="ae_radio4" name="ae_radio" onclick="set_ae_window('top')" /><label for="ae_radio4">top</label>
<input type="radio" id="ae_radio5" name="ae_radio" onclick="set_ae_window('bot')" /><label for="ae_radio5">bot</label>
</div>
</div>
<br/>
<div>
<div>White Balance:</div>
<div id="wb-div">
......
......@@ -32,7 +32,7 @@ input{
#settings {
width:850;
height:650;
height:687;
background:rgba(180,180,180,0.95);
/*color: white;*/
position:absolute;
......@@ -150,7 +150,7 @@ input{
.tabs_contents{
padding:10px;
width:840px;
height:613px;
height:650px;
background:rgba(230,230,230,0.95);
position:absolute;
top:32px;
......@@ -209,7 +209,7 @@ input{
-moz-border-radius: 9px;
}
#radio {
#radio, #ae_radio {
padding: 5px;
font-size: 10px;
}
......
......@@ -55,6 +55,7 @@ function restore_settings(text,which){
$('#radio1').click();
$('#radio').button("refresh");
$('#ae_radio').button("refresh");
}
}
......
......@@ -88,6 +88,9 @@ function tab1_init(mode){
// TAB 2: begin
function white_balance_sliders_init(){
$( "#ae_radio" ).buttonset();
$( "#radio" ).buttonset();
$( "#red" ).slider({
......@@ -146,22 +149,54 @@ function set_default_gains(light) {
$("#red_gain").val(2.82);
$("#green_gain").val(2);
$("#blue_gain").val(2.45);
set_ae_window("all");
}
if (light=="cloudy") {
$("#red_gain").val(2.82);
$("#green_gain").val(2);
$("#blue_gain").val(2.45);
set_ae_window("center bot");
}
if (light=="fluorescent") {
$("#red_gain").val(2.15);
$("#green_gain").val(2);
$("#blue_gain").val(3.82);
set_ae_window("all");
}
moveslider();
//set_gains();
}
function set_ae_window(mode){
if (mode=="all"){
set_parameter(master_ip,'HISTWND_RLEFT' ,65535,false);
set_parameter(master_ip,'HISTWND_RTOP' ,32768,false);
set_parameter(master_ip,'HISTWND_RWIDTH' ,49152,false);
set_parameter(master_ip,'HISTWND_RHEIGHT',65535,false);
}else if(mode=="center top"){
set_parameter(master_ip,'HISTWND_RLEFT' , 0,false);
set_parameter(master_ip,'HISTWND_RTOP' ,35967,false);
set_parameter(master_ip,'HISTWND_RWIDTH' ,30265,false);
set_parameter(master_ip,'HISTWND_RHEIGHT',19672,false);
}else if(mode=="center bot"){
set_parameter(master_ip,'HISTWND_RLEFT' ,65536,false);
set_parameter(master_ip,'HISTWND_RTOP' ,36769,false);
set_parameter(master_ip,'HISTWND_RWIDTH' ,30265,false);
set_parameter(master_ip,'HISTWND_RHEIGHT',19672,false);
}else if(mode=="top"){
set_parameter(master_ip,'HISTWND_RLEFT' ,65536,false);
set_parameter(master_ip,'HISTWND_RTOP' , 3700,false);
set_parameter(master_ip,'HISTWND_RWIDTH' ,63000,false);
set_parameter(master_ip,'HISTWND_RHEIGHT',16878,false);
}else if(mode=="bot"){
set_parameter(master_ip,'HISTWND_RLEFT' ,65536,false);
set_parameter(master_ip,'HISTWND_RTOP' ,65536,false);
set_parameter(master_ip,'HISTWND_RWIDTH' ,63000,false);
set_parameter(master_ip,'HISTWND_RHEIGHT',16878,false);
}
}
function set_gains(color) {
console.log("set_gains('"+color+"')");
if (color=="red"||color=="all") set_parameter(master_ip,'GAINR' ,Math.round(65536*$("#red_gain").val()),false); // *0x10000
......
......@@ -38,14 +38,25 @@ if (!is_dir($path)) {
}
if ($fp = simplexml_load_file("http://{$master['ip']}:{$master['port']}/trig/pointers")) {
//elphel_set_P_value(2,ELPHEL_TRIG_PERIOD,0,ELPHEL_CONST_FRAME_IMMED);
//usleep(200000);
//elphel_set_P_value(2,ELPHEL_TRIG_PERIOD,1,ELPHEL_CONST_FRAME_IMMED);
//$system_status = system("./images.sh $ip $n $path");
for($i=0;$i<count($cams);$i++){
exec("./get_image.sh \"{$cams[$i]['ip']}:{$cams[$i]['port']}/bimg\" \"${path}\" \"${i}.jp4\" \"${i}.log\" \"${i}\"> /dev/null 2>&1 &");
}
//why fopen?
$add_str = "http://{$master['ip']}/camogmgui/camogm_interface.php?cmd=set_parameter&pname=TRIG_PERIOD&pvalue=";
$fp = fopen($addr_str.($period+1)."&sensor_port={$master['channel']}", 'r');
$fp = fopen($addr_str.($period+1)."&sensor_port={$master['channel']}", 'r');
//$add_str = "http://{$master['ip']}/camogm_interface.php?cmd=set_parameter&pname=TRIG_PERIOD&pvalue=";
$addr_str = "http://{$master['ip']}/parsedit.php?immediate&TRIG_PERIOD=";
$fp = fopen($addr_str.($period+1)."*-2&sensor_port={$master['channel']}", 'r');
$fp = fopen($addr_str.($period)."*-2&sensor_port={$master['channel']}", 'r');
//printf($addr_str.($period+1)."*-2&sensor_port={$master['channel']}");
//elphel_set_P_value(2,ELPHEL_TRIG_PERIOD,100000000,ELPHEL_CONST_FRAME_IMMED);
//$fp = fopen("http://192.168.0.221:8081/trig/pointers",'r');
//$fp = fopen("http://192.168.0.221:8081/trig/pointers",'r');
//$fp = fopen("http://192.168.0.221:8081/trig/pointers",'r');
......
......@@ -4,10 +4,10 @@
<link rel="shortcut icon" href="favicon.ico" />
<script src="jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="button.css" />
<link rel="stylesheet" type="text/css" href="index.css" />
<link rel="stylesheet" type="text/css" href="js/button.css" />
<link rel="stylesheet" type="text/css" href="js/index.css" />
<style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment