void ShowHistoryView(
            RepositorySpec repSpec,
            long itemId,
            string path,
            bool isDirectory)
        {
            if (HistoryTab == null)
            {
                HistoryTab = new HistoryTab(
                    mWkInfo,
                    mWorkspaceWindow,
                    repSpec,
                    mDeveloperNewIncomingChangesUpdater,
                    mViewHost,
                    mParentWindow,
                    mIsGluonMode);

                mViewHost.AddRefreshableView(
                    ViewType.HistoryView, HistoryTab);
            }

            HistoryTab.RefreshForItem(
                itemId,
                path,
                isDirectory);

            SetSelectedView(SelectedTab.History);
        }
        public override void PreOpen()
        {
            base.PreOpen();
            tabs.Clear();
            tabs.Add(new TabRecord("Graph".Translate(), delegate
            {
                curTab = HistoryTab.Graph;
            }, () => curTab == HistoryTab.Graph));
            tabs.Add(new TabRecord("Messages".Translate(), delegate
            {
                curTab = HistoryTab.Messages;
            }, () => curTab == HistoryTab.Messages));
            tabs.Add(new TabRecord("Statistics".Translate(), delegate
            {
                curTab = HistoryTab.Statistics;
            }, () => curTab == HistoryTab.Statistics));
            historyAutoRecorderGroup = Find.History.Groups().FirstOrDefault();
            if (historyAutoRecorderGroup != null)
            {
                graphSection = new FloatRange(0f, (float)Find.TickManager.TicksGame / 60000f);
            }
            List <Map> maps = Find.Maps;

            for (int i = 0; i < maps.Count; i++)
            {
                maps[i].wealthWatcher.ForceRecount();
            }
        }
Example #3
0
 void InitHistory()
 {
     historyTab = new HistoryTab("History", this);
     displays.Add(historyTab);
     toolbarStrings.Add(historyTab.GetName());
     initializationProgress += 25;
 }
        public override void DoWindowContents(Rect rect)
        {
            base.DoWindowContents(rect);
            Rect rect2 = rect;

            rect2.yMin += 45f;
            List <TabRecord> list = new List <TabRecord>();

            list.Add(new TabRecord("Graph".Translate(), delegate
            {
                this.curTab = HistoryTab.Graph;
            }, this.curTab == HistoryTab.Graph));
            list.Add(new TabRecord("Statistics".Translate(), delegate
            {
                this.curTab = HistoryTab.Statistics;
            }, this.curTab == HistoryTab.Statistics));
            TabDrawer.DrawTabs(rect2, list);
            switch (this.curTab)
            {
            case HistoryTab.Graph:
                this.DoGraphPage(rect2);
                break;

            case HistoryTab.Statistics:
                this.DoStatisticsPage(rect2);
                break;
            }
        }
Example #5
0
        public override void Initialize(IApplicationManager applicationManager)
        {
            base.Initialize(applicationManager);

            HistoryTab.InitializeView(this);
            ChangesTab.InitializeView(this);
            BranchesTab.InitializeView(this);
            SettingsTab.InitializeView(this);
        }
Example #6
0
        public void ValidateInHistory(string Comment = null)
        {
            HistoryTab.Click();
            CustomWait.WaitFortheLoadingIconDisappear2000();
            CauseCodeForDeletionTab.Click();
            string      ActualAppointmentJobDetailCause = BeforeAppointmentJobDetailCause + Comment + AfterAppointmentJobDetailCause;
            IWebElement FinalAppointmentJobDetailCause  = Drive.driver.FindElement(By.XPath(ActualAppointmentJobDetailCause));

            Console.WriteLine(PriceCauseComment.Text + FinalAppointmentJobDetailCause.Text);
        }
        void CloseHistoryTab()
        {
            ShowView(mPreviousSelectedTab);

            mViewHost.RemoveRefreshableView(
                ViewType.HistoryView, HistoryTab);

            HistoryTab.OnDisable();
            HistoryTab = null;

            mParentWindow.Repaint();
        }
Example #8
0
        public void reloadLVTable()
        {
            LVTable.Items.Clear();
            var tableList = TableManager.getInstance().TableList;

            foreach (KeyValuePair <int, Table> entry in tableList)
            {
                if (entry.Value != null)
                {
                    var tableInfo = new TableInfo(entry.Value);
                    LVTable.Items.Add(tableInfo);
                }
            }
            BtnRemoveTable.IsEnabled = false;
            HistoryTab.reloadTable();
        }
Example #9
0
 private void BtnHistory_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     HistoryTab.reloadListViewOrder(false);
     HistoryTab.Visibility = System.Windows.Visibility.Visible;
 }
