Beispiel #1
0
        public WindowSettings(PhiniteSettings settings)
        {
            phi = settings;

            DataContext = this;

            InitializeComponent();
        }
Beispiel #2
0
        public PhiniteSettings(PhiniteSettings source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            settings = new Settings();

            settings.LayoutCreationFrequencyInUse = source.settings.LayoutCreationFrequencyInUse;
            settings.LayoutCreationFrequency      = source.settings.LayoutCreationFrequency;

            settings.EnableAutoResolutionModeInUse = source.settings.EnableAutoResolutionModeInUse;
            settings.EnableAutoResolutionMode      = source.settings.EnableAutoResolutionMode;

            settings.PdflatexInUse = source.settings.PdflatexInUse;
            settings.Pdflatex      = source.settings.Pdflatex;

            settings.PdflatexTimeoutInUse = source.settings.PdflatexTimeoutInUse;
            settings.PdflatexTimeout      = source.settings.PdflatexTimeout;

            settings.PdfViewerInUse = source.settings.PdfViewerInUse;
            settings.PdfViewer      = source.settings.PdfViewer;
        }
Beispiel #3
0
        public WindowUserHelp(PhiniteSettings settings, object machineOperationsLock, FiniteStateMachine machine)
        {
            if (machineOperationsLock == null)
            {
                throw new ArgumentNullException("machineOperationsLock");
            }
            if (machine == null)
            {
                throw new ArgumentNullException("machine");
            }

            this.settings = settings;

            fsmLock = machineOperationsLock;
            fsm     = machine;

            //lock (fsmLock)
            {
                states    = fsm.States;
                accepting = fsm.AcceptingStates;

                newExpression = fsm.NextNotLabeledState;

                parseTree = newExpression.ParseTree;

                newExpressionSimilarities = fsm.NextNotLabeledStateSimilarities;
            }

            newExpressionProcessed = false;
            expressionIsSelected   = false;
            selectedExpression     = -1;
            labeledExpressionsData = null;

            DataContext = this;
            InitializeComponent();

            ParseTreeDrawing.Draw(ParseTreeCanvas, parseTree);

            var data = new List <Tuple <RegularExpression, string, string, string> >();
            int i    = 0;

            foreach (var state in states)
            {
                var stateIsAccepting = accepting.Contains(state);

                StringBuilder s = new StringBuilder();
                if (i == 0)
                {
                    s.Append("initial state");
                }
                if (stateIsAccepting)
                {
                    if (i == 0)
                    {
                        s.Append(", ");
                    }
                    s.Append("accepting state");
                }

                //double similarity = newExpression.Similarity(state);

                data.Add(new Tuple <RegularExpression, string, string, string>(state, String.Format("q{0}", i), s.ToString(),
                                                                               String.Format("{0:0.00}%", newExpressionSimilarities[i] * 100)));

                ++i;
            }

            LabeledExpressionsData = data;
        }