Example #1
0
        /*
         * private void ResetDensityMatrixGrid()
         * {
         *  DensityMatrixBlock.Text = string.Empty;
         *  DensityMatrixGrid.Visibility = Visibility.Collapsed;
         * }
         *
         * private void ResetTransformedMatrixGrid()
         * {
         *  TransformedMatrixBlock.Text = string.Empty;
         *  TransformedMatrixGrid.Visibility = Visibility.Collapsed;
         * }
         *
         * private void ResetSingularResults()
         * {
         *  UMatrixBlock.Text = string.Empty;
         *  SigmaMatrixBlock.Text = string.Empty;
         *  VTMatrixBlock.Text = string.Empty;
         *  SingularValuesBlock.Text = string.Empty;
         *  SigmaRankBlock.Text = string.Empty;
         *  TraceNormBlock.Text = string.Empty;
         *  SvdDecompositionGrid.Visibility = Visibility.Collapsed;
         *  SingularValuesGrid.Visibility = Visibility.Collapsed;
         *  SigmaRankGrid.Visibility = Visibility.Collapsed;
         *  TraceNormGrid.Visibility = Visibility.Collapsed;
         * }
         *
         * private void ResetEigenValuesGrid()
         * {
         *  EigenvaluesBlock.Text = string.Empty;
         *  EigenvaluesGrid.Visibility = Visibility.Collapsed;
         * }
         */
        /*
         * private void SvdDisplay()
         * {
         *  SchmidtDecomposition svd = (SchmidtDecomposition)Criterion;
         *  UMatrixBlock.Text = svd.U.ToString(2);
         *  SigmaMatrixBlock.Text = svd.Sigma.ToString(2);
         *  VTMatrixBlock.Text = svd.VT.ToString(2);
         *  for (int i = 0; i < svd.SingularValues.Length; i++)
         *      SingularValuesBlock.Text += svd.SingularValues[i].Real.ToString("n2") + " ";
         *  SigmaRankBlock.Text = svd.SigmaRank.ToString();;
         *  TraceNormBlock.Text = svd.TraceNorm.ToString("n2");
         *  SvdDecompositionGrid.Visibility = Visibility.Visible;
         *  SingularValuesGrid.Visibility = Visibility.Visible;
         *  SigmaRankGrid.Visibility = Visibility.Visible;
         *  TraceNormGrid.Visibility = Visibility.Visible;
         * }
         */

        /*
         * private void CCNRDisplay()
         * {
         * if(State != null) { DensityMatrixBlock.Text = StateOperator.FromQuantumState(State).ToString(2); }
         * ComputableCrossNormCriterion ccnr = (ComputableCrossNormCriterion)Criterion;
         * TransformedMatrixBlock.Text = ccnr.EvaluatedMatrix.ToString(2);
         * TransformedMatrixGrid.Visibility = Visibility.Visible;
         * UMatrixBlock.Text = ccnr.U.ToString(2);
         * SigmaMatrixBlock.Text = ccnr.Sigma.ToString(2);
         * VTMatrixBlock.Text = ccnr.VT.ToString(2);
         * for(int i = 0; i < ccnr.SingularValues.Length; i++)
         *  SingularValuesBlock.Text += ccnr.SingularValues[i].Real.ToString("n2") + " ";
         * SigmaRankBlock.Text = ccnr.SigmaRank.ToString(); ;
         * TraceNormBlock.Text = ccnr.TraceNorm.ToString("n2");
         * SvdDecompositionGrid.Visibility = Visibility.Visible;
         * SingularValuesGrid.Visibility = Visibility.Visible;
         * SigmaRankGrid.Visibility = Visibility.Visible;
         * TraceNormGrid.Visibility = Visibility.Visible;
         * }
         */

        /*
         * private void PPTDisplay()
         * {
         * PPTCriterion ppt = (PPTCriterion)Criterion;
         * if(State != null) { DensityMatrixBlock.Text = StateOperator.FromQuantumState(State).ToString(2); }
         * TransformedMatrixBlock.Text = ppt.StateOperator.ToString(2);
         * TransformedMatrixGrid.Visibility = Visibility.Visible;
         * string text = "";
         * for(int i = 0; i < ppt.Eigenvalues.Length; i++)
         * {
         *  text += ppt.Eigenvalues[i].Real.ToString("n2");
         *  if(i < ppt.Eigenvalues.Length - 1)
         *      text += ", ";
         * }
         * EigenvaluesBlock.Text = text;
         * EigenvaluesGrid.Visibility = Visibility.Visible;
         * }
         */
        private void EvaluateCriterion(object sender, RoutedEventArgs e)
        {
            ErrorMessage.Visibility = Visibility.Collapsed;
            bool validState;

            if (Qubits.IsEnabled)
            {
                validState = CreateStateFromDefinition();
            }
            else
            {
                validState = true;
            }
            if (validState)
            {
                ResetResults();
                ResultsDisplay.Visibility = Visibility.Visible;
                if (DensityMatrix.IsChecked == true)
                {
                    ResultsDisplay.DisplayResults(StateOperator, Bipartition);
                }
                else if (StateMatrix.IsChecked == true)
                {
                    ResultsDisplay.DisplayResults(State, Bipartition);
                }
            }
        }
