Code of a shamrock with MapInfo (Freeheart original) Original: Zhang Jinzhu
In the optimization of mobile communication networks, network element information that often needs to be needed, and to include a large number of secondary information
To this end, use MapInfo to automatically generate a small program that generates clover, and now figure out the MIF file format.
This macro has nothing value, but maybe for everyone.
Dim intNowCell as Integer, intPower as Integer, intPos as Integer, strUseFile as String, strTempFile as String, i As IntegerDim tmpStr as String, tmpStr2 as string, tmpStr3 as Integer, mcolor as IntegerintNowCell = 1 '** create temp table ** strUseFile = FileOpendLG ("C: /", "," TXT "," Open Source Data File ") IF Not FileExists (Strusefile) or strusefile =" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" strTempFile = TableInfo (0, TAB_INFO_NAME) Register Table strUseFile Type ASCII Titles CharSet "Neutral" Into strTempFileOpen Table strTempFile InteractiveCreate Map For tempSite CoordSys Earth Projection 1, 0Map from tempSite Maxset map redraw offCreate Table "WYSite"
(Site_ID Char (8), Site_name Char (40), BSCID Char (7), MSCID Char (6), Lac Smallint, Longitude Float, Latitude Float, Cell_Name Char (1), Power Smallint, BCC Smallint, NCC Smallint, ANTDIR float, ANTTIL float, ANTBAND float, ANTNUM Smallint, ANTHIGH float, GROUNDHIGH float, ANTTYPE char (10), ANTPLUS Smallint, ANTLEN Smallint, OPENTIME Date, SiteType char (7), TRANSTYPE char (4), nCELL1 char (8), Ncell2 char (8), ncell3 char (8), ncell4 char (8), ncell5 char (8), ncell6 char (8), ncell7 char (8), ncell8 char (8), ncell9 char (8), ncell10 char (8), ncell11 char (8), ncell12 char (8), ncell13 char (8), ncell14 char (8), ncell15 char (8), ncell17 char (8), ncell18 char (8) ), Ncell19 char (8), ncell20 char (8), ncell21 char (8), ncell22 char (8), ncell24 char (8), ncell25 char (8), ncell26 char (8), Ncell27 char (8), ncell28 char (8), ncell29 char (8), ncell30 char (8), ncell31 char (8), ncell32 char (8), BCCH Smallint, DCH1 Smallint, DCH2 Smallint, DCH3 Smallint, DCH4 Small int, DCH5 Smallint, DCH6 Smallint, DCH7 Smallint, DCH8 Smallint, DCH9 Smallint, DCH10 Smallint, DCH11 Smallint, DCH12 Smallint, TRXS Smallint, DEVTYPE Char (6), ZFSite Char (1), HAVEWATCH Smallint, FIRETYPE Char (4), TOWERTYPE Char (4), TOWERHIGH Float, ROOMOWNER Char (8)) file GetMyTempFile (strUseFile, "WYSite.TAB") TYPE NATIVE Charset "WindowsSimpChinese" Create Map For WYSite CoordSys Earth Projection 1, 0Add Map Layer WYSiteFetch First From tempSiteSet Map Center (tempSite.LONGITUDE, tempSite.LATITUDE) Set Map Zoom 5 Units "km" Set Map Layer 0 Editable On Selectable OnDo While Not EOT (tempSite) if tempSite.POWER = 0 THEN intPower = 45 else intPower = tempSite.POWER end if x (1) =
Tempsite.longitude y (1) = Tempsite.latitude for i = 2 to 18 x (i) = Tempsite.longIdom 0.000012 * INTPOWER * COS ((90.0 - Tempsite.antdir Tempsite.antband * (i - 10) /16.0 * Pi / 180) y (i) = Tempsite.latitude 0.00001 * INTPOWER * SIN ((90.0 - Tempsite.antdir Tempsite.antband * (i - 10) /16.0) * pi / 180) Next Do Case Left $ (Tempsite.site_ID, 2) Case "We" mcolor = RGB (119, 158, 232) Case "de" mcolor = RGB (233, 118, 207) case "WM" mcolor = RGB (53, 201, 41) Case "WO" mcolor = RGB (231, 55 , 12) Case "ZF" Mcolor = RGB (240, 139, 2) Case Else Mcolor = RGB (240, 139, 2) End Case Create Region Into Variable Objregion 1 18 (x (1), Y (1)) (x (2) , Y (2)) (x (3), y (3)) (x (4), y (4)) (x (5), y (5)) (x (6), y (6)) (x (7), y (7)) (x (8), y (8)) (x (9), y (9)) (x (10), y (10)) (x (11), Y (11)) (x (12), y (12)) (x (13), y (13)) (x (14), y (14)) (x (15), y (15)) ( x (16), Y (16)) (x (17), y (17)) (x (18), y (18)) 'Pen (1, 1, blue)' brush (2, blue, blue) Pen Makepen (Int (Tempsite.anttil), 2, RGB (123, 23, 88)) 'Brush Makebrush (2, RGB (114, 137, 207), RGB (13, 0, 100)) Brush Makebrush (2, Mcolor, RG B (13,0,100)) Center (tempSite.LONGITUDE, tempSite.LATITUDE) 'Insert exemplary embodiment Jinzhu.Zhang tmpStr = tempSite.SITE_ID tmpStr2 = tempSite.SITE_NAME Insert Into WYSite (Obj, SITE_ID, SITE_NAME) Values (objRegion, tmpStr, TmpStr2)
'Update exemplary embodiment Jinzhu.Zhang tmpStr = tempSite. No relevant BSC Update WYSite set BSCID = tmpStr WHERE ROWID = intNowCell' tmpStr3 = tempSite. On-time 'Update WYSite set OPENTIME = NumberToDate (tmpStr3) WHERE ROWID = intNowCell
INTNOWCELL = INTNOWCell 1 Fetch Next from Tempsiteloopset Map Redraw On
QQ: 4631855
Name: Zhang Jinzhu