class LUCSettingsEditForm(controlpanel.RegistryEditForm): schema = ILUCSettings label = _(u"LUC Settings") description = _(u"""Configure the LEAM LUC scenario""") def updateFields(self): super(LUCSettingsEditForm, self).updateFields() def updateWidgets(self): super(LUCSettingsEditForm, self).updateWidgets()
class ILUCSettings(Interface): """Setup site configuration for the LUC model""" # -*- schema definition goes here -*- scenario_repo = schema.TextLine( title=_(u"Scenario Repository"), required=False, description=_(u"Enter the subversion repository for the LUC model"), ) scenario_cmd = schema.TextLine( title=_(u"Scenario Startup Command"), required=False, description=_(u"Enter starting command line string"), default=u"python startup.py -c config.xml", ) probmap_repo = schema.TextLine( title=_(u"Driver Set Repository"), required=False, description=_(u"Enter the subversion repository for the drivers"), ) probmap_cmd = schema.TextLine( title=_(u"Probmap Startup Command"), required=False, description=_(u"Enter starting command line string"), default=u"python startup.py -c config.xml", )
class IProjection(Interface): """A population and employment projection used within the LEAM model""" # -*- schema definition goes here -*- projection = schema.Float( title=_(u"Projection"), required=True, description= _(u"Enter as many population and employment as necssary. Intermediate values will be calculated automatically." ), ) zone = schema.Object( title=_(u"Effected Zone"), required=True, description=_(u"A GIS layer defining the region of the projection."), schema=Interface, # specify the interface(s) of the addable types here ) pop_density = schema.Object( title=_(u"Population Density"), required=False, description=_(u"A GIS layer defining the new population density."), schema=Interface, # specify the interface(s) of the addable types here ) emp_density = schema.Object( title=_(u"Employment Density"), required=False, description=_(u"A GIS layer defining the new employment density."), schema=Interface, # specify the interface(s) of the addable types here ) redevelopment = schema.Bool( title=_(u"Redevelopment"), description=_(u"Select to allow redevelopment."), )
from leam.luc.config import PROJECTNAME ProjectionSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- DataGridField( 'projection', searchable = False, storage=atapi.AnnotationStorage(), columns = ('year', 'pop', 'emp'), allow_reorder = False, default = [ { 'year': '2010', 'pop': '0', 'emp': '0'}, { 'year': '2040', 'pop': '0', 'emp': '0'}, ], widget=DataGridWidget( label=_(u"Projection"), description=_(u"Enter as many population and employment values as needed. Intermediate values will be calculated automatically."), columns = { 'year': Column(_(u"Year"), default='2010'), 'pop': Column(_(u"Population"), default='0'), 'emp': Column(_(u"Employment"), default='0'), } ), required=True, ), atapi.ReferenceField( 'zone', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( label=_(u"Effective Zone"), description=_(u"Select a subregional map defining the effective modeling zone."),
class IProbmap(Interface): """a Land Use Change probability map""" # -*- schema definition goes here -*- probview = schema.Object( title=_(u"Simmap view of the probmap."), required=False, description=_(u"A SimMap view visualzing the Probmap."), schema=Interface, # specify the interface(s) of the addable types here ) # probfile = schema.Bytes( title=_(u"Probmap File"), required=False, description=_(u"Precomputed version of the probability map."), ) # year = schema.Int( title=_(u"Effective Year"), required=True, description=_(u"First year the probmap will be used."), ) # roads = schema.Object( title=_(u"Additional Roads"), required=False, description=_(u"Select a GIS layer that contains any roads not included in the TDM network."), schema=Interface, # specify the interface(s) of the addable types here ) # # transit = schema.Object( # title=_(u"Transit Networks"), # required=False, # description=_(u"Select one or more GIS layers containing regional or local transit networks."), # schema=Interface, # specify the interface(s) of the addable types here # ) # tdm = schema.Object( title=_(u"Travel Demand Model Transportation Network"), required=True, description=_(u"Select a transportation network that has been generated from a travel demand model."), schema=Interface, # specify the interface(s) of the addable types here ) trans_w = schema.Int( title=_(u"Transportation Weight"), required=False, description=_(u"Weight of Transportation"), ) # nogrowth = schema.Object( title=_(u"No Growth Maps"), required=False, description=_(u"Select one or more GIS layers. These areas will be protected from model development."), schema=Interface, # specify the interface(s) of the addable types here ) # empcenters = schema.Object( title=_(u"Employment Centers"), required=True, description=_(u"Select a GIS layer containing employeers and employmment centers."), schema=Interface, # specify the interface(s) of the addable types here ) emp_w = schema.Int( title=_(u"Employment Weight"), required=False, description=_(u"Weight of Employment Centers"), ) # popcenters = schema.Object( title=_(u"City and Population Centers"), required=True, description=_(u"Select the GIS layer with city centers."), schema=Interface, # specify the interface(s) of the addable types here ) pop_w = schema.Int( title=_(u"Population Weight"), required=False, description=_(u"Weight of Population Centers"), ) # dem = schema.Object( title=_(u"Digital Elevation Map"), required=True, description=_(u"Select a GIS layer that provides regional elevation."), schema=Interface, # specify the interface(s) of the addable types here ) # landuse = schema.Object( title=_(u"Initial Land Use Map"), required=True, description=_(u"Provide an initial land use map for the scenario. Unused if a Starting Scenario is provided."), schema=Interface, # specify the interface(s) of the addable types here )
# -*- Message Factory Imported Here -*- from leam.luc import lucMessageFactory as _ from leam.luc.interfaces import IProbmap from leam.luc.config import PROJECTNAME ProbmapSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.IntegerField( 'year', storage=atapi.AnnotationStorage(), widget=atapi.IntegerWidget( label=_(u"Effective Year"), description=_(u"Each driver given below should correspond to this year."), ), required=True, default=_(u"2010"), validators=('isInt'), ), atapi.ReferenceField( 'tdm', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( allow_browse=1, allow_search=1, startup_directory='/luc/drivers/transportation',
class ILUCScenario(Interface): """LEAM Land Use Change (LUC) Scenario""" # end_time = schema.Date( title=_(u"End Time"), required=False, description=_(u"When the model completed."), ) # start_time = schema.Date( title=_(u"Start Time"), required=False, description=_(u"When the model began execution."), ) # runstatus = schema.TextLine( title=_(u"Run Status"), required=True, description=_(u"Provide the current run state of the scenario."), ) # growth = schema.Object( title=_(u"Growth Projections"), required=False, description=_( u"Add one or more growth Projections for this scenario."), schema=Interface, # specify the interface(s) of the addable types here ) # growthmap = schema.Object( title=_(u"Growth Drivers"), required=False, description=_(u"Add one or more driver sets."), schema=Interface, # specify the interface(s) of the addable types here ) # decline = schema.Object( title=_(u"Decline Projections"), required=False, description= _(u"Identify the study area and population and employment projections." ), schema=Interface, # specify the interface(s) of the addable types here ) # declinemap = schema.Object( title=_(u"Decline Drivers"), required=False, description=_(u"Add one or more driver sets."), schema=Interface, # specify the interface(s) of the addable types here )
columns=('year', 'pop', 'emp'), allow_reorder=False, default=[ { 'year': '2010', 'pop': '0', 'emp': '0' }, { 'year': '2040', 'pop': '0', 'emp': '0' }, ], widget=DataGridWidget( label=_(u"Projection"), description= _(u"Enter as many population and employment values as needed. Intermediate values will be calculated automatically." ), columns={ 'year': Column(_(u"Year"), default='2010'), 'pop': Column(_(u"Population"), default='0'), 'emp': Column(_(u"Employment"), default='0'), }), required=True, ), atapi.ReferenceField( 'zone', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( label=_(u"Effective Zone"),
import logging log = logging.getLogger(__name__) LUCScenarioSchema = folder.ATFolderSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.ReferenceField( 'growth', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( allow_browse=1, allow_search=0, startup_directory='/luc/projections', label=_(u"Growth Projections"), description=_(u"Identify one or more growth projection."), ), required=False, relationship='lucscenario_growth', allowed_types=('Projection'), multiValued=True, ), atapi.ReferenceField( 'growthmap', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( allow_browse=1, allow_search=0,
import json import logging log = logging.getLogger(__name__) LUCScenarioSchema = folder.ATFolderSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.ReferenceField( 'growth', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( allow_browse=1, allow_search=0, startup_directory='/luc/projections', label=_(u"Growth Projections"), description=_(u"Identify one or more growth projection."), ), required=False, relationship='lucscenario_growth', allowed_types=('Projection'), multiValued=True, ), atapi.ReferenceField( 'growthmap', storage=atapi.AnnotationStorage(), widget=ReferenceBrowserWidget( allow_browse=1, allow_search=0, startup_directory='/luc/drivers', label=_(u"Growth Drivers"),