Example #1
0
        public void Delete()
        {
            if (local == true)
            {
                throw new Exception("Can't call PhysicalQuery.Delete() method in Local transaction mode!");
            }

            string         mainNo = MainSet.RecNo;
            SqlTransaction trans  = AppRes.DB.BeginTrans();

            try
            {
                P2Set.MainNo = mainNo;
                P2Set.Delete(trans);
                P3Set.MainNo = mainNo;
                P3Set.Delete(trans);
                P40Set.MainNo = mainNo;
                P40Set.Delete(trans);
                P41Set.MainNo = mainNo;
                P41Set.Delete(trans);
                P5Set.MainNo = mainNo;
                P5Set.Delete(trans);
                ImageSet.RecNo = mainNo;
                ImageSet.Delete(trans);
                MainSet.Delete(trans);
                productSet.JobNo = mainNo;
                productSet.UpdateJobNoReset(trans);

                AppRes.DB.CommitTrans();
            }
            catch
            {
                AppRes.DB.RollbackTrans();
            }
        }
Example #2
0
        /// <summary>
        /// Constructor caller of base constructor
        /// Also reads a saves LUT file by its filename
        /// </summary>
        /// <param name="mod">One of provided image modifications</param>
        /// <param name="imageSet">Pointer to image set from engine</param>
        /// <param name="name">LUT filename</param>
        public ApplyLUT(ImageModification mod, ImageSet imageSet, string name) : base(mod, imageSet)
        {
            Tuple <int, Tuple <byte, byte, byte> [, , ]> lut = LookUpTable.Read(name);

            size = lut.Item1;
            map  = lut.Item2;
        }
Example #3
0
        /// <summary>
        /// Add new layout's set and add vertex to one
        /// </summary>
        /// <param name="vertex2D"></param>
        public void AddNewSet(Vertex2D vertex2D)
        {
            IVisualSet visualSet = null;

            switch (vertex2D.VertexType)
            {
            case VertexType.Vertex:
                visualSet = new SimpleSet();
                break;

            case VertexType.Brush:
                visualSet = new BrushSet();
                break;

            case VertexType.Eraser:
                visualSet = new EraserSet();
                break;

            case VertexType.Image:
                visualSet = new ImageSet();
                break;

            case VertexType.Spline:
                visualSet           = IsInstrumentChanged ? new SplineSet() : vertex2Ds.Last(x => x is SplineSet);
                IsInstrumentChanged = false;
                break;
            }

            visualSet?.Add(vertex2D);
            if (visualSet != null)
            {
                vertex2Ds.Add(visualSet);
            }
        }
Example #4
0
        public ImageSet GetImages(string id)
        {
            if (this.managerImages == null)
            {
                this.managerImages = (IDictionary <string, ImageSet>) new Dictionary <string, ImageSet>();
                string      @string     = ResourceExtensions.GetString(this.Resources["Microsoft.MediaCenter.Shell.dll"].GetResource("IMAGES.MCML", (object)10), Encoding.UTF8);
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.LoadXml(@string);
                XmlNodeList childNodes = xmlDocument.DocumentElement.ChildNodes;
                for (int index = 0; index < childNodes.Count; ++index)
                {
                    XmlElement element = childNodes[index] as XmlElement;
                    if (element != null)
                    {
                        ImageSet imageSet = ImageSet.FromXml(this.Resources, element);
                        if (imageSet.Name != null)
                        {
                            this.managerImages[imageSet.Name] = imageSet;
                        }
                    }
                }
            }
            ImageSet imageSet1;

            this.managerImages.TryGetValue(id, out imageSet1);
            if (imageSet1 == null)
            {
                Trace.TraceWarning("Could not find image set {0}.", new object[1]
                {
                    (object)id
                });
            }
            return(imageSet1);
        }
        // Checks to see if images in the image set contain "Pdrip" and builds an array with them.
        private String[] LoadPdripIndex(string color)
        {
            ImageSet  imageSet  = this.Images;
            ArrayList pDripList = new ArrayList();

            //int test = 0;
            foreach (ImageInfo image in imageSet)
            {
                //Log.Debug(color + " Pdrip");
                //test++;

                if (image.name.Contains(color + " Pdrip"))
                {
                    //Log.Debug("PImg Name: " + image.name);
                    pDripList.Add(image.name);
                }
            }
            String[] rv = new String[pDripList.Count];
            for (int i = 0; i < pDripList.Count; i++)
            {
                rv[i] = (string)pDripList[i];
            }
            //Log.Debug(color + " Pdrip Length: " + rv.Length);
            return(rv);
        }
 public virtual void Visit(ImageSet imageSet)
 {
     foreach (var image in imageSet.Images)
     {
         Visit(image);
     }
 }
