当前位置: 首页>>代码示例>>Python>>正文


Python IvyMessagesInterface.unbind方法代码示例

本文整理汇总了Python中pprzlink.ivy.IvyMessagesInterface.unbind方法的典型用法代码示例。如果您正苦于以下问题:Python IvyMessagesInterface.unbind方法的具体用法?Python IvyMessagesInterface.unbind怎么用?Python IvyMessagesInterface.unbind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pprzlink.ivy.IvyMessagesInterface的用法示例。


在下文中一共展示了IvyMessagesInterface.unbind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: PlotPanel

# 需要导入模块: from pprzlink.ivy import IvyMessagesInterface [as 别名]
# 或者: from pprzlink.ivy.IvyMessagesInterface import unbind [as 别名]

#.........这里部分代码省略.........
        if use_as_x:
            self.x_axis = self.plots[ac_id][message][field]

    def CalcMinMax(self, plot):
        if not self.auto_scale: return
        for x in plot.data:
            self.max = max(self.max, x)
            self.min = min(self.min, x)
            self.frame.SetMinMax(self.min, self.max)

    def FindPlotName(self, ivy_id):
        for ac_id in self.plots:
            for msg in self.plots[ac_id]:
                for field in self.plots[ac_id][msg]:
                    if self.plots[ac_id][msg][field].id == ivy_id:
                        return (ac_id, msg, field)
        return (None, None, None)

    def FindPlot(self, ivy_id):
        (ac_id, msg, field) = self.FindPlotName(ivy_id)
        if ac_id is None:
            return None

        return self.plots[ac_id][msg][field]

    def RemovePlot(self, ivy_id):
        (ac_id, msg, field) = self.FindPlotName(ivy_id)
        if ac_id is None:
            return

        if (self.x_axis is not None) and (self.x_axis.id == ivy_id):
            self.x_axis = None

        self.ivy_interface.unbind(ivy_id)
        del self.plots[ac_id][msg][field]
        if len(self.plots[ac_id][msg]) == 0:
            del self.plots[ac_id][msg]

    def OffsetPlot(self, ivy_id, offset):
        plot = self.FindPlot(ivy_id)
        if plot is None:
            return

        plot.SetOffset(offset)
        print('panel value: %.2f' % value)
        CalcMinMax(plot)

    def ScalePlot(self, ivy_id, offset):
        plot = self.FindPlot(ivy_id)
        if plot is None:
            return

        plot.SetScale(offset)
        CalcMinMax(plot)

    def SetRealTime(self, ivy_id, value):
        plot = self.FindPlot(ivy_id)
        if plot is None:
            return

        plot.SetRealTime(value)

    def SetXAxis(self, ivy_id):
        plot = self.FindPlot(ivy_id)
        if plot is None:
            return
开发者ID:amtcvx,项目名称:paparazzi,代码行数:70,代码来源:plotpanel.py


注:本文中的pprzlink.ivy.IvyMessagesInterface.unbind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。