<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic TimeControl to playback historical data on temporallayer in Spatial Data Science Questions</title>
    <link>https://community.esri.com/t5/spatial-data-science-questions/timecontrol-to-playback-historical-data-on/m-p/604604#M1375</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt; /// &amp;lt;summary&amp;gt;&lt;BR /&gt; /// Open a timecontrol and control a playback sequence without displaying the timecontrol GUI.&lt;BR /&gt; /// &amp;lt;/summary&amp;gt;&lt;BR /&gt; /// &amp;lt;param name="application"&amp;gt;An IApplication interface.&amp;lt;/param&amp;gt;&lt;BR /&gt; /// &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;BR /&gt; public void TimeControlPlayback()&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;ESRI.ArcGIS.Carto.IMap map = axMapControl1.ActiveView.FocusMap;&lt;BR /&gt; ESRI.ArcGIS.Carto.IMapTimeDisplay timeMap = map as IMapTimeDisplay;&lt;BR /&gt; ESRI.ArcGIS.TrackingAnalyst.ITemporalLayer temporalLayer = null;&lt;/P&gt;&lt;P&gt;if (map.get_Layer(0) is ESRI.ArcGIS.TrackingAnalyst.ITemporalLayer)&lt;BR /&gt; {&lt;BR /&gt; temporalLayer = (ESRI.ArcGIS.TrackingAnalyst.ITemporalLayer)map.get_Layer(0); // Explicit Cast&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;if (temporalLayer == null)&lt;BR /&gt; {&lt;BR /&gt; timeMap.ShowTime = true;&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; Type factoryType = Type.GetTypeFromProgID("esriTrackingAnalystUI.TimeControl");&lt;BR /&gt; ESRI.ArcGIS.TrackingAnalyst.ITimeControl timeControl = (ITimeControl)Activator.CreateInstance(factoryType);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System.Int32 int32_hWnd = axMapControl1.hWnd;&lt;/P&gt;&lt;P&gt;timeControl.CurrentMap = axMapControl1.ActiveView.FocusMap;&lt;BR /&gt; timeControl.SetTemporalReferencesFromMap();&lt;BR /&gt; timeControl.TemporalMode = ESRI.ArcGIS.TrackingAnalyst.enumPlaybackTemporalMode.enumTemporalHistoric;&lt;/P&gt;&lt;P&gt;if (!(timeControl.Status == ESRI.ArcGIS.TrackingAnalyst.enumTimeControlStatus.enumStopped)&amp;amp;&amp;amp;timeControl.Status&amp;lt;enumTimeControlStatus.enumInValidView)&lt;BR /&gt; {&lt;BR /&gt; timeControl.Stop();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;timeControl.SetTimeSequenceInterval(ESRI.ArcGIS.TrackingAnalyst.enumTemporalUnits.enumDays, 1);&lt;BR /&gt; timeControl.CurrentTime = timeControl.StartTime;&lt;/P&gt;&lt;P&gt;timeControl.UpdateDisplay = true;&lt;BR /&gt; timeControl.WindowTitle = "test";&lt;/P&gt;&lt;P&gt;try&lt;BR /&gt; {&lt;BR /&gt; timeControl.Play(ESRI.ArcGIS.TrackingAnalyst.enumDirection.enumForward);&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; catch (COMException ex)&lt;BR /&gt; {&lt;BR /&gt; System.Windows.Forms.MessageBox.Show(ex.StackTrace);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;everything is ok until Play, report an error like this:&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.COMException (0x80040980): The Time control must be activated before it can be made visible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 16 Oct 2016 09:03:22 GMT</pubDate>
    <dc:creator>JhonChin1</dc:creator>
    <dc:date>2016-10-16T09:03:22Z</dc:date>
    <item>
      <title>TimeControl to playback historical data on temporallayer</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/timecontrol-to-playback-historical-data-on/m-p/604604#M1375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt; /// &amp;lt;summary&amp;gt;&lt;BR /&gt; /// Open a timecontrol and control a playback sequence without displaying the timecontrol GUI.&lt;BR /&gt; /// &amp;lt;/summary&amp;gt;&lt;BR /&gt; /// &amp;lt;param name="application"&amp;gt;An IApplication interface.&amp;lt;/param&amp;gt;&lt;BR /&gt; /// &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;BR /&gt; public void TimeControlPlayback()&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;ESRI.ArcGIS.Carto.IMap map = axMapControl1.ActiveView.FocusMap;&lt;BR /&gt; ESRI.ArcGIS.Carto.IMapTimeDisplay timeMap = map as IMapTimeDisplay;&lt;BR /&gt; ESRI.ArcGIS.TrackingAnalyst.ITemporalLayer temporalLayer = null;&lt;/P&gt;&lt;P&gt;if (map.get_Layer(0) is ESRI.ArcGIS.TrackingAnalyst.ITemporalLayer)&lt;BR /&gt; {&lt;BR /&gt; temporalLayer = (ESRI.ArcGIS.TrackingAnalyst.ITemporalLayer)map.get_Layer(0); // Explicit Cast&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;if (temporalLayer == null)&lt;BR /&gt; {&lt;BR /&gt; timeMap.ShowTime = true;&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; Type factoryType = Type.GetTypeFromProgID("esriTrackingAnalystUI.TimeControl");&lt;BR /&gt; ESRI.ArcGIS.TrackingAnalyst.ITimeControl timeControl = (ITimeControl)Activator.CreateInstance(factoryType);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System.Int32 int32_hWnd = axMapControl1.hWnd;&lt;/P&gt;&lt;P&gt;timeControl.CurrentMap = axMapControl1.ActiveView.FocusMap;&lt;BR /&gt; timeControl.SetTemporalReferencesFromMap();&lt;BR /&gt; timeControl.TemporalMode = ESRI.ArcGIS.TrackingAnalyst.enumPlaybackTemporalMode.enumTemporalHistoric;&lt;/P&gt;&lt;P&gt;if (!(timeControl.Status == ESRI.ArcGIS.TrackingAnalyst.enumTimeControlStatus.enumStopped)&amp;amp;&amp;amp;timeControl.Status&amp;lt;enumTimeControlStatus.enumInValidView)&lt;BR /&gt; {&lt;BR /&gt; timeControl.Stop();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;timeControl.SetTimeSequenceInterval(ESRI.ArcGIS.TrackingAnalyst.enumTemporalUnits.enumDays, 1);&lt;BR /&gt; timeControl.CurrentTime = timeControl.StartTime;&lt;/P&gt;&lt;P&gt;timeControl.UpdateDisplay = true;&lt;BR /&gt; timeControl.WindowTitle = "test";&lt;/P&gt;&lt;P&gt;try&lt;BR /&gt; {&lt;BR /&gt; timeControl.Play(ESRI.ArcGIS.TrackingAnalyst.enumDirection.enumForward);&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; catch (COMException ex)&lt;BR /&gt; {&lt;BR /&gt; System.Windows.Forms.MessageBox.Show(ex.StackTrace);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;everything is ok until Play, report an error like this:&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.COMException (0x80040980): The Time control must be activated before it can be made visible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Oct 2016 09:03:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/timecontrol-to-playback-historical-data-on/m-p/604604#M1375</guid>
      <dc:creator>JhonChin1</dc:creator>
      <dc:date>2016-10-16T09:03:22Z</dc:date>
    </item>
  </channel>
</rss>

