Ejemplo n.º 1
0
 public SequenceStartedEventArgs(ISequence sequence, ITiming timingSource, TimeSpan startTime, TimeSpan endTime)
 {
     Sequence = sequence;
     TimingSource = timingSource;
     StartTime = startTime;
     EndTime = endTime;
 }
Ejemplo n.º 2
0
        public MarkManager(List<MarkCollection> markCollections, IExecutionControl executionControl, ITiming timingSource,
            TimedSequenceEditorForm timedSequenceEditorForm)
        {
            InitializeComponent();
            Icon = Resources.Icon_Vixen3;
            ForeColor = ThemeColorTable.ForeColor;
            BackColor = ThemeColorTable.BackgroundColor;
            ThemeUpdateControls.UpdateControls(this);
            listViewMarkCollections.BackColor = ThemeColorTable.BackgroundColor;
            listViewMarks.BackColor = ThemeColorTable.BackgroundColor;
            buttonPlay.Image = Tools.GetIcon(Resources.control_play_blue, 24);
            buttonPlay.Text = "";
            buttonStop.Image = Tools.GetIcon(Resources.control_stop_blue, 24);
            buttonStop.Text = "";
            buttonStop.Enabled = false;
            buttonIncreasePlaybackSpeed.Image = Tools.GetIcon(Resources.add, 24);
            buttonIncreasePlaybackSpeed.Text = "";
            buttonDecreasePlaySpeed.Image = Tools.GetIcon(Resources.minus, 24);
            buttonDecreasePlaySpeed.Text = "";
            buttonIncreaseSelectedMarks.Image = Tools.GetIcon(Resources.add, 24);
            buttonIncreaseSelectedMarks.Text = "";
            buttonDecreaseSelectedMarks.Image = Tools.GetIcon(Resources.minus, 24);
            buttonDecreaseSelectedMarks.Text = "";
            buttonRemoveCollection.ForeColor = buttonRemoveCollection.Enabled ? ThemeColorTable.ForeColor : ThemeColorTable.ForeColorDisabled;

            labelTapperInstructions.Visible = false;

            MarkCollections = markCollections;
            _executionControl = executionControl;
            _timingSource = timingSource;
            _timedSequenceEditorForm = timedSequenceEditorForm;
        }
Ejemplo n.º 3
0
        public override void Begin(ILightingController controller, Random random)
        {
            var nextPattern = _patternFactory.GenerateRandom(random);

            if (_currentPattern != null)
            {
                int i = 0;
                while (i < 10 && _currentPattern.GetType() == typeof(PatternClear) && nextPattern.GetType() == typeof(PatternClear))
                {
                    nextPattern = _patternFactory.GenerateRandom(random);
                    i++;
                }

                // TODO : Remove this?
                // NOTE : Temporary implementation to prevent unlit/black colour being used in succession
                if (i >= 9)
                {
                    nextPattern = new PatternRandomSolidColor();
                }
            }

            _currentPattern   = nextPattern;
            _currentTiming    = _timingFactory.GenerateRandom(random);
            _currentAnimation = _animationFactory.GenerateRandom(random);

            _currentPattern.Reset(controller, random);
            var totalSteps = _currentAnimation.Begin(controller, _currentPattern, random);

            _currentTiming.Reset(totalSteps);
        }
Ejemplo n.º 4
0
                public override void Begin(ILightingController controller, Random random)
                {
                    _currentStep = 0;

                    _on = new PatternConfigured
                    {
                        Configured = new[] { Color.Green }
                    };
                    _on.Reset(controller, random);

                    _off = new PatternConfigured
                    {
                        Configured = new[] { Color.Red }
                    };
                    _off.Reset(controller, random);

                    _animation = new AnimationInstant();
                    var totalSteps = _animation.Begin(controller, _on, random);

                    _timing = new TimingConstant
                    {
                        Milliseconds = 500
                    };
                    _timing.Reset(totalSteps);
                }
 public SequenceStartedEventArgs(ISequence sequence, ITiming timingSource, TimeSpan startTime, TimeSpan endTime)
 {
     Sequence     = sequence;
     TimingSource = timingSource;
     StartTime    = startTime;
     EndTime      = endTime;
 }
Ejemplo n.º 6
0
        private void PrintDrillDownLink(StringBuilder sb, ITiming timing, string baseViewPath)
        {
            if (timing.Data == null || !timing.Data.ContainsKey("correlationId"))
            {
                return;
            }

            var correlationId = timing.Data["correlationId"];

            Guid?drillDownSessionId = null;

            if (DrillDownHandler == null)
            {
                var drillDownSession = ProfilingSession.CircularBuffer.FirstOrDefault(s => s.Data != null && s.Data.ContainsKey("correlationId") && s.Data["correlationId"] == correlationId);
                if (drillDownSession != null)
                {
                    drillDownSessionId = drillDownSession.Id;
                }
            }
            else
            {
                drillDownSessionId = DrillDownHandler(correlationId);
            }

            if (!drillDownSessionId.HasValue)
            {
                return;
            }

            sb.Append("[<a href=\"");
            sb.Append(baseViewPath);
            sb.Append("/");
            sb.Append(drillDownSessionId);
            sb.Append("\">drill down</a>] ");
        }