Example #7
0
        private void cargar_imagenes(ImageSet listaMF)
        {
            tests = new Test_MF[3];
            var img = new Image[9];

            for (int i = 0; i < 9; i++)
            {
                img[i] = listaMF[i];
            }
            tests[0] = new Test_MF(img, new[] { 2, 5, 6 });

            img = new Image[9];
            for (int i = 0; i < 9; i++)
            {
                img[i] = listaMF[i + 9];
            }
            tests[1] = new Test_MF(img, new[] { 1, 6, 7 });

            img = new Image[9];
            for (int i = 0; i < 9; i++)
            {
                img[i] = listaMF[i + 18];
            }
            tests[2] = new Test_MF(img, new[] { 7, 0, 2 });
        }
Example #8
0
 private void PrepareTestForm()
 {
     if (question.SubtypeId == (int)Question.Subtype.ReadingComprehensionQuestionToPassage)
     {
         testForm.panel.Controls.Remove(generalQuestionPanel);
         testForm.panel.Controls.Add(readingComprehensionPanel);
         statusBar                = testForm.statusBar;
         passagePictureBox        = readingComprehensionPanel.passagePictureBox;
         questionPictureBox       = readingComprehensionPanel.questionPictureBox;
         questionPanel            = readingComprehensionPanel.questionPanel;
         clockTimer               = testForm.clockTimer;
         imageSet                 = renderer.Render(question);
         questionPictureBox.Image = imageSet.Question;
         passagePictureBox.Image  =
             renderer.RenderPasssageToQuestion(navigator.GetPasssageToQuestion(question.Id));
     }
     else
     {
         testForm.panel.Controls.Remove(readingComprehensionPanel);
         testForm.panel.Controls.Add(generalQuestionPanel);
         statusBar                = testForm.statusBar;
         questionPictureBox       = generalQuestionPanel.questionPictureBox;
         questionPanel            = generalQuestionPanel.questionPanel;
         clockTimer               = testForm.clockTimer;
         imageSet                 = renderer.Render(question);
         questionPictureBox.Image = imageSet.Question;
     }
 }
Example #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            string path = "";

            FolderSelect.SelectedPath = LastPath;
            DialogResult r = FolderSelect.ShowDialog();

            switch (r)
            {
            case DialogResult.Abort:
            case DialogResult.Cancel:
                Console.WriteLine("Load set aborted.");
                return;

                break;

            case DialogResult.OK:
                Console.WriteLine("Set selected:" + FolderSelect.SelectedPath);
                break;
            }
            LastPath = FolderSelect.SelectedPath;
            SavePath();
            ImageSet set = new ImageSet(FolderSelect.SelectedPath, IW, IH);

            InImages.Add(set);
            RebuildUI();
        }
Example #10
0
        /// <summary>
        /// Paint a preview of the <see cref="Image"/> specified by
        /// the image index provided by the <see cref="PaintValueEventArgs"/>
        /// </summary>
        /// <param name="pe">The PaintValue event args</param>
        public override void PaintValue(PaintValueEventArgs pe)
        {
            int imageIndex = -1;

            // value is the image index
            if (pe.Value != null)
            {
                try {
                    imageIndex = (int)Convert.ToUInt16(pe.Value.ToString());
                }
                catch {}
            }

            // no instance, or the instance represents an undefined image
            if ((pe.Context.Instance == null) || (imageIndex < 0))
            {
                return;
            }

            // get the image set
            ImageSet imageSet = GetImageSet(pe.Context.Instance);

            // make sure everything is valid
            if ((imageSet == null) || (imageSet.Count == 0) || (imageIndex >= imageSet.Count))
            {
                return;
            }

            // Draw the preview image
            pe.Graphics.DrawImage(imageSet.Images[imageIndex], pe.Bounds);
        }
        public void Delete(SqlTransaction trans = null)
        {
            if (local == true)
            {
                throw new Exception("Can't call ChemicalQuery.Delete() method in Local transaction mode!");
            }

            string mainNo = MainSet.RecNo;

            trans = AppRes.DB.BeginTrans();

            try
            {
                ImageSet.RecNo = mainNo;
                ImageSet.Delete(trans);
                JoinSet.RecNo = mainNo;
                JoinSet.Delete(trans);
                P2Set.MainNo = mainNo;
                P2Set.Delete(trans);
                P2ExtendSet.RecNo = mainNo;
                P2ExtendSet.Delete(trans);
                MainSet.Delete(trans);
                ResetReportValidation(trans);

                AppRes.DB.CommitTrans();
            }
            catch
            {
                AppRes.DB.RollbackTrans();
            }
        }
