返回列表

通达信扩展组件JBPlugins的秘密 (更新结束、结贴)

12万
设置
2114948 Lv.7

专栏

复制 显示全部楼层 倒序浏览 |
跳转到指定楼层

通达信扩展数据怎么用,通达信大数据组件公式,通达信扩展数据刷新,通达信公式数据组件软件数据教程_技术交流论坛股票软件指标公式技术理想股票技术论坛

JBPlugins扩展组件其实是对运行python的支持,可惜我在站点上搜索了很久对于python的使用几乎没有涉及,在通达信支持python的扩展可以当成什么概念捏?就是你想你的通达信 ...软件数据教程_技术交流论坛股票软件指标公式技术

JBPlugins扩展组件其实是对运行python的支持,可惜我在站点上搜索了很久对于python的使用几乎没有涉及,在通达信支持python的扩展可以当成什么概念捏?就是你想你的通达信是啥样的就是啥样的通达信扩展组件JBPlugins的秘密 (更新结束、结贴) ,这个真不骗人,通达信扩展组件JBPlugins的秘密 (更新结束、结贴), 关于python的更多请搜索,

废话不说,在主程序里有调用了一个pythong的脚本graphts.py,调试的时候很容易搜索到这字串,那么实际我们可以见到的是编译过的字节编译文件graphts.pyc

这里提供反编译出来的原文件,文件中数字后面的 L 是指长整形的意思,更新到用中文字串同时2楼给出呈现的界面图形让大家有更直观的感受,

python语句不是太难,只要主意下缩进格式就行了