Ejemplo n.º 7
0
 public MarkManager(List<MarkCollection> markCollections, IExecutionControl executionControl, ITiming timingSource)
 {
     InitializeComponent();
     MarkCollections = markCollections;
     _executionControl = executionControl;
     _timingSource = timingSource;
 }
Ejemplo n.º 8
0
 public MarkManager(List<MarkCollection> markCollections, IExecutionControl executionControl, ITiming timingSource, TimedSequenceEditorForm timedSequenceEditorForm)
 {
     InitializeComponent();
     MarkCollections = markCollections;
     _executionControl = executionControl;
     _timingSource = timingSource;
     _timedSequenceEditorForm = timedSequenceEditorForm;
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Handles <see cref="ITiming.Tick"/> event.
        /// </summary>
        /// <param name="sender">Event source.</param>
        /// <param name="e">An <see cref="EventArgs"/> containing event data.</param>
        private void Timing_Tick(object sender, EventArgs e)
        {
            ITiming source = (ITiming)sender;

            CountingDownLabel counter = (CountingDownLabel)upperPanel.Controls[TimeLeft];

            counter.Time = TimeSpan.FromSeconds(source.TimeLeft);
        }
Ejemplo n.º 10
0
 public MarkManager(List <MarkCollection> markCollections, IExecutionControl executionControl, ITiming timingSource, TimedSequenceEditorForm timedSequenceEditorForm)
 {
     InitializeComponent();
     MarkCollections          = markCollections;
     _executionControl        = executionControl;
     _timingSource            = timingSource;
     _timedSequenceEditorForm = timedSequenceEditorForm;
 }
Ejemplo n.º 11
0
 private static void SetDepth(ITiming timing, int depth)
 {
     if (timing.Data == null)
     {
         timing.Data = new Dictionary <string, string>();
     }
     timing.Data["depth"] = depth.ToString();
 }
Ejemplo n.º 12
0
        // enumerator.Current = 1-frame buffer

        //public MultiStateTimedEnumerator(IEnumerable<T> source, ITiming timingSource, TimeSpan startTime, TimeSpan endTime) {
        protected MultiStateTimedEnumerator(IEnumerable <T> source, ITiming timingSource, TimeSpan startTime)
        {
            _source       = source;
            _timingSource = timingSource;
            _startTime    = startTime;
            //_endTime = endTime;
            Reset();
        }
Ejemplo n.º 13
0
        public static A scoped <A>(this ITiming timing, string name, Fn <A> f)
        {
            timing.openScope(name);
            var ret = f();

            timing.closeScope();
            return(ret);
        }
Ejemplo n.º 14
0
        private void PrintTiming(ITimingSession session, ITiming timing, StringBuilder sb, double factor, string baseViewPath)
        {
            sb.Append("<li><span class=\"timing\" style=\"padding-left: ");
            var start = Math.Floor(timing.StartMilliseconds * factor);

            if (start > 300)
            {
                start = 300;
            }
            sb.Append(start);
            sb.Append("px\"><span class=\"bar ");
            sb.Append(timing.Type);
            sb.Append("\" title=\"");
            sb.Append(HttpUtility.HtmlEncode(timing.Name.Replace("\r\n", " ")));
            sb.Append("\" style=\"width: ");
            var width = (int)Math.Round(timing.DurationMilliseconds * factor);

            if (width > 300)
            {
                width = 300;
            }
            else if (width == 0)
            {
                width = 1;
            }
            sb.Append(width);
            sb.Append("px\"></span><span class=\"start\">+");
            sb.Append(timing.StartMilliseconds);
            sb.Append("</span><span class=\"duration\">");
            sb.Append(timing.DurationMilliseconds);
            sb.Append("</span></span>");
            var hasChildTimings = session.Timings.Any(s => s.ParentId == timing.Id);

            if (hasChildTimings)
            {
                sb.Append("<input type=\"checkbox\" id=\"t_");
                sb.Append(timing.Id.ToString());
                sb.Append("\" checked=\"checked\" /><label for=\"t_");
                sb.Append(timing.Id.ToString());
                sb.Append("\">");
                PrintDataLink(sb, timing);
                PrintDrillDownLink(sb, timing, baseViewPath);
                sb.Append(HttpUtility.HtmlEncode(timing.Name.Replace("\r\n", " ")));
                sb.Append("</label>");
                sb.Append("<ul>");
                PrintTimings(session, timing.Id, sb, factor, baseViewPath);
                sb.Append("</ul>");
            }
            else
            {
                sb.Append("<span class=\"leaf\">");
                PrintDataLink(sb, timing);
                PrintDrillDownLink(sb, timing, baseViewPath);
                sb.Append(HttpUtility.HtmlEncode(timing.Name.Replace("\r\n", " ")));
                sb.Append("</span>");
            }
            sb.Append("</li>");
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Whether or not this data field should be ignored.
        /// </summary>
        /// <param name="timing"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        protected override bool IsIgnoreDataField(ITiming timing, string key)
        {
            if (IgnoreDataFieldNames != null && IgnoreDataFieldNames.Any(f => string.Equals(f, key)))
            {
                return(true);
            }

            return(base.IsIgnoreDataField(timing, key));
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Adds a timing to the session.
        /// </summary>
        /// <param name="timing"></param>
        public void AddTiming(ITiming timing)
        {
            if (timing == null)
            {
                throw new ArgumentNullException("timing");
            }

            _timings.Enqueue(timing);
        }
Ejemplo n.º 17
0
        public override sealed void Begin(ILightingController controller, Random random)
        {
            _pattern = CreatePattern();
            _pattern.Reset(controller, random);
            _animation = CreateAnimation();
            var totalSteps = _animation.Begin(controller, _pattern, random);

            _timing = CreateTiming();
            _timing.Reset(totalSteps);
        }
Ejemplo n.º 18
0
        private static IList <ITiming> TraverseTimingsPreOrder(ITiming parent,
                                                               IEnumerable <ITiming> allTimings,
                                                               int depth = 0)
        {
            SetDepth(parent, depth);
            IEnumerable <ITiming> timings = allTimings as IList <ITiming> ?? allTimings.ToList();

            return(new[] { parent }.Concat(timings.Where(x => x.ParentId == parent.Id)
                                           .SelectMany(child => TraverseTimingsPreOrder(child, timings, depth + 1))).ToList());
        }
        private void ParseTimingField(ITiming timing, string key, JToken value)
        {
            if (IsIgnoreDataField(timing, key))
            {
                return;
            }

            switch (key)
            {
            case "type":
                timing.Type = value.ToObject <string>();
                break;

            case "id":
                timing.Id = value.ToObject <Guid>();
                break;

            case "parentId":
                timing.ParentId = value.ToObject <Guid?>();
                break;

            case "name":
                timing.Name = value.ToObject <string>();
                break;

            case "started":
                timing.Started = value.ToObject <DateTime>();
                break;

            case "start":
                timing.StartMilliseconds = value.ToObject <long>();
                break;

            case "duration":
                timing.DurationMilliseconds = value.ToObject <long>();
                break;

            case "tags":
                timing.Tags = ParseTags(value.ToString());
                break;

            case "sort":
                timing.Sort = value.ToObject <long>();
                break;

            default:
                if (timing.Data == null)
                {
                    timing.Data = new Dictionary <string, string>();
                }

                timing.Data[key] = value.ToString();
                break;
            }
        }
Ejemplo n.º 20
0
 /// <summary>
 /// Initializes a debounced function call
 /// </summary>
 /// <param name="timing">Timing system to use</param>
 /// <param name="wait">Time to wait</param>
 /// <param name="leading">If set to <c>true</c> invoke on leading flank.</param>
 /// <param name="trailing">If set to <c>true</c> invoke on trailing flank.</param>
 /// <param name="maxWait">Maximum time to wait</param>
 protected UnityDebounceBase(ITiming timing, float wait, bool leading, bool trailing, float?maxWait)
 {
     this.timing   = timing;
     this.wait     = Mathf.Max(wait, 0);
     this.leading  = leading;
     this.trailing = trailing;
     if (maxWait.HasValue)
     {
         this.maxWait = Mathf.Max(maxWait.Value, wait);
     }
 }
        // enumerator.Current = 1-frame buffer

        //protected SingleTimedEnumerator(IEnumerable<T> source, ITiming timingSource, TimeSpan startTime, TimeSpan endTime,
        //    SingleTimedEnumeratorProgressType progressResponseType, bool skipMissedItems)
        protected SingleTimedEnumerator(IEnumerable <T> source, ITiming timingSource, TimeSpan startTime,
                                        SingleTimedEnumeratorProgressType progressResponseType, bool skipMissedItems)
        {
            _source       = source;
            _timingSource = timingSource;
            _startTime    = startTime;
            //_endTime = endTime;
            _responseType    = progressResponseType;
            _skipMissedItems = skipMissedItems;
            Reset();
        }
Ejemplo n.º 22
0
		public MarkTapper(IExecutionControl executionControl, ITiming timingSource)
		{
			InitializeComponent();
			_executionControl = executionControl;
			_timingSource = timingSource;
			Results = new List<TimeSpan>();

			if (_executionControl == null || _timingSource == null) {
				groupBoxControls.Enabled = false;
			}

			_playing = false;
		}
Ejemplo n.º 23
0
        private void SaveTimingJson(ITimingSession session, ITiming timing)
        {
            var sb = new StringBuilder();

            sb.Append("{");

            AppendSessionSharedFields(sb, session);
            AppendTimingFields(sb, timing);

            sb.Append("}");

            Logger.Value.Info(sb.ToString());
        }
Ejemplo n.º 24
0
        private void PrintDataLink(StringBuilder sb, ITiming timing)
        {
            if (timing.Data == null || !timing.Data.Any())
            {
                return;
            }

            sb.Append("[<a href=\"#data_");
            sb.Append(timing.Id.ToString());
            sb.Append("\" onclick=\"document.getElementById('data_");
            sb.Append(timing.Id.ToString());
            sb.Append("').style.display='block';\" class=\"openModal\">data</a>] ");
        }
Ejemplo n.º 25
0
        internal Context(string name, IDataSource dataSource, ITiming timingSource)
            : this(name) {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Name is required");
            }
            if (dataSource == null)
            {
                throw new ArgumentNullException("timingSource");
            }

            _DataSource   = dataSource;
            _TimingSource = timingSource;
        }
Ejemplo n.º 26
0
 /// <inheritdoc />
 public bool Equals(ITiming other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other.GetType() == GetType()
         ? Equals((StandardTiming)other)
         : (Width == other.Width) && (Height == other.Height) && (Frequency == other.Frequency));
 }
Ejemplo n.º 27
0
        public MarkTapper(IExecutionControl executionControl, ITiming timingSource)
        {
            InitializeComponent();
            _executionControl = executionControl;
            _timingSource     = timingSource;
            Results           = new List <TimeSpan>();

            if (_executionControl == null || _timingSource == null)
            {
                groupBoxControls.Enabled = false;
            }

            _playing = false;
        }
Ejemplo n.º 28
0
        public ITiming GetTimingSource(SelectedTimingProvider selectedProvider)
        {
            ITiming selectedSource = null;

            var providers = _GetProviders();

            ITimingProvider provider;

            if (SelectedTimingProvider.IsValid(selectedProvider) && providers.TryGetValue(selectedProvider.ProviderType, out provider))
            {
                selectedSource = provider.GetTimingSource(Owner, selectedProvider.SourceName);
            }

            return(selectedSource);
        }
Ejemplo n.º 29
0
 private void AppendTimingFields(StringBuilder sb, ITiming timing)
 {
     AppendField(sb, "type", timing.Type);
     AppendField(sb, "id", timing.Id.ToString("N"));
     if (timing.ParentId.HasValue)
     {
         AppendField(sb, "parentId", timing.ParentId.Value.ToString("N"));
     }
     AppendField(sb, "name", timing.Name);
     AppendField(sb, "started", timing.Started);
     AppendField(sb, "start", timing.StartMilliseconds);
     AppendField(sb, "duration", timing.DurationMilliseconds);
     AppendField(sb, "tags", timing.Tags);
     AppendField(sb, "sort", timing.Sort);
     AppendDataFields(sb, timing.Data);
 }
Ejemplo n.º 30
0
        void _programExecutor_SequenceStarted(object sender, SequenceStartedEventArgs e)
        {
            _dataSource   = _programExecutor.GetCurrentSequenceData();
            _timingSource = _programExecutor.GetCurrentSequenceTiming();

            //Once a sequence is executed with this present, it can be saved and this
            //line commented out.  The sequence file will have it at that point.
            //****
            //_AddPreFilterToSequence();
            //****

            if (SequenceStarted != null)
            {
                SequenceStarted(this, e);
            }
        }
Ejemplo n.º 31
0
        public void ApplicationStart()
        {
            if (_analyticsSession == null)
            {
                _analyticsSession = new AnalyticsSession(Domain, GaCode);
            }

            _page = _analyticsSession.CreatePageViewRequest(
                "/",     // path
                "Main"); // page title

            _apptimer = _page.StartTiming("Application", "WPF", "ExecutionTime");

            _page.SendEvent("Application", "AppStart", string.Empty, "1");

            _page.Send();
        }
Ejemplo n.º 32
0
            internal bool NextScene(out IAnimation animation, out IPattern pattern, out ITiming timing)
            {
                // TODO : Parse command text and create next animation/pattern/timing as required
                // Read up to (including) the next animation and return
                // Use visitor to assign/generate values for all types

                // NOTE : Do not return null!
                _currentAnimation = null /* TODO */;
                _currentPattern   = null /* TODO */;
                _currentTiming    = null /* TODO */;


                animation = _currentAnimation;
                pattern   = _currentPattern;
                timing    = _currentTiming;
                return(false);
            }
Ejemplo n.º 33
0
        private PureProfilingEntity FormatTiming(ITimingSession session, ITiming timing)
        {
            PureProfilingEntity v = new PureProfilingEntity();

            v.SEQ         = Pure.Data.IdGenerateManager.Snowflake.NextId().ToString(); // Guid.NewGuid().ToString();
            v.MachineName = session.MachineName;
            v.SessionId   = session.Id.ToString();
            v.Type        = timing.Type;
            v.Id          = timing.Id.ToString();
            v.ParentId    = timing.ParentId != null?timing.ParentId.ToString() : "";

            v.Name                 = timing.Name;
            v.Started              = timing.Started;
            v.StartMilliseconds    = timing.StartMilliseconds;
            v.DurationMilliseconds = timing.DurationMilliseconds;
            v.Tags                 = timing.Tags != null?timing.Tags.ToString() : "";

            v.Sort = timing.Sort;



            //var sb = new StringBuilder();
            //sb.Append("{");
            //AppendDataFields(sb, timing.Data);
            //sb.Append("}");

            //v.Data = sb.ToString();

            SetAllFieldDataField(v, timing.Data);

            if (timing.Tags != null && timing.Tags.Contains(ProfilingSession.FailOnErrorMark))
            {
                v.ErrorCount = 1;
            }
            else
            {
                v.ErrorCount = 0;
            }


            return(v);
        }
Ejemplo n.º 34
0
        public MarkManager(List<MarkCollection> markCollections, IExecutionControl executionControl, ITiming timingSource,
            TimedSequenceEditorForm timedSequenceEditorForm)
        {
            InitializeComponent();
            Icon = Resources.Icon_Vixen3;
            buttonPlay.Image = Tools.GetIcon(Resources.control_play_blue, 16);
            buttonPlay.Text = "";
            buttonStop.Image = Tools.GetIcon(Resources.control_stop_blue, 16);
            buttonStop.Text = "";
            buttonIncreasePlaybackSpeed.Image = Tools.GetIcon(Resources.plus, 16);
            buttonIncreasePlaybackSpeed.Text = "";
            buttonDecreasePlaySpeed.Image = Tools.GetIcon(Resources.minus, 16);
            buttonDecreasePlaySpeed.Text = "";
            buttonIncreaseSelectedMarks.Image = Tools.GetIcon(Resources.plus, 16);
            buttonIncreaseSelectedMarks.Text = "";
            buttonDecreaseSelectedMarks.Image = Tools.GetIcon(Resources.minus, 16);
            buttonDecreaseSelectedMarks.Text = "";

            MarkCollections = markCollections;
            _executionControl = executionControl;
            _timingSource = timingSource;
            _timedSequenceEditorForm = timedSequenceEditorForm;
        }
Ejemplo n.º 35
0
		public MarkManager(List<MarkCollection> markCollections, IExecutionControl executionControl, ITiming timingSource,
						   TimedSequenceEditorForm timedSequenceEditorForm)
		{
			InitializeComponent();
			Icon = Resources.Icon_Vixen3;
			ForeColor = ThemeColorTable.ForeColor;
			BackColor = ThemeColorTable.BackgroundColor;
			
			listViewMarkCollections.BackColor = ThemeColorTable.BackgroundColor;
			listViewMarks.BackColor = ThemeColorTable.BackgroundColor;
			int iconSize = (int)(24 * ScalingTools.GetScaleFactor());
			buttonPlay.Image = Tools.GetIcon(Resources.control_play_blue, iconSize);
			buttonPlay.Text = "";
			buttonStop.Image = Tools.GetIcon(Resources.control_stop_blue, iconSize);
			buttonStop.Text = "";
			buttonStop.Enabled = false;
			buttonRestartPlay.Text = "";
			buttonRestartPlay.Image = Tools.GetIcon(Resources.control_start_blue,iconSize);
			buttonIncreasePlaybackSpeed.Image = Tools.GetIcon(Resources.add, iconSize);
			buttonIncreasePlaybackSpeed.Text = "";
			buttonDecreasePlaySpeed.Image = Tools.GetIcon(Resources.minus, iconSize);
			buttonDecreasePlaySpeed.Text = "";
			buttonIncreaseSelectedMarks.Image = Tools.GetIcon(Resources.add, iconSize);
			buttonIncreaseSelectedMarks.Text = "";
			buttonDecreaseSelectedMarks.Image = Tools.GetIcon(Resources.minus, iconSize);
			buttonDecreaseSelectedMarks.Text = "";
			buttonRemoveCollection.ForeColor = buttonRemoveCollection.Enabled ? ThemeColorTable.ForeColor : ThemeColorTable.ForeColorDisabled;
			ThemeUpdateControls.UpdateControls(this);
			labelTapperInstructions.Visible = false;

			MarkCollections = markCollections;
			_executionControl = executionControl;
			_timingSource = timingSource;
			_timedSequenceEditorForm = timedSequenceEditorForm;
			textBoxPosition.Text = TimeSpan.FromMilliseconds(trackBarPlayBack.Value).ToString(@"m\:ss\.fff");
		}
Ejemplo n.º 36
0
		///	<summary> This method copy's each database field from the <paramref name="source"/> interface to this data row.</summary>
		public void Copy_From(ITiming source, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) this.TimingsId = source.TimingsId;
			this.ConnectedType = source.ConnectedType;
			this.ConnectedId = source.ConnectedId;
			this.TimingTypId = source.TimingTypId;
			this.TimeA = source.TimeA;
			this.TimeB = source.TimeB;
			this.ZuordnungsId = source.ZuordnungsId;
			this.TimingsBemerkung = source.TimingsBemerkung;
			this.GoogleEventId = source.GoogleEventId;
			this.ModifyTimeStamp = source.ModifyTimeStamp;
			this.ProcessingStatus = source.ProcessingStatus;
			this.LastModifiedBy = source.LastModifiedBy;
			this.CreatedBy = source.CreatedBy;
			this.AccessRightsId = source.AccessRightsId;
			this.LastUpdateToken = source.LastUpdateToken;
		}
