Esempio n. 1
0
class FunctionFinder_2D(FunctionFinder):
    equationFamilyInclusion = django.forms.MultipleChoiceField(
        widget=myWidgets.BR_CheckboxSelectMultiple_Widget(),
        choices=formConstants.equationCategoryNameChoices2D,
        initial=formConstants.equationCategoryNameChoicesDefaultValues2D)
    smoothnessControl2D = django.forms.ChoiceField(
        choices=formConstants.smoothnessControl2DChoices, initial='4')
Esempio n. 2
0
File: forms.py Progetto: Sturtuk/Zun
class FunctionFinder(UsesDataForm_BaseClass):
    fittingTarget = django.forms.ChoiceField(
        widget=django.forms.widgets.RadioSelect(
            renderer=myWidgets.BR_RadioFieldRenderer),
        choices=formConstants.fittingTargetChoices,
        initial='SSQABS')
    extendedEquationTypes = django.forms.MultipleChoiceField(
        widget=myWidgets.BR_CheckboxSelectMultiple_Widget(),
        choices=formConstants.extendedEquationTypeChoices,
        initial=['STANDARD'])
    dataNameX = django.forms.CharField(max_length=40, initial='X data')
    dataNameY = django.forms.CharField(max_length=40, initial='Y data')
    smoothnessExactOrMax = django.forms.ChoiceField(
        widget=django.forms.widgets.RadioSelect(
            renderer=myWidgets.BR_RadioFieldRenderer),
        choices=formConstants.smoothnessExactOrMaxChoices,
        initial='M')

    def clean(self):  # override, no graph scales in form for function finders
        self.LoadAndVerifyTextData()
        if self.equationBase.dataCache.DependentDataContainsZeroFlag != 0 and self.cleaned_data[
                'fittingTarget'][-3:] == "REL":
            raise django.forms.ValidationError(
                'Your data contains at least one dependent data value of exactly 0.0, a relative fit cannot be performed as divide-by-zero errors would occurr.'
            )
        return self.cleaned_data
Esempio n. 3
0
class FunctionFinder_3D(FunctionFinder):
    equationFamilyInclusion = django.forms.MultipleChoiceField(
        widget=myWidgets.BR_CheckboxSelectMultiple_Widget(),
        choices=formConstants.equationCategoryNameChoices3D,
        initial=formConstants.equationCategoryNameChoicesDefaultValues3D)
    smoothnessControl3D = django.forms.ChoiceField(
        choices=formConstants.smoothnessControl3DChoices, initial='6')
    dataNameZ = django.forms.CharField(max_length=40, initial='Z data')