#!/usr/bin/env python
# -*- coding: gb2312 -*-
#from pylab import *
import matplotlib
import time
import math
import MySQLdb
hang=240
lie=480
rou=0.5
import re
def Get_Plus_Data():#时间点的选取很重要print "hehehhehehe"
xx_list_bef = []
yy_list_bef = []
#xx='000000020006000B001100190022002C003800460055006600770089009E00B400CB00E400FE011901330150016E018D01AD01CD01EF02120236025A027F02A502CB02F00316033C0360038603AB03D003F6041C04420468048D04B304D904FF0525054A056F059305B605D905FD062006430666068806AA06CB06ED070F073107530775079607B607D507F20810082C08480864087F089B08B608D208ED09070922093D09570972098B09A409BD09D409EB0A010A160A2A0A3F0A520A660A780A8B0A9C0AAE0ABE0ACF0ADE0AED0AFA0B060B100B190B210B280B2D0B310B330B330B320B300B2D0B270B1F0B160B0B0B000AF30AE70AD80AC90AB70AA50A920A7C0A660A4E0A350A1C0A0309E809CC09AE098E096D094C0929090608E408C0089B08770851082A080207DB07B4078C07630739070F06E406B9068F06640638060D05E105B5058A055F0533050904DE04B30488045D0432040603DA03B00387035E0337031002E902C302A0027D025C023B021A01FA01DC01BF01A40189016E015301390120010900F200DC00C700B300A0008F007D006D005D004E003F00320025001A0012000B0007000300020000'
#yy='164E1653166D16C4173A17BA1838189718C718DB18E418F81920197119EF1A741AEE1B411B981BDC1C3A1CA91D411DEC1EB51F561FC21FD71FCF1FA51F681F131ED01E9F1E9A1E941EB31ED71F1A1F541F851F9C1FA51F9C1F871F571F291EFD1EE01ED11ECD1EDF1EF41F101F291F461F5E1F681F5D1F531F391F201F021EEE1EDC1ED61EE01EFB1F161F2F1F421F4E1F571F531F4A1F311F1F1F081EFF1EFB1F031F101F1A1F2E1F471F5F1F711F711F6C1F5C1F421F2F1F161F101F041F111F0E1F141F171F321F451F4E1F481F471F3B1F231F0A1EF61EE51ED71ED91EEC1F091F291F3D1F2F1F051EC11E6D1DED1D481CAD1C341BED1BC01BA81B871B501B091AC91AAD1ABA1AF31B341B561B671B591B591B521B4C1B2A1AF41AC31AAA1AAA1AB31AC01ADB1AF11B0D1B1B1B2E1B351B2E1B1F1B091AF81AEB1AE11AE21ADA1ADA1ADD1AF11B011B101B101B131B121B0D1B031AF71AE71AD81AC71AC91ACA1AD31AD21ACC1AB81A8119C2186116EB15F715BA15B815AE156F14F1148A148014DC158015D6160715E115E415EE15FE15F415B7157C154F155C158715B115C715D315E11616164A167B1682166D'
#xx='000100030007000C0013001B00260031003F004F006000730088009E00B500CE00E801040121013E015B017B019B01BC01DF02020227024B0271029802BE02E5030C0333035B038403AC03D503FE04280451047B04A304CC04F5051D0544056D059505BE05E5060E0634065A068006A406C806EB070E07310755077A079D07C207E40808082A084D086E089108B208D408F60916093609550974099209AE09C909E409FF0A180A310A4A0A620A7A0A910AA70ABC0AD00AE50AF80B0C0B1F0B310B420B530B630B730B820B910B9E0BAB0BB50BBF0BC70BCF0BD50BD90BDB0BDC0BDB0BD90BD60BD10BCA0BC20BB60BAA0B9B0B8A0B770B630B4E0B370B1E0B030AE60AC90AAC0A8D0A6D0A4C0A2A0A0809E409C0099B0975094F0928090308DD08B6088F08680840081A07F307CC07A6077F0756072E070606DD06B3068906600636060C05E105B5058A055F0536050C04E304B8048E0465043C041303EB03C3039D0375034F0328030002DA02B50290026C02490226020401E201BF019F0180016201450129010E00F300DA00C200AC009600820070005E004F004100340029001F0017000F00090005000200010000'
#yy='1722178817E71809181A1833183F1864189318DA1920195F198E19BE1A0B1A6C1AD21B361B951BEE1C421CA11D0C1D811DF51E541E9F1EAF1E9F1E561E191DE61DDC1DDC1DE91E0A1E421E721E841E6F1E531E351E1A1DFB1DE41DE41E021E281E421E511E571E541E4B1E391E291E1B1E141E181E271E3B1E4A1E511E481E321E181E091E0E1E0C1E051DFE1E051E171E241E241E181E0C1E0B1E0A1DF91DEA1DE91DFF1E0F1E201E231E291E231E201E171E0C1E051E081E171E241E291E291E291E2A1E1E1E121DFF1E001E001E081E001DFE1DF51DF21DE91DE61DDD1DCF1DBC1DB01D821D361CE31CA91C8F1C721C581C3D1C281C241C271C311C2D1C171BF41BC31B801B2E1AD31A891A4419EA19871904189B181B17AF172A16AD161615A8158115B31613165C16871689168A1676164D160D15EC15E316011617163B164A16611667165B1639161C1608160815FF160316091621162B162A16251622161F160D160A16041609160C161C162216311633163716311632162E1636162E163C1640164F16561658165C165F165F16611661166D167516801686168F16951690168D168C1690168C1686168316B7'
#xx='0000000200050009001100190023002E003A00480058006A007D009200A900C100DB00F70113013101510171019301B701DC020202290251027802A002C902F1031903400367038E03B603DD0405042E0457047E04A704CF04F7051F05470570059905C205EC0615063E0665068E06B606DE07050729074E0773079807BC07E108040827084A086D088F08B108D208F309120931094F096C098909A409C009D909F20A0A0A220A3A0A520A670A7D0A930AA80ABD0AD00AE40AF70B0B0B1E0B310B440B560B680B790B8A0B990BA80BB60BC30BCE0BD90BE20BEB0BF10BF70BFC0BFF0C010C020C010C000BFD0BF80BF10BE90BDF0BD30BC50BB60BA50B940B810B6D0B570B3F0B270B0D0AF20AD50AB70A970A760A520A2D0A0409D909AE09810953092208F108C0088E085B082907F607C507930760072E06FD06CB06990669063A060B05DD05B005820556052804FB04CE04A20476044A041E03F203C7039B03700343031602EB02C102990271024A022401FF01DC01BB019B017C015F01430129011000F900E300CE00BB00A700960084007500660059004B003F0035002A002100180011000B0006000300020000'
#yy='17B917BC17C017F51836187F18A318C218D718E7190B193F197C19B819ED1A1D1A451A901AE41B4D1BA41C031C521CAA1D1B1D931DDF1DD41D821D1D1CD21CAD1C9A1CA31CD21D2C1D721D961D841D671D3B1D101CCD1C9E1C951CC51D041D361D531D631D631D441D0B1CD81CC21CC41CD81CF21D111D321D4E1D591D3B1D151CF01CDD1CD21CCB1CD71CEC1D111D201D241D171D121D021CEE1CCC1CC51CCC1CEE1D061D171D1E1D261D261D111CF81CE61CE71CE51CF01CFA1D0E1D1D1D2A1D261D1A1D001CF31CE11CE31CEA1CFA1D0B1D101D081D021CF61CF31CDB1CCF1CC21CC81CCE1CDA1CE01CE01CC31C9A1C661C3C1C151BF71BD81BB71B961B5E1B1F1ACE1A8A1A3C19EE198D192618A31821179D172716B1167616961713178517CF17E017E617D017A1175D170C16E416DC17021723174C177017851785177C176C1749172A1709170E17061710171617271737173F1730172417121710170216F916EB1700170D172717241722171E17181712170317081714172017241728173417371733172E172A172B172817311737173F1746174C175A175817581754175B176417731785179517A617A917B4'
xx='0000000100030007000C0013001C002600320040004F005F00700083009700AD00C400DC00F60111012D014B016A018901AA01CC01EE02120237025C028102A602CD02F3031A0342036C039403BC03E4040D0436045D048504AD04D504FD0525054C0573059905BF05E40609062E06520676069906BE06E00703072507470769078907A907C907E80808082808460865088308A108C108DE08FB09170932094E096B098609A209BD09D709F10A0B0A230A3A0A510A670A7D0A910AA50AB80AC90AD90AE80AF70B040B110B1C0B260B2F0B360B3D0B430B490B4D0B510B540B560B580B580B580B570B540B500B4A0B430B3B0B300B240B160B070AF70AE50AD20ABD0AA60A8F0A750A5A0A3D0A1E09FD09DC09BA099709740951092E090A08E508BF0896086D0842081807EB07BF079207630733070406D406A306720642061105E005AF057F054E051F04F204C6049A04710449042203FA03D403AE03880362033B031502F002CD02AC028A026902480228020901E901CC01B001940179015F0145012C011400FD00E800D400C000AD009900870076006500550047003A002F0025001C0013000C0007000300020001'
yy='128112C1130C1345135A139413EF1459149D14E21530156A159815B515E216241682170B178B1803186A18C1190E196219E81AAB1B6E1C1B1CAD1D151D881E071ECF1F98207020EB20F720831FFA1F8B1F3C1F041EE71EE61F1D1F7D1FD6201220192024200C1FE21F971F3C1F0A1EF21F071F2F1F571F7D1F9F1FC01FD31FCD1FA91F801F5A1F561F621F711F7E1F9F1FD92020203D200C1FB41F721F631F651F5D1F441F371F471F751F961F971F7B1F631F5B1F5F1F5A1F3F1F291F2C1F481F601F651F561F4D1F501F581F561F3B1F1D1F0B1F131F261F2C1F281F1F1F2C1F491F631F621F471F251F161F111F111EF91ED41EA31E6C1E321DDD1D7E1D141CBC1C711C421C001BA01B151A9C1A681A741ABB1AF11B241B361B4F1B5F1B591B421B081AE51AD01AE71AE81AEE1AE61AFA1B0A1B181B181AFD1AE41ADB1AE11AE11AD31AC31AB71AB21A9F19D7186D16BF158F14DF1471144B140B134911F610E710A4112811DD125E1298129E12D213021304128B11F01173117111A411DF11FA1220126C12C9130B130112BE126912371228123412311239125E12AF13021320130E12DD12C512BC129B128D126B'
xx_list_bef.append(str2data(xx,1))
yy_list_bef.append(str2data(yy,1))
xx_list=xx_list_bef[0]
yy_list=yy_list_bef[0]
xx_max = max(xx_list)
yy_max = max(yy_list)
xx_min = min(xx_list)
yy_min = min(yy_list)
#print xx_list
#print yy_list
#print xx_list[i],yy_list[i]
#print "位移最大值:%d 载荷最大值:%d 位移最小值:%d 载荷最小值:%d " % (xx_max,yy_max,xx_min,yy_min)
#xx_list0,yy_list0=chazhi(xx_list,yy_list)
get_01_juzhen = get_jz_back(xx_min,xx_max,yy_min,yy_max,xx_list,yy_list)
#get_juzhen_liwai=get_jz_liwai(get_01_juzhen)
#huidujuzheng=get_jz(get_01_juzhen,get_juzhen_liwai)
#f1,f2,f3,f4,f5,f6=huidu(huidujuzh