Ejemplo n.º 37
0
		///	<summary> This method copy's each database field from the <paramref name="source"/> interface to this data row.</summary>
		public void Copy_From(ITiming source, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) this.TimingsId = source.TimingsId;
			this.ConnectedType = source.ConnectedType;
			this.ConnectedId = source.ConnectedId;
			this.TimingTypId = source.TimingTypId;
			this.TimeA = source.TimeA;
			this.TimeB = source.TimeB;
			this.ZuordnungsId = source.ZuordnungsId;
			this.TimingsBemerkung = source.TimingsBemerkung;
			this.LastUpdateToken = source.LastUpdateToken;
		}
Ejemplo n.º 38
0
 private static int GetDepth(ITiming timing)
 {
     return(int.Parse(timing.Data["depth"]));
 }
Ejemplo n.º 39
0
 public CacheStartedEventArgs(ITiming timingSource, TimeSpan length, TimeSpan start)
 {
     Start = start;
     Length = length;
     TimingSource = timingSource;
 }
Ejemplo n.º 40
0
		///	<summary> This method copy's each database field into the <paramref name="target"/> interface. </summary>
		public void Copy_To(ITiming target, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) target.TimingsId = this.TimingsId;
			target.ConnectedType = this.ConnectedType;
			target.ConnectedId = this.ConnectedId;
			target.TimingTypId = this.TimingTypId;
			target.TimeA = this.TimeA;
			target.TimeB = this.TimeB;
			target.ZuordnungsId = this.ZuordnungsId;
			target.TimingsBemerkung = this.TimingsBemerkung;
			target.GoogleEventId = this.GoogleEventId;
			target.ModifyTimeStamp = this.ModifyTimeStamp;
			target.ProcessingStatus = this.ProcessingStatus;
			target.LastModifiedBy = this.LastModifiedBy;
			target.CreatedBy = this.CreatedBy;
			target.AccessRightsId = this.AccessRightsId;
			target.LastUpdateToken = this.LastUpdateToken;
		}
