當前位置: 首頁>>代碼示例>>Python>>正文


Python ObjectDict.position方法代碼示例

本文整理匯總了Python中tornado.util.ObjectDict.position方法的典型用法代碼示例。如果您正苦於以下問題:Python ObjectDict.position方法的具體用法?Python ObjectDict.position怎麽用?Python ObjectDict.position使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tornado.util.ObjectDict的用法示例。


在下文中一共展示了ObjectDict.position方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _form_upload_post

# 需要導入模塊: from tornado.util import ObjectDict [as 別名]
# 或者: from tornado.util.ObjectDict import position [as 別名]

#.........這裏部分代碼省略.........
                    elem_steps =  p.value
                    break
            else:
                ctx.errors._global = ("Lattice Element ({}) missing STEPS property"
                                                    .format(lattice_element.order))
                send_status(400, ctx)
                return

            if outputMode in [1, 2]:
                loop = elem_steps
                if elem_itype in [ -2, 4 ]:
                    # no output for these elements
                    loop = 0
                elif elem_itype < 0:
                    loop = elem_steps + 1
            elif outputMode in [3, 4]:
                loop = 0
                if elem_itype == -28:
                    # only output from monitor
                    loop = 1
            elif outputMode in [5, 6]:
                loop = 1

            for _ in range(loop):

                idx += 1

                try:
                    model_element = ObjectDict()
                    model_element._id = ObjectId()
                    model_element.order = idx+1
                    model_element.model_id = ctx.model._id
                    model_element.lattice_element_id = lattice_element._id
                    model_element.position = model.getSPosition(idx)
                    model_element.properties = []
                    model_element.properties.append(dict(
                        name="BeamCenterX",
                        value=model.getOrbit("X", idx),
                        unit="mm"
                    ))
                    model_element.properties.append(dict(
                        name="BeamCenterY",
                        value=model.getOrbit("Y", idx),
                        unit="mm"
                    ))
                    model_element.properties.append(dict(
                        name="BeamEnergy",
                        value=model.getEnergy(idx),
                        unit="eV"
                    ))
                    model_element.properties.append(dict(
                        name="BeamMomentumCenterX",
                        value=model.getBeamMomentumCentroid("X", idx),
                        unit="rad"
                    ))
                    model_element.properties.append(dict(
                        name="BeamMomentumCenterY",
                        value=model.getBeamMomentumCentroid("Y", idx),
                        unit="rad"
                    ))
                    model_element.properties.append(dict(
                        name="BeamMomentumCenterZ",
                        value=model.getBeamMomentumCentroid("Z", idx),
                        unit="MeV"
                    ))
                    model_element.properties.append(dict(
開發者ID:frib-high-level-controls,項目名稱:phyhlc,代碼行數:70,代碼來源:impact.py


注:本文中的tornado.util.ObjectDict.position方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。