Skip to content

Front End

Travis Stewart edited this page Aug 30, 2018 · 1 revision

Description

The program begins in MainForm.cs, and reads it's settings from the settings.ini file. If it is the first time opening the program, the POST function will run. This checks for python, and installs the required python packages. Once this is verified, it is redirected to the Main Form.

Main Form

ReadSettings() Reads setting.ini file and updates settings variable in the program accordingly.

UpdateSettings() Writes settings to settings.ini.

ReadCheckbox() Returns a list of strings that are in the checkbox.ini

UpdateCheckbox() Updates checkbox.ini file for selected batch.

POST() Verifies the user system has the correct version of Python along with the correct packages installed. If the user does not have the correct version, 'Run New Analysis' is disabled.

displayImages(boolean) Displays currently selected image from the checkbox list. Argument of True opens images in a new window using the default image viewer. False uses the built in image viewer.

menuBtnNewAnalysis_Click() Callback for 'Run New Analysis' button. Opens process form.

menuBtnSelectResults_Click() Callback for 'Select Results Folder' button. Opens batch form.

Watcher_Changed() Event Handler for the file system watcher that updates the list of images.

Watcher_Created() Event Handler for the file system watcher that updates the list of images.

checkedListBox_SelectedIndexChanged() Event handler for selecting a different checkbox item.

checkImages() Verifies if specified image exists.

loadImages() Load images from folder into image checkbox list. Does not work with file watcher (See 'updateImages()').

updateImages() Updates image checkbox list. This works along side the file system watcher.

checkedListBox_ItemCheck() Updates checkbox.ini for currently checked images.

checkedListBox_KeyDown() Event handler for key presses. Used for Space Bar input when checking boxes of image list.

editParametersToolStripMenuItem_Click() Opens parameters window. Reads parameters from the parameters.ini file.

viewingToolStripMenuItem_Click() Sets optimization mode to viewing.

analysisToolStripMenuItem_Click() Sets optimization mode to analysis.

openImagesInNewWindowToolStripMenuItem_Click() Opens current image in the image viewer.

pictureBox1_DoubleClick() Opens clicked image in the image viewer.

Settings

Each setting is in the format of <setting>=<value>

FirstRun=<Boolean> This value is set to true by default, and is only set to false after passing the python verification process during the first time the program is run.

RunPOST=<Boolean> This value is set to false by default. Setting this option to true forces the program to run the python verification process during every startup.

PythonPath= Local path to the Python executable

BatchesPath= Local path to the MPDT Batches folder.

BinPath= Local path to the MPDT bin folder. This is not currently used.

AllowMultiThread=<Boolean> Determines whether to run the back-end analysis program single or multi-threaded. Is true when "Optimized for Analysis" is selected.

Parameters Form

Read() Reads from the parameters.ini file.

Save() Saves to the parameters.ini file.

btnSave_Click() Callback for Save button

btnCancel_Click() Callback for Cancel button

ParametersForm_FormClosing() Warning for closing of form

ParametersForm_FormClosing() Called when contents of a cell are clicked.

Process Form

getNextBatchName() Generates next default batch name.

createDirectories() Creates necessary directories for program.

btnBatchName_Click() Verifies batch name and creates batch directories.

UpdateLabelInfo() Updates file information label such as file count.

run_copy() Copies original files to new directory. Uses a background worker.

btnSelectFile_Click() Select file button callback. Prompts filoe selection dialog.

btnSelectFolder_Click() Select folder button callback. Prompts folder selection dialog.

btnAnalyze_Click() Creates backend process and passes command line arguments.

run_analyze() Calls/starts backend process.

OnChange() Delegate used to receive data on completed images from backend. Updates progress bar and displays appropriate data.

redirectHandler() Event handler for backend standard output redirection.

getCurrentBatchPath() Returns current batch name.

ProcessForm_FormClosing() Kills backend process when window closes.

batchName.cs

textBox1_TextChanged() Event handler to check user input against valid the character string.

resultDialog.cs

LoadBatches() Updates number of files checked and number of images detected for each batch in the Batches folder. button1_Click() Called when button1 is clicked, sets Selection to current batch selected.

Clone this wiki locally