Example #12
0
        protected override void Load()
        {
            string attribute1       = this.XmlElement.GetAttribute("Title");
            int    stringResourceId = MediaCenterUtil.GetMagicStringResourceID(attribute1);

            if (stringResourceId >= 0)
            {
                string stringResource = ResourceExtensions.GetStringResource(this.Manager.Resources["ehres.dll"], stringResourceId);
                if (stringResource != null)
                {
                    this.originalTitle = stringResource;
                }
            }
            if (this.originalTitle == null)
            {
                this.originalTitle = attribute1;
            }
            this.Title = this.originalTitle;
            string attribute2 = this.XmlElement.GetAttribute("Icon");

            this.images = ((DefaultStartMenuManager)this.Manager).GetImages(attribute2);
            if (this.images == null)
            {
                throw new ApplicationException("Could not find image set \"" + attribute2 + "\".");
            }
            this.SetValue(XmlQuickLink.ImageProperty, (object)this.images["Focus"]);
            this.SetValue(XmlQuickLink.NonFocusImageProperty, (object)this.images["Default"]);
            string attribute3 = this.XmlElement.GetAttribute("Visible");
            bool   result;

            this.IsEnabled       = string.IsNullOrEmpty(attribute3) || bool.TryParse(attribute3, out result) && result;
            this.originalStripID = this.XmlElement.GetAttribute("AppId");
            this.originalStrip   = (DefaultMenuStrip)null;
        }
Example #13
0
        public Floor()
        {
            gfx        = new ImageSet(Assets.GFX_FLOOR, 32, 32);
            gfx.Repeat = true;
            Graphic    = gfx;

            Layer = 20;
        }
Example #14
0
		public static ItemImageSet TransformFromAmazonImplementation(ImageSet imageSet)
		{
			return new ItemImageSet
				{
					SmallImageAddress = imageSet.SmallImage.URL,
					MediumImageAddress = imageSet.MediumImage.URL,
					LargeImageAddress = imageSet.LargeImage.URL
				};
		}
Example #15
0
        public ImageSet GetImageSet(string resourcePath)
        {
            if (!ImageSets.ContainsKey(resourcePath))
            {
                ImageSets[resourcePath] = ImageSet.LoadFromStream(mpqProvider.GetStream(resourcePath));
            }

            return(ImageSets[resourcePath]);
        }
 private void cargar_imagenes( ImageSet listaPVA )
 {
     var ej1 = new[] { listaPVA[0], listaPVA[1], listaPVA[2] };
     ejemplos[0] = new Test_Ejemplo_PVA( ej1, new[] { 2, 0, 1 } );
     var ej2 = new[] { listaPVA[3], listaPVA[4], listaPVA[5] };
     ejemplos[1] = new Test_Ejemplo_PVA( ej2, new[] { 1, 0, 2 } );
     var ej3 = new[] { listaPVA[6], listaPVA[7], listaPVA[8] };
     ejemplos[2] = new Test_Ejemplo_PVA( ej3, new[] { 2, 1, 0 } );
 }
