Esempio n. 1
0
 def onClick(self):
     if loadCode.load:
         hoja100 = loadCode.codhoja100
         path = self.url + '/{}.htm'.format(hoja100)
         openFiles(path).process()
     else:
         pythonaddins.MessageBox(nls().error, nls().titleError)
Esempio n. 2
0
 def onClick(self):
     if os.path.exists(Conexion().path):
         if loadCode.load:
             savepath = pythonaddins.SaveDialog(
                 nls().mapGeo().titleDialog,
                 '{}.mxd'.format(loadCode.codhoja), "", lambda x: x,
                 'Map Document(MXD)')
             if savepath:
                 evalue = os.path.basename(savepath).split(".")
                 if len(evalue) >= 2:
                     if evalue[-1] != "mxd":
                         pythonaddins.MessageBox(nls().mapGeo().errorFormat,
                                                 nls().titleError)
                 else:
                     savepath = '{}.mxd'.format(savepath)
                 try:
                     self.runProcess(savepath)
                     pythonaddins.MessageBox(nls().suscefull, nls().title)
                 except Exception as e:
                     pythonaddins.MessageBox(e, nls().titleError)
             else:
                 pass
         else:
             pythonaddins.MessageBox(nls().error, nls().titleError)
     else:
         pythonaddins.MessageBox(nls().failedConn, nls().titleError)
Esempio n. 3
0
 def onClick(self):
     res = pythonaddins.MessageBox(nls().tablaLeyenda().descrmb,
                                   nls().title, 1)
     if res == 'OK':
         poo = execute(self.runProcess)
         poo.onProcess()
     else:
         pass
Esempio n. 4
0
 def runProcess(self):
     with pythonaddins.ProgressDialog as dialog:
         dialog.title = nls().simbolos().title
         dialog.description = nls().simbolos().descr
         dialog.animation = nls().simbolos().anima
         for x in xrange(10000):
             dialog.progress = x
             if x == 1:
                 arcpy.makeSymbols(loadCode.codhoja, loadCode.zone)
Esempio n. 5
0
 def runProcess(self):
     with pythonaddins.ProgressDialog as dialog:
         dialog.title = nls().datacion().title
         dialog.description = nls().datacion().descr
         dialog.animation = nls().datacion().anima
         for x in xrange(10000):
             dialog.progress = x
             if x == 1:
                 arcpy.makeTableDatation(loadCode.codhoja,
                                         loadCode.codequery50,
                                         loadCode.zone)
Esempio n. 6
0
 def runProcess(self):
     with pythonaddins.ProgressDialog as dialog:
         dialog.title = nls().leyenda().title
         dialog.description = nls().leyenda().descr
         dialog.animation = nls().leyenda().anima
         for x in xrange(10000):
             dialog.progress = x
             if x == 1:
                 arcpy.makeLegend(
                     loadCode.codhoja,  #row,col,quad
                     loadCode.codequery50)  #"CODHOJA" = codhoja
Esempio n. 7
0
 def runProcess(self, savepath):
     with pythonaddins.ProgressDialog as dialog:
         dialog.title = nls().mapGeo().title
         dialog.description = nls().mapGeo().descr
         dialog.animation = nls().mapGeo().anima
         for x in xrange(10000):
             dialog.progress = x
             if x == 1:
                 arcpy.makeMapGeo(loadCode.codhoja, loadCode.zone, savepath,
                                  loadCode.namehoja, loadCode.codequery50)
             else:
                 pass
Esempio n. 8
0
 def onClick(self):
     ubi = pythonaddins.OpenDialog(nls().ConfigGDB().title, False, "#",
                                   nls().ConfigGDB().namebutton,
                                   lambda x: x, "Geodatabase (GDB)")
     if ubi:
         evalue = os.path.basename(ubi).split(".")
         if len(evalue) >= 2:
             if evalue[-1] == 'gdb':
                 if os.path.exists(self.dirname):
                     pass
                 else:
                     os.mkdir(self.dirname)
                 fl = Conexion().path
                 data = {
                     'conn':
                     ubi,
                     'templates':
                     os.path.join(os.path.dirname(__file__), "templates")
                 }
                 self.createJson(fl, data)
                 self.connection = True
                 pythonaddins.MessageBox(nls().suscefull, nls().title)
             else:
                 pythonaddins.MessageBox(nls().ConfigGDB().error,
                                         nls().titleError)
                 self.onClick()
         else:
             pythonaddins.MessageBox(nls().ConfigGDB().error,
                                     nls().titleError)
             self.onClick()
     else:
         pass
Esempio n. 9
0
 def process(self):
     self._validation01()
     if self.npy.size > 0:
         classTableLegend = TableLegend(self.hoja, self.npy, self.fields, self.sql)
         classTableLegend.main()
     else:
         raise RuntimeError(nls().tablaLeyenda().toolmsg_01)
Esempio n. 10
0
 def runProcess(self):
     if self.validation_01:
         classTableLegend = MakeTables(self.code, self.sql, self.zone,
                                       self.feature)
         classTableLegend.main()
         self.addFeatureToMap()
     else:
         raise RuntimeError(nls().datacion().toolmsg_01)
Esempio n. 11
0
 def onClick(self):
     # if conngdb.enabled == True:
     #     conngdb.enabled = False
     # else:
     #     conngdb.enabled = True
     v = self.getInfo
     if getRow.enabled:
         if v:
             getRow.enabled = False
             getCol.enabled = False
             getQuad.enabled = False
             conngdb.enabled = False
             fcode50 = functionCode(getRow.value, getCol.value,
                                    getQuad.value)
             self.codhoja = fcode50.makeCode
             self.codequery50 = fcode50.makeQuery()
             fcode100 = functionCode(getRow.value, getCol.value)
             self.codhoja100 = fcode100.makeCode
             self.load = True
             informacion.value = v
             informacion.refresh()
         else:
             pythonaddins.MessageBox(nls().loadCodeMSG().error,
                                     nls().titleError)
     else:
         r = pythonaddins.MessageBox(nls().changeCode(self.codhoja),
                                     nls().title, 4)
         if r == u"Yes":
             conngdb.enabled = True
             getRow.enabled = True
             getRow.value = ""
             getRow.refresh()
             getCol.enabled = True
             getCol.value = ""
             getCol.refresh()
             getQuad.enabled = True
             getQuad.value = ""
             getQuad.refresh()
             informacion.value = ""
             informacion.refresh()
             self.disableLoad()
             self.codhoja = ''
             self.codequery50 = ''
             self.codhoja100 = ''
             self.load = False
Esempio n. 12
0
 def onProcess(self):
     if os.path.exists(Conexion().path):
         if loadCode.load:
             try:
                 self.function()
                 pythonaddins.MessageBox(nls().suscefull, nls().title)
             except Exception as e:
                 pythonaddins.MessageBox(e, nls().titleError)
         else:
             pythonaddins.MessageBox(nls().error, nls().titleError)
     else:
         pythonaddins.MessageBox(nls().failedConn, nls().titleError)
Esempio n. 13
0
 def onClick(self):
     if os.path.exists(Conexion().path):
         path = os.path.dirname(Conexion().conn)
         openFiles(path).process()
     else:
         pythonaddins.MessageBox(nls().failedConn, nls().titleError)
Esempio n. 14
0
 def onClick(self):
     if os.path.exists(self.path):
         openFiles(self.path).process()
         openFiles(self.path2).process()
     else:
         pythonaddins.MessageBox(nls().guideUser().msg, nls().title)