===============================================================================================================
                                               VERSION HISTORY
===============================================================================================================
				use of colorID from AS! session file

tbd:	ImpactMinTime vs min frames vs incrimpact frames
tbd:	Interval for checking other files processed + check nbinstances first!



v3.9.0 (Detection algorithm improved, multi-instances mode dynamic (using CPU and RAM usage), all files rejected during analysis are now logged, , bugfixes (progress bars, fatal errors))
Algo:			Confidence min corrected
Algo:			Correction impact radius calculation, parameters in advanced settings
Log:			Logs as error rejected files during ROI/frames analysis
Instances:		Changes from definition of max instances to choice of different level of resource usages (min, low, medium, high, max)
Instances:		Reduces if needed number of instances to ensure min of RAM always available
Instances:		Reduces if needed number of instances to ensure min of CPU always available
Instances:		Exits DeTeCt child instance if parent not running
Bugfix:			Displays correct progress bars
Bugfix:			Long name rename : deactivation of warning popup window blocking (Lee Keith)
Bugfix:			Timeout for csv dir creation and renaming detect files
Bugfix:			Fatal error when cv::destroyWindow a non existent window
Bugfix::		Correction of advanced settings window settings
Dev:			Set null pointer after free
Dev:			Use of str(n)cpy_s and str(n)cat_s
Dev:			Detection of developper version to use specific configuration (eg no zip file)

--------------------------------------------------------------------------------------
v3.8.0 (bugfix integration with AutoStakkert!4, introduction of OpenCL)
Autostakkert:	Info in log if launched from AS!
OpenCL:			Check if available
OpenCL:			First easy migrations from Mat to UMat
GUI:			select folder button more understandable
GUI:			instances "running" display
Bugfix:			Space in full filename handling in AutoStakkert! session file
Bugfix:			Bugfix security factor spin button
--------------------------------------------------------------------------------------
v3.7.3 (integration with Autostakkert 4)
Autostakkert:	Integration with Autostakkert 4
Autostakkert:	Force autoprocessing, no reprocessing and single instance in Autostakkert mode
Autostakkert:	Backup and restore interactive, reprocessing and maxinstances values from/for normal standalone mode
Autostakkert:	Check updates when exiting (because deactivated when starting)
GUI:			Deactivate at startup intermediate save of frames for identifying candidate event
GUI:			Harmonize advanced/development settings menu/window naming
Bugfix:			Test of ffmpeg dll on full pathname instead of short filename
Bugfix:			Correct final progressbar in single instance mode
--------------------------------------------------------------------------------------
v3.7.2 (Rejection of bad frames, planet in zip filename, logs)
Alignement:		Rejection of bad frames (using similarity change over frames)
GUI:			Ignore incorrect frames default on
GUI:			Description in user settings about flat preparation image and send email not working with webmails
Log:			Planet name in zip filename
Log:			Log of all rejected frames in output file, display of quantity and type of rejected frames
--------------------------------------------------------------------------------------
v3.7.1 (Improvement of ROI and alignment)
ROI:			ROI min size changed to 68x68 pixels
				Detection of background from histogram
				Removal of background for ROI sizing and alignment
GUI:			Advanced settings : limits defined for all parameters
Bugfix:			Autoupdate: download of mandatory dll(s) before updating exe
Bugfix:			Set maxinstances back to 1 (was set to 12)
--------------------------------------------------------------------------------------
v3.7.0 (Autoupdate fix and extension to handle dlls, migration to openCV 4.6.0 / C++, bugfixes incl. Uranus-C raw videos reading)
Autoupdate:		Pop-up windows to inform about update ongoing and done
				Implementation of dll files changes handling
				Explicit message when update not possible (exe filename)
				Rerun configuration updates function (entry in help menu)
Dev:			All code but external modules compiled in C++ (incl. IplImage migration to Mat)
				Migration to openCV 4.6.0 and associated ffmpeg dll