Ejemplo n.º 41
0
		///	<summary> 
		///		This method copy's each database field which is in the <paramref name="includedColumns"/> 
		///		from the <paramref name="source"/> interface to this data row.
		/// </summary>
		public void Copy_From_But_TakeOnly(ITiming source, params string[] includedColumns)
		{
			if (includedColumns.Contains(TimingsTable.TimingsIdCol)) this.TimingsId = source.TimingsId;
			if (includedColumns.Contains(TimingsTable.ConnectedTypeCol)) this.ConnectedType = source.ConnectedType;
			if (includedColumns.Contains(TimingsTable.ConnectedIdCol)) this.ConnectedId = source.ConnectedId;
			if (includedColumns.Contains(TimingsTable.TimingTypIdCol)) this.TimingTypId = source.TimingTypId;
			if (includedColumns.Contains(TimingsTable.TimeACol)) this.TimeA = source.TimeA;
			if (includedColumns.Contains(TimingsTable.TimeBCol)) this.TimeB = source.TimeB;
			if (includedColumns.Contains(TimingsTable.ZuordnungsIdCol)) this.ZuordnungsId = source.ZuordnungsId;
			if (includedColumns.Contains(TimingsTable.TimingsBemerkungCol)) this.TimingsBemerkung = source.TimingsBemerkung;
			if (includedColumns.Contains(TimingsTable.LastUpdateTokenCol)) this.LastUpdateToken = source.LastUpdateToken;
		}