Example #10
0
        private void SpawnButtons()
        {
            // Tabs
            TabButton btnSolved = new TabButton(new Rectangle(), texPixel, texSolved, null, Color.DarkGray, new Color(14, 14, 14));

            btnSolved.Click += () =>
            {
                currentTab  = HistoryTab.Solved;
                currentPage = 0;
                fileNames   = FileStorageManager.GetSolvedPanelsNames();
                UpdatePageSize();
                RespawnPanelButtons();
                SoundManager.PlayOnce(Sound.ButtonNext, 0.75f);
            };
            tabs.Add(btnSolved);

            TabButton btnDiscarded = new TabButton(new Rectangle(), texPixel, texDiscarded, null, Color.DarkGray, new Color(14, 14, 14));

            btnDiscarded.Click += () =>
            {
                currentTab  = HistoryTab.Discarded;
                currentPage = 0;
                fileNames   = FileStorageManager.GetDiscardedPanelsNames();
                UpdatePageSize();
                RespawnPanelButtons();
                SoundManager.PlayOnce(Sound.ButtonNext, 0.75f);
            };
            tabs.Add(btnDiscarded);

            TabButton btnFavs = new TabButton(new Rectangle(), texPixel, texFavourite, null, Color.DarkGray, new Color(14, 14, 14));

            btnFavs.Click += () =>
            {
                currentTab  = HistoryTab.Favourites;
                currentPage = 0;
                fileNames   = FileStorageManager.GetFavouritePanelsNames();
                UpdatePageSize();
                RespawnPanelButtons();
                SoundManager.PlayOnce(Sound.ButtonNext, 0.75f);
            };
            tabs.Add(btnFavs);

            // Other buttons
            foreach (TabButton tab in tabs)
            {
                foreach (TabButton otherTab in tabs.Where(x => x != tab))
                {
                    tab.ConnectTab(otherTab);
                }
            }
            btnSolved.Activate();

            btnBack        = new TextButton(new Rectangle(), font, "Back", texPixel);
            btnBack.Click += () =>
            {
                ScreenManager.Instance.GoBack();
                SoundManager.PlayOnce(Sound.MenuEscape);
            };

            btnPrevPage        = new TouchButton(new Rectangle(), texLeft);
            btnPrevPage.Click += () =>
            {
                if (currentPage > 0)
                {
                    currentPage--;
                    RespawnPanelButtons();
                }
                SoundManager.PlayOnce(Sound.ButtonNext, 0.75f);
            };

            btnNextPage        = new TouchButton(new Rectangle(), texRight);
            btnNextPage.Click += () =>
            {
                if (currentPage < maxPage)
                {
                    currentPage++;
                    RespawnPanelButtons();
                }
                SoundManager.PlayOnce(Sound.ButtonNext, 0.75f);
            };

            UpdateButtonsPositions();
        }
	/// <summary>
	/// Displays the history of the supplied harvest as a line graph.
	/// </summary>
	/// <returns>
	/// The tooltip for the current point, if any.
	/// </returns>
	/// <param name='parent'>
	/// The parent rectangle
	/// </param>
	/// <param name='harvest'>
	/// Harvest.
	/// </param>
	/// <param name='currentTab'>
	/// Current tab.
	/// </param>
	/// <param name='poleTimberSeries'>
	/// Pole timber point style.
	/// </param>
	/// <param name='sawTimberSeries'>
	/// Saw timber point style.
	/// </param>
	/// <param name='lineGraphMaterial'>
	/// Line graph material.
	/// </param>
	public static string DisplayHarvestHistoryGraph(
		Rect parent,
		Harvest harvest, HistoryTab currentTab,
		TimeSeries poleTimberSeries, TimeSeries sawTimberSeries,
		Material lineGraphMaterial
	)
	{
		// create space in the layout and store it
		Rect placeholder = GUILayoutUtility.GetRect(
			//BottomTrayGUI.use.rectActionControls.width*0.5f, // min width
			//BottomTrayGUI.use.rectActionControls.width, // max width
			150f, 300f,
			m_histogramHeight, // min height
			m_histogramHeight // max height
		);
		if (Event.current.type == EventType.Repaint) {
			m_lineGraphRect = GUILayoutUtility.GetLastRect();
		}
		// determine max value for ordinate
		float maxOrdinate = 0f;
		if (currentTab == HistoryTab.Value) {
			foreach (Harvest.Products products in harvest.history) {
				maxOrdinate = Mathf.Max(maxOrdinate, products.poletimberValue);
				maxOrdinate = Mathf.Max(maxOrdinate, products.sawtimberValue);
			}
		} else {
			foreach (Harvest.Products products in harvest.history) {
				maxOrdinate = Mathf.Max(maxOrdinate, products.poletimberVolume);
				maxOrdinate = Mathf.Max(maxOrdinate, products.sawtimberVolume);
			}
		}
		// graph gui
		Color currentGUIColor = GUI.color;
		GUI.BeginGroup(m_lineGraphRect); {
			// allocations for background
			Color opaqueLine = GUI.color;
			Color fadeLine = new Color(opaqueLine.r, opaqueLine.g, opaqueLine.b, opaqueLine.a * 0.5f);
			Rect r = new Rect();
			int numLines = 5;
			float div = 1f/numLines;
			bool fill = true;
			GUIStyle labelStyle = GameGUIManager.use.styles.smallTextMedium;
			// draw background
			for (int i=0; i<numLines; ++i) {
				// ordinate number
				r.width = m_lineGraphRect.width; r.x = 0f;
				r.height = m_lineGraphRect.height*div; r.y = r.height*i;
				GUI.Label(r, string.Format("{0:0,0}", maxOrdinate*div*(numLines-i)), labelStyle);
				// line
				if (fill) {
					GUI.color = fadeLine;
					GUI.DrawTexture(r, GameGUIManager.use.styles.histogramBar.active.background, ScaleMode.StretchToFill);
					GUI.color = opaqueLine;
				}
				fill = !fill;
			}
			// get points
			Vector2[] poleTimberPoints = new Vector2[harvest.history.Length];
			Vector2[] sawTimberPoints = new Vector2[harvest.history.Length];
			float divOrdinate = 1f/maxOrdinate;
			float divAbcissa = m_lineGraphRect.width/(harvest.duration-1);
			if (currentTab == HistoryTab.Value) {
				for (int i=0; i<harvest.history.Length; ++i) {
					poleTimberPoints[i] = new Vector2(divAbcissa*i, divOrdinate*harvest.history[i].poletimberValue*m_histogramHeight);
					sawTimberPoints[i] = new Vector2(divAbcissa*i, divOrdinate*harvest.history[i].sawtimberValue*m_histogramHeight);
				}
			}
			else {
				for (int i=0; i<harvest.history.Length; ++i) {
					poleTimberPoints[i] = new Vector2(divAbcissa*i, divOrdinate*harvest.history[i].poletimberVolume*m_histogramHeight);
					sawTimberPoints[i] = new Vector2(divAbcissa*i, divOrdinate*harvest.history[i].sawtimberVolume*m_histogramHeight);
				}
			}
			// draw lines
			if (Event.current.type == EventType.Repaint) {
				Vector2 corner = new Vector2(
					parent.x+placeholder.x,
					Screen.height-parent.y-placeholder.y-placeholder.height
				);
				DrawLineInGraph(poleTimberSeries, poleTimberPoints, lineGraphMaterial, corner);
				DrawLineInGraph(sawTimberSeries, sawTimberPoints, lineGraphMaterial, corner);
			}
			// draw points
			for (int i=0; i<harvest.history.Length; ++i) {
				// draw poletimber point
				DrawPointInGraph(
					poleTimberSeries, poleTimberPoints[i],
					string.Format(
						"Pole Timber Year {0:0}: {1}", i+1,
						currentTab==HistoryTab.Value?
						string.Format("{0:c}", harvest.history[i].poletimberValue):
						string.Format("{0:0} cords", harvest.history[i].poletimberVolume)
					)
				);
				// draw sawtimber point
				DrawPointInGraph(
					sawTimberSeries, sawTimberPoints[i],
					string.Format(
						"Saw Timber Year {0:0}: {1}", i+1,
						currentTab==HistoryTab.Value?
						string.Format("{0:c}", harvest.history[i].sawtimberValue):
						string.Format("{0:0} board feed", harvest.history[i].sawtimberVolume)
					)
				);
			}
		} GUI.EndGroup();
		GUI.color = currentGUIColor;
		// axis labels
		GUILayout.BeginHorizontal(); {
			for (int i=0; i<harvest.duration; ++i) {
				GUILayout.Label(
					string.Format("{0}", i+1),
					GameGUIManager.use.styles.smallTextMedium
				);
				if (i<harvest.duration-1) {
					GUILayout.FlexibleSpace();
				}
			}
		} GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal(); {
			GUILayout.FlexibleSpace();
			GUILayout.Label("Harvest Year", GameGUIManager.use.styles.smallTextLight);
			GUILayout.FlexibleSpace();
		} GUILayout.EndHorizontal();
		// return the tooltip if the mouse is in the graph
		return (placeholder.Contains(Event.current.mousePosition)?GUI.tooltip:"");
	}
	/// <summary>
	/// Displays the current harvest history viewer.
	/// </summary>
	private void DisplayCurrentHarvestHistoryViewer()
	{
		// early out if no history to show
		if ((m_currentlySelectedHarvest.history == null ||
			m_currentlySelectedHarvest.history.Length == 0)
		) {
			GUILayout.Label("No history for this harvest yet.", m_minorText);
			return;
		}
		// otherwise display history of products
		else {
			GUILayout.BeginHorizontal(); {
				GUILayout.Label("Product Extraction History:", m_mainText);
				m_historyTab = (HistoryTab)GUILayout.SelectionGrid(
					(int)m_historyTab,
					System.Enum.GetNames(typeof(PlayerActionScheduleHarvest.HistoryTab)),
					2,
					m_button
				);
			} GUILayout.EndHorizontal();
			string tooltip = DisplayHarvestHistoryGraph(
				BottomTrayGUI.use.rectActionControls,
				m_currentlySelectedHarvest, m_historyTab,
				m_poleTimberPointStyle, m_sawTimberPointStyle,
				m_lineGraphLineMaterial
			);
			// display info about the current point, if any
			GUILayout.Label(tooltip, m_mainText);
		}
	}