反编译于graphts.pyc
  1. def RGB(r, g, b):
  2.         return b * 2L ** 16L + g * 2L ** 8L + r

  3. nWndIDTitle_Stock = 0L
  4. nWndIDTitle_CurGrade = 0L
  5. nWndIDPie_CurGrade = 0L
  6. nWndIDGrid_CurGrade = 0L
  7. nWndIDSwitch_CurGrade = 0L
  8. nWndIDTitle_DynGrade = 0L
  9. nWndIDChart_DynGrade = 0L
  10. nWndIDEdit_CollGrade = 0L
  11. nWndIDTitle_Prifit = 0L
  12. nWndIDGrid_Prifit = 0L
  13. nWndIDTitle_Detail = 0L
  14. nWndIDEdit_Desc = 0L
  15. nWndIDGrid_Detail = 0L
  16. CLR_BACK = RGB(0L, 0L, 0L)
  17. CLR_WHITE = RGB(255L, 255L, 255L)
  18. CLR_GRAY = RGB(128L, 128L, 128L)
  19. CLR_GRAY2 = RGB(192L, 192L, 192L)
  20. CLR_BLUE = RGB(0L, 0L, 255L)
  21. CLR_BLUE_LIGHT = RGB(0L, 0L, 128L)
  22. CLR_YELLOW = RGB(255L, 255L, 0L)
  23. CLR_RED = RGB(255L, 0L, 0L)
  24. CLR_RED_LIGHT = RGB(128L, 0L, 0L)
  25. CLR_GREEN = RGB(0L, 255L, 0L)
  26. CLR_QING = RGB(0L, 255L, 255L)
  27. GRID_COL_WIDTH = 100L
  28. GRID_ROW_HEIGHT = 25L
  29. GRID_MAX_HEIGHT = 192L
  30. nFrameWidth = 790L
  31. nChartHigh = 240L
  32. nInterval = 10L
  33. nPieHigh = 240L
  34. nTitleHigh = 20L
  35. nComboHigh = 18L
  36. nEditWidth = 780L
  37. g_StockCode = ''
  38. g_StockName = ''
  39. g_bFlag = 0L
  40. g_nErrCode = 0L
  41. nWndIDEdit_Error = 0L
  42. g_listCurGrade = []
  43. g_dictDynGrade = {}
  44. g_dictGradeReport = {}
  45. def FormatDecimal(sDecimal):
  46.         if sDecimal == '':
  47.                 sRet = '--'
  48.                 return sRet
  49.         try:
  50.                 fDecimal = float(sDecimal)
  51.         except:
  52.                 fDecimal = 0.0
  53.         if fDecimal != 0.0:
  54.                 fDecimal = '%5.2f' % fDecimal
  55.                 sRet = str(fDecimal)
  56.         else:
  57.                 sRet = '--'
  58.         return sRet

  59. def DivideHundred(sValue):
  60.         if sValue == '':
  61.                 sRet = '--'
  62.                 return sRet
  63.         try:
  64.                 fValue = float(sValue)
  65.         except:
  66.                 fValue = 0.0
  67.         if fValue != 0.0:
  68.                 fValue = fValue / 100L
  69.                 fValue = '%5.2f' % fValue
  70.                 sRet = str(fValue)
  71.         else:
  72.                 sRet = '--'
  73.         return sRet

  74. def MultiHundred(sValue):
  75.         if sValue == '':
  76.                 sRet = '--'
  77.                 return sRet
  78.         try:
  79.                 fValue = float(sValue)
  80.         except:
  81.                 fValue = 0.0
  82.         if fValue != 0.0:
  83.                 fValue = fValue * 100L
  84.                 fValue = '%5.2f' % fValue
  85.                 sRet = str(fValue)
  86.         else:
  87.                 sRet = '--'
  88.         return sRet

  89. def FormatInt(sValue):
  90.         try:
  91.                 iValue = int(sValue)
  92.         except:
  93.                 iValue = 0L
  94.         sInt = str(iValue)
  95.         if sInt == '' or sInt == '0':
  96.                 sInt = '--'
  97.         return sInt

  98. def FormatMonth(sMonth):
  99.         nLen = len(sMonth)
  100.         if nLen == 0L:
  101.                 sRet = '--'
  102.                 return sRet
  103.         if nLen != 6L:
  104.                 return sMonth
  105.         else:
  106.                 sRet = sMonth[4L:6L]
  107.                 sRet += '/'
  108.                 sRet += sMonth[0L:4L]
  109.         return sRet

  110. def FormatStr(sStr):
  111.         if sStr == '' or len(sStr) == 0L:
  112.                 sRet = '--'
  113.         else:
  114.                 sRet = sStr
  115.         return sRet

  116. def FormatReport(sReport):
  117.         nLen = len(sReport)
  118.         if nLen == 0L:
  119.                 sRet = '--'
  120.                 return sRet
  121.         if nLen != 8L:
  122.                 return sReport
  123.         else:
  124.                 sRet = sReport[0L:4L]
  125.                 sRet += '-'
  126.                 sRet += sReport[4L:6L]
  127.                 sRet += '-'
  128.                 sRet += sReport[6L:8L]
  129.         return sRet

  130. def InitWndSize():
  131.         globDict = globals()
  132.         if globDict['g_nErrCode'] == 0L and globDict['g_bFlag'] == 1L:
  133.                 pyContainer.MoveWndRect(globDict['nWndIDGrid_CurGrade'], 0L, 0L, 0L, 0L, 0L)
  134.                 pyContainer.MoveWndRect(globDict['nWndIDGrid_Prifit'], 0L, 0L, 0L, 0L, 0L)
  135.                 pyContainer.MoveWndRect(globDict['nWndIDGrid_Detail'], 0L, 0L, 0L, 0L, 0L)

  136. def OnSize(sCx, sCy):
  137.         ReSize(sCx, sCy, 1L)

  138. def ReSize(sCx, sCy, bRepaint):
  139.         nFrameLeft = 0L
  140.         globDict = globals()
  141.         InitWndSize()
  142.         containersize = pyContainer.GetContainerSize()
  143.         conWidth = containersize[0L]
  144.         conHight = containersize[1L]
  145.         if conWidth > nFrameWidth:
  146.                 nFrameLeft = (conWidth - nFrameWidth) / 2L - 1L
  147.         ntop = nInterval / 2L
  148.         if globDict['g_nErrCode'] == 0L:
  149.                 if globDict['g_bFlag'] == 1L:
  150.                         pyContainer.MoveWndRect(globDict['nWndIDTitle_Stock'], nFrameLeft, ntop, 180L, 22L, 0L)
  151.                         tup = pyContainer.Edit_GetReqSize(globDict['nWndIDEdit_CollGrade'])
  152.                         pyContainer.MoveWndRect(globDict['nWndIDEdit_CollGrade'], nFrameLeft + 185L, ntop + 3L, 400L, tup[1L], 0L)
  153.                         ntop += 22L
  154.                         ntop += nInterval / 2L
  155.                         pyContainer.MoveWndRect(globDict['nWndIDTitle_DynGrade'], nFrameLeft + 5L, ntop, nFrameWidth / 2L + 15L, nTitleHigh, 0L)
  156.                         pyContainer.MoveWndRect(globDict['nWndIDTitle_CurGrade'], nFrameLeft + nFrameWidth / 2L + 15L, ntop, nFrameWidth / 2L - 20L, nTitleHigh, 0L)
  157.                         ntop += nTitleHigh
  158.                         pyContainer.MoveWndRect(globDict['nWndIDChart_DynGrade'], nFrameLeft + 5L, ntop, nFrameWidth / 2L + 15L, nChartHigh, 0L)
  159.                         pyContainer.MoveWndRect(globDict['nWndIDPie_CurGrade'], nFrameLeft + nFrameWidth / 2L + 15L, ntop + 10L, nPieHigh, nPieHigh, 0L)
  160.                         pyContainer.MoveWndRect(globDict['nWndIDSwitch_CurGrade'], nFrameLeft + nFrameWidth / 2L + nPieHigh + 15L, ntop + 15L, 70L, nTitleHigh, 0L)
  161.                         GridSize = pyContainer.Grid_GetTotalSize(globDict['nWndIDGrid_CurGrade'])
  162.                         pyContainer.MoveWndRect(globDict['nWndIDGrid_CurGrade'], nFrameLeft + nFrameWidth / 2L + nPieHigh + 15L, ntop + 15L + nTitleHigh, GridSize[0L], GridSize[1L], 0L)
  163.                         ntop += nChartHigh
  164.                         ntop += nInterval / 2L
  165.                         pyContainer.MoveWndRect(globDict['nWndIDTitle_Prifit'], nFrameLeft + 5L, ntop, nFrameWidth - 10L, nTitleHigh, 0L)
  166.                         ntop += nTitleHigh
  167.                         ntop += nInterval / 2L
  168.                         GridSize = pyContainer.Grid_GetTotalSize(globDict['nWndIDGrid_Prifit'])
  169.                         pyContainer.MoveWndRect(globDict['nWndIDGrid_Prifit'], nFrameLeft + 5L, ntop, GridSize[0L], GridSize[1L], 0L)
  170.                         ntop += GridSize[1L]
  171.                         ntop += nInterval
  172.                         pyContainer.MoveWndRect(globDict['nWndIDTitle_Detail'], nFrameLeft + 5L, ntop, nFrameWidth - 10L, nTitleHigh, 0L)
  173.                         ntop += nTitleHigh
  174.                         ntop += nInterval / 2L
  175.                         GridSize = pyContainer.Grid_GetTotalSize(globDict['nWndIDGrid_Detail'])
  176.                         pyContainer.MoveWndRect(globDict['nWndIDGrid_Detail'], nFrameLeft + 5L, ntop, nFrameWidth - 10L, GRID_MAX_HEIGHT, 0L)
  177.                         ntop += GRID_MAX_HEIGHT
  178.                         ntop += nInterval
  179.                         tup = pyContainer.Edit_GetReqSize(globDict['nWndIDEdit_Desc'])
  180.                         pyContainer.MoveWndRect(globDict['nWndIDEdit_Desc'], nFrameLeft + 5L, ntop, nEditWidth, tup[1L], 0L)
  181.                         ntop += tup[1L]
  182.                         ntop += nInterval / 2L
  183.         else:
  184.                 if globDict['g_nErrCode'] == 1L or globDict['g_nErrCode'] == 2L:
  185.                         tup = pyContainer.Edit_GetReqSize(globDict['nWndIDEdit_Error'])
  186.                         pyContainer.MoveWndRect(globDict['nWndIDEdit_Error'], nFrameLeft, ntop, nEditWidth, tup[1L], 0L)
  187.         pyContainer.SetFocusWnd(-1L)
  188.         if bRepaint:
  189.                 bRepaint
  190.                 pyContainer.InvalidateWnd(1L)
  191.         else:
  192.                 bRepaint

  193. def OnSwitchChanged(sWndID, sCurLabelID):
  194.         globDict = globals()

  195. def OnGridSelChanged(sWndID, sRow, sCol):
  196.         globDict = globals()

  197. def OnGridLButClick(sWndID, sRow, sCol):
  198.         if int(sCol) == 20L and int(sRow) >= 2L:
  199.                 strtext = pyContainer.Grid_GetHideStr(int(sWndID), int(sRow), int(sCol))
  200.                 pyContainer.DlgShowText('报告摘要', strtext, RGB(0L, 0L, 0L), CLR_YELLOW)
  201.         if int(sCol) == 19L and int(sRow) >= 2L:
  202.                 strtext = pyContainer.Grid_GetHideStr(int(sWndID), int(sRow), int(sCol))
  203.                 pyContainer.FetchFile('', strtext)

  204. def OnGridLButDblClick(sWndID, sRow, sCol):
  205.         globDict = globals()

  206. def OnPieSelChanged(sWndID, sElementID, szElement):
  207.         a = 1L

  208. def OnComboSelChanged(sWndID, sSelItem, szSelItem):
  209.         globDict = globals()

  210. def AddChart(sWndID):
  211.         globDict = globals()
  212.         globDict[sWndID] = pyContainer.Chart_AddWnd(0L, 0L, 0L, 0L, '')
  213.         pyContainer.Chart_EnableRefresh(globDict[sWndID], 0L)
  214.         pyContainer.Chart_SetBackColor(globDict[sWndID], CLR_BACK)
  215.         pyContainer.Chart_SetZoomEnabled(globDict[sWndID], 0L)
  216.         pyContainer.Chart_SetPanEnabled(globDict[sWndID], 0L)
  217.         pyContainer.Chart_SetTitleColor(globDict[sWndID], CLR_GRAY)
  218.         pyContainer.Chart_LegendDockSide(globDict[sWndID], 3L)
  219.         pyContainer.Chart_SetLegendBackColor(globDict[sWndID], CLR_GRAY)
  220.         pyContainer.Chart_SetLegendVisable(globDict[sWndID], 0L)
  221.         pyContainer.Chart_SetLegendHorizontalMode(globDict[sWndID], 1L)
  222.         pyContainer.Chart_SetLegendShadowDepth(globDict[sWndID], 2L)
  223.         pyContainer.Chart_SetLegendShadowColor(globDict[sWndID], CLR_BACK)
  224.         pyContainer.Chart_SetLegendFont(globDict[sWndID], 100L, '宋体')
  225.         pyContainer.Chart_CreateAxis(globDict[sWndID], 0L, 0L)
  226.         pyContainer.Chart_SetAxisColor(globDict[sWndID], 0L, CLR_GRAY)
  227.         pyContainer.Chart_SetAxisTextColor(globDict[sWndID], 0L, CLR_GRAY)
  228.         pyContainer.Chart_SetGridVisable(globDict[sWndID], 0L, 1L)
  229.         pyContainer.Chart_CreateAxis(globDict[sWndID], 1L, 0L)
  230.         pyContainer.Chart_SetAxisColor(globDict[sWndID], 1L, CLR_GRAY)
  231.         pyContainer.Chart_SetGridVisable(globDict[sWndID], 1L, 0L)
  232.         pyContainer.Chart_SetAxisTextColor(globDict[sWndID], 1L, CLR_GRAY)
  233.         pyContainer.Chart_SetAxisFont(globDict[sWndID], 1L, 100L, '宋体')
  234.         pyContainer.Chart_EnableRefresh(globDict[sWndID], 1L)

  235. def AddPie(sWndID):
  236.         globDict = globals()
  237.         globDict[sWndID] = pyContainer.Pie_AddWnd(0L, 0L, nPieHigh, nPieHigh, '')
  238.         pyContainer.Pie_EnableBkColorGradient(globDict[sWndID], 0L)
  239.         pyContainer.Pie_SetPieChartStyle(globDict[sWndID], 2L)
  240.         pyContainer.Pie_SetBackgrndColor(globDict[sWndID], CLR_BACK)
  241.         pyContainer.Pie_SetTitleColor(globDict[sWndID], CLR_YELLOW)
  242.         pyContainer.Pie_DockTitle(globDict[sWndID], 0L)
  243.         pyContainer.Pie_SetTitleFont(globDict[sWndID], 100L, '宋体', 0L)
  244.         pyContainer.Pie_ShowPieLable(globDict[sWndID], 0L)

  245. def FillPie_CurGrade():
  246.         globDict = globals()
  247.         pyContainer.Pie_SetPieChartTitle(globDict['nWndIDPie_CurGrade'], '评级分布')
  248.         pyContainer.Pie_RemoveAllItem(globDict['nWndIDPie_CurGrade'])
  249.         list = []
  250.         list = globDict['g_listCurGrade']
  251.         if len(list) != 0L:
  252.                 pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '买入', 'Lable1', float(list[3L]), RGB(255L, 0L, 0L))
  253.                 pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '增持', 'Lable2', float(list[4L]), RGB(255L, 85L, 0L))
  254.                 pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '中性', 'Lable2', float(list[5L]), RGB(255L, 170L, 0L))
  255.                 pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '减持', 'Lable3', float(list[6L]), RGB(120L, 255L, 0L))
  256.                 pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '卖出', 'Lable4', float(list[7L]), RGB(0L, 255L, 0L))
  257.                 pyContainer.Pie_InsertItem(globDict['nWndIDPie_CurGrade'], '无评级', 'Lable4', float(list[8L]), RGB(192L, 192L, 192L))
  258.         del list
  259.         pyContainer.Pie_SetElementTransparencyAll(globDict['nWndIDPie_CurGrade'], 50L)
  260.         pyContainer.Pie_SetDistanceIndexAll(globDict['nWndIDPie_CurGrade'], 4L)
  261.         pyContainer.Pie_SetInclineAngle(globDict['nWndIDPie_CurGrade'], 10L)
  262.         pyContainer.Pie_SetItemHighlightColor(globDict['nWndIDPie_CurGrade'], CLR_QING)

  263. def AddGrid_CurGrade():
  264.         globDict = globals()
  265.         globDict['nWndIDGrid_CurGrade'] = pyContainer.Grid_AddWnd(0L, 0L, 0L, 0L, '')
  266.         pyContainer.Grid_SetGridBkColor(globDict['nWndIDGrid_CurGrade'], CLR_BACK)
  267.         pyContainer.Grid_SetGridLines(globDict['nWndIDGrid_CurGrade'], 3L)
  268.         pyContainer.Grid_SetGridLineColor(globDict['nWndIDGrid_CurGrade'], CLR_GRAY)
  269.         pyContainer.Grid_SetRowCount(globDict['nWndIDGrid_CurGrade'], 7L)
  270.         pyContainer.Grid_SetColumnCount(globDict['nWndIDGrid_CurGrade'], 2L)
  271.         pyContainer.Grid_SetFixedTextColor(globDict['nWndIDGrid_CurGrade'], CLR_GRAY)
  272.         pyContainer.Grid_SetFixedRowCount(globDict['nWndIDGrid_CurGrade'], 1L)
  273.         pyContainer.Grid_SetFixedColumnCount(globDict['nWndIDGrid_CurGrade'], 1L)
  274.         pyContainer.Grid_SetListMode(globDict['nWndIDGrid_CurGrade'], 1L)
  275.         pyContainer.Grid_SetColumnResize(globDict['nWndIDGrid_CurGrade'], 0L)
  276.         pyContainer.Grid_SetHeaderSort(globDict['nWndIDGrid_CurGrade'], 0L)
  277.         pyContainer.Grid_SetSingleRowSelection(globDict['nWndIDGrid_CurGrade'], 1L)
  278.         pyContainer.Grid_SetFixedBkColor(globDict['nWndIDGrid_CurGrade'], CLR_BACK)
  279.         pyContainer.Grid_SetTextBkColor(globDict['nWndIDGrid_CurGrade'], CLR_BACK)
  280.         pyContainer.Grid_SetFixedRowFont(globDict['nWndIDGrid_CurGrade'], 100L, '宋体')
  281.         pyContainer.Grid_SetNonFixedRowFont(globDict['nWndIDGrid_CurGrade'], 100L, '宋体')
  282.         pyContainer.Grid_SetNonSortColWidth(globDict['nWndIDGrid_CurGrade'], 0L)
  283.         pyContainer.Grid_EnableSelectFixedColumn(globDict['nWndIDGrid_CurGrade'], 0L)
  284.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 0L, 0L, CLR_BACK, CLR_GRAY, '合计', 1L)
  285.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 1L, 0L, CLR_BACK, CLR_GRAY, '买入', 1L)
  286.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 2L, 0L, CLR_BACK, CLR_GRAY, '增持', 1L)
  287.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 3L, 0L, CLR_BACK, CLR_GRAY, '中性', 1L)
  288.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 4L, 0L, CLR_BACK, CLR_GRAY, '减持', 1L)
  289.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 5L, 0L, CLR_BACK, CLR_GRAY, '卖出', 1L)
  290.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 6L, 0L, CLR_BACK, CLR_GRAY, '无评级', 1L)
  291.         for row in range(0L, 7L):
  292.                 pyContainer.Grid_SetRowHeight(globDict['nWndIDGrid_CurGrade'], row, GRID_ROW_HEIGHT)
  293.         pyContainer.Grid_SetColumnWidth(globDict['nWndIDGrid_CurGrade'], 0L, 70L)
  294.         pyContainer.Grid_SetColumnWidth(globDict['nWndIDGrid_CurGrade'], 1L, 65L)

  295. def FillGrid_CurGrade():
  296.         globDict = globals()
  297.         T001 = ''
  298.         T003 = ''
  299.         T004 = ''
  300.         T005 = ''
  301.         T006 = ''
  302.         T007 = ''
  303.         T008 = ''
  304.         list = []
  305.         list = globDict['g_listCurGrade']
  306.         if len(list) != 0L:
  307.                 T003 = list[3L]
  308.                 T004 = list[4L]
  309.                 T005 = list[5L]
  310.                 T006 = list[6L]
  311.                 T007 = list[7L]
  312.                 T008 = list[8L]
  313.                 nTotal = int(T003)
  314.                 nTotal += int(T004)
  315.                 nTotal += int(T005)
  316.                 nTotal += int(T006)
  317.                 nTotal += int(T007)
  318.                 nTotal += int(T008)
  319.                 T001 = str(nTotal)
  320.                 del list
  321.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 0L, 1L, CLR_BACK, CLR_GRAY, FormatInt(T001), 1L)
  322.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 1L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T003), 1L)
  323.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 2L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T004), 1L)
  324.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 3L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T005), 1L)
  325.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 4L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T006), 1L)
  326.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 5L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T007), 1L)
  327.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_CurGrade'], 6L, 1L, CLR_BACK, CLR_YELLOW, FormatInt(T008), 1L)
  328.         pyContainer.Grid_InvalidateWnd(globDict['nWndIDGrid_CurGrade'], 1L)

  329. def FillChart_DynGrade():
  330.         globDict = globals()
  331.         pyContainer.Chart_EnableRefresh(globDict['nWndIDChart_DynGrade'], 0L)
  332.         pyContainer.Chart_RemoveAllSeries(globDict['nWndIDChart_DynGrade'])
  333.         nSeriesID = pyContainer.Chart_CreateXYPointSeries(globDict['nWndIDChart_DynGrade'], 2L, 0L, 0L)
  334.         dict = {}
  335.         dict = globDict['g_dictDynGrade']
  336.         list = []
  337.         for sKey in dict:
  338.                 list.append(sKey)
  339.         list.sort(None, None, 0L)
  340.         for i in range(0L, len(list)):
  341.                 sKey = list[i]
  342.                 T001 = dict[sKey][0L]
  343.                 pyContainer.Chart_AddXYPointAttUserData(globDict['nWndIDChart_DynGrade'], nSeriesID, i, float(T001), FormatReport(sKey))
  344.         pyContainer.Chart_EnableAxisCustomTick(globDict['nWndIDChart_DynGrade'], 1L, 1L)
  345.         pyContainer.Chart_SetAxisActiveSeries(globDict['nWndIDChart_DynGrade'], 1L, nSeriesID)
  346.         pyContainer.Chart_SetSeriesColor(globDict['nWndIDChart_DynGrade'], nSeriesID, CLR_BLUE)
  347.         pyContainer.Chart_EnableAxisSlopeFont(globDict['nWndIDChart_DynGrade'], 1L, 1L)
  348.         pyContainer.Chart_SetAxisSlopeDegree(globDict['nWndIDChart_DynGrade'], 1L, 28L)
  349.         pyContainer.Chart_SetLineWidth(globDict['nWndIDChart_DynGrade'], nSeriesID, 2L)
  350.         pyContainer.Chart_SetFixedPointSize(globDict['nWndIDChart_DynGrade'], nSeriesID, 6L, 6L)
  351.         pyContainer.Chart_SetFixedBorderColor(globDict['nWndIDChart_DynGrade'], nSeriesID, CLR_BLUE_LIGHT)
  352.         pyContainer.Chart_SetFixedPointType(globDict['nWndIDChart_DynGrade'], nSeriesID, 1L)
  353.         pyContainer.Chart_SetAxisLableColor(globDict['nWndIDChart_DynGrade'], 0L, CLR_GRAY)
  354.         pyContainer.Chart_SetAxisLableVisable(globDict['nWndIDChart_DynGrade'], 0L, 1L)
  355.         pyContainer.Chart_SetAxisLableText(globDict['nWndIDChart_DynGrade'], 0L, '动态综合评级分')
  356.         pyContainer.Chart_SetAxisLableFont(globDict['nWndIDChart_DynGrade'], 0L, 100L, '宋体')
  357.         pyContainer.Chart_SetAxisAutomatic(globDict['nWndIDChart_DynGrade'], 0L, 1L)
  358.         tup = pyContainer.Chart_GetAxisMinMax(globDict['nWndIDChart_DynGrade'], 0L)
  359.         inc = pyContainer.Chart_GetAxisTickIncrement(globDict['nWndIDChart_DynGrade'], 0L)
  360.         dMin = tup[0L] - inc / 4L
  361.         if tup[0L] < tup[1L]:
  362.                 pyContainer.Chart_SetAxisAutomatic(globDict['nWndIDChart_DynGrade'], 0L, 0L)
  363.                 pyContainer.Chart_SetAxisMinMax(globDict['nWndIDChart_DynGrade'], 0L, dMin, tup[1L] + inc / 4L)
  364.         else:
  365.                 if tup[0L] == tup[1L]:
  366.                         pyContainer.Chart_SetNormalTickIncrement(globDict['nWndIDChart_DynGrade'], 0L, 0L, 0.01)
  367.         pyContainer.Chart_SetAxisAutomatic(globDict['nWndIDChart_DynGrade'], 1L, 1L)
  368.         tup = pyContainer.Chart_GetAxisMinMax(globDict['nWndIDChart_DynGrade'], 1L)
  369.         pyContainer.Chart_SetNormalTickIncrement(globDict['nWndIDChart_DynGrade'], 1L, 0L, 1L)
  370.         pyContainer.Chart_SetAxisMinMax(globDict['nWndIDChart_DynGrade'], 1L, tup[0L] - 0.1, tup[1L] + 0.1)
  371.         pyContainer.Chart_EnableRefresh(globDict['nWndIDChart_DynGrade'], 1L)
  372.         return None

  373. def AddGrid_Profit(xmlnode, sWndID):
  374.         globDict = globals()
  375.         globDict[sWndID] = pyContainer.Grid_AddWnd(0L, 0L, 0L, 0L, '')
  376.         pyContainer.Grid_SetGridBkColor(globDict[sWndID], CLR_BACK)
  377.         pyContainer.Grid_SetGridLines(globDict[sWndID], 3L)
  378.         pyContainer.Grid_SetGridLineColor(globDict[sWndID], CLR_GRAY)
  379.         pyContainer.Grid_SetRowCount(globDict[sWndID], 8L)
  380.         pyContainer.Grid_SetColumnCount(globDict[sWndID], 7L)
  381.         pyContainer.Grid_SetFixedTextColor(globDict[sWndID], CLR_GRAY)
  382.         pyContainer.Grid_SetFixedRowCount(globDict[sWndID], 1L)
  383.         pyContainer.Grid_SetFixedColumnCount(globDict[sWndID], 1L)
  384.         pyContainer.Grid_SetListMode(globDict[sWndID], 1L)
  385.         pyContainer.Grid_SetColumnResize(globDict[sWndID], 0L)
  386.         pyContainer.Grid_SetHeaderSort(globDict[sWndID], 0L)
  387.         pyContainer.Grid_SetSingleRowSelection(globDict[sWndID], 1L)
  388.         pyContainer.Grid_SetFixedBkColor(globDict[sWndID], CLR_BACK)
  389.         pyContainer.Grid_SetTextBkColor(globDict[sWndID], CLR_BACK)
  390.         pyContainer.Grid_SetFixedRowFont(globDict[sWndID], 100L, '宋体')
  391.         pyContainer.Grid_SetNonFixedRowFont(globDict[sWndID], 100L, '宋体')
  392.         pyContainer.Grid_SetItem(globDict[sWndID], 0L, 0L, CLR_BACK, CLR_GRAY, '指标 ', 2L)
  393.         pyContainer.Grid_SetItem(globDict[sWndID], 0L, 1L, CLR_BACK, CLR_GRAY, '2007A', 2L)
  394.         pyContainer.Grid_SetItem(globDict[sWndID], 0L, 2L, CLR_BACK, CLR_GRAY, '2008A', 2L)
  395.         pyContainer.Grid_SetItem(globDict[sWndID], 0L, 3L, CLR_BACK, CLR_GRAY, '2009A', 2L)
  396.         pyContainer.Grid_SetItem(globDict[sWndID], 0L, 4L, CLR_BACK, CLR_GRAY, '2010E', 2L)
  397.         pyContainer.Grid_SetItem(globDict[sWndID], 0L, 5L, CLR_BACK, CLR_GRAY, '2011E', 2L)
  398.         pyContainer.Grid_SetItem(globDict[sWndID], 0L, 6L, CLR_BACK, CLR_GRAY, '2012E', 2L)
  399.         pyContainer.Grid_SetItem(globDict[sWndID], 1L, 0L, CLR_BACK, CLR_GRAY, '营业总收入(百万元)', 2L)
  400.         pyContainer.Grid_SetItem(globDict[sWndID], 2L, 0L, CLR_BACK, CLR_GRAY, '营业总收入增长率(%)', 2L)
  401.         pyContainer.Grid_SetItem(globDict[sWndID], 3L, 0L, CLR_BACK, CLR_GRAY, '归属母公司净利润(百万元)', 2L)
  402.         pyContainer.Grid_SetItem(globDict[sWndID], 4L, 0L, CLR_BACK, CLR_GRAY, '净利润增长率(%)', 2L)
  403.         pyContainer.Grid_SetItem(globDict[sWndID], 5L, 0L, CLR_BACK, CLR_GRAY, '摊薄每股收益(元)', 2L)
  404.         pyContainer.Grid_SetItem(globDict[sWndID], 6L, 0L, CLR_BACK, CLR_GRAY, '市盈率(倍)', 2L)
  405.         pyContainer.Grid_SetItem(globDict[sWndID], 7L, 0L, CLR_BACK, CLR_GRAY, 'PEG ', 2L)
  406.         cIndex = 1L
  407.         sValue = ''
  408.         while xmlnode:
  409.                 xmlnode
  410.                 pyContainer.Grid_SetItem(globDict[sWndID], 1L, cIndex, CLR_BACK, CLR_YELLOW, DivideHundred(pyTinyXml.Attribute(xmlnode, 'col1')), 2L)
  411.                 pyContainer.Grid_SetItem(globDict[sWndID], 2L, cIndex, CLR_BACK, CLR_YELLOW, MultiHundred(pyTinyXml.Attribute(xmlnode, 'col2')), 2L)
  412.                 pyContainer.Grid_SetItem(globDict[sWndID], 3L, cIndex, CLR_BACK, CLR_YELLOW, DivideHundred(pyTinyXml.Attribute(xmlnode, 'col3')), 2L)
  413.                 pyContainer.Grid_SetItem(globDict[sWndID], 4L, cIndex, CLR_BACK, CLR_YELLOW, MultiHundred(pyTinyXml.Attribute(xmlnode, 'col4')), 2L)
  414.                 pyContainer.Grid_SetItem(globDict[sWndID], 5L, cIndex, CLR_BACK, CLR_YELLOW, FormatDecimal(pyTinyXml.Attribute(xmlnode, 'col5')), 2L)
  415.                 pyContainer.Grid_SetItem(globDict[sWndID], 6L, cIndex, CLR_BACK, CLR_YELLOW, FormatDecimal(pyTinyXml.Attribute(xmlnode, 'col6')), 2L)
  416.                 pyContainer.Grid_SetItem(globDict[sWndID], 7L, cIndex, CLR_BACK, CLR_YELLOW, FormatDecimal(pyTinyXml.Attribute(xmlnode, 'col7')), 2L)
  417.                 cIndex += 1L
  418.                 xmlnode = pyTinyXml.NextSiblingElement(xmlnode)
  419.         else:
  420.                 xmlnode
  421.         pyContainer.Grid_SelectRows(globDict[sWndID], 1L)
  422.         for row in range(0L, 8L):
  423.                 pyContainer.Grid_SetRowHeight(globDict[sWndID], row, GRID_ROW_HEIGHT)
  424.         for col in range(1L, 7L):
  425.                 pyContainer.Grid_SetColumnWidth(globDict[sWndID], col, 100L)
  426.         pyContainer.Grid_SetColumnWidth(globDict[sWndID], 0L, 180L)

  427. def AddGrid_Detail():
  428.         globDict = globals()
  429.         nMaxRow = len(globDict['g_dictGradeReport'])
  430.         globDict['nWndIDGrid_Detail'] = pyContainer.Grid_AddWnd(0L, 0L, 0L, 0L, '')
  431.         pyContainer.Grid_IsAppendFrame(globDict['nWndIDGrid_Detail'], 1L)
  432.         pyContainer.Grid_Frame_SetStaticColor(globDict['nWndIDGrid_Detail'], CLR_BACK)
  433.         pyContainer.Grid_SetGridBkColor(globDict['nWndIDGrid_Detail'], CLR_BACK)
  434.         pyContainer.Grid_SetGridLines(globDict['nWndIDGrid_Detail'], 3L)
  435.         pyContainer.Grid_SetGridLineColor(globDict['nWndIDGrid_Detail'], CLR_GRAY)
  436.         pyContainer.Grid_SetRowCount(globDict['nWndIDGrid_Detail'], 2L + nMaxRow)
  437.         pyContainer.Grid_SetColumnCount(globDict['nWndIDGrid_Detail'], 21L)
  438.         pyContainer.Grid_SetFixedTextColor(globDict['nWndIDGrid_Detail'], CLR_GRAY)
  439.         pyContainer.Grid_SetFixedRowCount(globDict['nWndIDGrid_Detail'], 2L)
  440.         pyContainer.Grid_SetFixedColumnCount(globDict['nWndIDGrid_Detail'], 4L)
  441.         pyContainer.Grid_SetListMode(globDict['nWndIDGrid_Detail'], 1L)
  442.         pyContainer.Grid_SetColumnResize(globDict['nWndIDGrid_Detail'], 0L)
  443.         pyContainer.Grid_SetHeaderSort(globDict['nWndIDGrid_Detail'], 1L)
  444.         pyContainer.Grid_SetSingleRowSelection(globDict['nWndIDGrid_Detail'], 1L)
  445.         pyContainer.Grid_SetFixedBkColor(globDict['nWndIDGrid_Detail'], CLR_BACK)
  446.         pyContainer.Grid_SetArrowDisplayRow(globDict['nWndIDGrid_Detail'], 1L)
  447.         pyContainer.Grid_SetTextBkColor(globDict['nWndIDGrid_Detail'], CLR_BACK)
  448.         pyContainer.Grid_SetFixedRowFont(globDict['nWndIDGrid_Detail'], 100L, '宋体')
  449.         pyContainer.Grid_SetNonFixedRowFont(globDict['nWndIDGrid_Detail'], 100L, '宋体')
  450.         pyContainer.Grid_SetNonSortColWidth(globDict['nWndIDGrid_Detail'], 1L)
  451.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 0L, CLR_BACK, CLR_GRAY, '序号', 1L)
  452.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 1L, CLR_BACK, CLR_GRAY, '发布时间', 1L)
  453.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 2L, CLR_BACK, CLR_GRAY, '机构', 1L)
  454.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 3L, CLR_BACK, CLR_GRAY, '分析师', 1L)
  455.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 4L, CLR_BACK, CLR_GRAY, '最新评级', 1L)
  456.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 5L, CLR_BACK, CLR_GRAY, '目标价', 1L)
  457.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 6L, CLR_BACK, CLR_GRAY, '前次评级', 1L)
  458.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 19L, CLR_BACK, CLR_GRAY, '原文', 1L)
  459.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, 20L, CLR_BACK, CLR_GRAY, '报告摘要', 1L)
  460.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 0L, 4L, CLR_BACK, CLR_GRAY, '评级', 1L)
  461.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 0L, 7L, CLR_BACK, CLR_GRAY, '摊薄每股收益(元)', 1L)
  462.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 0L, 10L, CLR_BACK, CLR_GRAY, '市盈率', 1L)
  463.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 0L, 13L, CLR_BACK, CLR_GRAY, '营业总收入(百万元)', 1L)
  464.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 0L, 16L, CLR_BACK, CLR_GRAY, '归属母公司的净利润(百万元)', 1L)
  465.         pyContainer.Grid_MergeFixedCells(globDict['nWndIDGrid_Detail'], 0L, 4L, 0L, 6L, 0L, 4L)
  466.         for i in range(0L, 4L):
  467.                 pyContainer.Grid_MergeFixedCells(globDict['nWndIDGrid_Detail'], 0L, i, 1L, i, 1L, i)
  468.         pyContainer.Grid_MergeFixedCells(globDict['nWndIDGrid_Detail'], 0L, 19L, 1L, 19L, 1L, 19L)
  469.         pyContainer.Grid_MergeFixedCells(globDict['nWndIDGrid_Detail'], 0L, 20L, 1L, 20L, 1L, 20L)
  470.         for i in range(0L, 4L):
  471.                 pyContainer.Grid_MergeFixedCells(globDict['nWndIDGrid_Detail'], 0L, i * 3L + 7L, 0L, i * 3L + 9L, 0L, i * 3L + 7L)
  472.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, i * 3L + 7L, CLR_BACK, CLR_GRAY, '2010E', 1L)
  473.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, i * 3L + 8L, CLR_BACK, CLR_GRAY, '2011E', 1L)
  474.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], 1L, i * 3L + 9L, CLR_BACK, CLR_GRAY, '2011E', 1L)
  475.         dict = {}
  476.         dict = globDict['g_dictGradeReport']
  477.         for rindex in range(0L, nMaxRow):
  478.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 0L, CLR_BACK, CLR_YELLOW, str(rindex + 1L), 1L)
  479.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 1L, CLR_BACK, CLR_YELLOW, FormatReport(dict[rindex][0L]), 1L)
  480.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 2L, CLR_BACK, CLR_YELLOW, dict[rindex][1L], 1L)
  481.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 3L, CLR_BACK, CLR_YELLOW, dict[rindex][2L], 1L)
  482.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 4L, CLR_BACK, CLR_YELLOW, FormatStr(dict[rindex][3L]), 1L)
  483.                 sValue = FormatDecimal(dict[rindex][4L])
  484.                 sValue += '/'
  485.                 sValue += FormatDecimal(dict[rindex][5L])
  486.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 5L, CLR_BACK, CLR_YELLOW, sValue, 1L)
  487.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 6L, CLR_BACK, CLR_YELLOW, FormatStr(dict[rindex][6L]), 1L)
  488.         for cIndex in range(7L, 19L):
  489.                 pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, cIndex, CLR_BACK, CLR_YELLOW, FormatDecimal(dict[rindex][cIndex]), 1L)
  490.         nlen = len(dict[rindex][19L])
  491.         strtype = dict[rindex][19L][nlen - 3L:nlen]
  492.         strtype2 = dict[rindex][19L][nlen - 4L:nlen]
  493.         if strtype == 'doc' or strtype2 == 'docx':
  494.                 pyContainer.Grid_SetImage(globDict['nWndIDGrid_Detail'], rindex + 2L, 19L, 2L)
  495.         else:
  496.                 pyContainer.Grid_SetImage(globDict['nWndIDGrid_Detail'], rindex + 2L, 19L, 1L)
  497.         pyContainer.Grid_SetHideStr(globDict['nWndIDGrid_Detail'], rindex + 2L, 19L, dict[rindex][19L])
  498.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 19L, CLR_BACK, CLR_YELLOW, '', 1L)
  499.         pyContainer.Grid_SetImage(globDict['nWndIDGrid_Detail'], rindex + 2L, 20L, 0L)
  500.         pyContainer.Grid_SetHideStr(globDict['nWndIDGrid_Detail'], rindex + 2L, 20L, dict[rindex][20L])
  501.         pyContainer.Grid_SetItem(globDict['nWndIDGrid_Detail'], rindex + 2L, 20L, CLR_BACK, CLR_YELLOW, '', 1L)
  502.         for row in range(0L, 2L + nMaxRow):
  503.                 pyContainer.Grid_SetRowHeight(globDict['nWndIDGrid_Detail'], row, GRID_ROW_HEIGHT)
  504.         if nMaxRow == 0L:
  505.                 pyContainer.Grid_SetRowCount(globDict['nWndIDGrid_Detail'], 3L)
  506.                 pyContainer.Grid_SetRowHeight(globDict['nWndIDGrid_Detail'], 2L, 0L)
  507.         pyContainer.Grid_SetColumnWidth(globDict['nWndIDGrid_Detail'], 0L, 43L)
  508.         for col in range(1L, 21L):
  509.                 pyContainer.Grid_SetColumnWidth(globDict['nWndIDGrid_Detail'], col, 80L)
  510.         pyContainer.Grid_SetColumnWidth(globDict['nWndIDGrid_Detail'], 19L, 0L)
  511.         for cIndex in range(7L, 19L):
  512.                 pyContainer.Grid_SetColumnType(globDict['nWndIDGrid_Detail'], cIndex, 1L)

  513. def InitContainer(datafile):
  514.         #[NODE: 2151]
  515.         xmlelement_0 = pyTinyXml.FirstChildElement(xmlelement)

  516.         #[NODE: 2176]
  517.         xmlelement_0
  518.         sKey = pyTinyXml.Attribute(xmlelement_0, 'col0')
  519.         T001 = pyTinyXml.Attribute(xmlelement_0, 'col1')
  520.         globDict['g_dictDynGrade'][sKey] = [T001]
  521.         xmlelement_0 = pyTinyXml.NextSiblingElement(xmlelement_0)

  522.         #[NODE: 2248]
  523.         xmlelement_0

  524.         #[NODE: 2257]
  525.         xmlelement

  526.         #[NODE: 2258]
  527.         FillChart_DynGrade()
  528.         globDict['nWndIDTitle_Prifit'] = pyContainer.Title_AddWnd(0L, 0L, 0L, 0L, '')
  529.         pyContainer.Title_SetBkColor(globDict['nWndIDTitle_Prifit'], CLR_BACK)
  530.         pyContainer.Title_HideGoBack(globDict['nWndIDTitle_Prifit'], 1L)
  531.         pyContainer.Title_SetFont(globDict['nWndIDTitle_Prifit'], 13L, '宋体', 1L)
  532.         pyContainer.Title_SetTextColor(globDict['nWndIDTitle_Prifit'], CLR_QING, 1L)
  533.         pyContainer.Title_SetTipText(globDict['nWndIDTitle_Prifit'], '盈利预测综合值(一致预期)')
  534.         xmlProfit = 0L
  535.         if xmlelement:
  536.                 xmlelement
  537.                 xmlelement = pyTinyXml.NextSiblingElement(xmlelement)
  538.                 if pyTinyXml.Attribute(xmlelement, 'id') == '1':
  539.                         xmlProfit = pyTinyXml.FirstChildElement(xmlelement)
  540.         else:
  541.                 xmlelement
  542.         AddGrid_Profit(xmlProfit, 'nWndIDGrid_Prifit')
  543.         globDict['nWndIDTitle_Detail'] = pyContainer.Title_AddWnd(0L, 0L, 0L, 0L, '')
  544.         pyContainer.Title_SetBkColor(globDict['nWndIDTitle_Detail'], CLR_BACK)
  545.         pyContainer.Title_HideGoBack(globDict['nWndIDTitle_Detail'], 1L)
  546.         pyContainer.Title_SetFont(globDict['nWndIDTitle_Detail'], 13L, '宋体', 1L)
  547.         pyContainer.Title_SetTextColor(globDict['nWndIDTitle_Detail'], CLR_QING, 1L)
  548.         pyContainer.Title_SetTipText(globDict['nWndIDTitle_Detail'], '机构评级与预测明细表')

  549.         #[NODE: 2640]
  550.         xmlelement
  551.         xmlelement = pyTinyXml.NextSiblingElement(xmlelement)

  552.         #[NODE: 2680]
  553.         xmlelement_0 = pyTinyXml.FirstChildElement(xmlelement)
  554.         rindex = 0L

  555.         #[NODE: 2711]
  556.         xmlelement_0
  557.         T001 = pyTinyXml.Attribute(xmlelement_0, 'col0')
  558.         T002 = pyTinyXml.Attribute(xmlelement_0, 'col1')
  559.         T003 = pyTinyXml.Attribute(xmlelement_0, 'col2')
  560.         T004 = pyTinyXml.Attribute(xmlelement_0, 'col3')
  561.         T005 = pyTinyXml.Attribute(xmlelement_0, 'col4')
  562.         T006 = pyTinyXml.Attribute(xmlelement_0, 'col5')
  563.         T007 = pyTinyXml.Attribute(xmlelement_0, 'col6')
  564.         T008 = pyTinyXml.Attribute(xmlelement_0, 'col7')
  565.         T009 = pyTinyXml.Attribute(xmlelement_0, 'col8')
  566.         T010 = pyTinyXml.Attribute(xmlelement_0, 'col9')
  567.         T011 = pyTinyXml.Attribute(xmlelement_0, 'col10')
  568.         T012 = pyTinyXml.Attribute(xmlelement_0, 'col11')
  569.         T013 = pyTinyXml.Attribute(xmlelement_0, 'col12')
  570.         T014 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col13'))
  571.         T015 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col14'))
  572.         T016 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col15'))
  573.         T017 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col16'))
  574.         T018 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col17'))
  575.         T019 = DivideHundred(pyTinyXml.Attribute(xmlelement_0, 'col18'))
  576.         T020 = pyTinyXml.Attribute(xmlelement_0, 'col19')
  577.         T021 = pyTinyXml.Attribute(xmlelement_0, 'col20')
  578.         globDict['g_dictGradeReport'][rindex] = [T001, T002, T003, T004, T005, T006, T007, T008, T009, T010, T011, T012, T013, T014, T015, T016, T017, T018, T019, T020, T021]
  579.         rindex += 1L
  580.         xmlelement_0 = pyTinyXml.NextSiblingElement(xmlelement_0)

  581.         #[NODE: 3231]
  582.         xmlelement_0

  583.         #[NODE: 3240]
  584.         xmlelement

  585.         #[NODE: 3241]
  586.         AddGrid_Detail()
  587.         globDict['nWndIDEdit_Desc'] = pyContainer.Edit_AddWnd(0L, 0L, nEditWidth, 0L, '')
  588.         pyContainer.Edit_SetBkColor(globDict['nWndIDEdit_Desc'], CLR_BACK)
  589.         pyContainer.Edit_AddText(globDict['nWndIDEdit_Desc'], '使用说明:\r\n', CLR_RED, 10L, '宋体', 1L, 0L, 0L)
  590.         pyContainer.Edit_AddText(globDict['nWndIDEdit_Desc'], '\t1、投资综合评级:我们将来自证券研究机构的投资评级进行1-5档标准化,给予最高5分最低1分的标准分值。买入=5、增持=4、中性=3、减持=2、卖出=1。投资评级综合值根据各机构投资评级得分简单平均获得,计算时段为近三个月。按照上速赋值计算,四舍五入确定综合评级:[1.0, 1.5) 卖出;[1.5, 2.5) 减持;[2.5, 3.5) 中性;[3.5, 4.5) 增持;[4.5, 5.0] 买入。r\n', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
  591.         pyContainer.Edit_AddText(globDict['nWndIDEdit_Desc'], '\t2、盈利预测综合值:我们共收录包括营业总收入、归属母公司的净利润、摊薄每股收益、市盈率和PEG共5项盈利预测指标,相应的盈利预测综合值是根据各分析师预测值进行简单平均获得,计算时段为近三个月。\r\n', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
  592.         pyContainer.Edit_AddText(globDict['nWndIDEdit_Desc'], '\t3、目标价(一致预期):目标价的计算是根据各个分析师预测数据的算数平均而来,计算时段为近三个月。\r\n', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
  593.         pyContainer.Edit_AddText(globDict['nWndIDEdit_Desc'], '\t4、PEG:预测市盈率 / 未来1年归属母公司净利润增长率*100。\r\n', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
  594.         pyContainer.Edit_SetLineSpacing(globDict['nWndIDEdit_Desc'], 9L)
  595.         globDict['g_bFlag'] = 1L
  596.         pyContainer.SetBottomInterval(0L)
  597.         ReSize('', '', 0L)

  598.         #[NODE: 0&93]
  599.         globDict = globals()
  600.         pyContainer.SetBkClr(CLR_BACK)
  601.         globDict['g_nErrCode'] = 0L
  602.         globDict['g_bFlag'] = 0L
  603.         nPos = datafile.find('nojy.xml')
  604.         nLen = len('nojy.xml')
  605.         nPathLen = len(datafile)
  606.         if nPos != -1L and nPathLen == nPos + nLen:
  607.                 globDict['g_nErrCode'] = 1L
  608.         nPos = datafile.find('noright.xml')
  609.         nLen = len('noright.xml')
  610.         if nPos != -1L and nPathLen == nPos + nLen:
  611.                 globDict['g_nErrCode'] = 2L
  612.         if globDict['g_nErrCode'] != 0L:
  613.                 globDict['nWndIDEdit_Error'] = pyContainer.Edit_AddWnd(0L, 0L, nEditWidth, 0L, '')
  614.                 pyContainer.Edit_SetBkColor(globDict['nWndIDEdit_Error'], CLR_BACK)
  615.                 pyContainer.Edit_SetLineSpacing(globDict['nWndIDEdit_Error'], 9L)
  616.                 if globDict['g_nErrCode'] == 1L:
  617.                         pyContainer.Edit_AddText(globDict['nWndIDEdit_Error'], '您尚未登陆交易', CLR_WHITE, 9L, '宋体', 0L, 0L, 0L)
  618.                         pyContainer.Edit_DoExtraAttribute(globDict['nWndIDEdit_Error'], 1L, 0L, 0L)
  619.                 else:
  620.                         if globDict['g_nErrCode'] == 2L:
  621.                                 pyContainer.Edit_AddText(globDict['nWndIDEdit_Error'], '\t您目前尚不能使用该产品或服务。请到定制中心查看是否拥有该产品或服务的权限。有权限的情况:即可进行定制;没有权限的情况:如想享用本产品或服务,具体获取方式和途径请咨询客服热线(全国:4008888818 四川省内95584)。\r\n', CLR_WHITE, 9L, '宋体', 0L, 0L, 0L)
  622.                 pyContainer.SetBottomInterval(50L)
  623.                 ReSize('', '', 1L)
  624.         pyTinyXml.LoadFile(datafile)
  625.         pyContainer.SetBottomInterval(900L)
  626.         ReSize('', '', 1L)
  627.         xmlroot = pyTinyXml.RootElement()
  628.         if xmlroot:
  629.                 xmlroot
  630.                 globDict['g_StockCode'] = pyTinyXml.Attribute(xmlroot, 'code')
  631.                 globDict['g_StockName'] = pyTinyXml.Attribute(xmlroot, 'name')
  632.                 T001 = pyTinyXml.Attribute(xmlroot, 'rate')
  633.                 T002 = pyTinyXml.Attribute(xmlroot, 'value')
  634.                 T003 = pyTinyXml.Attribute(xmlroot, 'price')
  635.                 T004 = pyTinyXml.Attribute(xmlroot, 'buy')
  636.                 T005 = pyTinyXml.Attribute(xmlroot, 'inc')
  637.                 T006 = pyTinyXml.Attribute(xmlroot, 'neutral')
  638.                 T007 = pyTinyXml.Attribute(xmlroot, 'reduce')
  639.                 T008 = pyTinyXml.Attribute(xmlroot, 'sell')
  640.                 T009 = pyTinyXml.Attribute(xmlroot, 'none')
  641.                 globDict['g_listCurGrade'] = [T001, T002, T003, T004, T005, T006, T007, T008, T009]
  642.         else:
  643.                 xmlroot
  644.         globDict['nWndIDTitle_Stock'] = pyContainer.Title_AddWnd(0L, 0L, 0L, 0L, '')
  645.         pyContainer.Title_SetBkColor(globDict['nWndIDTitle_Stock'], CLR_BACK)
  646.         pyContainer.Title_HideGoBack(globDict['nWndIDTitle_Stock'], 1L)
  647.         pyContainer.Title_SetFont(globDict['nWndIDTitle_Stock'], 17L, '宋体', 1L)
  648.         pyContainer.Title_SetTextColor(globDict['nWndIDTitle_Stock'], CLR_RED, 1L)
  649.         pyContainer.Title_SetTipText(globDict['nWndIDTitle_Stock'], FormatStr(globDict['g_StockCode']) + '\t' + FormatStr(globDict['g_StockName']))
  650.         globDict['nWndIDEdit_CollGrade'] = pyContainer.Edit_AddWnd(0L, 0L, 400L, 0L, '')
  651.         pyContainer.Edit_SetBkColor(globDict['nWndIDEdit_CollGrade'], CLR_BACK)
  652.         pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], '综合评级:', CLR_QING, 10L, '宋体', 1L, 0L, 0L)
  653.         if len(globDict['g_listCurGrade']) == 0L:
  654.                 pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], '--', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
  655.         else:
  656.                 list = []
  657.                 list = globDict['g_listCurGrade']
  658.                 if len(list) != 0L:
  659.                         T003 = list[3L]
  660.                         T004 = list[4L]
  661.                         T005 = list[5L]
  662.                         T006 = list[6L]
  663.                         T007 = list[7L]
  664.                         T008 = list[8L]
  665.                         nTotal = int(T003)
  666.                         nTotal += int(T004)
  667.                         nTotal += int(T005)
  668.                         nTotal += int(T006)
  669.                         nTotal += int(T007)
  670.                         nTotal += int(T008)
  671.                         del list
  672.                 if nTotal != 0L:
  673.                         pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], globDict['g_listCurGrade'][0L] + '[' + FormatDecimal(globDict['g_listCurGrade'][1L]) + ']', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
  674.                 else:
  675.                         pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], '--', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
  676.         pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], '  目标价(一致预期):', CLR_QING, 10L, '宋体', 1L, 0L, 0L)
  677.         if len(globDict['g_listCurGrade']) != 0L:
  678.                 pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], FormatDecimal(globDict['g_listCurGrade'][2L]) + ' 元', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
  679.         else:
  680.                 pyContainer.Edit_AddText(globDict['nWndIDEdit_CollGrade'], '-- 元', CLR_YELLOW, 10L, '宋体', 0L, 0L, 0L)
  681.         pyContainer.Edit_EnableWindow(globDict['nWndIDEdit_CollGrade'], 0L)
  682.         globDict['nWndIDTitle_DynGrade'] = pyContainer.Title_AddWnd(0L, 0L, 0L, 0L, '')
  683.         pyContainer.Title_SetBkColor(globDict['nWndIDTitle_DynGrade'], CLR_BACK)
  684.         pyContainer.Title_HideGoBack(globDict['nWndIDTitle_DynGrade'], 1L)
  685.         pyContainer.Title_SetFont(globDict['nWndIDTitle_DynGrade'], 13L, '宋体', 1L)
  686.         pyContainer.Title_SetTextColor(globDict['nWndIDTitle_DynGrade'], CLR_QING, 1L)
  687.         pyContainer.Title_SetTipText(globDict['nWndIDTitle_DynGrade'], '动态综合评级变化')
  688.         globDict['nWndIDTitle_CurGrade'] = pyContainer.Title_AddWnd(0L, 0L, 0L, 0L, '')
  689.         pyContainer.Title_SetBkColor(globDict['nWndIDTitle_CurGrade'], CLR_BACK)
  690.         pyContainer.Title_HideGoBack(globDict['nWndIDTitle_CurGrade'], 1L)
  691.         pyContainer.Title_SetFont(globDict['nWndIDTitle_CurGrade'], 13L, '宋体', 1L)
  692.         pyContainer.Title_SetTextColor(globDict['nWndIDTitle_CurGrade'], CLR_QING, 1L)
  693.         pyContainer.Title_SetTipText(globDict['nWndIDTitle_CurGrade'], '当前机构评级分布')
  694.         globDict['nWndIDSwitch_CurGrade'] = pyContainer.Switch_AddWnd(0L, 0L, 0L, 0L, '')
  695.         pyContainer.Switch_SetFontColorSchema(globDict['nWndIDSwitch_CurGrade'], CLR_BACK, CLR_GRAY, CLR_GRAY, CLR_BACK, CLR_GRAY, CLR_BACK, CLR_QING, CLR_BACK, CLR_GRAY, 13L, '宋体')
  696.         pyContainer.Switch_InsertLabel(globDict['nWndIDSwitch_CurGrade'], 0L, '评级分布', '')
  697.         pyContainer.Switch_SetStyle(globDict['nWndIDSwitch_CurGrade'], 3L)
  698.         pyContainer.Switch_SetCurLabel(globDict['nWndIDSwitch_CurGrade'], 0L)
  699.         AddChart('nWndIDChart_DynGrade')
  700.         AddPie('nWndIDPie_CurGrade')
  701.         AddGrid_CurGrade()
  702.         FillGrid_CurGrade()
  703.         FillPie_CurGrade()
  704.         xmlelement = 0L
  705.         if xmlroot:
  706.                 xmlroot
  707.                 xmlelement = pyTinyXml.FirstChildElement(xmlroot)
  708.         else:
  709.                 xmlroot

  710.         #[NODE: 2101&2126]
  711.         xmlelement