Ejemplo n.º 42
0
 private void PrintTiming(IProfiler result, ITiming timing, StringBuilder sb, double factor)
 {
     sb.Append("<li><span class=\"timing\" style=\"padding-left: ");
     var start = Math.Floor(timing.StartMilliseconds*factor);
     if (start > 300)
     {
         start = 300;
     }
     sb.Append(start);
     sb.Append("px\"><span class=\"bar ");
     sb.Append(timing.Type);
     sb.Append("\" title=\"");
     sb.Append(HttpUtility.HtmlEncode(timing.Name.Replace("\r\n", " ")));
     sb.Append("\" style=\"width: ");
     var width = (int)Math.Round(timing.DurationMilliseconds*factor);
     if (width > 300)
     {
         width = 300;
     }
     else if (width == 0)
     {
         width = 1;
     }
     sb.Append(width);
     sb.Append("px\"></span><span class=\"start\">+");
     sb.Append(timing.StartMilliseconds);
     sb.Append("</span><span class=\"duration\">");
     sb.Append(timing.DurationMilliseconds);
     sb.Append("</span></span>");
     var hasChildTimings = result.StepTimings.Any(s => s.ParentId == timing.Id)
         || result.CustomTimings.Any(c => c.ParentId == timing.Id);
     if (hasChildTimings)
     {
         sb.Append("<input type=\"checkbox\" id=\"t_");
         sb.Append(timing.Id.ToString());
         sb.Append("\" checked=\"checked\" /><label for=\"t_");
         sb.Append(timing.Id.ToString());
         sb.Append("\">");
         sb.Append(timing.Name.Replace("\r\n", " "));
         sb.Append("</label>");
         sb.Append("<ul>");
         PrintTimings(result, timing.Id, sb, factor);
         sb.Append("</ul>");
     }
     else
     {
         sb.Append("<span class=\"leaf\">");
         var customTiming = timing as CustomTiming;
         if (customTiming != null)
         {
             sb.Append("[<a href=\"#input_");
             sb.Append(timing.Id.ToString());
             sb.Append("\" onclick=\"document.getElementById('input_");
             sb.Append(timing.Id.ToString());
             sb.Append("').style.display='block';\" class=\"openModal\">input</a>] ");
         }
         sb.Append(timing.Name.Replace("\r\n", " "));
         sb.Append("</span>");
     }
     sb.Append("</li>");
 }
