Changeset 1699


Ignore:
Timestamp:
Jun 24, 2010, 4:12:57 PM (11 years ago)
Author:
nolte
Message:

Exchanged the scale-event through a Viewbox (thx Paul)...now scaling the presentations gets a lot easier!!!

Location:
trunk/CrypPlugins/AutokorrelationFunction
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/AutokorrelationFunction/AutocorrelationPresentation.xaml

    r1675 r1699  
    88             mc:Ignorable="d"
    99             d:DesignHeight="300" d:DesignWidth="300">
    10     <Grid Name="Grid" Width="300">
    11         <Grid.LayoutTransform>
    12             <ScaleTransform x:Name="scaler" ScaleX="1" ScaleY="1"/>
    13         </Grid.LayoutTransform>
     10    <Viewbox>
     11   
     12    <Grid Name="Grid" Height="154">
     13            <Grid.ColumnDefinitions>
     14                <ColumnDefinition Width="11*" />
     15                <ColumnDefinition Width="143*" />
     16                <ColumnDefinition Width="0*" />
     17            </Grid.ColumnDefinitions>
    1418
    1519        <TextBlock TextAlignment="Center" FontSize="20" Foreground="DarkBlue"  FontFamily="Academy" OpacityMask="Turquoise" Text="Shift values" Height="20" VerticalAlignment="Bottom"></TextBlock>
     
    2024
    2125    </Grid>
    22    
     26
     27    </Viewbox>
    2328   
    2429</UserControl>
  • trunk/CrypPlugins/AutokorrelationFunction/AutocorrelationPresentation.xaml.cs

    r1675 r1699  
    2424        public AutocorrelationPresentation()
    2525        {
    26             InitializeComponent();
    27             SizeChanged += new SizeChangedEventHandler(AutocorrelationPresentation_SizeChanged);
    28         }
    29 
    30         private void AutocorrelationPresentation_SizeChanged(object sender, SizeChangedEventArgs e)
    31         {
    32             updateScaling();
    33         }
    34 
    35         private void updateScaling()
    36         {
    37             this.scaler.ScaleX = this.ActualWidth / this.Grid.Width;
    38             this.scaler.ScaleY = this.scaler.ScaleX;
     26            InitializeComponent();       
    3927        }
    4028    }
     29
     30    //INFO TO ALL DEVELOPERS WORKING ON PRESENTATIONS:
     31    //To resize the quickview the same way as this plugin does just use a <Viewbow> around all your other Presentation Elements!
    4132}
  • trunk/CrypPlugins/AutokorrelationFunction/AutokorrelationFunction.cs

    r1697 r1699  
    4444        private String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";         //used alphabet
    4545        private double same;                                            //Found same letter counter
    46         private double average;                                         //Holds the average value of the found matches
    4746        private double[] ak;                                            // Autokorrelation Values
    48         private double[] top;
    4947        private HistogramElement bar;                                   
    5048        private HistogramDataSource data;
     
    163161                    }
    164162
    165             average = averageMatch(ak);                         //find the average value of matches
    166163            data.ValueCollection.Clear();
    167164
     
    278275
    279276//---------------------------------------------------------------------------------------------------------------------------------------
    280 //AVERAGE MATCHES COUNT------------------------------------------------------------------------------------------------------------------
    281 
    282         /// <summary>
    283         /// Calculates the average value for all matches in the autokorrelation
    284         /// </summary>
    285         private double averageMatch(double[] ak)
    286         {
    287             double average = 0;
    288 
    289             for (int y = 0; y < ak.Length; y++)
    290             {
    291                 average += ak[y];
    292             }
    293 
    294             average = average / ak.Length;
    295 
    296             return average;
    297         }
    298 
    299 //---------------------------------------------------------------------------------------------------------------------------------------
    300277//FIND TOP 13----------------------------------------------------------------------------------------------------------------------------
    301278
     279        /// <summary>
     280        /// Thirteen possible shift values with the highest match count are enough information
     281        /// </summary>
    302282        private double[] findTopThirteen(double[] ak)
    303283        {
Note: See TracChangeset for help on using the changeset viewer.