-# Copyright (C) 2010 Alberto Gomez-Casado
-# W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@tremily.us>
#
# This file is part of Hooke.
#
-# Hooke is free software: you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation, either
-# version 3 of the License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
#
-# Hooke is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with Hooke. If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with Hooke. If not, see <http://www.gnu.org/licenses/>.
"""The ``multifit`` module provides :class:`MultifitPlugin` and
several associated :class:`hooke.command.Command`\s for fitting
from ..command import Command, Argument, Failure
from ..playlist import FilePlaylist
-from ..plugin import Plugin
-from ..plugin.playlist import PlaylistArgument
+from . import Plugin
+from .playlist import PlaylistArgument
class MultifitPlugin (Plugin):
def __init__(self):
super(MultifitPlugin, self).__init__(name='multifit')
+ self._commands = [MultifitCommand(self)]
- def commands(self):
- return [MultifitCommand()]
class MultifitCommand (Command):
"""Presents curves for interactive manual analysis.
"""
#NOTE: centerzero plot modifier should be activated (set centerzero
#1).
- def __init__(self):
+ def __init__(self, plugin):
super(MultifitCommand, self).__init__(
name='multifit',
arguments=[
Perform the fits on the current curve instead of iterating.
""".strip()),
],
- help=self.__doc__)
+ help=self.__doc__, plugin=plugin)
def _run(self, hooke, inqueue, outqueue, params):
counter=0
#remove set leaves some styles disturbing the next graph, fixed by doing do_plot
self.do_plot(0)
if contact_point_index>5.0/6.0*sizeret:
- if params['just one']:
- break
- curveindex+=1
- continue
+ return
self.wlccontact_point=contact_point
self.wlccontact_index=contact_point.index
else:
print '\nWould you like to try again on this same curve?'
if self.YNclick():
- continue
- curveindex+=1
+ return