'---------------------------------------- '---------Creation Information----------- '---------------------------------------- ' 'Name: oflowsel 'Author: Cindy How 'Date: 6/27/97 ' '---------------------------------------- '-----------Purpose/Description---------- '---------------------------------------- ' 'This script will allow the user to enter 'data for inflow to the OSBL system, 'specifying input at locations the user 'clicks on. ' 'This script runs as the Apply event 'with the script OINFLOW. ' '---------------------------------------- '-----------------Input------------------ '---------------------------------------- ' '1. Node theme Onodes.shp '2. Attribute table to node theme ' - Field "Ex_br" '3. Table oinflow.dbf ' '---------------------------------------- '-----------------Output----------------- '---------------------------------------- ' '1. oinflow.dbf file with branch, flow, ' temperature, concentration, and oil ' fraction for each inflow site. ' 'This file will help create the OSBL.IN 'naUTilus input file ' '---------------------------------------- '-----------Get Initial Info------------- '---------------------------------------- ' TheProject = av.GetProject TheView = av.GetActiveDoc TheTheme = TheView.FindTheme("onode.shp") TheFtab = TheTheme.GetFtab TheTabName = theProject.FindDoc("oinflow.dbf") FlowTab = TheTabName.GetVtab FlowTab.SetEditable(True) 'FindFields 'in theFtab BrFld = TheFtab.FindField("Ex_br") 'in FlowTab BFld = FlowTab.FindField("Branch") FFld = Flowtab.FindField("Flow") TFld = Flowtab.FindField("Temperat") CFld = Flowtab.FindField("Concentra") OFld = Flowtab.FindField("Oil_frac") '---------------------------------------- '----------User Select Point------------- '---------------------------------------- NewPt = TheView.GetDisplay.ReturnUserPoint PtOnTheme = Thetheme.FindByPoint(NewPt) If (PtOnTheme.isEmpty) then Msgbox.error("That point is not found, try again","Not found") exit end rec=PtOnTheme.get(0) branch = TheFtab.ReturnValue(BrFld,rec) ct = 0 BrList = List.Make For each record in FlowTab ct = ct + 1 br = FlowTab.ReturnValue(BFld,record) BrList.Add(br) end Idx = BrList.FindByValue(branch) If (idx = -1) then labels = {"Flow (L/s)","Temperature (C)","Concentration (mg/L)","Oil fraction"} defaults = {"1.0","20","5","0.0"} OutList = msgBox.MultiInput("Enter inflow characteristics","User Input",labels,defaults) Test = Outlist.Count If (Test > 0) then Flow = Outlist.Get(0).AsNumber Temp = Outlist.Get(1).AsNumber Conc = Outlist.Get(2).AsNumber Frac = Outlist.Get(3).AsNumber FlowTab.AddRecord recnum = ct FlowTab.SetValue(BFld,recnum,branch) FlowTab.SetValue(FFld,recnum,flow) FlowTab.SetValue(TFld,recnum,temp) FlowTab.SetValue(CFld,recnum,conc) FlowTab.SetValue(OFld,recnum,frac) else MsgBox.Info("No inflow information added to table","No Input") end else MsgBox.Info("Flow already exists at that location. No flow added","No Input") end FlowTab.SetEditable(False)