コード例 #1
0
        public static SpringMvcController getRequestMapping(annotation javaAnnotation)
        {
            if (javaAnnotation != null)
            {
                var newController = new SpringMvcController();
                if (javaAnnotation.member != null)
                {
                    foreach (var member in javaAnnotation.member)
                    {
                        switch (member.memberName)
                        {
                        case "method":
                            newController.HttpRequestMethod = member.memberValue;
                            newController.HttpRequestMethod = newController.HttpRequestMethod.Replace("{org.springframework.web.bind.annotation.RequestMethod.", "").Replace("}", "");
                            break;

                        case "value":
                            newController.HttpRequestUrl = decodeString(member.memberValue);
                            newController.HttpRequestUrl = newController.HttpRequestUrl.Replace("{\"", "").Replace("\"}", "");
                            break;

                        case "params":
                            newController.HttpMappingParameter = decodeString(member.memberValue);
                            newController.HttpMappingParameter = newController.HttpMappingParameter.Replace("{\"", "").Replace("\"}", "");

                            break;
                        }
                    }
                }
                return(newController);
            }
            return(null);
        }
コード例 #2
0
    public void save_annotation(annotation new_annotation)
    {
        int state_id = 0;

        foreach (string state in states)
        {
            state_id++;
            if (animator.GetCurrentAnimatorStateInfo(0).IsName(state))
            {
                new_annotation.category_id     = state_id;
                new_annotation.keypoints3d     = hp.keypoints.keypoints3d;
                new_annotation.jointrotation3d = hp.keypoints.rotationJoint3d;
                BroadcastMessage("gatherKeypoints2d", new_annotation);
            }
        }
    }
コード例 #3
0
        public static void AddNoteToLead(CrmService service, Guid leadID, string noteText)
        {
            try
            {
                var annotation = new annotation();

                annotation.notetext = noteText;
                annotation.objectid = new Lookup
                {
                    Value = leadID,
                    type  = EntityName.lead.ToString()
                };

                var annotationId = service.Create(annotation);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
    public IEnumerator Capture(RenderTexture source, RenderTexture destination)
    {
        Camera cam = GetComponent <Camera>();

        RenderTexture tmp = RenderTexture.GetTemporary(source.width, source.height, 16, RenderTextureFormat.ARGB32);

        Graphics.Blit(source, tmp);


        //Store the last active render texture and set our source copy as active
        RenderTexture lastActive = RenderTexture.active;

        RenderTexture.active = tmp;

        Texture2D image = new Texture2D(source.width, source.height, TextureFormat.ARGB32, false);

        image.ReadPixels(new Rect(0, 0, source.width, source.height), 0, 0);

        image.Apply();

        //Restore the active render texture and release our temporary tex
        RenderTexture.active = lastActive;

        RenderTexture.ReleaseTemporary(tmp);

        byte[] bytes = image.EncodeToPNG();
        Destroy(image);

        string image_name = $"rgb_{cam.name}_{image_numb+1000000}.png";

        File.WriteAllBytes("Data/Captures/" + image_name, bytes);
        save_coco_json(image_numb, source.width, source.height, image_name, cam.name);



        annotation new_annotation = new annotation(image_numb, source.width * source.height);

        //Uncomment if we want 3d data as well
        //SendMessageUpwards("save_annotation", new_annotation);

        //Uncomment if we only want 2d data
        current_camid = $"{cam.name}{new_annotation.id}";
        if (current_camid != prev_camid)
        {
            cameraPtsData = new CameraPointsData(charactor, cam);
            new_annotation.keypoints2d = cameraPtsData.keypoints2d;
            string annotation_data = JsonUtility.ToJson(new_annotation);
            if (new_file_annotation)
            {
                File.WriteAllText($"Data/AnnotationJSON/{cam.name}_annotation.json", "[" + annotation_data);
                new_file_annotation = false;
                prev_camid          = current_camid;
            }
            else
            {
                File.AppendAllText($"Data/AnnotationJSON/{cam.name}_annotation.json",
                                   ", " + Environment.NewLine + annotation_data);
                prev_camid = current_camid;
            }
        }
        //BroadcastMessage("gatherKeypoints2d", new_annotation);
        m_SavingDepth = false;

        GetComponent <ImageSynthesis>().Save($"segmentation_{cam.name}_{image_numb+1000000}", 0, 0);
        image_numb += 1;
        yield return(null);

        for (int i = 0; i < frames_to_skip; i++)
        {
            yield return(null);
        }
    }
コード例 #5
0
ファイル: Audit.cs プロジェクト: ccellar/crmaudit
        private void CreateNote(ICrmService crmService, string entityName, Guid entityId, string subject, string body)
        {
            // Create the Note object and set the parent object.
            var note = new annotation
            {
                objectid = new Lookup(entityName, entityId),
                objecttypecode = new EntityNameReference(entityName),
                subject = subject,
                notetext = body
            };

            // Set the note text and subject

            // Create the note
            crmService.Create(note);
        }