; notes_panel.pro ; ; Created by: James Everton ; ; PURPOSE: ; ; ; BACKGROUND: ; ; ALGORITHM: ; IDL widgets combined with the iTools environment were used in creating ; this program. ; ; REFERENCES: ; ; NOTES: ; ; CONSTRAINTS: ; ; OTHER SERVERS/MODULES USED: ; ; RELATED MODULES / CLASSES: ; ; SUPPORTING DATABASE TABLES OR FILES: ; ; USAGE EXAMPLE: ; ; -------------------------------------------------------------------------- ; PROCEDURE actions_panel_callback ; -------------------------------------------------------------------------- ; PURPOSE: ; This procedure is called whenever a registered component generates a ; message. In this UI panel, there are no registered components, so this ; procedure is here simply for syntactical reasons. If components get ; registered later, this is where messages will be handled. ; ; INPUT PARAMETERS: (Automatically sent by the iTools environment) ; wPanel - the widget id of the panel widget ; strID - string identifying the source of the message ; messageIn - string that uniquely identifies the message being sent. ; component - a value that is associated with the message being sent. ; PRO notes_panel_callback, wPanel, strID, messageIn, component ; Make sure we have a valid widget ID IF ~WIDGET_INFO(wPanel, /VALID) THEN RETURN ; Retrieve the widget ID of the first child widget of the UI panel wChild = WIDGET_INFO(wPanel, /CHILD) ; Retrieve the state structure from the user value of the first child widget WIDGET_CONTROL, wChild, GET_UVALUE = state END ; -------------------------------------------------------------------------- ; PROCEDURE notes_panel_event ; -------------------------------------------------------------------------- ; PURPOSE: ; PRO notes_panel_event, event ;COMMON COLORS, R_orig, G_orig, B_orig, R_curr, G_curr, B_curr ;COMMON VIEW_CIPS_NOTES, notes END ; -------------------------------------------------------------------------- ; PROCEDURE notes_panel ; -------------------------------------------------------------------------- ; PURPOSE: ; ; INPUT PARAMETERS: ; ; OUTPUT PARAMETERS: ; NONE ; ; RETURN VALUE: ; ; KEYWORD ARGUMENTS: ; ; NOTES: ; PRO notes_panel, wPanel, oUI COMMON VIEW_CIPS_NOTES, notes ; Name the panel WIDGET_CONTROL, wPanel, BASE_SET_TITLE = 'Notes' ; Specify the event handler WIDGET_CONTROL, wPanel, EVENT_PRO = "notes_panel_event" ; Register the panel with the UI object strObserverIdentifier = oUI->RegisterWidget(wPanel, "Panel", $ 'notes_panel_callback') ; Get reference to current iTool oTool = oUI->GetTool() ; Create widget base wBase = WIDGET_BASE(wPanel, /COLUMN, SPACE = 10, /BASE_ALIGN_LEFT) ; --- Create the panel contents ; Fill in the notes section notes_text = widget_text(wBase, ysize=20, xsize=35, value=*notes.info, /wrap) ; Output the parameters for the cloud selection label = widget_label(wBase, value='Parameters:', $ scr_xsize=fix((widget_info(wBase,/geom,units=0)).xsize*.9)) line = widget_base(wBase, /FRAME, ysize=2, $ xsize=(widget_info(label,/geom,units=0)).xsize) ; Output the background parameters label = widget_label(wBase, value='--- Background ---') label = widget_label(wBase, $ value=('BACKGROUND_NUM: '+strtrim(notes.background,2))) label = widget_label(wBase, $ value=('NOISE: '+(notes.noise eq 1?'True':'False'))) ; Output the cloud_selector parameters blank = widget_label(wBase, value='') case notes.cloud_select of 0: begin ;Stripecloud label = widget_label(wBase, value='--- Stripecloud ---') end else: begin endelse endcase param_names = TAG_NAMES(*notes.cloud_param) for i=0, N_TAGS(*notes.cloud_param)-1 do begin if(size((*notes.cloud_param).(i), /type) eq 2) then $ data = strtrim(string((*notes.cloud_param).(i)), 1) $ else data = strtrim(string(double((*notes.cloud_param).(i))), 1) parameter = widget_label(wBase, $ value=param_names[i] + ': ' + data) endfor ; Output the parameters for the indicator selection blank = widget_label(wBase, value='') label = widget_label(wBase, value='--- Indicators ---') indicator_names = TAG_NAMES(*notes.indicator_param) for i=0, N_TAGS(*notes.indicator_param)-1 do begin if (indicator_names[i] eq 'IND_TYPE') then begin case (*notes.indicator_param).(i) of 0: begin text_value = 'Indicator Threshold (Correlation)' ind_value = 'IND_THRESHOLD_CORR' end 1: begin text_value = 'Indicator Threshold (Slope Ratio)' ind_value = 'IND_THRESHOLD_SLOPERAT' end 2: begin text_value = 'Indicator Threshold (All Ratio)' ind_value = 'IND_THRESHOLD_RATALL' end 3: begin text_value = 'Indicator Threshold (First/Last Ratio)' ind_value = 'IND_THRESHOLD_RAT2' end else: begin text_value = 'Indicator Threshold (Unknown)' ind_value = 'IND_THRESHOLD_UNK' end endcase parameter = widget_label(wBase, value=text_value) CONTINUE endif if ( (indicator_names[i] ne 'MIN_STACK_THICKNESS') && $ (indicator_names[i] ne ind_value) ) then CONTINUE if(size((*notes.indicator_param).(i), /type) eq 2) then $ data = strtrim(string((*notes.indicator_param).(i)), 2) $ else data = strtrim(string(double((*notes.indicator_param).(i))), 2) parameter = widget_label(wBase, $ value=indicator_names[i] + ': ' + data) endfor ; Create state structure in first child state = { oTool:oTool , $ oUI:oUI , $ wPanel:wPanel, $ wBase:wBase } wChild = WIDGET_INFO(wPanel, /CHILD) IF wChild NE 0 THEN $ WIDGET_CONTROL, wChild, SET_UVALUE = state, /NO_COPY ; Add the wPanel object to the data manager ; Create the IDLitDataObject oPanel = OBJ_NEW('IDLitData', wPanel, IDENTIFIER = 'SPLIT_PANEL2') ; Add the data object to the data manager oTool->AddByIdentifier, '/Data Manager', oData END