GUI:			(c) till 2023
Buffix:			Reading of Uranus-C raw avi video (A. Frantzis) - fixed by openCV update
Bugfix:			Automatic relaunch after Autoupdate not working (fix WndResizer bug (null pointer not detected))
Bugfix:			#of files to be processed when fileprocessing interrupted because ROI too small
Bugfix:			bMat usage still activated
--------------------------------------------------------------------------------------
v3.6.2
Detection:		Speed improvement (~60%) in multi instances mode (processing bigger acquisitions first)
Files:			Improvement of numbering detection in filename
GUI:			Improvement of selection/processing interface
Log:			Sort detect.log per fullpath filename
Log:			Format PID # (0*)
Bugfix:			Rating in detection images filenames
Bugfix:			Datation if PIPP capture exists and has 1 frame
Bugfix:			1/01/03->0001/01/03 for invalid date in log (allows sorting)
Dev:			IDE moved to VS2022
--------------------------------------------------------------------------------------
v3.6.1
GUI:			eco logo, wording for auto exit/shutdown
Bugfix:			Default value for impact minimum confidence
Bugfix:			Renaming mean and max-mean files (provoking exit before log done) (S. Walsh)
--------------------------------------------------------------------------------------
v3.6.0
Detection:		PIPP support: look for integrity to analyze PIPP file (usage of options info in log file)
Datation:		Additionnal support for:
					IC Capture				YY-MM-DD hh-mm-ss
					wxAstroCapture			YYYYMMDD_hhmm_ss
					WinJupos old filenames (YYYY-MM-DD-hhmm[_,.]t)
					FireCapture1			YYYYMMDD_hhmmss
					FireCapture2			DDMMYY_hhmmss
					SharpCap				DD_MM_YYYY hh_mm_ss
Datation:		Looks for datation info anywhere in filename (S. Walsh)
Datation:		Better handling of timezone/UT/LT
Selection:		Ignores frames files generated by DeTeCt
Selection:		support for numbered files without "-", "_", "." around number
Misc:			Warning window if opencv_ffmpeg dll not found (prevents from decoding mp4, mov, avi etc... files)
Email:			Probabilities format in subject corrected
GUI:			Additional info for some options
ROI:			Number of frames is 15 by default (was 1)
Bugfix:			Removes unnecessary exit on failure
Bugfix:			No crash when acquisition video not readable/not present anymore (A. Frantzis)
Bugfix:			Better handling of acquisitions without any valid frame
Bugfix:			No processing of files with *1, *10-*19 in filename when *0 or *1 found
Debug:			Relevant messages in popup windows for errors, and dedicated warnings and errors logged
Debug:			Additional log in output for zip file creation debug
--------------------------------------------------------------------------------------
v3.5.1: Algorithm improvement (% of frame for impact candidate), user settings separated from advanced settings, option to (de)activate detection/mean image during processing (M. Lewis), bugfixes
GUI:			User and advanced/dev. settings separate windows
				Entry "Update to latest version" in the Help menu to update manually
				Entry "Versions history" in the Help menu (opens github releases page)
User Settings:	Option to show/not show detection image (Martin)
				Option to show/not show mean image
				Show mean/detection images without any time limit (speeds up processing)
				preflat image generation option (not saved in ini file)
				dateonly option not saved (one time action)
Adv. Settings:	Debug option in adv. parameters (not saved in ini file)
				Zip option moved to dev. section
				(pre)clean directory checkbox in dev. parameters (one time action)
Algorithm:		30% factor of frames in impact candidate (adapted after bugfix)
Logs:			DeTeCt version and ini file at begining of output log
Bugfix:			High probability rating qualification
				MP4 file selection
--------------------------------------------------------------------------------------
v3.5.0 (=v3.4.3.0)
Detection:		Distance calculation now relative to size of ROI (withdrawing security factor)
				Impact_distance_max=3%		(tuning for 2021.09.13 impact)
				Impact_duration_min=0.4s	(tuning for 2020.08.11 impact)
ROI:			ROI min size = 70
Files:			MP4, MOV support
Email:			Error-null/low/high # info
Log:			Header and value field size fixed for better readability
				Size of ROI logged