Example #17
0
    public void BattlePrep()
    {
        cardArray = new GameObject[moveOrder.Length];

        /*placeholderArray = new GameObject[spawnRef.unitArray.Length];
         * //counts the number of allied units in order to define the allyArray size
         * while (a < 6)
         * {
         *  while (spawnRef.UnitArray[0, a] == null)
         *  {
         *      a++;
         *  }
         *  arraySize++;
         * }
         * allyArray = new GameObject[arraySize];
         * a = 0;
         * int b = 0;
         * //populates allyArray with each allied unit
         * while (a < 6)
         * {
         *  while (spawnRef.UnitArray[0, a] == null)
         *  {
         *      a++;
         *  }
         *  allyArray[b] = spawnRef.UnitArray[0, a];
         *  b++;
         * }
         */
        for (int i = 0; i < moveOrder.Length; i++)
        {
            cardArray[i] = Instantiate(unitCard);
            cardArray[i].transform.SetParent(GameObject.FindGameObjectWithTag("Canvas").transform, false);
            //cardArray[i].transform.SetPositionAndRotation(new Vector3(152.7f, 290.5f - (110 * i), 0), Quaternion.identity); *This is for fullsize cards
            cardArray[i].transform.SetPositionAndRotation(new Vector3(103.7f, 310.5f - (70 * i), 0), Quaternion.identity);
            cardArray[i].transform.localScale -= new Vector3(0.35f, 0.35f, 0);
            currentCard                = cardArray[i];
            currentCardManager         = currentCard.GetComponent <CardManager>();
            currentCardImage           = currentCard.GetComponent <Image>();
            setImage                   = currentCard.GetComponentInChildren <ImageSet>();
            sideRef                    = moveOrder[i].GetComponent <UnitInfo>();
            currentCardManager.unitRef = sideRef;
            currentCardManager.SetNameText(sideRef.name);
            currentCardManager.SetLvlText(sideRef.level.ToString());
            //setImage.SetImage(sideRef.sprite);
            if (sideRef.ally)
            {
                currentCardImage.sprite = allyCard;
            }
            else
            {
                currentCardImage.sprite = enemyCard;
            }
            //currentCardImage.sprite = moveOrder[i].GetComponent<SpriteRenderer>().sprite;
        }
        SequentialBattleStart();
    }
Example #18
0
        protected void SetStatus(int step, StatusType t, string message)
        {
            int         pos = (step > 0) ? step - 1 : 0;
            HtmlLiteral i   = StatusImages[pos];
            HtmlLiteral m   = MessageFields[pos];
            ImageSet    p   = StatusTypes[t];

            i.Text = ThemeManager.GetImage(p.Src, p.Width, p.Height);
            m.Text = message;
        }
        public Ensayo_Memoria_Figuras(Control control, ImageSet listaEj)
        {
            ejemplos = new Test_Ejemplo_MF[3];
            cargar_imagenes(listaEj);
            this.control = control;
            var ThSt_ej = new ThreadStart(St_ej);

            th_ej          = new Thread(ThSt_ej);
            EnCurso        = false;
            ejemplificando = false;
        }
Example #20
0
        public Vista_Previa_MF(Control c, ImageSet listaIMG)
        {
            this.c = c;
            cargar_imagenes(listaIMG);
            var ThSt = new ThreadStart(St);

            th            = new Thread(ThSt);
            ronda         = -1;
            estado        = Estado_MF.Nulo;
            this.c.Paint += this.Paint;
        }
Example #21
0
    public ImageAnimator top; // A DisplaySlot at the top of the Pile

    void OnEnable()
    {
        _group = new List <int>();
        if (Network.isServer)
        {
            top = ImageSet.GetNewBlank(gameObject);
            networkView.RPC("NetworkSetTop", RPCMode.Others, top.networkView.viewID);
            Init();
            UpdateSprite();
        }
    }
        private void cargar_imagenes(ImageSet listaEj)
        {
            var ej1 = new[] { listaEj[0], listaEj[1], listaEj[2] };

            ejemplos[0] = new Test_Ejemplo_MF(ej1, 1);
            var ej2 = new[] { listaEj[3], listaEj[4], listaEj[5] };

            ejemplos[1] = new Test_Ejemplo_MF(ej2, 0);
            var ej3 = new[] { listaEj[6], listaEj[7], listaEj[8] };

            ejemplos[2] = new Test_Ejemplo_MF(ej3, 2);
        }
        private void cargar_imagenes(ImageSet listaPVA)
        {
            var img = new Image[6];

            for (int j = 0; j < 6; j++)
            {
                img[j] = listaPVA[j];
            }
            tests[0] = new Test_PVA(img, new[] { 2, 4, 1, 5, 0, 3 }, Colores);
            tests[1] = new Test_PVA(img, new[] { 0, 1, 5, 3, 2, 4 }, Colores);
            tests[2] = new Test_PVA(img, new[] { 4, 5, 3, 2, 0, 1 }, Colores);
        }
