示例#1
0
        /// <summary>
        /// Generates the challenge node.
        /// </summary>
        /// <param name="challengeName">Name of the challenge.</param>
        /// <param name="experiment">The experiment to which new component is added.</param>
        /// <param name="positionX">The position X.</param>
        /// <param name="positionY">The position Y.</param>
        /// <returns></returns>
        private static ChallengeNode CreateChallengeNode(string challengeName, IEditableExperiment experiment, double positionX, double positionY)
        {
            var data = new SerializedVertexDataWithSize();

            data.X      = positionX;
            data.Y      = positionY;
            data.Width  = 160;
            data.Height = 160;

            string componentId = Guid.NewGuid().ToString();

            var componentGraph = new CompositeComponentEditableGraph(true);

            if (componentGraph.References != null)
            {
                componentGraph.References = experiment.References.CopyCollection();
            }

            data.Metadata = new ChallengeMetadata(componentGraph, challengeName, System.IO.Path.GetDirectoryName(experiment.ExperimentInfo.FilePath));

            string componentNodeId = Guid.NewGuid().ToString();
            string componentName   = data.Metadata.Label;

            var challengeNode = new ChallengeNode(Guid.NewGuid().ToString(), data);

            experiment.AddVertex(challengeNode);

            return(challengeNode);
        }
示例#2
0
        /// <summary>
        /// Generates the scope node.
        /// </summary>
        /// <param name="scopeName">Name of the scope.</param>
        /// <param name="experiment">The experiment to which new component is added.</param>
        /// <param name="positionX">The position X.</param>
        /// <param name="positionY">The position Y.</param>
        /// <returns></returns>
        private static LoopScopeNode CreateLoopScopeNode(string scopeName, IEditableExperiment experiment, double positionX, double positionY)
        {
            var data = new SerializedVertexDataWithSize();

            data.X      = positionX;
            data.Y      = positionY;
            data.Width  = 160;
            data.Height = 160;

            string componentId = Guid.NewGuid().ToString();

            var componentGraph = new CompositeComponentEditableGraph(true);

            componentGraph.References = new System.Collections.ObjectModel.ObservableCollection <TraceLabSDK.PackageSystem.IPackageReference>(experiment.References);

            data.Metadata = new LoopScopeMetadata(componentGraph, scopeName, System.IO.Path.GetDirectoryName(experiment.ExperimentInfo.FilePath));

            string componentNodeId = Guid.NewGuid().ToString();
            string componentName   = data.Metadata.Label;

            var loopScopeNode = new LoopScopeNode(Guid.NewGuid().ToString(), data);

            experiment.AddVertex(loopScopeNode);

            return(loopScopeNode);
        }
示例#3
0
        /// <summary>
        /// Generates the scope node at the given position.
        /// </summary>
        /// <param name="scopeName">Name of the scope.</param>
        /// <param name="experiment">The experiment to which new component is added.</param>
        /// <param name="positionX">The position X.</param>
        /// <param name="positionY">The position Y.</param>
        /// <returns></returns>
        private static ScopeNode GenerateScopeNode(string scopeName, IExperiment experiment, double positionX, double positionY, double width, double height)
        {
            var data = new SerializedVertexDataWithSize();

            data.X      = positionX;
            data.Y      = positionY;
            data.Width  = width;
            data.Height = height;

            string componentId = Guid.NewGuid().ToString();

            var componentGraph = new CompositeComponentEditableGraph(true);

            if (componentGraph.References != null)
            {
                componentGraph.References = experiment.References.CopyCollection();
            }

            data.Metadata = new ScopeMetadata(componentGraph, scopeName, System.IO.Path.GetDirectoryName(experiment.ExperimentInfo.FilePath));

            string componentNodeId = Guid.NewGuid().ToString();
            string componentName   = data.Metadata.Label;

            var scopeNode = new ScopeNode(Guid.NewGuid().ToString(), data);

            return(scopeNode);
        }
        public override SerializedVertexData Clone()
        {
            SerializedVertexDataWithSize clone = new SerializedVertexDataWithSize();

            clone.X        = X;
            clone.Y        = Y;
            clone.Width    = Width;
            clone.Height   = Height;
            clone.Metadata = Metadata.Clone();

            clone.m_isInitialized = m_isInitialized;

            return(clone);
        }
        public override SerializedVertexData Clone()
        {
            SerializedVertexDataWithSize clone = new SerializedVertexDataWithSize();

            clone.X      = X;
            clone.Y      = Y;
            clone.Width  = Width;
            clone.Height = Height;
            // HERZUM SPRINT 1.1 MAX
            clone.WidgetStatus = WidgetStatus;
            // END HERZUM SPRINT 1.1 MAX
            clone.Metadata = Metadata.Clone();

            clone.m_isInitialized = m_isInitialized;

            return(clone);
        }