Autoupdate:		Change parameters in .ini after update if needed
--------------------------------------------------------------------------------------
v3.4.2.0
Logs:			SharpCap and ASICap new versions settings better support
--------------------------------------------------------------------------------------
v3.4.1.0
Email:			Add detect version in email
Detection:		*Do not save detection original images not stretched (max-mean2, mean2, diff2) - saves 50% storage
Logs:			*SharpCap 3.2 (=future date/frame fields) support
Logs:			*ASICap 1.5 support
Logs:			log additional info from analysis (sampling, noise, aso.)
GUI:			About: Gemini price
GUI:			About: supported acquisition softwares
Bugfix:			*Logs: Multi-instances files missed (total rewrite of queuefile management)
Bugfix:			Logs: Simultaneous instances writing in output.log / detect.log
Bugfix:			Instances: Freeze of processing time in multi-instance mode (refresh of display when getting processed files)
Bugfix:			*Logs: No capture info for avi acquisitions
Bugfix:			Logs: Bad Binning and sensor temperature capture info
Bugfix:			Autoupdate: Incorrect messages when new DeTeCt version not found on server
Bugfix:			Read access error opt variable
Development:	Code Analysis check
--------------------------------------------------------------------------------------
v3.4.0
Functions:
General:		*Autoupdate function (not effective in autostakkert/child mode)
General:		Clean impact files/directories function
General:		*No reprocessing option/parameter to skip processing files already in DeTeCt log
General:		*Unique and consolidated log in root directory in multicore mode
General:		Executable file properties updated
Logs:			Both central log and session log (with detailed filename) stored in root directory
Logs:			*include impact rating in filename or folder (Salma)
Logs:			Creation of log name with all instances data
Logs:			*Log additional info from FireCapture log (camera, filters, aso.)
Logs:			*Use profile field from FireCapture to determine planet type
dateonly:		do not zip / send email if dateonly mode

Bugfixes:
Datation:		*Correction of bug for avi files
General:		Closure when no file selected and auto processing on
Autostakkert:	Noreprocessing check of .as3 when video already processed (:tolower)
Autostakkert:	No reprocessing by default
Autostakkert:	Children windows not exited when file not to be processed (bugfix)
Autostakkert:	Total file counter in parent window (bugfix)
Autostakkert:	Hide children window
Autostakkert:	No auto exit when autostakkert single instance (bugfix)
Autostakkert:	No auto exit when autostakkert mode (bugfix)
Autostakkert:	Unique zip from Autostakkert in DeTeCt directory (bugfix)
Autostakkert:	Optimization of IsProcessRunning test

Dev:
General:		Migration to Visual Studio 19
General:		Code warnings cleaning and small corrections (e.g. types/casts)
General:		Check of latest staticlib version of opencv used
Bugfix:			correction of m_hIcon bug visible in debug version
--------------------------------------------------------------------------------------
v3.3.0
Detection:		Probability+frame in detection images filename for easier analysis (S.Sylla)
General:		Optimizing processing time (forks, instances count)
--------------------------------------------------------------------------------------
v3.2.4
Options:		Details not by default, moved to processing section in GUI
Command:		Option for flat preparation image (max of not aligned trames)
Bugfix:			Code to close all opened streams, files and captures (C.Foster)
--------------------------------------------------------------------------------------