Ejemplo n.º 43
0
        private void _Play(TimeSpan startTime, TimeSpan endTime)
        {
            if(IsRunning || IsPaused) return;

            if(Sequence != null) {
                // Only hook the input stream during execution.
                // Hook before starting the behaviors.
                _sequence.InsertDataListener += _DataListener;

                // Bound the execution range.
                StartTime = startTime < Sequence.Length ? startTime : Sequence.Length;
                EndTime = endTime < Sequence.Length ? endTime : Sequence.Length;

                // Notify any subclass that we're ready to start and allow it to do
                // anything it needs to prepare.
                OnPlaying(StartTime, EndTime);

                _TimingSource = Sequence.GetTiming() ??
                    Modules.GetManager<ITimingModuleInstance, TimingModuleManagement>().GetDefault();

                // Initialize behaviors BEFORE data is pulled from the sequence,
                // they may influence the data.
                foreach(IRuntimeBehaviorModuleInstance behavior in _runtimeBehaviors) {
                    behavior.Startup(Sequence);
                }

                // Load the media.
                foreach(IMediaModuleInstance media in Sequence.GetAllMedia()) {
                    media.LoadMedia(StartTime);
                }

                // Start the crazy train.
                // Need to set IsRunning to true before firing the SequenceStarted event, otherwise
                // we will be lying to our subscribers and they will be very confused.
                IsRunning = true;
                OnSequenceStarted(new SequenceStartedEventArgs(Sequence, _TimingSource));

                // Start the media.
                foreach(IMediaModuleInstance media in Sequence.GetAllMedia()) {
                    media.Start();
                }
                _TimingSource.Position = StartTime;
                _TimingSource.Start();

                // Fire the first event manually because it takes a while for the timer
                // to elapse the first time.
                _CheckForNaturalEnd();
                // If there is no length, we may have been stopped as a cascading result
                // of that update.
                if(IsRunning) {
                    _updateTimer.Start();
                }
            }
        }