示例#6
0
        // HERZUM SPRINT 1.0
        private static bool TryCreateComment(IEditableExperiment experiment, MetadataDefinition metadataDefinition,
                                             SerializedVertexData data, out ExperimentNode newCreatedNode)
        {
            bool isCreated = false;

            newCreatedNode = null;

            CommentMetadataDefinition commentMetadataDefinition = metadataDefinition as CommentMetadataDefinition;

            if (commentMetadataDefinition != null)
            {
                data.Metadata = new CommentMetadata(commentMetadataDefinition.Label);
                string commentNodeId = Guid.NewGuid().ToString();

                // HERZUM SPRINT 1.2 COMMENT
                // newCreatedNode = new CommentNode(commentNodeId, data);
                var data_with_size = new SerializedVertexDataWithSize();
                data_with_size.X            = data.X;
                data_with_size.Y            = data.Y;
                data_with_size.Metadata     = data.Metadata;
                data_with_size.Width        = 160;
                data_with_size.Height       = 160;
                data_with_size.WidgetStatus = "normal";
                newCreatedNode = new CommentNode(commentNodeId, data_with_size);
                // END SPRINT 1.2 COMMENT

                experiment.AddVertex(newCreatedNode);

                //set the log settings of the new component
                experiment.SetLogLevelSettings(newCreatedNode);

                isCreated = true;
            }

            return(isCreated);
        }
        public override SerializedVertexData Clone()
        {
            SerializedVertexDataWithSize clone = new SerializedVertexDataWithSize();
            clone.X = X;
            clone.Y = Y;
            clone.Width = Width;
            clone.Height = Height;
            // HERZUM SPRINT 1.1 MAX
            clone.WidgetStatus = WidgetStatus;
            // END HERZUM SPRINT 1.1 MAX
            clone.Metadata = Metadata.Clone();

            clone.m_isInitialized = m_isInitialized;

            return clone;
        }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChallengeNode"/> class.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="data">The data.</param>
 public ChallengeNode(string id, SerializedVertexDataWithSize data) : base(id, data) {
 }
示例#9
0
        /// <summary>
        /// Generates the scope node at the given position.
        /// </summary>
        /// <param name="scopeName">Name of the scope.</param>
        /// <param name="experiment">The experiment to which new component is added.</param>
        /// <param name="positionX">The position X.</param>
        /// <param name="positionY">The position Y.</param>
        /// <returns></returns>
        private static ScopeNode GenerateScopeNode(string scopeName, IExperiment experiment, double positionX, double positionY, double width, double height)
        {
            var data = new SerializedVertexDataWithSize();
            data.X = positionX;
            data.Y = positionY;
            data.Width = width;
            data.Height = height;

            string componentId = Guid.NewGuid().ToString();

            var componentGraph = new CompositeComponentEditableGraph(true);

            if (componentGraph.References != null)
            {
                componentGraph.References = experiment.References.CopyCollection();
            }

            data.Metadata = new ScopeMetadata(componentGraph, scopeName, System.IO.Path.GetDirectoryName(experiment.ExperimentInfo.FilePath));
            
            string componentNodeId = Guid.NewGuid().ToString();
            string componentName = data.Metadata.Label;

            var scopeNode = new ScopeNode(Guid.NewGuid().ToString(), data);
            return scopeNode;
        }
示例#10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScopeNode"/> class.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="data">The data.</param>
 public ScopeNode(string id, SerializedVertexDataWithSize data) : base(id, data)
 {
 }
        /// <summary>
        /// Generates the scope node.
        /// </summary>
        /// <param name="scopeName">Name of the scope.</param>
        /// <param name="experiment">The experiment to which new component is added.</param>
        /// <param name="positionX">The position X.</param>
        /// <param name="positionY">The position Y.</param>
        /// <returns></returns>
        private static LoopScopeNode CreateLoopScopeNode(string scopeName, IEditableExperiment experiment, double positionX, double positionY)
        {
            var data = new SerializedVertexDataWithSize();
            data.X = positionX;
            data.Y = positionY;
            data.Width = 160;
            data.Height = 160;

            string componentId = Guid.NewGuid().ToString();

            var componentGraph = new CompositeComponentEditableGraph(true);
            componentGraph.References = new System.Collections.ObjectModel.ObservableCollection<TraceLabSDK.PackageSystem.IPackageReference>(experiment.References);

            data.Metadata = new LoopScopeMetadata(componentGraph, scopeName, System.IO.Path.GetDirectoryName(experiment.ExperimentInfo.FilePath));

            string componentNodeId = Guid.NewGuid().ToString();
            string componentName = data.Metadata.Label;

            var loopScopeNode = new LoopScopeNode(Guid.NewGuid().ToString(), data);

            experiment.AddVertex(loopScopeNode);

            return loopScopeNode;
        }
        public override SerializedVertexData Clone()
        {
            SerializedVertexDataWithSize clone = new SerializedVertexDataWithSize();
            clone.X = X;
            clone.Y = Y;
            clone.Width = Width;
            clone.Height = Height;
            clone.Metadata = Metadata.Clone();

            clone.m_isInitialized = m_isInitialized;

            return clone;
        }