v3.2.3
-----------------------------
General:		Allows to select another folder/file for new detection when previous detection done
General:		Options to process, to exit, to shutdown PC automatically
Documentation:	New guide under github management
Log:			Writes parameters from ini file in output log
Files:			16b (and automatic detection 1 to 16b) support for files/fits
Exit:			Kill children instances, cross working
GUI:			General execution full log in parent/child instance mode
GUI:			Lighter interface in non debug mode
GUI:			Optimized design
GUI:			Direct select folder / file buttons + checkbox automatic mode
GUI:			improvment of windows refreshes
GUI:			display duration processed total (parent) or instance
GUI:			display "probability" total (parent) or instance (child)
GUI:			display computing time total: total (parent) or instance
GUI:			Activate button/menu only when needed
GUI:			Email dialog removed, moves messages to principal window
GUI:			Total computing time incl. waiting time displayed
GUI:			Delete process queue on exit / reset list
GUI:			Detect impacts button, zip and detection images links enabled only when relevant
GUI:			Zipfile, image detection folder and detection log links
Instances:		Disable Restart manager (m_dwRestartManagerSupportFlags)
Instances:		Display # of instances running / max instances
Instances:		Attempt to fork when new processed file
Instances:		Check children instances for forks
Instances:		Multi-instances DeTeCt mode with central log, launching automaticaly child instances
Instances:		Blockers on access and depending on the state of processing
Autostakkert/
Instances:		Waiting message
Autostakkert:	Implement "stop waiting" option to exit
Autostakkert:	Identified Autostakkert launching from PID, process queue file with this PID
Postprocessing:	scripts under github management
Bugfix:			Options not dynamic during detection
Bugfix:			Incorrect display of total number of files
Bugfix:			Controls init too early before creation of dialog
Bugfix:			-auto automatically exits when processing is done
Bugfix:			Correct count of files to be processed in multi-instance mode
Bugfix:			Output generation (multi-instance mode)
BugFix:			Close handle kill process corrected
Bugfix:			Progress bar when # frames > SHRT_MAX
Bugfix:			Reset list does not remove queue
Bugfix:			Activation of execution from autostakkert button
Bugfix:			Reset probabilities after open
Bugfix:			Datation with old version of LucamRecorder
Bugfix:			Filecapture double structure definition
--------------------------------------------------------------------------------------
v3.2.2
Autostakkert:	wait for autostakkert to exit before finishing processings (zip, aso...)
Autostakkert:	Store impact detection folder and general logs within DeTeCt.exe folder
Autostakkert:	use as3 file for processing queue (to compute faster)
Algorithm:		red cross changed to yellow, Green to blue to see them better, and be color blind compliant (M. Lewis)
Logs:			do not zip / send email if no file has been processed
Logs:			renames logs with date-time min and max
Files:			do not add processed file (if -noreproc on) / file with too few frames / file with type to be ignored (dark, ...) to the processing list
WinJupos:		Reads xml derot configuration file
GUI:			Full interface with small logs
GUI:			Global progress bar
GUI:			Shows live # of null/low/high probability impacts processed
GUI:			Reset file list menu
GUI:			parent/child instance and call from AS
Bugfix:			do not launch several DeTeCt instances if maxinstances = 1 even in non auto mode
Bugfix:			in automatic mode, exits if no valid file selected
Options:		Reads options from ini before interpreting command line options
General			Displays number of processors
Command:		add shorter names for all command line options
--------------------------------------------------------------------------------------
v3.2.1
Detection:	rename output files with planet and dates of analysis
Detection:  button to opens explorer in the detection folder (systematic), on the zip file (depending on the generation), and send email (by default, but deactivable)
Detection:  messages in the final window to synthetize the resuts (no impact, low probablity, high probability)
Detection:  messages in the final window to push for analyzing images and sending email with zipfile
Parameters:	options to generate zip file and send email
Logs:		store .csv separately (S. Sylla)
Command line:-nozip option
Bugfix:		zip file empty in automatic mode (L.Keith)
Bugfix:		zip file empty when relative path use as parameter for directory or file
Bugfix:		*.exe file tested when detect exe launched without the upper cases
Bugfix:		accents (ie  ) in directory name prevents image / directory creation
--------------------------------------------------------------------------------------
v3.2 (/v3.1.12):
Algorithm:		Check #of frames calculated from fps for impacts (duration 0.6s)
Detection:		use of multi criteria for impact detection (confidence, distance acceptable, "contrast" of detection image)
Detection:		messages and logs clarified (rating high, low, nul, error)
GUI:			Advanced settings window more alerting user, about box enriched
GUI:			Latest version menu
GUI:			Tutorial menu
GUI:			Documentation menu
GUI:			Reset preferences saves reset preferences
Parameters:		details deactivated by default
Log:			frame # of impact when detection in log (Sylla/Lewis)
Log:			addition of distance in logfile
Log:			addition of planet and min/max dates in logfilename in impact_detection folder (Lewis)
Log:			Creation by default of zipped impact_detection folder for sending (messages changed, checkbox added in advanced settings)
Files:			Displays file processed/total number of files to process in window
Command line:	-help option
Command line:	displaying messages at the initialization (-help, errors, ...)
Command line:	error message if folder or file from command line not found
Bugfix:			negative value for number of frames (error with _ftelli64)
Bugfix:			generation of max-mean non normalized value even if no detail option activated
Bugfix:			space in file/folder names from command line
Bugfix:			reinitialization of all parameters
Bugfix:			save all parameters in .ini (and remove crash)
Warnings cleaning
--------------------------------------------------------------------------------------
v3.1.11:
General:	option for dark file usage (except on winjupos and pipp files)
Algorithm:	no logging of impacts when overal mean is too small (ie no planetary acquisition)
AS3:		using as3 with highest number of aligned frames in priority
AS3:		using WinJupos DRS if as3 uses unexisting derotated file
Files:		Ignore dark files (possibility to ignore PIPP or WJ derotation)
ROI:		ignoring pixels with small brightness for center of mass calculation
Algorithm:	decrease rejection of frames due to low mean of brightness
Algorithm:	include in log all statistics about the mean/diff/detections images generated
Bugfix:		ROI not working if coordinates outside of range
Bugfix:		crash when erasing first file from file list in detection
Bugfix:		datation only mode not working and bad output for logfile pathname
--------------------------------------------------------------------------------------
v3.1.10: Usage of Autostakkert prealignement (est. 5% perf. gain)
Ignore ROI too small (<=20x20)
Do not ignore winjupos derotation files
Ignore file info if pipp or winjupos video derotation used
Code cleaning
--------------------------------------------------------------------------------------
v3.1.9: noreprocessing command line option (checks in log if file was already processed)
--------------------------------------------------------------------------------------
v1.3.8: datation multiple improvements, detection report window resizable
general:			detect log file appended by default
datation:			SER timestamps bug correction
datation:			Usage of filename syntax (PVOL, WJ, SharpCap, etc.) for refining datation from fileinfo
interface:			detection report window resizable
dateonly:			datation only info on detection report window
--------------------------------------------------------------------------------------
v3.1.7: processes queue implementation used when automatic mode incl. multi-instances support
dateonly:			N/A values for rating
detailed images:	Default value for detailed images off
instances:			DeTeCt number of instances check vs maximum number of instances
--------------------------------------------------------------------------------------
v3.1.6: option file renamed "DeTeCt.ini"
red and green cross not at the same place
bug warning datation incorrectly signaled
bug adding as3 file as duplicate
bug duplicate name with open video file
bug compilation day <10
cleaning C and C++ definition of opts
--------------------------------------------------------------------------------------
v3.1.5: usage of GetCreation/LastAccess/Time CFileFind class for file information (bug stat() not working on all files)
confidence:	bug corrected
interface:	automatic scroll of execution log when added folder/file
datation:	file info start/end time bug correction 
date only:	print log bug for Display date only; disclaimers
autostakkert:check existence of as3 acquisition file
code:		code cleaning and warnings checked
--------------------------------------------------------------------------------------
v3.1.4:  main window improved
interface:	Main window not persistant
interface:	Main window Maximize/minimize buttons added
interface:	Main title bar standard style
interface:	Messages changes
code:		WndResizer resources added
--------------------------------------------------------------------------------------
v3.1.3: resizable window (from WndResizer class)
interface:	Messages changes
--------------------------------------------------------------------------------------
v3.1.2: autostakkert .as3 session file format support
interface:	icon on title bar and on main window
interface:	Messages changes
interface:	cleaning of messages
code:		code cleaning
--------------------------------------------------------------------------------------
v3.1.1: migration to MSVS17/github, opencv 2.4.13.6
-------------------------------------------


