pogucam 0.1.13__py3-none-any.whl → 0.1.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pogucam/explore_u24_uni.py +319 -78
- {pogucam-0.1.13.dist-info → pogucam-0.1.15.dist-info}/METADATA +1 -1
- {pogucam-0.1.13.dist-info → pogucam-0.1.15.dist-info}/RECORD +5 -5
- {pogucam-0.1.13.dist-info → pogucam-0.1.15.dist-info}/WHEEL +0 -0
- {pogucam-0.1.13.dist-info → pogucam-0.1.15.dist-info}/entry_points.txt +0 -0
pogucam/explore_u24_uni.py
CHANGED
@@ -91,8 +91,8 @@ import datetime as dt
|
|
91
91
|
import cv2
|
92
92
|
import threading
|
93
93
|
|
94
|
-
|
95
|
-
|
94
|
+
import glob # look for bg fg
|
95
|
+
import shutil
|
96
96
|
|
97
97
|
istrip = 0
|
98
98
|
UPDATE_INTERVAL = 1
|
@@ -104,6 +104,69 @@ FILE_USERPASS = "~/.config/flashcam/.flashcam_upw" # will extend
|
|
104
104
|
FILE_REDCROSS0 = "~/.config/pogucam/crossred" # will extend
|
105
105
|
FILE_REDCROSS = "~/.config/pogucam/crossred" # will extend
|
106
106
|
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
# ================================================================================
|
112
|
+
#
|
113
|
+
# --------------------------------------------------------------------------------
|
114
|
+
|
115
|
+
|
116
|
+
# ================================================================================
|
117
|
+
#
|
118
|
+
# --------------------------------------------------------------------------------
|
119
|
+
|
120
|
+
|
121
|
+
# ================================================================================
|
122
|
+
#
|
123
|
+
# --------------------------------------------------------------------------------
|
124
|
+
|
125
|
+
|
126
|
+
# ================================================================================
|
127
|
+
#
|
128
|
+
# --------------------------------------------------------------------------------
|
129
|
+
|
130
|
+
|
131
|
+
# def parse_timestamp_in_saved_file(filename):
|
132
|
+
# # Extract timestamp part YYmmdd_HHMMSS.ff from filename
|
133
|
+
# parts = filename.split('_')
|
134
|
+
# if len(parts) < 5:
|
135
|
+
# return None
|
136
|
+
# timestamp_str = parts[3] + '_' + parts[4] # YYmmdd_HHMMSS.ff
|
137
|
+
# try:
|
138
|
+
# # Parse ignoring fractional seconds for sorting
|
139
|
+
# dt = datetime.strptime(timestamp_str.split('.')[0], "%Y%m%d_%H%M%S")
|
140
|
+
# return dt
|
141
|
+
# except ValueError:
|
142
|
+
# return None
|
143
|
+
|
144
|
+
def find_latest_bg_or_fg(new_name, foreground=False):
|
145
|
+
#
|
146
|
+
tag = "background"
|
147
|
+
if foreground:
|
148
|
+
tag = "foreground"
|
149
|
+
base, ext = os.path.splitext(new_name) #
|
150
|
+
parts = base.split('_')
|
151
|
+
pattern = f"{parts[0]}_{parts[1]}_{parts[2]}_"
|
152
|
+
copyfile = f"{pattern}{tag}{ext}"
|
153
|
+
#if not base.endswith(tag):
|
154
|
+
# print("Filename must end with '_background' before extension")
|
155
|
+
# return
|
156
|
+
#base_prefix = base[:-11] # remove '_background'
|
157
|
+
pattern2 = f"{pattern}20*{ext}" # 20ieth century
|
158
|
+
files = glob.glob(pattern2)
|
159
|
+
lastfile = None
|
160
|
+
if not files:
|
161
|
+
print("D... No matching files found for", pattern2)
|
162
|
+
else:
|
163
|
+
lastfile = sorted(files)[-1]
|
164
|
+
print(f"D... {len(files)} possible files" , lastfile)
|
165
|
+
if lastfile is None: print(f"{fg.red}X... no suitable saved file for {tag} ", fg.default)
|
166
|
+
return lastfile,copyfile
|
167
|
+
|
168
|
+
|
169
|
+
|
107
170
|
# ================================================================================
|
108
171
|
# RA "00 12 45.2"
|
109
172
|
# --------------------------------------------------------------------------------
|
@@ -588,7 +651,14 @@ class StreamWidget(QLabel):
|
|
588
651
|
# -------------------------------------------------
|
589
652
|
#self.level2_buffer = None
|
590
653
|
#self.level2_buffer_max_size = 10
|
591
|
-
|
654
|
+
#---------------------------------------------
|
655
|
+
self.filename_background = None
|
656
|
+
self.filename_foreground = None
|
657
|
+
self.image_background = None
|
658
|
+
self.image_foreground = None
|
659
|
+
self.l_timelaps = False
|
660
|
+
self.l_timelaps_seconds = 16 # initial 2^4
|
661
|
+
self.l_timelaps_last = dt.datetime.now() #
|
592
662
|
# --------------------------------- I put it at the end so that it knows all attributes
|
593
663
|
self.update_image()
|
594
664
|
|
@@ -613,7 +683,8 @@ class StreamWidget(QLabel):
|
|
613
683
|
#print(self.internet_not_device, self.internet_not_device)
|
614
684
|
# -------------------------------------------------------------- ACCUM -----------------
|
615
685
|
if self.internet_not_device:
|
616
|
-
|
686
|
+
#### every internet call do here
|
687
|
+
#### but skip anyting with ACCUM ACCUMTXT !!!!!!!!
|
617
688
|
if ('accumtxt' in data) and int(data['accumtxt']) == 1: # skip Loop 1
|
618
689
|
print("D... LOOP 1 skipped for remote send command - for some reason I send out 0 only,not 1")
|
619
690
|
pass
|
@@ -622,7 +693,7 @@ class StreamWidget(QLabel):
|
|
622
693
|
if val == 0: val = 1 # trying to fix
|
623
694
|
if len(self.FABuffer) != val and val > 0:
|
624
695
|
self.FABuffer.set_max_frames(val)
|
625
|
-
else
|
696
|
+
else:#### HERE REALLY ######--------------------------------------------------
|
626
697
|
post_response = requests.post(url=self.post_addr, data=data )
|
627
698
|
else:
|
628
699
|
# --------------------------------------------------------- JUST LOCAL DEVICE ----------------
|
@@ -965,7 +1036,7 @@ class StreamWidget(QLabel):
|
|
965
1036
|
SAV = f" "
|
966
1037
|
if self.saving_all:
|
967
1038
|
SAV = f"SAVING"
|
968
|
-
LAPS = f"
|
1039
|
+
LAPS = f"LAPS:{self.saving_laps:3d}"
|
969
1040
|
#
|
970
1041
|
FIT = f" "
|
971
1042
|
if self.saving_fits_only:
|
@@ -980,11 +1051,30 @@ class StreamWidget(QLabel):
|
|
980
1051
|
#if self.accum_buffer is not None:
|
981
1052
|
# total_size = sys.getsizeof(self.accum_buffer) + sum(sys.getsizeof(arr) for arr in self.accum_buffer)
|
982
1053
|
#BUF = f"BUF={self.accum_count:3d}/{self.accum_n:3d} {total_size/1024/1024:5.0f} MB"
|
983
|
-
|
984
|
-
|
1054
|
+
bufshow = "( )"
|
1055
|
+
if self.l_show_accum:
|
1056
|
+
if self.l_show_accum_avg:
|
1057
|
+
bufshow = "(AVG)"
|
1058
|
+
else:
|
1059
|
+
bufshow = "(SUM)"
|
1060
|
+
else:
|
1061
|
+
bufshow = "( )"
|
1062
|
+
bgfg1 = " "
|
1063
|
+
bgfg2 = " "
|
1064
|
+
if self.image_foreground is not None: bgfg1 = "FG"
|
1065
|
+
if self.image_background is not None: bgfg2 = "BG"
|
1066
|
+
|
1067
|
+
BUF = f"BUF{bufshow}={cur_size:3d}/{max_size:3d} {total_size/1024/1024:5.0f} MB"
|
985
1068
|
#
|
1069
|
+
#*********************************** HERE I CONTRUCT THE BOTTOM LINE ***********************
|
986
1070
|
#
|
987
|
-
overtext = f"{self.frame_time} # {self.frame_num} # {self.l_frame_num:6d} # {RXT} . {ZOO} . {ROO} . {LGA} . {SAV} {FIT} . {BUF}. {LAPS}"
|
1071
|
+
#overtext = f"{self.frame_time} # {self.frame_num} # {self.l_frame_num:6d} # {RXT} . {ZOO} . {ROO} . {LGA} . {SAV} {FIT} . {BUF}. {LAPS}"
|
1072
|
+
# SAVING is already red
|
1073
|
+
#overtext = f"{self.frame_time} # {self.frame_num} # {self.l_frame_num:6d} # {RXT} . {ZOO} . {ROO} . {LGA} . {FIT} . {BUF}. {LAPS}"
|
1074
|
+
# ROTATE IS LOCAL
|
1075
|
+
#overtext = f"{self.frame_time} # {self.frame_num} # {self.l_frame_num:6d} # {RXT} . {ZOO} . {LGA} . {FIT} . {BUF}. {LAPS}"
|
1076
|
+
# I add BG-FG
|
1077
|
+
overtext = f"{self.frame_time} # {self.frame_num} # {self.l_frame_num:6d} # {RXT} . {ZOO} . {LGA} . {FIT} . {bgfg1}{bgfg2} . {BUF}. {LAPS}"
|
988
1078
|
#
|
989
1079
|
position = ( 0, selfimg.shape[0]-1 ) # 480 on x-axis
|
990
1080
|
#
|
@@ -1019,6 +1109,7 @@ class StreamWidget(QLabel):
|
|
1019
1109
|
# ----------------------------------------------------------------------
|
1020
1110
|
|
1021
1111
|
def prepare_save(self, png=False, time_tag=None):
|
1112
|
+
# ..... self.saving_fits_only is not necessary, handled elsewhere
|
1022
1113
|
dir2create = os.path.expanduser("~/DATA/")
|
1023
1114
|
if not os.path.isdir(os.path.expanduser(dir2create)):
|
1024
1115
|
print(f"D... trying to create directory {dir2create} for saving")
|
@@ -1026,12 +1117,13 @@ class StreamWidget(QLabel):
|
|
1026
1117
|
os.mkdir(os.path.expanduser(dir2create))
|
1027
1118
|
now = time_tag
|
1028
1119
|
if time_tag is None:
|
1029
|
-
now = dt.datetime.now().strftime( '%Y%m%d_%H%M%
|
1120
|
+
now = dt.datetime.now().strftime( '%Y%m%d_%H%M%S.%f')[:-4] # dot fraction - should be conform with other parts
|
1030
1121
|
else:
|
1031
1122
|
# 20:23:46.12
|
1032
1123
|
now = dt.datetime.now().strftime( '%Y%m%d_')+now.replace(":", "")
|
1033
1124
|
ext = "jpg"
|
1034
1125
|
if png:ext = "png"
|
1126
|
+
#if self.saving_fits_only:ext = "fits" # not necessary here...
|
1035
1127
|
host = socket.gethostname()
|
1036
1128
|
murl = ""
|
1037
1129
|
if self.url.find("http://") >= 0:
|
@@ -1147,7 +1239,9 @@ class StreamWidget(QLabel):
|
|
1147
1239
|
dumpbuffer:
|
1148
1240
|
use_buffer is None OR THE BUFFER TO USE (level2)
|
1149
1241
|
"""
|
1150
|
-
fname1 =
|
1242
|
+
fname1 = fname
|
1243
|
+
if fname is None:
|
1244
|
+
fname1 = self.prepare_save( time_tag=time_tag)
|
1151
1245
|
if not silent: print(fname1)
|
1152
1246
|
#---------- FITS *****
|
1153
1247
|
if use_fits: # --------- FITS CASE --- more complex -------------------------------
|
@@ -1197,8 +1291,11 @@ class StreamWidget(QLabel):
|
|
1197
1291
|
mycnt += 1
|
1198
1292
|
fff = fname1.replace(".jpg", f"_{mycnt:03d}.jpg")
|
1199
1293
|
print(fff)
|
1294
|
+
# ----------------------- Overtext shoud be IMPROVED FOR DUMPED BUFFER
|
1200
1295
|
if self.flag_print_over:
|
1201
|
-
self.overtext(blackbar=True) # ---- after ACCUM ------------------ img should be tagged
|
1296
|
+
self.overtext(blackbar=True, image=i) # ---- after ACCUM ------------------ img should be tagged
|
1297
|
+
i = self.img
|
1298
|
+
print(fg.magenta, "D... simple save - overtext solved ", fg.default, end="\n")
|
1202
1299
|
if self.saving_jpg:
|
1203
1300
|
cv2.imwrite(fff, i, [int(cv2.IMWRITE_JPEG_QUALITY), 90])
|
1204
1301
|
else:
|
@@ -1206,15 +1303,43 @@ class StreamWidget(QLabel):
|
|
1206
1303
|
pass
|
1207
1304
|
# -----------------------------------------------
|
1208
1305
|
elif (not dumpbuffer) and (not self.l_show_accum):
|
1306
|
+
print(fg.magenta, "D... simple save overtext is there", fg.default)
|
1209
1307
|
# This is a simple save
|
1210
1308
|
if self.saving_jpg:
|
1211
1309
|
cv2.imwrite(fname1, self.img, [int(cv2.IMWRITE_JPEG_QUALITY), 90])
|
1212
1310
|
else:
|
1213
1311
|
cv2.imwrite(fname1.replace("jpg", "png"), self.img )
|
1214
1312
|
elif (dumpbuffer) and (self.l_show_accum):
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1313
|
+
# -....
|
1314
|
+
print(fg.magenta, "D... the trickies - save every Nth-every new buffer - IDK ", fg.default)
|
1315
|
+
elif (len(self.FABuffer) < 2) and (not dumpbuffer):# and (self.l_show_accum):
|
1316
|
+
# ....
|
1317
|
+
print(fg.magenta, f"D... buffer <1; cannot dump; save SUM {not self.l_show_accum_avg} or AVG {self.l_show_accum_avg}", fg.default)
|
1318
|
+
mymean = None
|
1319
|
+
if self.l_show_accum_avg: # not sum
|
1320
|
+
mymean = self.FABuffer.get_avg_frames()
|
1321
|
+
else:# # yes sum
|
1322
|
+
mymean = self.FABuffer.get_sum_frames()
|
1323
|
+
# NO OVERTEXT ! ! ! ! ! ! SOLVED
|
1324
|
+
if self.flag_print_over:
|
1325
|
+
self.overtext(blackbar=True, image=mymean)
|
1326
|
+
mymean = self.img
|
1327
|
+
if self.saving_jpg:
|
1328
|
+
cv2.imwrite(fname1, mymean, [int(cv2.IMWRITE_JPEG_QUALITY), 90])
|
1329
|
+
else:
|
1330
|
+
cv2.imwrite(fname1.replace("jpg", "png"), mymean )
|
1331
|
+
elif (len(self.FABuffer) > 1) and (not dumpbuffer):# and (self.l_show_accum):
|
1332
|
+
# ....
|
1333
|
+
print(fg.magenta, "D... buffer >1; do not dump; save SUM or AVG", fg.default)
|
1334
|
+
mymean = None
|
1335
|
+
if self.l_show_accum_avg: # not sum
|
1336
|
+
mymean = self.FABuffer.get_avg_frames()
|
1337
|
+
else:# # yes sum
|
1338
|
+
mymean = self.FABuffer.get_sum_frames()
|
1339
|
+
# NO OVERTEXT ! ! ! ! ! ! SOLVED
|
1340
|
+
if self.flag_print_over:
|
1341
|
+
self.overtext(blackbar=True, image=mymean)
|
1342
|
+
mymean = self.img
|
1218
1343
|
if self.saving_jpg:
|
1219
1344
|
cv2.imwrite(fname1, mymean, [int(cv2.IMWRITE_JPEG_QUALITY), 90])
|
1220
1345
|
else:
|
@@ -1472,6 +1597,12 @@ class StreamWidget(QLabel):
|
|
1472
1597
|
ret_val = False
|
1473
1598
|
if True:# self.img.shape == self.frame.shape:
|
1474
1599
|
self.img = self.frame.copy()
|
1600
|
+
if not self.image_background is None:
|
1601
|
+
#self.img = self.img - self.image_background
|
1602
|
+
self.img = cv2.subtract(self.img , self.image_background )
|
1603
|
+
if not self.image_foreground is None:
|
1604
|
+
#self.img = self.img + self.image_foreground
|
1605
|
+
self.img = 0.5*self.img + 0.5*self.image_foreground
|
1475
1606
|
if stripes: # These are thin gray
|
1476
1607
|
#self.vcr_pal_style(["NO SIGNAL"])
|
1477
1608
|
for y in range(0, self.img.shape[0], 16):
|
@@ -1558,7 +1689,7 @@ class StreamWidget(QLabel):
|
|
1558
1689
|
called from from fetch_and_update() / returns BOOL
|
1559
1690
|
"""
|
1560
1691
|
ret_val = False
|
1561
|
-
if self.stream is None:
|
1692
|
+
if self.stream is None: # INITIALIZE THE STREAM -----------------
|
1562
1693
|
#self.make_strips()
|
1563
1694
|
self.stream = self.get_stream(videodev=self.url)
|
1564
1695
|
if self.stream is not None:
|
@@ -1589,6 +1720,7 @@ class StreamWidget(QLabel):
|
|
1589
1720
|
self.t_lasread = self.l_frame_time
|
1590
1721
|
self.l_frame_time = dt.datetime.now()
|
1591
1722
|
delta_frame = (self.l_frame_time - self.t_lasread).total_seconds() # TOTAL
|
1723
|
+
self.l_frame_num += 1 # INCREMENT LOCAL FRAME NUMBER
|
1592
1724
|
#
|
1593
1725
|
print(f" ; {self.stream_length/delta_frame/1024/1024*8:4.2f} Mbs .. buffer tot= {len(self.bytex)/1024:4.1f} kB; Reading:{delta_read:4.2f} s.; TOT {str(delta_frame)[:4]} s.; Duty {int((delta_frame-delta_read)/delta_frame*100):3.0f} % ", end="")
|
1594
1726
|
#
|
@@ -1903,8 +2035,8 @@ class StreamWidget(QLabel):
|
|
1903
2035
|
rimg = self.FABuffer.get_avg_frames()#_mean_accum_buffer()
|
1904
2036
|
else:
|
1905
2037
|
rimg = self.FABuffer.get_sum_frames()#_mean_accum_buffer()
|
1906
|
-
|
1907
|
-
|
2038
|
+
#print("\n new", type(rimg))
|
2039
|
+
print(f"SATURATED: {self.FABuffer.get_saturated_pixel_count()}", end="") # only for SUM
|
1908
2040
|
else:
|
1909
2041
|
rimg = self.FABuffer.get_previous_sum_frames()#_mean_accum_buffer()
|
1910
2042
|
#print("\n----pre", type(rimg))
|
@@ -1944,95 +2076,139 @@ class StreamWidget(QLabel):
|
|
1944
2076
|
# print(fg.red, f"L{self.saving_laps}{fitag}", fg.default, end="")
|
1945
2077
|
# self.saving_laps_last_save = now
|
1946
2078
|
# self.save_img( time_tag=self.frame_time , savingjpg=False) #
|
1947
|
-
|
2079
|
+
DO_TIMELAPS = False
|
2080
|
+
if self.l_timelaps:
|
2081
|
+
if dt.datetime.now() > self.l_timelaps_last + dt.timedelta(seconds=self.l_timelaps_seconds):
|
2082
|
+
print(f"\ni... {fg.cyan} TIMELAPS saving now {fg.default} ... every {fg.orange} {self.l_timelaps_seconds} s. {fg.defaiult}")
|
2083
|
+
self.l_timelaps_last = dt.datetime.now()
|
2084
|
+
DO_TIMELAPS = True
|
1948
2085
|
# ---- just save once -------------------- ************ "s" ***********
|
1949
|
-
if self.saving_once:
|
1950
|
-
|
2086
|
+
if self.saving_once or DO_TIMELAPS:
|
2087
|
+
DO_TIMELAPS = False
|
2088
|
+
# jpg and NO AVG --------- No difference show_accum_not_showaccum if frabuffer ==1
|
1951
2089
|
if (len(self.FABuffer) < 2) and (not self.l_show_accum) and (not self.saving_fits_only):
|
1952
2090
|
# no bufffer no loopshow no fits
|
2091
|
+
print(f"\ni... {fg.red}SAVING ONE 1 B1 NOshac{fg.default}")
|
2092
|
+
self.save_img( time_tag=self.frame_time , dumpbuffer=False, use_fits=False ) # one simple image
|
2093
|
+
#print(fg.magenta, "\ns1 b1 shac", fg.default, end="\n")
|
2094
|
+
self.saving_once = False
|
2095
|
+
elif (len(self.FABuffer) < 2) and (self.l_show_accum) and (not self.saving_fits_only):
|
2096
|
+
# no bufffer no loopshow no fits
|
2097
|
+
print()
|
2098
|
+
print(f"i... {fg.red}SAVING ONE 2 B1 shac{fg.default}")
|
1953
2099
|
self.save_img( time_tag=self.frame_time , dumpbuffer=False, use_fits=False ) # one simple image
|
1954
|
-
print(fg.red, "
|
2100
|
+
#print(fg.red, "\ns1", fg.default, end="\n")
|
1955
2101
|
self.saving_once = False
|
1956
2102
|
# jpg and NO AVG
|
1957
2103
|
elif (len(self.FABuffer) >= 2) and (not self.l_show_accum) and (not self.saving_fits_only):
|
2104
|
+
print()
|
2105
|
+
print(fg.red, "SAVING ONE 3 B2+ NOshac ", fg.default, end="\n")
|
1958
2106
|
self.save_img( time_tag=self.frame_time, dumpbuffer=False, use_fits=False ) # save one simple image only
|
1959
|
-
print(fg.red, "s1", fg.default, end="")
|
1960
2107
|
self.saving_once = False
|
1961
2108
|
# jpg and AVG
|
1962
2109
|
elif (len(self.FABuffer) < 2) and (self.l_show_accum) and (not self.saving_fits_only):
|
1963
2110
|
# no bufffer no loopshow no fits
|
2111
|
+
print()
|
2112
|
+
print(fg.red, "SAVING ONE 4 B1 shac ", fg.default, end="\n")
|
1964
2113
|
self.save_img( time_tag=self.frame_time, dumpbuffer=False, use_fits=False ) # just one simple image /lshow inside
|
1965
|
-
print(fg.red, "F1", fg.default, end="")
|
2114
|
+
#print(fg.red, "F1", fg.default, end="")
|
1966
2115
|
self.saving_once = False
|
1967
2116
|
pass
|
1968
2117
|
# jpg and AVG
|
1969
2118
|
elif (len(self.FABuffer) >= 2) and (self.l_show_accum) and (not self.saving_fits_only):
|
1970
2119
|
# no bufffer no loopshow no fits
|
1971
2120
|
#if self.accum_index >= len(self.FABuffer) - 1:
|
2121
|
+
print()
|
2122
|
+
print(fg.red, "SAVING ONE 5 B2+ shac ", fg.default, end="\n")
|
1972
2123
|
self.save_img( time_tag=self.frame_time, dumpbuffer=False, use_fits=False ) # should be 1 AVG IMG
|
1973
|
-
print(fg.red, "F1", fg.default, end="")
|
2124
|
+
#print(fg.red, "F1", fg.default, end="")
|
1974
2125
|
self.saving_once = False
|
1975
2126
|
# FITS and NO AVG ---------------------------------------------------------------------------- FITS
|
1976
2127
|
elif (len(self.FABuffer) < 2) and (not self.l_show_accum) and (self.saving_fits_only):
|
1977
2128
|
# no bufffer no loopshow YES fits
|
2129
|
+
print()
|
2130
|
+
print(fg.red, "SAVING ONE 6 B1 NOshac ", fg.default, end="\n")
|
1978
2131
|
self.save_img( time_tag=self.frame_time , dumpbuffer=False, use_fits=True ) # 1 img
|
1979
|
-
print(fg.red, "F1", fg.default, end="")
|
2132
|
+
#print(fg.red, "F1", fg.default, end="")
|
1980
2133
|
self.saving_once = False
|
1981
2134
|
pass
|
1982
2135
|
# FITS and NO AVG
|
1983
2136
|
elif (len(self.FABuffer) >= 2) and (not self.l_show_accum) and (self.saving_fits_only):
|
1984
2137
|
# no bufffer no loopshow no fits
|
2138
|
+
print(fg.red, "SAVING ONE 7 B2 NOshac ", fg.default, end="\n")
|
1985
2139
|
self.save_img( time_tag=self.frame_time , dumpbuffer=True, use_fits=True ) # dump buffer once
|
1986
|
-
print(fg.red, "F1", fg.default, end="")
|
2140
|
+
#print(fg.red, "F1", fg.default, end="")
|
1987
2141
|
self.saving_once = False
|
1988
2142
|
pass
|
1989
2143
|
# FITS and avg
|
1990
2144
|
elif (len(self.FABuffer) < 2) and (self.l_show_accum) and (self.saving_fits_only):
|
1991
2145
|
# no bufffer no loopshow no fits
|
2146
|
+
print()
|
2147
|
+
print(fg.red, "SAVING ONE 8 B1 shac ", fg.default, end="\n")
|
1992
2148
|
self.save_img( time_tag=self.frame_time , dumpbuffer=False, use_fits=True ) # one AVG
|
1993
|
-
print(fg.red, "F1", fg.default, end="")
|
2149
|
+
#print(fg.red, "F1", fg.default, end="")
|
1994
2150
|
self.saving_once = False
|
1995
2151
|
pass
|
1996
2152
|
# FITS and avg there are more
|
1997
2153
|
elif (len(self.FABuffer) >= 2) and (self.l_show_accum) and (self.saving_fits_only):
|
1998
2154
|
# no bufffer no loopshow no fits
|
1999
2155
|
#if self.accum_index >= len(self.FABuffer) - 1:
|
2156
|
+
print()
|
2157
|
+
print(fg.red, "SAVING ONE 9 B2+ shac ", fg.default, end="\n")
|
2000
2158
|
self.save_img( time_tag=self.frame_time , dumpbuffer=False, use_fits=True ) # many AVG IDK
|
2001
|
-
print(fg.red, "F1", fg.default, end="")
|
2159
|
+
#print(fg.red, "F1", fg.default, end="")
|
2002
2160
|
self.saving_once = False
|
2003
2161
|
|
2004
2162
|
|
2005
2163
|
# ---- save ALL ----------------- -------------------------------------------- ************ "shift-s" ***********
|
2164
|
+
#
|
2006
2165
|
# ---- save ALL ----------------- -------------------------------------------- ************ "shift-s" ***********
|
2007
|
-
if self.saving_all: # --------------- Shift-S-------
|
2166
|
+
if self.saving_all: # --------------- Shift-S------- ALWAYS PUT RED
|
2008
2167
|
|
2009
|
-
# jpg and NO AVG
|
2010
|
-
if (len(self.FABuffer) < 2)
|
2168
|
+
# jpg and NO AVG when no frbuffer, showaccum makes no sense
|
2169
|
+
if (len(self.FABuffer) < 2) and (not self.l_show_accum) and (not self.saving_fits_only):
|
2170
|
+
print()
|
2171
|
+
print(fg.red, "D... SALL 1 B1 NOshaccum NOdump", fg.default, f"{bg.red}{fg.white}!!ALL-1!!{bg.default}{fg.default}", end="\n")
|
2172
|
+
self.save_img( time_tag=self.frame_time, dumpbuffer=False, use_fits=False) # every frame, BURSTING JPGS!
|
2173
|
+
elif (len(self.FABuffer) < 2) and (self.l_show_accum) and (not self.saving_fits_only):
|
2174
|
+
print()
|
2175
|
+
print(fg.red, "D... SALL 2 B1 shaccum NOdump", fg.default, f"{bg.red}{fg.white}!!ALL-2!!{bg.default}{fg.default}", end="\n")
|
2011
2176
|
self.save_img( time_tag=self.frame_time, dumpbuffer=False, use_fits=False) # every frame, BURSTING JPGS!
|
2012
|
-
print(fg.red, "s!", fg.default, f"{bg.red}{fg.white}!!!!!!!!!!!!{bg.default}{fg.default}", end="\n")
|
2013
2177
|
# jpg and NO AVG
|
2014
2178
|
elif (len(self.FABuffer) >= 2) and (not self.l_show_accum) and (not self.saving_fits_only):
|
2179
|
+
print()
|
2180
|
+
print(fg.red, "D... SALL 3 B2+ NOshac DUMP", fg.default, end="\n") # ONE DUMP
|
2015
2181
|
self.save_img( time_tag=self.frame_time, dumpbuffer=True, use_fits=False ) # Dump Full Buffer and stop
|
2016
|
-
print(fg.red, "s-FuB DUMPED", fg.default, end="\n") # ONE DUMP
|
2017
2182
|
self.saving_all = False
|
2018
2183
|
# jpg and AVG
|
2019
2184
|
elif (len(self.FABuffer) < 2) and (self.l_show_accum) and (not self.saving_fits_only):
|
2020
2185
|
# no bufffer no loopshow no fits
|
2021
2186
|
#self.save_img( time_tag=self.frame_time, dumpbuffer=False, use_fits=False ) # just one simple image /lshow inside
|
2187
|
+
print()
|
2188
|
+
print(fg.red, "D... SALL 4 B1 shaccum / switching OFF saving all but not saving", fg.default, end="\n") # ???
|
2022
2189
|
self.saving_all = False
|
2023
2190
|
pass
|
2024
2191
|
# jpg and AVG
|
2025
|
-
elif (len(self.FABuffer) >= 2) and (self.l_show_accum) and (not self.saving_fits_only):
|
2192
|
+
elif (len(self.FABuffer) >= 2) and (self.l_show_accum) and (not self.saving_fits_only): # ??? newSUM x newAVG
|
2193
|
+
#
|
2194
|
+
#if self.l_show_accum_avg:
|
2195
|
+
# rimg = self.FABuffer.get_avg_frames()#_mean_accum_buffer()
|
2196
|
+
#
|
2026
2197
|
# no bufffer no loopshow no fits
|
2027
2198
|
#self.save_img( time_tag=self.frame_time, dumpbuffer=False, use_fits=False ) # should be AVG
|
2028
2199
|
#if self.accum_index >= len(self.FABuffer) - 1:
|
2029
2200
|
if self.FABuffer.new_sum_available():
|
2201
|
+
print()
|
2202
|
+
if self.l_show_accum_avg:
|
2203
|
+
print(fg.red, "D... SALL 5a shac Save AVG evry Nth ", fg.default, end="\n")
|
2204
|
+
else:
|
2205
|
+
print(fg.red, "D... SALL 5b Save SUM evry Nth ", fg.default, end="\n")
|
2030
2206
|
self.save_img( time_tag=self.frame_time, dumpbuffer=False, use_fits=False ) # Dump Full Buffer and stop
|
2031
|
-
print(fg.red, "Save SUM evry Nth ", fg.default, end="\n")
|
2032
2207
|
# FITS and NO AVG ---------------------------------------------------------------------------- FITS
|
2033
2208
|
# FITS and NO AVG ---------------------------------------------------------------------------- FITS
|
2034
2209
|
elif (len(self.FABuffer) < 2) and (not self.l_show_accum) and (self.saving_fits_only):
|
2035
|
-
print("
|
2210
|
+
print(fg.red, "D... SALL 6 fits for every image ... ", fg.default, end="\n")
|
2211
|
+
#print(" here fits for every image .... too low buffer --- so MAYBE ")
|
2036
2212
|
# no bufffer no loopshow YES fits
|
2037
2213
|
self.save_img( time_tag=self.frame_time, dumpbuffer=False, use_fits=True) # every frame, BURSTING FITS !?!?!
|
2038
2214
|
#print(fg.red, "every N frames to FITS-IDK", fg.default, f"{bg.red}{fg.white}???{bg.default}{fg.default}", end="\n")
|
@@ -2060,8 +2236,8 @@ class StreamWidget(QLabel):
|
|
2060
2236
|
#self.save_img( time_tag=self.frame_time , dumpbuffer=False, use_fits=True ) # many AVG IDK
|
2061
2237
|
if self.FABuffer.new_sum_available():
|
2062
2238
|
#if self.accum_index >= len(self.FABuffer) - 1: # ONLY THE ACCUM FRAME!
|
2063
|
-
self.save_img( time_tag=self.frame_time , dumpbuffer=False, use_fits=True ) # SIMPLIFIED
|
2064
2239
|
print(fg.red, "F-Every Nth-AVG to FITS -IDK", fg.default, end="")
|
2240
|
+
self.save_img( time_tag=self.frame_time , dumpbuffer=False, use_fits=True ) # SIMPLIFIED
|
2065
2241
|
###########################################################################################################################################
|
2066
2242
|
# if self.level2_buffer.get_frame_shape() != self.img.shape: #
|
2067
2243
|
# print(self.level2_buffer.get_frame_shape, self.img.shape) # CLEAR WHEN RES_CHANGE #
|
@@ -2155,7 +2331,9 @@ class StreamWidget(QLabel):
|
|
2155
2331
|
#post_addr = self.url.replace("/video", "/cross") # FOR REMOTE COMMANDS
|
2156
2332
|
|
2157
2333
|
#print(" + ".join(parts), f" /{chr(key)}/ .... {parts_set}")
|
2158
|
-
|
2334
|
+
|
2335
|
+
|
2336
|
+
# ----------------------------------------------------------------- s savings - LOCAL ONLY !
|
2159
2337
|
if (key == Qt.Key.Key_S):
|
2160
2338
|
self.SAVED_NOW = True # red blink
|
2161
2339
|
if ( len(parts_set) == 0) :
|
@@ -2163,12 +2341,12 @@ class StreamWidget(QLabel):
|
|
2163
2341
|
self.saving_all = False
|
2164
2342
|
#self.saving_fits_only = False
|
2165
2343
|
#self.saving_jpg = True
|
2166
|
-
print("i... SAVING_ONCE IMAGE ")
|
2344
|
+
#print(f"i... {fg.red}SAVING_ONCE IMAGE {fg.default}")
|
2167
2345
|
#---------------- SHIFT-S: 1) IbufferON=> save every nth image; 2) ---
|
2168
2346
|
elif (parts_set == {'Shift'}):
|
2169
2347
|
self.saving_all = not self.saving_all
|
2170
2348
|
#self.saving_fits_only = False
|
2171
|
-
print(f"i... 'SAVING_all' SET TO {self.saving_all} !!!!!FITS=={self.saving_fits_only}!!!!!
|
2349
|
+
print(f"i... {fg.orange}'SAVING_all' SET TO {self.saving_all} !!!!!FITS=={self.saving_fits_only}!!!!! {fg.default}")
|
2172
2350
|
if self.saving_all:
|
2173
2351
|
print('ffmpeg -framerate 5 -pattern_type glob -i "*.jpg" -c:v libx264 -pix_fmt yuv420p output.mkv')
|
2174
2352
|
print('ffmpeg -hide_banner -y -framerate 5 -pattern_type glob -i "*.jpg" -c:v libx264 -pix_fmt yuv420p output.mkv')
|
@@ -2176,22 +2354,28 @@ class StreamWidget(QLabel):
|
|
2176
2354
|
print('kstars (but press revert)')
|
2177
2355
|
print()
|
2178
2356
|
elif (parts_set == {'Ctrl'}) :
|
2179
|
-
|
2180
|
-
self.saving_all = False
|
2181
|
-
if self.saving_fits_only:
|
2182
|
-
print(f"i... {fg.orange}FITS_ONLY set to {self.saving_fits_only}{fg.default} (interval is {self.FITS_INTERVAL_SECONDS}) ; but 'SAVING_all' SET TO ", self.saving_all)
|
2183
|
-
else:
|
2184
|
-
print(f"i... FITS_ONLY set to {fg.cyan}{self.saving_fits_only}{fg.default} (interval is {self.FITS_INTERVAL_SECONDS}) ; but 'SAVING_all' SET TO ", self.saving_all)
|
2357
|
+
pass
|
2185
2358
|
|
2186
2359
|
elif (parts_set == {'Ctrl', 'Shift'}) :
|
2360
|
+
# --------------
|
2187
2361
|
self.saving_jpg = not self.saving_jpg
|
2188
2362
|
self.saving_all = False
|
2189
2363
|
if self.saving_jpg:
|
2190
2364
|
print(f"i... {fg.green}SAVING_JPG set to {self.saving_jpg}{fg.default} (interval is {self.FITS_INTERVAL_SECONDS}) ; but 'SAVING_all' SET TO ", self.saving_all)
|
2191
2365
|
else:
|
2192
2366
|
print(f"i... {fg.orange}PNG!{fg.default} SAVING_JPG set to {fg.cyan}{self.saving_jpg}{fg.default} (interval is {self.FITS_INTERVAL_SECONDS}) ; but 'SAVING_all' SET TO ", self.saving_all)
|
2367
|
+
elif (parts_set == {'Alt'}) :
|
2368
|
+
# FITS / JPEG saving !!!
|
2369
|
+
self.saving_fits_only = not self.saving_fits_only
|
2370
|
+
self.saving_all = False
|
2371
|
+
if self.saving_fits_only:
|
2372
|
+
print(f"i... {fg.orange}FITS_ONLY set to {self.saving_fits_only}{fg.default} (interval is {self.FITS_INTERVAL_SECONDS}) ; but 'SAVING_all' SET TO ", self.saving_all)
|
2373
|
+
else:
|
2374
|
+
print(f"i... FITS_ONLY set to {fg.cyan}{self.saving_fits_only}{fg.default} (interval is {self.FITS_INTERVAL_SECONDS}) ; but 'SAVING_all' SET TO ", self.saving_all)
|
2375
|
+
|
2376
|
+
|
2193
2377
|
|
2194
|
-
#
|
2378
|
+
# ------------------------------ xtend x2 ot switchres resolution--- x XRES SWITCH - REMOTE - **SEND_COMMAND**
|
2195
2379
|
if (key == Qt.Key.Key_X):
|
2196
2380
|
if ( len(parts_set) == 0):
|
2197
2381
|
self.xtended = not self.xtended
|
@@ -2209,7 +2393,7 @@ class StreamWidget(QLabel):
|
|
2209
2393
|
self.send_command( data={"switch_res_off": "SWITCH_RES_OFF"})
|
2210
2394
|
print("D.... r_xtend == ' ' <<======== ", self.r_xtend)
|
2211
2395
|
|
2212
|
-
# ----------------------------------------------------------------- p printout
|
2396
|
+
# ----------------------------------------------------------------- p printout - LOCAL ONLY
|
2213
2397
|
if (key == Qt.Key.Key_P):
|
2214
2398
|
if ( len(parts_set) == 0):
|
2215
2399
|
self.flag_print = not self.flag_print
|
@@ -2220,7 +2404,7 @@ class StreamWidget(QLabel):
|
|
2220
2404
|
print(f"i... overtext: {self.flag_print_over}")
|
2221
2405
|
elif (parts_set == {'Ctrl'}) :
|
2222
2406
|
pass
|
2223
|
-
# ----------------------------------------------------------------- e expo
|
2407
|
+
# ----------------------------------------------------------------- e expo - REMOTE ONLY ! **SEND_COMMAND**
|
2224
2408
|
if (key == Qt.Key.Key_E):
|
2225
2409
|
if ( len(parts_set) == 0):
|
2226
2410
|
if self.r_expo < 1.0: self.r_expo += 0.02
|
@@ -2236,7 +2420,7 @@ class StreamWidget(QLabel):
|
|
2236
2420
|
self.send_command( data= {"expot": "EXPOT", "expotxt": -1.0} )
|
2237
2421
|
self.r_expodef = True
|
2238
2422
|
|
2239
|
-
# ----------------------------------------------------------------- g gain
|
2423
|
+
# ----------------------------------------------------------------- g gain - REMOTE ONLY ! **SEND_COMMAND**
|
2240
2424
|
if (key == Qt.Key.Key_G):
|
2241
2425
|
if ( len(parts_set) == 0):
|
2242
2426
|
if self.r_gain < 1.0: self.r_gain += 0.1
|
@@ -2256,7 +2440,7 @@ class StreamWidget(QLabel):
|
|
2256
2440
|
# self.send_command( data= {"gain05": "GAIN05"})
|
2257
2441
|
#elif (parts_set == {'Ctrl'}) :
|
2258
2442
|
# self.send_command( data= {"gain": "GAIN"} )
|
2259
|
-
# ----------------------------------------------------------------- y gamma
|
2443
|
+
# ----------------------------------------------------------------- y gamma - REMOTE ONLY ! **SEND_COMMAND**
|
2260
2444
|
if (key == Qt.Key.Key_Y):
|
2261
2445
|
if ( len(parts_set) == 0):
|
2262
2446
|
if self.r_gamma < 1.0: self.r_gamma += 0.1
|
@@ -2277,7 +2461,7 @@ class StreamWidget(QLabel):
|
|
2277
2461
|
# self.send_command( data= {"gamma05": "GAMMA05"})
|
2278
2462
|
#elif (parts_set == {'Ctrl'}) :
|
2279
2463
|
# self.send_command( data= {"gamma": "GAMMA"} )
|
2280
|
-
# ----------------------------------------------------------------- d local gamma
|
2464
|
+
# ----------------------------------------------------------------- d local gamma - LOCAL ONLY
|
2281
2465
|
if (key == Qt.Key.Key_D):
|
2282
2466
|
if ( len(parts_set) == 0):
|
2283
2467
|
self.l_gamma = self.l_gamma * 1.4
|
@@ -2286,7 +2470,7 @@ class StreamWidget(QLabel):
|
|
2286
2470
|
elif (parts_set == {'Ctrl'}) :
|
2287
2471
|
self.l_gamma = 1
|
2288
2472
|
|
2289
|
-
# ----------------------------------------------------------------- w
|
2473
|
+
# ----------------------------------------------------------------- w - Web Browser - LOCAL ONLY
|
2290
2474
|
if (key == Qt.Key.Key_W):
|
2291
2475
|
if ( len(parts_set) == 0):
|
2292
2476
|
webbrowser.open(self.url.replace("/video", "")) # BRUTAL
|
@@ -2294,7 +2478,7 @@ class StreamWidget(QLabel):
|
|
2294
2478
|
pass
|
2295
2479
|
elif (parts_set == {'Ctrl'}) :
|
2296
2480
|
pass
|
2297
|
-
# ----------------------------------------------------------------- z
|
2481
|
+
# ----------------------------------------------------------------- z - ZOOM - LOCAL ONLY !
|
2298
2482
|
if (key == Qt.Key.Key_Z):
|
2299
2483
|
if ( len(parts_set) == 0):
|
2300
2484
|
self.zoomme *= 1.5
|
@@ -2306,7 +2490,7 @@ class StreamWidget(QLabel):
|
|
2306
2490
|
if self.zoomme < 1: self.zoome= 1
|
2307
2491
|
elif (parts_set == {'Ctrl'}) :
|
2308
2492
|
self.zoomme = 1
|
2309
|
-
# ----------------------------------------------------------------- hjkl
|
2493
|
+
# ----------------------------------------------------------------- hjkl - H - **SEND_COMMAND** c-s-*
|
2310
2494
|
# self.send_command( data={"right": "RIGHT"})
|
2311
2495
|
if (key == Qt.Key.Key_H):
|
2312
2496
|
if ( len(parts_set) == 0):
|
@@ -2320,7 +2504,7 @@ class StreamWidget(QLabel):
|
|
2320
2504
|
if self.r_xtend[0] == "R": self.r_xtend = "C" + self.r_xtend[1:]
|
2321
2505
|
elif self.r_xtend[0] == "C": self.r_xtend = "L" + self.r_xtend[1:]
|
2322
2506
|
elif self.r_xtend[0] == " ": self.r_xtend = "L" + self.r_xtend[1:]
|
2323
|
-
# ----------------------------------------------------------------- hjkl
|
2507
|
+
# ----------------------------------------------------------------- hjkl - J **SEND_COMMAND** c-s-*
|
2324
2508
|
if (key == Qt.Key.Key_J):
|
2325
2509
|
if ( len(parts_set) == 0):
|
2326
2510
|
self.redcross[1] += 4 # DOWN
|
@@ -2333,7 +2517,7 @@ class StreamWidget(QLabel):
|
|
2333
2517
|
if self.r_xtend[1] == "U": self.r_xtend = self.r_xtend[:1] + "C"
|
2334
2518
|
elif self.r_xtend[1] == "C": self.r_xtend = self.r_xtend[:1] + "D"
|
2335
2519
|
elif self.r_xtend[1] == " ": self.r_xtend = self.r_xtend[:1] + "D"
|
2336
|
-
# ----------------------------------------------------------------- hjkl
|
2520
|
+
# ----------------------------------------------------------------- hjkl - K **SEND_COMMAND** c-s-*
|
2337
2521
|
if (key == Qt.Key.Key_K):
|
2338
2522
|
if ( len(parts_set) == 0):
|
2339
2523
|
self.redcross[1] -= 4 # UP
|
@@ -2346,7 +2530,7 @@ class StreamWidget(QLabel):
|
|
2346
2530
|
if self.r_xtend[1] == "D": self.r_xtend = self.r_xtend[:1] + "C"
|
2347
2531
|
elif self.r_xtend[1] == "C": self.r_xtend = self.r_xtend[:1] + "U"
|
2348
2532
|
elif self.r_xtend[1] == " ": self.r_xtend = self.r_xtend[:1] + "U"
|
2349
|
-
# ----------------------------------------------------------------- hjkl
|
2533
|
+
# ----------------------------------------------------------------- hjkl - L **SEND_COMMAND** c-s-*
|
2350
2534
|
if (key == Qt.Key.Key_L):
|
2351
2535
|
if ( len(parts_set) == 0):
|
2352
2536
|
self.redcross[0] += 4
|
@@ -2359,7 +2543,7 @@ class StreamWidget(QLabel):
|
|
2359
2543
|
if self.r_xtend[0] == "L": self.r_xtend = "C" + self.r_xtend[1:]
|
2360
2544
|
elif self.r_xtend[0] == "C": self.r_xtend = "R" + self.r_xtend[1:]
|
2361
2545
|
elif self.r_xtend[0] == " ": self.r_xtend = "R" + self.r_xtend[1:]
|
2362
|
-
# ----------------------------------------------------------------- v GREEN CROSS
|
2546
|
+
# ----------------------------------------------------------------- v GREEN CROSS - REMOTE **SEND_COMMAND**
|
2363
2547
|
if (key == Qt.Key.Key_V):
|
2364
2548
|
if ( len(parts_set) == 0):
|
2365
2549
|
self.send_command( data= {"crosson": "CROSSON"} )
|
@@ -2368,7 +2552,7 @@ class StreamWidget(QLabel):
|
|
2368
2552
|
pass
|
2369
2553
|
elif (parts_set == {'Ctrl'}) :
|
2370
2554
|
self.send_command( data= {"crossoff": "CROSSOFF"} )
|
2371
|
-
# ----------------------------------------------------------------- c RED CROSS
|
2555
|
+
# ----------------------------------------------------------------- c RED CROSS - LOCAL ONLY
|
2372
2556
|
if (key == Qt.Key.Key_C):
|
2373
2557
|
if ( len(parts_set) == 0):
|
2374
2558
|
self.flag_redcross = True# not self.flag_redcross
|
@@ -2379,8 +2563,8 @@ class StreamWidget(QLabel):
|
|
2379
2563
|
elif (parts_set == {'Ctrl'}) :
|
2380
2564
|
print( "i... reset position red cross")
|
2381
2565
|
self.redcross = [0, 0]
|
2382
|
-
# ----------------------------------------------------------------- i integrate accumulate
|
2383
|
-
if (key == Qt.Key.Key_I): # i shift-i
|
2566
|
+
# ----------------------------------------------------------------- i integrate accumulate - LOCAL ONLY ! tricky**SEND_COMMAND**
|
2567
|
+
if (key == Qt.Key.Key_I): # i:inc shift-i:dec Ctrl-i:reset Ctrl-Shift-i:watch Alt-i: SUM vs. AVG
|
2384
2568
|
# 4.6GB / 1000 640x480
|
2385
2569
|
if ( len(parts_set) == 0):
|
2386
2570
|
if self.r_integrate < 8:
|
@@ -2408,32 +2592,65 @@ class StreamWidget(QLabel):
|
|
2408
2592
|
elif (parts_set == {'Ctrl'}) :
|
2409
2593
|
self.r_integrate = 1
|
2410
2594
|
self.send_command( data= {"accum": "ACCUM", "accumtxt": 0})
|
2595
|
+
self.l_show_accum = False
|
2411
2596
|
# 0 would be a problem (locally???); but 1 is not sent!!! ; SENDING 0, checking@send_command
|
2412
2597
|
elif (parts_set == {'Ctrl', 'Shift'}) :
|
2598
|
+
# REMOVE SHOW ACCUM .... ok but I remove it also when reseting buffer
|
2413
2599
|
self.l_show_accum = not self.l_show_accum
|
2414
|
-
print(f"i...
|
2600
|
+
print(f"i... BUFFER ACCUMULATED SHOW IS {self.l_show_accum} ; MODE AVG={self.l_show_accum_avg} MODE SUM = {not self.l_show_accum_avg}")
|
2415
2601
|
elif (parts_set == {'Alt'}) :
|
2416
2602
|
self.l_show_accum_avg = not self.l_show_accum_avg
|
2417
|
-
print(f"i... ACCUMULATION AVG
|
2603
|
+
print(f"i... ACCUMULATION DISPLAY MODE SWITCHED: AVG (nonSUM) IS {self.l_show_accum_avg}")
|
2418
2604
|
|
2419
|
-
# ----------------------------------------------------------------- b
|
2605
|
+
# ----------------------------------------------------------------- b BACKGROUND - REMOTE **SEND_COMMAND**
|
2420
2606
|
if (key == Qt.Key.Key_B):
|
2421
2607
|
if ( len(parts_set) == 0):
|
2422
|
-
self.send_command( data= {"subbg": "SUBBG"})
|
2608
|
+
#self.send_command( data= {"subbg": "SUBBG"})
|
2609
|
+
fname1 = self.prepare_save( time_tag=None)
|
2610
|
+
#print(fg.green, f"D... looking for like {fname1}", fg.default)
|
2611
|
+
bgfilename, copyname= find_latest_bg_or_fg(fname1, foreground=False)
|
2612
|
+
self.filename_background = copyname
|
2613
|
+
if os.path.exists(self.filename_background):
|
2614
|
+
print(f"{fg.green}D... BG= {self.filename_background}", fg.default)
|
2615
|
+
self.image_background = cv2.imread(self.filename_background)
|
2616
|
+
pass
|
2423
2617
|
elif (parts_set == {'Shift'}) :
|
2424
|
-
self.
|
2618
|
+
fname1 = self.prepare_save( time_tag=None)
|
2619
|
+
#print(fg.green, f"D... looking for like {fname1}", fg.default)
|
2620
|
+
bgfilename, copyname= find_latest_bg_or_fg(fname1, foreground=False)
|
2621
|
+
if not bgfilename is None:
|
2622
|
+
print(f"{fg.green}D... copying:", bgfilename, copyname, fg.default)
|
2623
|
+
shutil.copy(bgfilename, copyname)
|
2624
|
+
#self.send_command( data= {"savebg": "SAVEBG"})
|
2625
|
+
pass
|
2425
2626
|
elif (parts_set == {'Ctrl'}) :
|
2627
|
+
self.filename_background = None
|
2628
|
+
self.image_background = None
|
2426
2629
|
pass
|
2427
|
-
# -----------------------------------------------------------------
|
2630
|
+
# ----------------------------------------------------------------- f FOREGROUND - LOCAL ONLY !
|
2428
2631
|
if (key == Qt.Key.Key_F):
|
2429
2632
|
if ( len(parts_set) == 0):
|
2430
|
-
self.send_command( data= {"mixfg": "MIXFG"})
|
2633
|
+
#self.send_command( data= {"mixfg": "MIXFG"})
|
2634
|
+
fname1 = self.prepare_save( time_tag=None)
|
2635
|
+
bgfilename, copyname= find_latest_bg_or_fg(fname1, foreground=True)
|
2636
|
+
self.filename_foreground = copyname
|
2637
|
+
if os.path.exists(self.filename_foreground):
|
2638
|
+
print(f"{fg.green}D... FG= {self.filename_foreground}", fg.default)
|
2639
|
+
self.image_foreground = cv2.imread(self.filename_foreground)
|
2431
2640
|
elif (parts_set == {'Shift'}) :
|
2432
|
-
self.send_command( data= {"savefg": "SAVEFG"})
|
2641
|
+
#self.send_command( data= {"savefg": "SAVEFG"})
|
2642
|
+
fname1 = self.prepare_save( time_tag=None)
|
2643
|
+
#print(fg.green, f"D... looking for like {fname1}", fg.default)
|
2644
|
+
bgfilename, copyname= find_latest_bg_or_fg(fname1, foreground=True)
|
2645
|
+
if not bgfilename is None:
|
2646
|
+
print(f"{fg.green}D... copying:", bgfilename, copyname, fg.default)
|
2647
|
+
shutil.copy(bgfilename, copyname)
|
2433
2648
|
elif (parts_set == {'Ctrl'}) :
|
2649
|
+
self.filename_foreground = None
|
2650
|
+
self.image_foreground = None
|
2434
2651
|
pass
|
2435
2652
|
|
2436
|
-
# ----------------------------------------------------------------- r
|
2653
|
+
# ----------------------------------------------------------------- r ROTATE - LOCAL ONLY !
|
2437
2654
|
if (key == Qt.Key.Key_R):
|
2438
2655
|
if ( len(parts_set) == 0):
|
2439
2656
|
self.l_rotate += 1
|
@@ -2441,7 +2658,7 @@ class StreamWidget(QLabel):
|
|
2441
2658
|
self.l_rotate -= 1
|
2442
2659
|
elif (parts_set == {'Ctrl'}) :
|
2443
2660
|
self.l_rotate = 0
|
2444
|
-
# ----------------------------------------------------------------- 1
|
2661
|
+
# ----------------------------------------------------------------- 1 config
|
2445
2662
|
if (key == Qt.Key.Key_1) or (key == ord("!") ):
|
2446
2663
|
if ( len(parts_set) == 0):
|
2447
2664
|
print("i... config 1 - recall")
|
@@ -2457,7 +2674,7 @@ class StreamWidget(QLabel):
|
|
2457
2674
|
print("D... r_xtend == ", self.r_xtend)
|
2458
2675
|
elif (parts_set == {'Ctrl'}) :
|
2459
2676
|
self.setup("q")
|
2460
|
-
# ----------------------------------------------------------------- 2
|
2677
|
+
# ----------------------------------------------------------------- 2 config
|
2461
2678
|
if (key == Qt.Key.Key_2) or (key == ord("@") ):
|
2462
2679
|
if ( len(parts_set) == 0):
|
2463
2680
|
print("i... config 2 - recall")
|
@@ -2469,7 +2686,7 @@ class StreamWidget(QLabel):
|
|
2469
2686
|
self.setup("w", 2)
|
2470
2687
|
elif (parts_set == {'Ctrl'}) :
|
2471
2688
|
self.setup("q")
|
2472
|
-
# ----------------------------------------------------------------- 3
|
2689
|
+
# ----------------------------------------------------------------- 3 config
|
2473
2690
|
if (key == Qt.Key.Key_3) or (key == ord("#") ):
|
2474
2691
|
if ( len(parts_set) == 0):
|
2475
2692
|
print("i... config 3 - recall")
|
@@ -2481,7 +2698,7 @@ class StreamWidget(QLabel):
|
|
2481
2698
|
self.setup("w", 3)
|
2482
2699
|
elif (parts_set == {'Ctrl'}) :
|
2483
2700
|
self.setup("q")
|
2484
|
-
# ----------------------------------------------------------------- 4
|
2701
|
+
# ----------------------------------------------------------------- 4 config
|
2485
2702
|
if (key == Qt.Key.Key_4) or (key == ord("$") ):
|
2486
2703
|
if ( len(parts_set) == 0):
|
2487
2704
|
print("i... config 4 - recall")
|
@@ -2495,7 +2712,7 @@ class StreamWidget(QLabel):
|
|
2495
2712
|
self.setup("q") # quit-resetall
|
2496
2713
|
|
2497
2714
|
|
2498
|
-
# -----------------------------------------------------------------
|
2715
|
+
# ----------------------------------------------------------------- [ ] tests whatever
|
2499
2716
|
if (key == Qt.Key.Key_T):
|
2500
2717
|
if ( len(parts_set) == 0):
|
2501
2718
|
#self.send_command( data= {"gaint": "GAINT", "gaintxt": float(0.123)})
|
@@ -2508,7 +2725,31 @@ class StreamWidget(QLabel):
|
|
2508
2725
|
elif (parts_set == {'Ctrl'}) :
|
2509
2726
|
#self.send_command( data= {"expot": "EXPOT", "expotxt": float(-1.0)})
|
2510
2727
|
pass
|
2511
|
-
|
2728
|
+
|
2729
|
+
# ----------------------------------------------------------------- [ ] tests whatever A timelaps LOCAL
|
2730
|
+
if (key == Qt.Key.Key_A):
|
2731
|
+
if ( len(parts_set) == 0):
|
2732
|
+
self.l_timelaps = True
|
2733
|
+
if self.l_timelaps_seconds == 0:
|
2734
|
+
self.l_timelaps_seconds = 1
|
2735
|
+
else:
|
2736
|
+
self.l_timelaps_seconds = self.l_timelaps_seconds * 2
|
2737
|
+
self.l_timelaps_last = dt.datetime.now()- dt.timedelta(seconds=self.l_timelaps_seconds)
|
2738
|
+
pass
|
2739
|
+
elif (parts_set == {'Shift'}) :
|
2740
|
+
if self.l_timelaps_seconds > 1:
|
2741
|
+
self.l_timelaps_seconds = int(self.l_timelaps_seconds / 2)
|
2742
|
+
else:
|
2743
|
+
self.l_timelaps_seconds = 1
|
2744
|
+
self.l_timelaps_last = dt.datetime.now()- dt.timedelta(seconds=self.l_timelaps_seconds)
|
2745
|
+
pass
|
2746
|
+
elif (parts_set == {'Ctrl'}) :
|
2747
|
+
self.l_timelaps = False
|
2748
|
+
print(f"{fg.cyan}i... NO TIMELAPS from now {fg.default}")
|
2749
|
+
pass
|
2750
|
+
elif (parts_set == {'Alt'}) :
|
2751
|
+
pass
|
2752
|
+
# ----------------------------------------------------------------- t tests whatever REMOTE ! **SEND_COMMAND**
|
2512
2753
|
if (key == Qt.Key.Key_T):
|
2513
2754
|
if ( len(parts_set) == 0):
|
2514
2755
|
# THIS IS in reallity SKIPPED IN send_command ....
|
@@ -1,11 +1,11 @@
|
|
1
1
|
pogucam/__init__.py,sha256=Iij7VvXCrFPMtTia41mQ7LxFLaulf_fD5cb-AyjpUo0,53
|
2
2
|
pogucam/buffers.py,sha256=1JLkuenkHoA-K-uZAlNV7chHQDZLrspgT5_XOY-E-34,6692
|
3
|
-
pogucam/explore_u24_uni.py,sha256=
|
3
|
+
pogucam/explore_u24_uni.py,sha256=y0YmH_RLhtSlHv3i6g-PvvKeTd1Yx0dylTulncFlSO0,134104
|
4
4
|
pogucam/installation.md,sha256=8qspiLlYjEBx5CedRfBU7Mm0A2pz0lfAnaupZyBm5Eo,128
|
5
5
|
pogucam/mqimr.py,sha256=f48gTXng5vM-1RiNPXSA-IvAc3y6WMStbvfQ8rUV7l0,1727
|
6
6
|
pogucam/mqims.py,sha256=_G8AdfrbTrkIm2MOsq3tFOBYpiD4o58JUIvnZt0Sm7A,3293
|
7
7
|
pogucam/text_write.py,sha256=hyRyA1M5z-pda963T-k0i8fvvAlv1p3YBTZtYNdOeoE,19304
|
8
|
-
pogucam-0.1.
|
9
|
-
pogucam-0.1.
|
10
|
-
pogucam-0.1.
|
11
|
-
pogucam-0.1.
|
8
|
+
pogucam-0.1.15.dist-info/METADATA,sha256=5TiiypRFdtco8r3Rg1m76MXhsh07vIdK3QrsPQxdX_w,499
|
9
|
+
pogucam-0.1.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
10
|
+
pogucam-0.1.15.dist-info/entry_points.txt,sha256=-97N0LsXIR8h0rJMzIMuNeNwuY8LvPYPTqnXsuAnVsM,63
|
11
|
+
pogucam-0.1.15.dist-info/RECORD,,
|
File without changes
|
File without changes
|