Ejemplo n.º 1
0
        private void ClickRemoveParamRef(object sender, RoutedEventArgs e)
        {
            Models.AppVersion ver = VersionList.SelectedItem as Models.AppVersion;

            Models.ParameterRef dev = ParamRefList.SelectedItem as Models.ParameterRef;
            ver.ParameterRefs.Remove(dev);
        }
Ejemplo n.º 2
0
 private void ClickAddMemory(object sender, RoutedEventArgs e)
 {
     Models.Application app     = AppList.SelectedItem as Models.Application;
     Models.AppVersion  version = (sender as Button).DataContext as Models.AppVersion;
     version.Memories.Add(new Models.Memory()
     {
         Type = app.Mask.Memory
     });
 }
Ejemplo n.º 3
0
        private void ClickCalcHeatmap(object sender, RoutedEventArgs e)
        {
            Models.Memory     mem  = (sender as Button).DataContext as Models.Memory;
            Models.AppVersion ver  = VersionList.SelectedItem as Models.AppVersion;
            byte[]            data = AutoHelper.GetMemorySize(ver, mem);

            int height = Convert.ToInt32(Math.Ceiling(data.Length / 16.0));

            Debug.WriteLine("Höhe: " + height);

            WriteableBitmap map = new WriteableBitmap(16, height, 1, 1, PixelFormats.Indexed8, BitmapPalettes.WebPalette);

            int stride = (map.PixelWidth * map.Format.BitsPerPixel + 7) / 8;

            byte[] pixelByteArray = new byte[map.PixelHeight * stride];

            map.CopyPixels(pixelByteArray, stride, 0);

            for (int i = 0; i < pixelByteArray.Length; i++)
            {
                int val = (i >= data.Length) ? 0 : data[i];
                switch (val)
                {
                case 0:
                    pixelByteArray[i] = 18;
                    break;

                case 1:
                case 2:
                case 3:
                case 4:
                    pixelByteArray[i] = 205;
                    break;

                case 5:
                case 6:
                case 7:
                    pixelByteArray[i] = 193;
                    break;

                case 8:
                    pixelByteArray[i] = 180;
                    break;

                default:
                    pixelByteArray[i] = 0;
                    break;
                }
            }

            map.WritePixels(new Int32Rect(0, 0, map.PixelWidth, map.PixelHeight), pixelByteArray, stride, 0);
            OutHeatmap.Source = map;
        }
Ejemplo n.º 4
0
        private void ClickRemoveVersion(object sender, RoutedEventArgs e)
        {
            if (AppList.SelectedItem == null || VersionList.SelectedItem == null)
            {
                return;
            }

            Models.Application app = AppList.SelectedItem as Models.Application;
            Models.AppVersion  ver = VersionList.SelectedItem as Models.AppVersion;

            app.Versions.Remove(ver);
        }
Ejemplo n.º 5
0
        private void ClickGenerateRefAuto(object sender, RoutedEventArgs e)
        {
            Models.AppVersion ver = VersionList.SelectedItem as Models.AppVersion;
            ver.ParameterRefs.Clear();

            foreach (Models.Parameter para in ver.Parameters)
            {
                Models.ParameterRef pref = new Models.ParameterRef();
                pref.Name            = para.Name;
                pref.ParameterObject = para;
                ver.ParameterRefs.Add(pref);
            }
        }
Ejemplo n.º 6
0
        private void ClickCopyVersion(object sender, RoutedEventArgs e)
        {
            if (AppList.SelectedItem == null || VersionList.SelectedItem == null)
            {
                return;
            }

            Models.Application app = AppList.SelectedItem as Models.Application;
            Models.AppVersion  ver = VersionList.SelectedItem as Models.AppVersion;

            Models.AppVersion copy = new Models.AppVersion(ver);
            app.Versions.Add(copy);
        }
Ejemplo n.º 7
0
 private void ClickRemoveDyn(object sender, RoutedEventArgs e)
 {
     Models.AppVersion        ver  = VersionList.SelectedItem as Models.AppVersion;
     Models.Dynamic.IDynItems item = (sender as MenuItem).DataContext as Models.Dynamic.IDynItems;
     if (item is Models.Dynamic.DynParameter && ver.IsParameterRefAuto)
     {
         ver.ParameterRefs.Remove((item as Models.Dynamic.DynParameter).ParameterRefObject);
     }
     if (item is Models.Dynamic.DynComObject && ver.IsComObjectRefAuto)
     {
         ver.ComObjectRefs.Remove((item as Models.Dynamic.DynComObject).ComObjectRefObject);
     }
     item.Parent.Items.Remove(item);
 }
Ejemplo n.º 8
0
        private void ClickAddVersion(object sender, RoutedEventArgs e)
        {
            Models.Application app    = AppList.SelectedItem as Models.Application;
            Models.AppVersion  newVer = new Models.AppVersion()
            {
                Name = app.Name
            };

            if (app.Versions.Count > 0)
            {
                Models.AppVersion ver = app.Versions.OrderByDescending(v => v.Number).ElementAt(0);
                newVer.Number = ver.Number + 1;
            }

            newVer.Dynamics.Add(new Models.Dynamic.DynamicMain());
            app.Versions.Add(newVer);
        }
Ejemplo n.º 9
0
        private void ListDevicesForExport()
        {
            Exports.Clear();
            foreach (Models.Hardware hard in General.Hardware)
            {
                foreach (Models.Device dev in hard.Devices)
                {
                    foreach (Models.Application app in hard.Apps)
                    {
                        if (InPublishOnlyLatest.IsChecked == true)
                        {
                            Models.AppVersion ver  = app.Versions.OrderByDescending(v => v.Number).First();
                            Models.ExportItem item = new Models.ExportItem();
                            item.Hardware = hard;
                            item.Device   = dev;
                            item.App      = app;
                            item.Version  = ver;
                            Exports.Add(item);
                        }
                        else
                        {
                            foreach (Models.AppVersion ver in app.Versions)
                            {
                                Models.ExportItem item = new Models.ExportItem();
                                item.Hardware = hard;
                                item.Device   = dev;
                                item.App      = app;
                                item.Version  = ver;
                                Exports.Add(item);
                            }
                        }
                    }
                }
            }

            ExportList.ItemsSource = Exports;
        }
Ejemplo n.º 10
0
 private void ClickRemoveParam(object sender, RoutedEventArgs e)
 {
     Models.AppVersion ver = VersionList.SelectedItem as Models.AppVersion;
     ver.Parameters.Remove(ParamList.SelectedItem as Models.Parameter);
 }
Ejemplo n.º 11
0
 private void ClickAddParam(object sender, RoutedEventArgs e)
 {
     Models.AppVersion ver = VersionList.SelectedItem as Models.AppVersion;
     ver.Parameters.Add(new Models.Parameter());
 }
Ejemplo n.º 12
0
 private void ClickRemoveMemory(object sender, RoutedEventArgs e)
 {
     Models.AppVersion version = (sender as Button).DataContext as Models.AppVersion;
     version.Memories.Remove(ListMemories.SelectedItem as Models.Memory);
 }
Ejemplo n.º 13
0
 private void ClickRemoveParamType(object sender, RoutedEventArgs e)
 {
     Models.AppVersion version = (sender as Button).DataContext as Models.AppVersion;
     version.ParameterTypes.Remove(ListParamTypes.SelectedItem as Models.ParameterType);
 }
Ejemplo n.º 14
0
 private void ClickAddParamType(object sender, RoutedEventArgs e)
 {
     Models.AppVersion version = (sender as Button).DataContext as Models.AppVersion;
     version.ParameterTypes.Add(new Models.ParameterType());
 }