===============================================================================================================
                                       TODO LIST (highest to lowest priority)
===============================================================================================================

High priority:
--------------
E	Show computing progression in size not in number
E	Show time remaining expectation
E	FITS DATE/TIME format of SWIR PdM camera (2023-10-14 ; 16:20:38) + BITPIX -32
E	Check usage of Date(UT), Noise, deviation, etc. from FC log
E	Remove or ignore bright borders on detection image
A	overexposed frames : ignore too much overexposed frames (eg 50% of pixels ?)
A	overexposed images : test black max-mean white mean for error
D	Double calculation of ROI (initially + for each frame on a 3x bigger ROI than defined)
A	Check satellite shadow on mean image for 2nd round of yellow cross
E	Calculate max pixel on scale 1/3 for blue cross
E	Detection image optional display

Bugs
----
Bugfix: count in multiinstance mode <> reality
Bugfix: opencv alloc.cpp!73 error (-4:Insufficient memory) Failed to allocate 1031356 bytes in function 'cv:OutOfMemoryError' => allocate + free when child instance started for test ?
Bugfix: Long name rename to be checked (look at all warnings + https://stackoverflow.com/questions/5188527/how-to-deal-with-files-with-a-name-longer-than-259-characters) (Lee)
Bugfix: Long name rename : deactivate warning popup window (Lee)
AutoStakkert mode: increase number of instances when AS not running (Lee)
Main instance 2.5GB, children instance 310MB
DeTeCt launch after single instance ? test on dataset
Slowness in files acquisition addition
FITS:			TBD: Check detection image Capture 2014-11-09T14_23_22\0001.fits should not be 0 ? (32b FITS)

Functionalities
---------------
Instances:		available RAM check to adapt # of instances (200Mo/instance ?) - see https://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process
Instances:		available logical processors to adapt # of instances (1 core/instance)
Instances:		Children list to optimize exit
				Children count to stop processes scan
				TBD: optimize children count process
				TBD: InstanceType to modify with GetIntParam?

Algorithm:		attempt to match impact candidates with brightest point in max-mean
				*TBD: Prioritize as3 over file even if as3 is read after
				check distance criteria (not working ?)
				ignore bad centered images (part of ROI outside of fullframe)

ROI:			Scan of 90  from cog to edge (for Saturn)
				Increase size of ROI (Martin)
				TBD: Use as3 ROI

Detection:		Move use min duration in impact candidate function
				Test max duration for impact candidate
				Do not draw Null probability crosses
Detection:		Check csv for low positives
Detection:		Ignore "DSO", "Star"
(Detection:		Look for second+ differential photometry (yellow cross) candidates near max brightness (blue cross))
Detection:		Change color of crosses in case of low/high/error
Detection:		Scan directory
Detection:		log (x,y) for crosses
Detection:		Max duration for impact
Detection:		Null qualification for pixel like blue cross center
Detection:		Do not draw blue cross when null qualification
Detection:		*ignore off planet impact detection (check level of background?)
Detection:		Check if several impact candidates which one closest to brightest point in dtc_max-mean image and use it
Detection:		**stretch black level in detection max-mean/mean images

GUI:			Advertise contributions by displaying current impact frequency estimation
				**Extra tool to analyze images
GUI:			Pause/Resume button (M.Lewis)
GUI:			Forecast processing time left (A. Frantzis)
GUI:			Exit mode for all instances (like Pause/Resume)
GUI:			Resume option after quitting detect (through  noreprocessing option and flags to identify impact directories aborted/processing ongoing) (Alexandros)
GUI:			End after next video (M.Lewis)

Autostakkert:	Search as3 file at same location than movie if not found (cf. j20200828 ir685)
Autostakkert:	Log AS3 (median quality)
Autostakkert:	Use of as3 file compatibility with AS3 subfolder default option (Andy Casely)

Medium priority:
----------------
				French GUI version
				TBD: generate limited zip files
GUI:			uses symbols instead of grey checkboxes
Instances:		logs fps and # of frames in file_processed
Instances:		check exact processes kills + auto kill windows + kill grand-sons process (image windows)
Algorithm:		minimum size for flash
Algorithm:		binning depending on size of planet to decrease computing A.(Wesley)
Algorithm:		use WJ ims file for initial RoI/center of gravity
WinJupos:		use of planet and equatorial radius information from measurement files (incl. from derotation file)

Low priority:
-------------
GUI:			checkboxes for selecting files/folders to be processed (M.Lewis, Isaac Lozano)
GUI:			Drag & drop functionality
GUI:			Ability to send results at a later date easily. So an option to open the folder you checked the day before and send the results then
GUI:			Identify Win11
Firecapture:	code for live detection
Dev:			cleans includes in headers vs sources
Dev:			Dev. subrevision automatic version update for subscribers
Dev:			Expose only needed functions

Small updates:
--------------
GUI:			auto shutdown even if auto exit not checked
GUI:			clean folders recursively on demand
GUI:			Advanced option to mofify factor of frames for impact candidate
				Advanced option to mofify min duration for impact candidate
				Advanced option to mofify max distance for high impact probability
				Advanced option to mofify min average brightness for high impact probability
				Advanced option to mofify min confidence for high impact probability
				Advanced option to mofify ROI min pixel brightness
				Advanced option to mofify ROI min size
SER format:		logs fps / gain / duration in structure if available
SER format:		puts datation calculation either fully out or fully in ser header/timestamp reading function
GUI:			display option for warnings
Code:			wrapper for Warning() in C++
Code:			Include filename in SerCapture struct for debug/warnings

Suspended:
----------
Bugfix:			correct darkfile comment in log (not reproductable)