示例#13
0
        // HERZUM SPRINT 1.0
        private static bool TryCreateComment(IEditableExperiment experiment, MetadataDefinition metadataDefinition, 
                                               SerializedVertexData data, out ExperimentNode newCreatedNode)
        {
            bool isCreated = false;
            newCreatedNode = null;

            CommentMetadataDefinition commentMetadataDefinition = metadataDefinition as CommentMetadataDefinition;
            if (commentMetadataDefinition != null)
            {
                data.Metadata = new CommentMetadata(commentMetadataDefinition.Label);
                string commentNodeId = Guid.NewGuid().ToString();

                // HERZUM SPRINT 1.2 COMMENT
                // newCreatedNode = new CommentNode(commentNodeId, data);
                var data_with_size = new SerializedVertexDataWithSize();
                data_with_size.X = data.X;
                data_with_size.Y = data.Y;
                data_with_size.Metadata = data.Metadata;
                data_with_size.Width  = 160;
                data_with_size.Height = 160;
                data_with_size.WidgetStatus = "normal";
                newCreatedNode = new CommentNode(commentNodeId, data_with_size);
                // END SPRINT 1.2 COMMENT

                experiment.AddVertex(newCreatedNode);

                //set the log settings of the new component
                experiment.SetLogLevelSettings(newCreatedNode);

                isCreated = true;
            }

            return isCreated;
        }
示例#14
0
        /// <summary>
        /// Generates the challenge node.
        /// </summary>
        /// <param name="challengeName">Name of the challenge.</param>
        /// <param name="experiment">The experiment to which new component is added.</param>
        /// <param name="positionX">The position X.</param>
        /// <param name="positionY">The position Y.</param>
        /// <returns></returns>
        private static ChallengeNode CreateChallengeNode(string challengeName, IEditableExperiment experiment, double positionX, double positionY)
        {
            var data = new SerializedVertexDataWithSize();
            data.X = positionX;
            data.Y = positionY;
            data.Width = 160;
            data.Height = 160;

            string componentId = Guid.NewGuid().ToString();

            var componentGraph = new CompositeComponentEditableGraph(true);

            if (componentGraph.References != null)
            {
                componentGraph.References = experiment.References.CopyCollection();
            }

            data.Metadata = new ChallengeMetadata(componentGraph, challengeName, System.IO.Path.GetDirectoryName(experiment.ExperimentInfo.FilePath));

            string componentNodeId = Guid.NewGuid().ToString();
            string componentName = data.Metadata.Label;

            var challengeNode = new ChallengeNode(Guid.NewGuid().ToString(), data);

            experiment.AddVertex(challengeNode);

            return challengeNode;
        }
示例#15
0
 public ScopeNodeBase(string id, SerializedVertexDataWithSize data)
     : base(id, data)
 {
 }
示例#16
0
 // HERZUM SPRINT 1.2 COMMENT
 // public CommentNode(string id, SerializedVertexData data) : base(id, data)
 public CommentNode(string id, SerializedVertexDataWithSize data) : base(id, data)
 // END HERZUM SPRINT 1.2 COMMENT
 {
     ID = id;
 }
示例#17
0
        // END HERZUM SPRINT 5.1: TLAB-230

        public ComponentResizeControl(ExperimentNode node, ApplicationContext applicationContext) : base(node, applicationContext)
        {
           
            info = this.ExperimentNode.Data as SerializedVertexDataWithSize;
            double widthMeta = info.Width;          
            double heightMeta = info.Height;

            PaddingTop = 7.0;
            PaddingLeft= widthMeta/2;
            PaddingRight= widthMeta/2;           
            PaddingBottom= heightMeta;
            MoveTo (info.X, info.Y);

            if (info.WidgetStatus == "" || info.WidgetStatus== null)
                stateWidget = "normal";
            else
                stateWidget = info.WidgetStatus;


            paddingLeftOriginal = 80.0;
            paddingRightOriginal = 80.0;
            paddingBottomOriginal = 160.0;

            xOriginal = rect.X;
            yOriginal = rect.Y; 

            SetPixButtonHandle ();
            RedrawButton ();        

        }
示例#18
0
 // HERZUM SPRINT 1.2 COMMENT
 // public CommentNode(string id, SerializedVertexData data) : base(id, data)
 public CommentNode(string id, SerializedVertexDataWithSize data) : base(id, data)
     // END HERZUM SPRINT 1.2 COMMENT
 {
     ID = id;
 }
示例#19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChallengeNode"/> class.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="data">The data.</param>
 public ChallengeNode(string id, SerializedVertexDataWithSize data) : base(id, data)
 {
 }