Beispiel #1
0
 public Model(ProModelInterface model, InParamsExt inParams, OutParams previewParams, OptionParams optionParams)
 {
     this.model         = model;
     this.inParams      = inParams;
     this.previewParams = previewParams;
     this.optionParams  = optionParams;
 }
Beispiel #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]));
            }
        }
Beispiel #3
0
 public TransCon(TransCon con)
 {
     Clear();
     foreach (float x in con)
     {
         Add(x);
     }
     inParams = con.inParams;
 }
Beispiel #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;
        }
Beispiel #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();
 }
Beispiel #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();
        }
Beispiel #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();
        }
Beispiel #8
0
 public CCDCells(InParamsExt inParams)
 {
     this.inParams = inParams;
 }
Beispiel #9
0
 public LCCDCells(InParamsExt inparams)
     : base(inparams)
 {
 }
Beispiel #10
0
 public TransCon(InParamsExt inparams)
 {
     this.inParams = inparams;
 }
Beispiel #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));
 }
Beispiel #12
0
 public abstract void updateModel(InParamsExt inParams, ViewParams viewParams, OptionParams optionParams, ViewType viewType, bool updateModelReq, bool updateOutReq);
Beispiel #13
0
 public abstract void updatePreview(InParamsExt inParams, ViewParams viewParams, OptionParams optionParams);
Beispiel #14
0
 public TransModel(ProModelInterface model, InParamsExt inParams, OutParams previewParams, OptionParams optionParams)
     : base(model, inParams, previewParams, optionParams)
 {
     mincon = 0.001f;
 }
Beispiel #15
0
 public PreviewModel(ProModelInterface model, InParamsExt inParams, OptionParams optionParams)
     : base(model, inParams, null, optionParams)
 {
 }