예제 #1
0
        public static void UndumpModel(StringTokenizer st)
        {
            string name = CustomLogicModel.unescape(st.nextToken());
            var    dm   = getModelWithName(name);

            dm.undump(st);
        }
예제 #2
0
        public Adjustable(StringTokenizer st, CirSim sim)
        {
            int e = st.nextTokenInt();

            if (e == -1)
            {
                return;
            }
            Elm        = sim.getElm(e);
            EditItem   = st.nextTokenInt();
            MinValue   = st.nextTokenDouble();
            MaxValue   = st.nextTokenDouble();
            SliderText = CustomLogicModel.unescape(st.nextToken());
        }
예제 #3
0
파일: Scope.cs 프로젝트: mctr909/CircuitSim
        public void Undump(StringTokenizer st)
        {
            _initialize();

            int e = st.nextTokenInt();

            if (e == -1)
            {
                return;
            }

            var ce = CirSim.Sim.getElm(e);

            SetElm(ce);
            Speed = st.nextTokenInt();
            var value = st.nextTokenEnum <VAL>();

            var flags = st.nextTokenInt();

            mScale = st.nextTokenDouble();
            st.nextTokenDouble();

            if (mScale == 0)
            {
                mScale = 0.5;
            }
            Text = null;
            if ((flags & FLAG_PLOTS) != 0)
            {
                try {
                    Position = st.nextTokenInt();
                    int sz = st.nextTokenInt();

                    _setValue(value);
                    /* setValue(0) creates an extra plot for current, so remove that */
                    while (1 < mPlots.Count)
                    {
                        mPlots.RemoveAt(1);
                    }

                    for (int i = 0; i != sz; i++)
                    {
                        var eleNum = st.nextTokenInt();
                        var val    = st.nextTokenEnum <VAL>();
                        var elm    = CirSim.Sim.getElm(eleNum);
                        mPlots.Add(new ScopePlot(elm, val));
                    }
                    while (st.hasMoreTokens())
                    {
                        if (Text == null)
                        {
                            Text = st.nextToken();
                        }
                        else
                        {
                            Text += " " + st.nextToken();
                        }
                    }
                } catch (Exception ex) {
                    throw ex;
                }
            }
            if (Text != null)
            {
                Text = CustomLogicModel.unescape(Text);
            }
            mFlags = flags;
        }