Ejemplo n.º 44
0
		///	<summary> This method copy's each database field into the <paramref name="target"/> interface. </summary>
		public void Copy_To(ITiming target, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) target.TimingsId = this.TimingsId;
			target.ConnectedType = this.ConnectedType;
			target.ConnectedId = this.ConnectedId;
			target.TimingTypId = this.TimingTypId;
			target.TimeA = this.TimeA;
			target.TimeB = this.TimeB;
			target.ZuordnungsId = this.ZuordnungsId;
			target.TimingsBemerkung = this.TimingsBemerkung;
			target.LastUpdateToken = this.LastUpdateToken;
		}
Ejemplo n.º 45
0
	    public TimingTask(ITask task, ITiming timing)
		{
			Task = task;
			Timing = timing;
		}
Ejemplo n.º 46
0
 protected void context_SequenceStarted(object sender, SequenceStartedEventArgs e)
 {
     timerPlaying.Start();
     _TimingSource = e.TimingSource;
     updateButtonStates();
 }
 public SystemChannelEnumerator(IEnumerable <CommandNode> data, ITiming timingSource)
     : base(data, timingSource, TimeSpan.Zero)
 {
     _SetupInstrumentation();
 }
Ejemplo n.º 48
0
		///	<summary> 
		///		This method copy's each database field which is in the <paramref name="includedColumns"/> 
		///		from the <paramref name="source"/> interface to this data row.
		/// </summary>
		public void Copy_From_But_TakeOnly(ITiming source, params string[] includedColumns)
		{
			if (includedColumns.Contains(TimingsTable.TimingsIdCol)) this.TimingsId = source.TimingsId;
			if (includedColumns.Contains(TimingsTable.ConnectedTypeCol)) this.ConnectedType = source.ConnectedType;
			if (includedColumns.Contains(TimingsTable.ConnectedIdCol)) this.ConnectedId = source.ConnectedId;
			if (includedColumns.Contains(TimingsTable.TimingTypIdCol)) this.TimingTypId = source.TimingTypId;
			if (includedColumns.Contains(TimingsTable.TimeACol)) this.TimeA = source.TimeA;
			if (includedColumns.Contains(TimingsTable.TimeBCol)) this.TimeB = source.TimeB;
			if (includedColumns.Contains(TimingsTable.ZuordnungsIdCol)) this.ZuordnungsId = source.ZuordnungsId;
			if (includedColumns.Contains(TimingsTable.TimingsBemerkungCol)) this.TimingsBemerkung = source.TimingsBemerkung;
			if (includedColumns.Contains(TimingsTable.GoogleEventIdCol)) this.GoogleEventId = source.GoogleEventId;
			if (includedColumns.Contains(TimingsTable.ModifyTimeStampCol)) this.ModifyTimeStamp = source.ModifyTimeStamp;
			if (includedColumns.Contains(TimingsTable.ProcessingStatusCol)) this.ProcessingStatus = source.ProcessingStatus;
			if (includedColumns.Contains(TimingsTable.LastModifiedByCol)) this.LastModifiedBy = source.LastModifiedBy;
			if (includedColumns.Contains(TimingsTable.CreatedByCol)) this.CreatedBy = source.CreatedBy;
			if (includedColumns.Contains(TimingsTable.AccessRightsIdCol)) this.AccessRightsId = source.AccessRightsId;
			if (includedColumns.Contains(TimingsTable.LastUpdateTokenCol)) this.LastUpdateToken = source.LastUpdateToken;
		}