Example #2
0
 private void OnHandler1(object sender, WeatherEvent e)
 {
     if (InvokeRequired)
     {
         ResultsDisplay.Invoke((MethodInvoker) delegate { ResultsDisplay.Text += e.Message + Environment.NewLine; });
     }
 }
Example #3
0
    private void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else
        {
            Debug.LogWarning("You have an extra ResultsDisplay script attached to " + name + ".\nDestroying extra script!");
            Destroy(this);
        }

        _scrollView = GetComponent <ScrollRect>();
        ShowListScreen();
        ClearList();
    }
Example #4
0
 /// <summary>
 /// This will load the configuration from the TextBoxes
 /// </summary>
 private void UpdateConfiguration_Click(object sender, EventArgs e)
 {
     ResultsDisplay.AppendText(Environment.NewLine + "Updating configuration Information." + Environment.NewLine);
     if (!string.IsNullOrEmpty(WeatherServiceURLInput.Text))
     {
         _weather.APIConfiguration.WeatherAPIURI = WeatherServiceURLInput.Text;
     }
     if (!string.IsNullOrEmpty(APIKeyInput.Text))
     {
         _weather.APIConfiguration.APIKey = APIKeyInput.Text;
     }
     if (!string.IsNullOrEmpty(SaveFileLocationInput.Text))
     {
         _weather.APIConfiguration.SaveFileLocation = SaveFileLocationInput.Text;
     }
     if (!string.IsNullOrEmpty(ZipCodeInput.Text))
     {
         _weather.APIConfiguration.ZipInformationLocation = ZipCodeInput.Text;
     }
 }
Example #5
0
        public void MakeBasicWebCall(string zipCode)
        {
            ResultsDisplay.Text = $"Making a simple call to weather based on zip{Environment.NewLine}";

            CurrentWeather now = _weather.GetWeatherObjectByZipAsync(zipCode, "").GetAwaiter().GetResult();

            if (now.Cod == "200")
            {
                ResultsDisplay.AppendText($"Result set successful {Environment.NewLine}");
                ResultsDisplay.AppendText($"Retrieval Time:  {now.RetrievalTime.ToLongDateString()}{Environment.NewLine}");
                ResultsDisplay.AppendText($"Condition:  {now.Condition}{Environment.NewLine}");
                ResultsDisplay.AppendText($"Pressure:  {now.Pressure}{Environment.NewLine}");
                ResultsDisplay.AppendText($"WindDirection:  {now.WindDirection}{Environment.NewLine}");
                ResultsDisplay.AppendText($"WindSpeed:  {now.WindSpeed}{Environment.NewLine}");
                ResultsDisplay.AppendText($"Humidity:  {now.Humidity}%{Environment.NewLine}");
                ResultsDisplay.AppendText(now.CreateLogLine() + Environment.NewLine);
            }
            else
            {
                ResultsDisplay.AppendText($"There was an error attempting to connect to the service: {Environment.NewLine} Code: {now.Cod}{Environment.NewLine}Message: {now.Message}{now.ErrorMessage}");
            }
        }
Example #6
0
 private void StopMultipleTimers_Click(object sender, EventArgs e)
 {
     ResultsDisplay.AppendText(Environment.NewLine + "Stopping Timers");
     _weather.StopTimers();
 }