复制代码

[ 本帖最后由 股票初学12 于 2011-10-12 21:27 编辑 ]
948.middle
2114948
Lv.7

专栏

发表于 2011-10-10 12:19 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
599.middle
2021599
Lv.2

专栏

发表于 2011-10-10 12:24 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
870.middle
2266870
Lv.3

专栏

发表于 2011-10-10 12:25 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
172.middle
1856172
Lv.2

专栏

发表于 2011-10-10 12:27 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
506.middle
2265506
Lv.4

专栏

发表于 2011-10-10 12:28 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
774.middle
691774
Lv.6

专栏

发表于 2011-10-10 12:37 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
967.middle
218967
Lv.7

专栏

发表于 2011-10-10 12:43 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
921.middle
2377921
Lv.5

专栏

发表于 2011-10-10 12:44 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
426.middle
2298426
Lv.4

专栏

发表于 2011-10-10 12:45 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
977.middle
1785977
Lv.4

专栏

发表于 2011-10-10 13:02 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
204.middle
1200204
Lv.4

专栏

发表于 2011-10-10 13:11 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
025.middle
2272025
Lv.4

专栏

发表于 2011-10-10 13:37 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
224.middle
1559224
Lv.4

专栏

发表于 2011-10-10 13:58 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
751.middle
2349751
Lv.5

