Ignore:
Timestamp:
Mar 17, 2016 12:41:47 PM (9 years ago)
Author:
ajj
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
ec36e48
Parents:
1c628f0
Message:

Making easy sum model work with sasmodels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/calculator/model_editor.py

    rbac3988 r26d5aa5  
    589589                    else: 
    590590                        out_f.write(line + "\n") 
     591                elif line.count("P1 = make_class"): 
     592                    out_f.write(line % (name1) + "\n") 
     593                elif line.count("P2 = make_class"): 
     594                    out_f.write(line % (name2) + "\n") 
     595 
    591596                elif line.count("self.description = '%s'"): 
    592597                    out_f.write(line % description + "\n") 
     
    12631268import copy 
    12641269from sas.models.pluginmodel import Model1DPlugin 
     1270from sasmodels.sasview_model import make_class 
     1271from sasmodels.core import load_model_info 
    12651272# User can change the name of the model (only with single functional model) 
    12661273#P1_model: 
    1267 #from sasmodels.models import %s as P1 
    12681274#from %s import Model as P1 
    12691275 
    12701276#P2_model: 
    1271 #from sasmodels.models import %s as P2 
    12721277#from %s import Model as P2 
    12731278import os 
     
    12781283    def __init__(self): 
    12791284        Model1DPlugin.__init__(self, name='') 
     1285        P1 = make_class(load_model_info('%s')) 
     1286        P2 = make_class(load_model_info('%s')) 
    12801287        p_model1 = P1() 
    12811288        p_model2 = P2() 
Note: See TracChangeset for help on using the changeset viewer.