Beispiel #1
0
        string GetString(ModelProgramGraphView v)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("# --- Assemblies ---\n");
            if (reference != null)
            {
                foreach (string r in reference)
                {
                    sb.Append("/r:");
                    sb.Append(r);
                    sb.Append("\n");
                }
            }
            sb.Append("\n# --- Models ---\n");
            if (model != null)
            {
                foreach (string m in model)
                {
                    sb.Append(m);
                    sb.Append("\n");
                }
            }
            if (fsm != null)
            {
                foreach (string f in fsm)
                {
                    sb.Append("/fsm:");
                    sb.Append(f);
                    sb.Append("\n");
                }
            }
            if (!String.IsNullOrEmpty(testSuite))
            {
                sb.Append("/testSuite:");
                sb.Append(testSuite);
                sb.Append("\n");
                sb.Append("/startTestAction:");
                sb.Append(startTestAction);
                sb.Append("\n");
            }
            sb.Append("\n# --- Analysis ---\n");
            sb.Append("/livenessCheckIsOn");
            sb.Append((v.LivenessCheckIsOn ? "" : "-"));
            sb.Append("\n/safetyCheckIsOn");
            sb.Append((v.SafetyCheckIsOn ? "" : "-"));
            sb.Append("\n/deadStatesVisible");
            sb.Append((v.DeadstatesVisible ? "" : "-"));
            sb.Append("\n/deadStateColor:");
            sb.Append(v.DeadStateColor.Name);
            sb.Append("\n/unsafeStateColor:");
            sb.Append(v.UnsafeStateColor.Name);

            sb.Append("\n\n# --- Exploration limits ---\n");
            sb.Append("/initialTransitions:");
            sb.Append(initialTransitions);
            sb.Append("\n/maxTransitions:");
            sb.Append(v.MaxTransitions);

            sb.Append("\n\n# --- States ---\n");
            sb.Append("/nodeLabelsVisible");
            sb.Append((v.NodeLabelsVisible ? "" : "-"));
            sb.Append("\n/acceptingStatesMarked");
            sb.Append((v.AcceptingStatesMarked ? "" : "-"));
            sb.Append("\n/stateShape:");
            sb.Append(v.StateShape.ToString());
            sb.Append("\n/initialStateColor:");
            sb.Append(v.InitialStateColor.Name);

            sb.Append("\n\n# --- Transitions ---\n");
            sb.Append("/transitionLabels:");
            sb.Append(v.TransitionLabels.ToString());
            sb.Append("\n/loopsVisible");
            sb.Append(v.LoopsVisible ? "" : "-");
            sb.Append("\n/combineActions");
            sb.Append(v.CombineActions ? "" : "-");
            sb.Append("\n/mergeLabels");
            sb.Append(v.MergeLabels ? "" : "-");


            sb.Append("\n\n# --- Graph ---\n");
            sb.Append("/hoverColor:");
            sb.Append(v.HoverColor.Name);
            sb.Append("\n/selectionColor:");
            sb.Append(v.SelectionColor.Name);
            sb.Append("\n/direction:");
            sb.Append(v.Direction.ToString());
            sb.Append("\n");

            return(sb.ToString());
        }
        string GetString(ModelProgramGraphView v)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("# --- Assemblies ---\n");
            if (reference != null)
                foreach (string r in reference)
                {
                    sb.Append("/r:");
                    sb.Append(r);
                    sb.Append("\n");
                }
            sb.Append("\n# --- Models ---\n");
            if (model != null)
                foreach (string m in model)
                {
                    sb.Append(m);
                    sb.Append("\n");
                }
            if (fsm != null)
                foreach (string f in fsm)
                {
                    sb.Append("/fsm:");
                    sb.Append(f);
                    sb.Append("\n");
                }
            if (!String.IsNullOrEmpty(testSuite))
            {
                sb.Append("/testSuite:");
                sb.Append(testSuite);
                sb.Append("\n");
                sb.Append("/startTestAction:");
                sb.Append(startTestAction);
                sb.Append("\n");
            }
            sb.Append("\n# --- Analysis ---\n");
            sb.Append("/livenessCheckIsOn");
            sb.Append((v.LivenessCheckIsOn ? "" : "-"));
            sb.Append("\n/safetyCheckIsOn");
            sb.Append((v.SafetyCheckIsOn ? "" : "-"));
            sb.Append("\n/deadStatesVisible");
            sb.Append((v.DeadstatesVisible ? "" : "-"));
            sb.Append("\n/deadStateColor:");
            sb.Append(v.DeadStateColor.Name);
            sb.Append("\n/unsafeStateColor:");
            sb.Append(v.UnsafeStateColor.Name);

            sb.Append("\n\n# --- Exploration limits ---\n");
            sb.Append("/initialTransitions:");
            sb.Append(initialTransitions);
            sb.Append("\n/maxTransitions:");
            sb.Append(v.MaxTransitions);

            sb.Append("\n\n# --- States ---\n");
            sb.Append("/nodeLabelsVisible");
            sb.Append((v.NodeLabelsVisible ? "" : "-"));
            sb.Append("\n/acceptingStatesMarked");
            sb.Append((v.AcceptingStatesMarked ? "" : "-"));
            sb.Append("\n/stateShape:");
            sb.Append(v.StateShape.ToString());
            sb.Append("\n/initialStateColor:");
            sb.Append(v.InitialStateColor.Name);

            sb.Append("\n\n# --- Transitions ---\n");
            sb.Append("/transitionLabels:");
            sb.Append(v.TransitionLabels.ToString());
            sb.Append("\n/loopsVisible");
            sb.Append(v.LoopsVisible ? "" : "-");
            sb.Append("\n/combineActions");
            sb.Append(v.CombineActions ? "" : "-");
            sb.Append("\n/mergeLabels");
            sb.Append(v.MergeLabels ? "" : "-");

            sb.Append("\n\n# --- Graph ---\n");
            sb.Append("/hoverColor:");
            sb.Append(v.HoverColor.Name);
            sb.Append("\n/selectionColor:");
            sb.Append(v.SelectionColor.Name);
            sb.Append("\n/direction:");
            sb.Append(v.Direction.ToString());
            sb.Append("\n");

            return sb.ToString();
        }