Ejemplo n.º 49
0
        protected void context_SequenceEnded(object sender, SequenceEventArgs e)
        {
            //This is for the delayed play options
            if (delayOffToolStripMenuItem.Checked == false)
            {
                //MessageBox.Show("SHOWING STATUS BAR");
                toolStripStatusLabel3.Visible = toolStripStatusLabel_delayPlay.Visible = true;
                toolStripStatusLabel_delayPlay.Text = string.Format("{0} Seconds", timerPostponePlay.Interval / 1000);
            }

            timerPlaying.Stop();
            _TimingSource = null;
        }
 protected void context_SequenceEnded(object sender, SequenceEventArgs e)
 {
     timerPlaying.Stop();
     _TimingSource = null;
 }
Ejemplo n.º 51
0
        void _programExecutor_SequenceStarted(object sender, SequenceStartedEventArgs e)
        {
            _dataSource = _programExecutor.GetCurrentSequenceData();
            _timingSource = _programExecutor.GetCurrentSequenceTiming();

            //Once a sequence is executed with this present, it can be saved and this
            //line commented out.  The sequence file will have it at that point.
            //****
            //_AddPreFilterToSequence();
            //****

            if(SequenceStarted != null) {
                SequenceStarted(this, e);
            }
        }
Ejemplo n.º 52
0
        private static void SetBasicTimingProperties(ITiming timing, TimingDataBase timingData)
        {
            if (timing == null || timingData == null)
            {
                return;
            }

            timingData.DurationMilliseconds = timing.DurationMilliseconds;
            timingData.ExecuteType = timing.ExecuteType == null ? null : timing.ExecuteType.ToLowerInvariant();
            timingData.Id = timing.Id;
            timingData.MachineName = timing.MachineName;
            timingData.Name = timing.Name;
            timingData.ParentId = timing.ParentId;
            timingData.StartMilliseconds = timing.StartMilliseconds;
            timingData.Sort = timing.Sort;
            timingData.Started = ToSortableDateTimeString(timing.Started);
            if (timing.Tags != null && timing.Tags.Any())
            {
                timingData.Tags = new List<string>(timing.Tags);
            }
            timingData.Type = timing.Type;
        }