Example #24
0
            protected virtual IImageSet CreateImageSet(MprVolume volume)
            {
                int      number   = 0;
                ImageSet imageSet = new ImageSet();

                foreach (IMprSliceSet sliceSet in volume.SliceSets)
                {
                    imageSet.DisplaySets.Add(CreateDisplaySet(++number, sliceSet));
                }
                imageSet.Name = volume.Description;
                return(imageSet);
            }
        public string UploadImageSet(ImageSet model)
        {
            var sb = new StringBuilder();

            sb.AppendFormat("Received image set {0}: ", model.Name);
            model.Images.ForEach(i =>
                sb.AppendFormat("Got image {0} of type {1} and size {2} bytes,", i.FileName, i.MimeType,
                    i.ImageData.Length)
                );

            var result = sb.ToString();
            Trace.Write(result);

            return result;
        }
Example #26
0
		private IImageSet CreateImageSet(string patientId, string description)
		{
			string studyInstanceUid = DicomUid.GenerateUid().UID;
			string seriesInstanceUid = DicomUid.GenerateUid().UID;
			string sopInstanceUid = DicomUid.GenerateUid().UID;

			ImageSop sop = CreateImageSop(patientId, studyInstanceUid, seriesInstanceUid, sopInstanceUid);
			DicomGrayscalePresentationImage img = new DicomGrayscalePresentationImage(sop.Frames[1]);
			sop.Dispose();

			DisplaySet displaySet = new DisplaySet(patientId, seriesInstanceUid);
			displaySet.PresentationImages.Add(img);
			ImageSet imageSet = new ImageSet();
			imageSet.PatientInfo = description;
			imageSet.DisplaySets.Add(displaySet);

			return imageSet;
		}
 public ImageSetVM()
 {
     ImageSet = new ImageSet();
 }
Example #28
0
        public IImageSet BuildImageSet(StudyTree studyTree, out Study study)
        {
            if (IsRemote)
            {
                study = null;
                //Add only the image set, which essentially makes it a remote study.
                var identifier = new StudyRootStudyIdentifier(this, this, new StudyIdentifier())
                                     {
                                         PatientId = ReconciledPatientId ?? PatientId
                                     };

                return new ImageSet(new DicomImageSetDescriptor(identifier));
            }

            study = AddStudy(studyTree);
            var studyIdentifier = study.GetIdentifier();
            studyIdentifier = new StudyRootStudyIdentifier(studyIdentifier) { PatientId = ReconciledPatientId ?? study.ParentPatient.PatientId };
            var imageSet = new ImageSet(new DicomImageSetDescriptor(studyIdentifier));
            foreach (var series in study.Series)
            {
                foreach (var displaySet in DisplaySetFactory.CreateDisplaySets(series))
                    imageSet.DisplaySets.Add(displaySet);
            }

            return imageSet;
        }
Example #29
0
			protected virtual IImageSet CreateImageSet(MprVolume volume)
			{
				int number = 0;
				ImageSet imageSet = new ImageSet();
				foreach (IMprSliceSet sliceSet in volume.SliceSets)
				{
					imageSet.DisplaySets.Add(CreateDisplaySet(++number, sliceSet));
				}
				imageSet.Name = volume.Description;
				return imageSet;
			}
Example #30
0
        private void Test(StudyTree studyTree, StudyBuilder builder, DisplaySetCreationOptions options, bool expectModalityDisplaySet, int expectedDisplaySetCount)
        {
            var filler = new LayoutManager.ImageSetFiller(studyTree, options);
            var imageSet = new ImageSet { Uid = builder.StudyInstanceUid };

            var study = studyTree.Studies.First();

            try
            {
                //NOTE: follow the same pattern as the layout manager where we add the "all images" display sets
                //first, then we add ones for the individual series after.
                filler.AddMultiSeriesDisplaySets(imageSet, study);
                Assert.AreEqual(expectModalityDisplaySet ? 1 : 0, imageSet.DisplaySets.Count, "Empty Image Set");

                foreach (var series in study.Series)
                    filler.AddSeriesDisplaySets(imageSet, series);

                Assert.AreEqual(expectedDisplaySetCount, imageSet.DisplaySets.Count, "Display Set Counts");
            }
            finally
            {
                studyTree.Dispose();
                imageSet.Dispose();
            }
        }