예제 #1
0
    public void addFrameSectionToXMLList(FrameSection frameSection)
    {
        FrameSectionForXML newElement = new FrameSectionForXML(frameSection.GetName(), frameSection.GetMaterialName(), (int)frameSection.GetFrameSectionType(), frameSection.GetDimensions());

        elementsListsForXML.frameSectionForXMLList.Add(newElement);
        saveToXML();
    }
    public void propFrameGetSectProps(FrameSection section)
    {
        string message = "VRE to SAPTranslator: propFrameGetSectProps(" + section.GetName() + ")";

        sendString(message);
        section.SectProps = readPropFrameGetSectProps();
    }
예제 #3
0
 /// <summary>
 /// Add a new FrameSection to the list of FrameSections
 /// Also tells SAP Translator to set the FrameSection's "SectProps" property (currently commented-out)
 /// </summary>
 public int addFrameSection(FrameSection frameSection)
 {
     if (findFrameSection(frameSection.GetName()) == null)
     {
         frameSections.Add(frameSection);
         if (frameSections.Count == 1)
         {
             SetCurrentFrameSection(frameSection.GetName());
         }
         //sapTranslatorIpcHandler.propFrameGetSectProps(frameSection);
         myXmlController.GetComponent <xmlController>().addFrameSectionToXMLList(frameSection);
         return(1);
     }
     else
     {
         return(0);
     }
 }
예제 #4
0
    /// <summary>
    /// Deletes a frame section
    /// </summary>
    public void deleteFrameSection(string name)
    {
        FrameSection targetFrameSection = findFrameSection(name);

        if (targetFrameSection != null)
        {
            frameSections.Remove(targetFrameSection);
            myXmlController.GetComponent <xmlController>().deleteFrameSectionFromXMLList(name);

            string sapTranslatorCommand = "VRE to SAPTranslator: propFrameDelete(" + targetFrameSection.GetName() + ")";
            // arguments: (name)
            sapTranslatorIpcHandler.enqueueToOutputBuffer(sapTranslatorCommand);
        }
        if (frameSections.Count == 0)
        {
            //int success = addFrameSection(defaultFrameSection);
        }
    }
예제 #5
0
    /// <summary>
    /// Main constructor for defining a frame object
    /// Takes in the frames endpoints, the correct frame prefab for the section, the frame section, and the frames name
    /// </summary>
    public Frame(Vector3 start, Vector3 end, GameObject framePrefab, FrameSection section, string frameName)
    {
        sectionPropertyName = section.GetName();
        frameObject         = MonoBehaviour.Instantiate(framePrefab);

        trans             = frameObject.transform;
        frameTrans        = trans.Find("frame");
        releaseStartTrans = trans.Find("startRelease");
        releaseEndTrans   = trans.Find("endRelease");

        startPos = start;
        endPos   = end;

        release = new FrameRelease();
        setRelease();

        frameObject.GetComponent <FrameBehavior>().setMyFrame(this);
        frameHighlighter = frameObject.GetComponent <highlighter>();
        // scale the frame depending on the section type
        if (section.type == FrameSectionType.I)
        {
            frame_iBeamController controller = frameObject.GetComponent <frame_iBeamController>();
            float[] arr = section.GetDimensions();
            controller.SetDimensions(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5]);
        }
        else if (section.type == FrameSectionType.Pipe)
        {
            frame_PipeController controller = frameObject.GetComponent <frame_PipeController>();
            float[] arr = section.GetDimensions();
            controller.SetDimensions(arr[0], arr[1]);
        }
        else if (section.type == FrameSectionType.Tube)
        {
            frame_TubeController controller = frameObject.GetComponent <frame_TubeController>();
            float[] arr = section.GetDimensions();
            controller.SetDimensions(arr[0], arr[1], arr[2], arr[3]);
        }
        else
        {
            Debug.LogError("Invalid frame section type passed to createFrame in Frame Class");
        }

        setName(frameName);
    }
예제 #6
0
 public void deleteFrameSectionFromXMLList(FrameSection frameSection)
 {
     deleteFrameSectionFromXMLList(frameSection.GetName());
 }
예제 #7
0
 public void setSectionProperty(FrameSection section)
 {
     sectionPropertyName = section.GetName();
 }