Esempio n. 1
0
        private void loadIni(string sFilename)
        {
            //note: requires absolute path to file.
            if (!File.Exists(sFilename))
            {
                return;
            }
            IniFileParsing ifParsing = new IniFileParsing(sFilename, true);

            try
            {
                CsIniLoadHelper loader = new CsIniLoadHelper(ifParsing, "main");
                double          nX0    = loader.getDouble("X0");
                double          nX1    = loader.getDouble("X1");
                double          nY0    = loader.getDouble("Y0");
                double          nY1    = loader.getDouble("Y1");
                plotCntrl.setBounds(nX0, nX1, nY0, nY1);
                plotCntrl.param1       = loader.getDouble("param1");
                plotCntrl.param2       = loader.getDouble("param2");
                plotCntrl.param3       = loader.getDouble("param3", true);
                plotCntrl.param4       = loader.getDouble("param4", true);
                plotCntrl.paramSettle  = loader.getInt("paramSettle");
                plotCntrl.paramShading = loader.getDouble("paramShading");

                //these are transformed, so set the ui instead of the prop. Call to Redraw will retrieve this.
                mnuAdvShades.Checked = loader.getInt("bShading") != 0;
                mnuAdvPoints.Checked = loader.getInt("bShading") == 0;
                txtExpression.Text   = loader.getString("paramExpression");
                txtP0.Text           = loader.getString("paramP0");
                txtInit.Text         = loader.getString("paramInit");
            }
            catch (IniFileParsingException err)
            {
                MessageBox.Show("Prefs Error:" + err.ToString());
                return;
            }

            //set ui
            double p1 = plotCntrl.param1; double p2 = plotCntrl.param2;
            double p3 = plotCntrl.param3; double p4 = plotCntrl.param4;
            double ps = plotCntrl.paramShading; double pst = plotCntrl.paramSettle;

            lblParam1.Text   = p1.ToString();
            lblParam2.Text   = p2.ToString();
            lblSettling.Text = pst.ToString();
            lblShading.Text  = ps.ToString();

            setSliderToValue(ps, tbShading);
            setSliderToValue(p1, tbParam1);
            setSliderToValue(p2, tbParam2);
            setSliderToValue(p3, tbParam3);
            setSliderToValue(p4, tbParam4);

            Redraw();
        }
        private void loadIni(string sFilename)
        {
            //note: requires absolute path to file.
            if (!File.Exists(sFilename)) return;
            IniFileParsing ifParsing = new IniFileParsing(sFilename, true);
            try
            {
                CsIniLoadHelper loader = new CsIniLoadHelper(ifParsing, "main");
                double nX0 = loader.getDouble("X0");
                double nX1 = loader.getDouble("X1");
                double nY0 = loader.getDouble("Y0");
                double nY1 = loader.getDouble("Y1");
                plotCntrl.setBounds(nX0, nX1, nY0, nY1);
                plotCntrl.param1 = loader.getDouble("param1");
                plotCntrl.param2 = loader.getDouble("param2");
                plotCntrl.param3 = loader.getDouble("param3", true);
                plotCntrl.param4 = loader.getDouble("param4", true);
                plotCntrl.paramSettle = loader.getInt("paramSettle");
                plotCntrl.paramShading = loader.getDouble("paramShading");

                //these are transformed, so set the ui instead of the prop. Call to Redraw will retrieve this.
                mnuAdvShades.Checked = loader.getInt("bShading")!=0;
                mnuAdvPoints.Checked = loader.getInt("bShading")==0;
                txtExpression.Text = loader.getString("paramExpression");
                txtP0.Text = loader.getString("paramP0");
                txtInit.Text = loader.getString("paramInit");

            }
            catch (IniFileParsingException err)
            {
                MessageBox.Show("Prefs Error:"+err.ToString());
                return;
            }

            //set ui
            double p1 = plotCntrl.param1; double p2 = plotCntrl.param2;
            double p3 = plotCntrl.param3; double p4 = plotCntrl.param4;
            double ps = plotCntrl.paramShading; double pst = plotCntrl.paramSettle;
            lblParam1.Text = p1.ToString();
            lblParam2.Text = p2.ToString();
            lblSettling.Text = pst.ToString();
            lblShading.Text = ps.ToString();
            
            setSliderToValue(ps, tbShading);
            setSliderToValue(p1, tbParam1);
            setSliderToValue(p2, tbParam2);
            setSliderToValue(p3, tbParam3);
            setSliderToValue(p4, tbParam4);

            Redraw();
        }
Esempio n. 3
0
        private void loadIni(string sFilename)
        {
            //note: requires absolute path to file.
            if (!File.Exists(sFilename)) return;
            IniFileParsing ifParsing = new IniFileParsing(sFilename, true);
            try
            {
                CsIniLoadHelper loader = new CsIniLoadHelper(ifParsing, "main_portrait");
                double nX0 = loader.getDouble("X0");
                double nX1 = loader.getDouble("X1");
                double nY0 = loader.getDouble("Y0");
                double nY1 = loader.getDouble("Y1");
                plotCntrl.setBounds(nX0, nX1, nY0, nY1);
                plotCntrl.param1 = loader.getDouble("param1");
                plotCntrl.param2 = loader.getDouble("param2");
                plotCntrl.param3 = loader.getDouble("param3", true);
                plotCntrl.param4 = loader.getDouble("param4", true);
                plotCntrl.paramSettle = loader.getInt("paramSettle");
                plotCntrl.paramTotalIters = loader.getInt("paramTotalIters");

                //these are transformed, so set the ui instead of the prop. Call to Redraw will retrieve this.
                txtExpression.Text = loader.getString("paramExpression");
                txtInit.Text = loader.getString("paramInit");

            }
            catch (IniFileParsingException err)
            {
                MessageBox.Show("Prefs Error:"+err.ToString());
                return;
            }

            //set ui
            double p1 = plotCntrl.param1; double p2 = plotCntrl.param2;
            double p3 = plotCntrl.param3; double p4 = plotCntrl.param4;
            int npoints = plotCntrl.paramTotalIters; int nsettle = plotCntrl.paramSettle;

            setSliderToValue(npoints, tbTotalPoints, lblTotalPoints);
            setSliderToValue(nsettle, tbSettling, lblSettling);
            setSliderToValue(p1, tbParam1, lblParam1);
            setSliderToValue(p2, tbParam2, lblParam2);
            setSliderToValue(p3, tbParam3, lblParam3);
            setSliderToValue(p4, tbParam4, lblParam4);

            Redraw();
        }