专栏

发表于 2011-10-10 14:26 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
621.middle
542621
Lv.2

专栏

发表于 2011-10-10 14:50 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
567.middle
2408567
Lv.2

专栏

发表于 2011-10-10 14:59 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
832.middle
2449832
Lv.3

专栏

发表于 2011-10-10 15:14 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
229.middle
1141229
Lv.2

专栏

发表于 2011-10-10 15:32 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
927.middle
2344927
Lv.3

专栏

发表于 2011-10-10 15:32 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
001.middle
1631001
Lv.7

专栏

发表于 2011-10-10 15:36 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
060.middle
886060
Lv.5

专栏

发表于 2011-10-10 15:38 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
820.middle
2000820
Lv.4

专栏

发表于 2011-10-10 15:48 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
856.middle
2307856
Lv.4

专栏

发表于 2011-10-10 16:14 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
108.middle
1223108
Lv.4

专栏

发表于 2011-10-10 16:36 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
874.middle
656874
Lv.5

专栏

发表于 2011-10-10 16:38 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
483.middle
1562483
Lv.7

专栏

发表于 2011-10-10 17:16 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
745.middle
814745
Lv.4

专栏

发表于 2011-10-10 17:50 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
116.middle
2379116
Lv.5

专栏

发表于 2011-10-10 17:59 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
060.middle
1809060
Lv.3
common_100_usergroup_icon

专栏

发表于 2011-10-10 18:07 复制 查看全部楼层
游客,您是(游客)级别,无法查看回复内容,请到新手区学习升级之后才能查看,或直接购买升级后查看。
您需要登录后才可以回帖 登录

本版积分规则 《理想财富服务协议》《免责声明》

楼主 19楼
2楼 20楼
3楼 21楼
4楼 22楼
5楼 23楼
6楼 24楼
7楼 25楼
8楼 26楼
9楼 27楼
10楼 28楼
11楼 29楼
12楼 30楼
13楼  
14楼  
15楼  
16楼  
17楼  
18楼  
100917ezsyqwysystjznce
160828rrwbe8b2ijeeae8w
站长推荐 /1

最新主题

回顶部 到页底