Пример #1
0
 public Model(ProModelInterface model, InParamsExt inParams, OutParams previewParams, OptionParams optionParams)
 {
     this.model         = model;
     this.inParams      = inParams;
     this.previewParams = previewParams;
     this.optionParams  = optionParams;
 }
Пример #2
0
        public OutSet(InParamsExt inParams)
        {
            int ncomps = inParams.comps.Count;

            for (int compi = 0; compi < ncomps; compi++)
            {
                comps.Add(new OutComp(inParams.comps[compi]));
            }
        }
Пример #3
0
 public TransCon(TransCon con)
 {
     Clear();
     foreach (float x in con)
     {
         Add(x);
     }
     inParams = con.inParams;
 }
Пример #4
0
        public CCDCells(CCDCells ccdCells)
        {
            int len = ccdCells.Count;

            this.Clear();
            for (int i = 0; i < len; i++)
            {
                this.Add(new Cell(ccdCells[i].m, ccdCells[i].zone));
            }
            inParams = ccdCells.inParams;
        }
Пример #5
0
 public override void updatePreview(InParamsExt inParams, ViewParams viewParams, OptionParams optionParams)
 {
     if (preview == null)
     {
         preview = new PreviewModel(this, inParams, optionParams);
     }
     preview.update(inParams, null);
     preview.updateOut(viewParams);
     preview.stats.start();
     updatePreviewObservers();
     preview.stats.storeDrawviewTime();
 }
Пример #6
0
        public void update(InParamsExt inParams, OutParams previewParams)
        {
            outParams = new OutParams();

            this.inParams      = inParams;
            this.previewParams = previewParams;
            if (this.previewParams == null)
            {
                this.previewParams = outParams;
            }

            stats.start();
            run();
            stats.storeModelTime();
        }
Пример #7
0
        public void writeOutRaw(string fileName, ViewParams viewParams, InParamsExt inParams, OutParams outParams)
        {
            // *** obsolete; can re-use writeOut instead?
            TextWriter file;

            OutCell[][] rawOutCells;
            string      unitsLabel = "";
            string      label;
            string      addlabel;
            int         nphases;
            int         ncomps;
            int         nseries;
            int         ncells;
            bool        dispDual = (viewParams.phaseDisplay == PhaseDisplayType.UpperLower);
            bool        first;

            if (dispDual)
            {
                nphases = 2;
            }
            else
            {
                nphases = 1;
            }
            ncomps = inParams.comps.Count;
            if (viewParams.peaksDisplay != PeaksDisplayType.Peaks)
            {
                ncomps++;
            }
            nseries = ncomps * nphases;

            if (inParams.natUnits == QuantityType.Steps)
            {
                unitsLabel = "Step";
            }
            else if (inParams.natUnits == QuantityType.Volume)
            {
                unitsLabel = "Volume";
            }
            else if (inParams.natUnits == QuantityType.Time)
            {
                unitsLabel = "Time";
            }
            else if (inParams.natUnits == QuantityType.ReS)
            {
                unitsLabel = "ReS";
            }

            file = new StreamWriter(fileName);
            // labels
            first = true;
            for (int c = 0; c < ncomps; c++)
            {
                if (c < inParams.comps.Count)
                {
                    label = inParams.comps[c].label;
                }
                else
                {
                    label = "Sum";
                }
                for (int i = 0; i < nphases; i++)
                {
                    if (!first)
                    {
                        file.Write(",");
                    }
                    file.Write(unitsLabel);
                    file.Write(",");
                    if (nphases > 1 && (PhaseType)(i + 1) == PhaseType.Upper)
                    {
                        addlabel = "(UP)";
                    }
                    else if (nphases > 1 && (PhaseType)(i + 1) == PhaseType.Lower)
                    {
                        addlabel = "(LP)";
                    }
                    else
                    {
                        addlabel = "";
                    }
                    file.Write(label + addlabel);
                    first = false;
                }
            }
            file.WriteLine();

            // data
            rawOutCells = outParams.outSet.rawOutCells;
            ncells      = rawOutCells[0].Length;
            for (int i = 0; i < ncells; i++)
            {
                first = true;
                for (int s = 0; s < nseries; s++)
                {
                    if (!first)
                    {
                        file.Write(",");
                    }
                    file.Write(string.Format(CultureInfo.InvariantCulture, "{0},{1}", rawOutCells[s][i].pos, rawOutCells[s][i].con));
                    first = false;
                }
                file.WriteLine();
            }
            file.Close();
        }
Пример #8
0
 public CCDCells(InParamsExt inParams)
 {
     this.inParams = inParams;
 }
Пример #9
0
 public LCCDCells(InParamsExt inparams)
     : base(inparams)
 {
 }
Пример #10
0
 public TransCon(InParamsExt inparams)
 {
     this.inParams = inparams;
 }
Пример #11
0
 public override void updateModel(InParamsExt inParams, ViewParams viewParams, OptionParams optionParams, ViewType viewType, bool updateModelReq, bool updateOutReq)
 {
     modelThread = new Thread(new ParameterizedThreadStart(updateModelThreadFunction));
     modelThread.Start(new ModelRunParams(inParams, viewParams, optionParams, viewType, updateModelReq, updateOutReq));
 }
Пример #12
0
 public abstract void updateModel(InParamsExt inParams, ViewParams viewParams, OptionParams optionParams, ViewType viewType, bool updateModelReq, bool updateOutReq);
Пример #13
0
 public abstract void updatePreview(InParamsExt inParams, ViewParams viewParams, OptionParams optionParams);
Пример #14
0
 public TransModel(ProModelInterface model, InParamsExt inParams, OutParams previewParams, OptionParams optionParams)
     : base(model, inParams, previewParams, optionParams)
 {
     mincon = 0.001f;
 }
Пример #15
0
 public PreviewModel(ProModelInterface model, InParamsExt inParams, OptionParams optionParams)
     : base(model, inParams, null, optionParams)
 {
 }