File Format rps

From LabRPS Documentation
Revision as of 03:16, 28 December 2024 by LabRPS (talk | contribs) (Created page with "{{TOCright}} ==Overview== The '''LabRPS Standard file format''' ({{FileName|.rps}}) is LabRPS's main file format. It is a compound format, supports compression and embedding of different kinds of data. == Internals of .rps files == rps is a standard zip file containing one or more files in a specific structure. As such, it is possible to unpack a {{FileName|.rps}} file using a regular zip decompression tool, but care needs to be taken while...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

The LabRPS Standard file format (.rps) is LabRPS's main file format. It is a compound format, supports compression and embedding of different kinds of data.

Internals of .rps files

rps is a standard zip file containing one or more files in a specific structure. As such, it is possible to unpack a .rps file using a regular zip decompression tool, but care needs to be taken while packing the contents of a .rps file. LabRPS contains a "Project Utility" to re-pack .rps files, it's use is described in Change the source of the file .rps below.

Document.xml

This is the main .xml file describing all the objects inside a LabRPS document, that is, only the geometric and parametric definition of the objects, not their visual representation. If LabRPS is ran in console mode (without the GUI), only this Document.xml will be used.

Example Document.xml

<?xml version='1.0' encoding='utf-8'?>
<Document SchemaVersion="4" ProgramVersion="0.1R0059 (Git shallow)" FileVersion="1">
    <Properties Count="16" TransientCount="3">
        <_Property name="FileName" type="App::PropertyString" status="50331649"/>
        <_Property name="Tip" type="App::PropertyLink" status="33554433"/>
        <_Property name="TransientDir" type="App::PropertyString" status="50331649"/>
        <Property name="Comment" type="App::PropertyString">
            <String value=""/>
        </Property>
        <Property name="Company" type="App::PropertyString">
            <String value=""/>
        </Property>
        <Property name="CreatedBy" type="App::PropertyString">
            <String value=""/>
        </Property>
        <Property name="CreationDate" type="App::PropertyString" status="16777217">
            <String value="2024-11-27T11:25:31Z"/>
        </Property>
        <Property name="Id" type="App::PropertyString">
            <String value=""/>
        </Property>
        <Property name="Label" type="App::PropertyString" status="1">
            <String value="test"/>
        </Property>
        <Property name="LastModifiedBy" type="App::PropertyString">
            <String value=""/>
        </Property>
        <Property name="LastModifiedDate" type="App::PropertyString" status="16777217">
            <String value="2024-11-27T11:27:43Z"/>
        </Property>
        <Property name="License" type="App::PropertyString" status="1">
            <String value="All rights reserved"/>
        </Property>
        <Property name="LicenseURL" type="App::PropertyString" status="1">
            <String value="http://en.wikipedia.org/wiki/All_rights_reserved"/>
        </Property>
        <Property name="Material" type="App::PropertyMap">
            <Map count="0">
            </Map>
        </Property>
        <Property name="Meta" type="App::PropertyMap">
            <Map count="0">
            </Map>
        </Property>
        <Property name="PluginList" type="App::PropertyMap" status="1">
            <Map count="0">
            </Map>
        </Property>
        <Property name="ShowHidden" type="App::PropertyBool" status="1">
            <Bool value="false"/>
        </Property>
        <Property name="TipName" type="App::PropertyString" status="83886080">
            <String value=""/>
        </Property>
        <Property name="Uid" type="App::PropertyUUID" status="16777217">
            <Uuid value="a3ba7d6a-4288-42dd-a2e1-6c64e79fe485"/>
        </Property>
    </Properties>
    <Objects Count="1" Dependencies="1">
        <ObjectDeps Name="SeismicGroundMotion" Count="0"/>
        <Object type="SeismicLab::SeismicLabSimulation" name="SeismicGroundMotion" id="2111" />
    </Objects>
    <ObjectData Count="1">
        <Object name="SeismicGroundMotion" Extensions="True">
            <Extensions Count="1">
                <Extension type="App::GroupExtension" name="GroupExtension">
                </Extension>
            </Extensions>
            <Properties Count="73" TransientCount="1">
                <_Property name="_GroupTouched" type="App::PropertyBool" status="100663424"/>
                <Property name="CoherenceFunction" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="ComparisonMode" type="App::PropertyBool">
                    <Bool value="false"/>
                </Property>
                <Property name="CorrelationFunction" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="CumulativeProbabilityDistribution" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="Direction" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="DirectionIncrement" type="App::PropertyAngle">
                    <Float value="0.0010000000000000"/>
                </Property>
                <Property name="DirectionIndex" type="App::PropertyInteger">
                    <Integer value="1"/>
                </Property>
                <Property name="ExpressionEngine" type="App::PropertyExpressionEngine" status="67108864">
                    <ExpressionEngine count="0">
                    </ExpressionEngine>
                </Property>
                <Property name="FrequencyDistribution" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="FrequencyIncrement" type="App::PropertyFrequency">
                    <Float value="0.0039000000000000"/>
                </Property>
                <Property name="FrequencyIndex" type="App::PropertyInteger">
                    <Integer value="1"/>
                </Property>
                <Property name="Gaussianity" type="App::PropertyBool">
                    <Bool value="true"/>
                </Property>
                <Property name="Group" type="App::PropertyLinkList">
                    <LinkList count="0">
                    </LinkList>
                </Property>
                <Property name="IncrementOfVariableX" type="App::PropertyFloat">
                    <Float value="0.1000000000000000"/>
                </Property>
                <Property name="IndexOfVariableX" type="App::PropertyInteger">
                    <Integer value="1"/>
                </Property>
                <Property name="IsInterruptionRequested" type="App::PropertyBool">
                    <Bool value="false"/>
                </Property>
                <Property name="IsSimulationSuccessful" type="App::PropertyBool">
                    <Bool value="false"/>
                </Property>
                <Property name="Kurtosis" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="Label" type="App::PropertyString" status="134217728">
                    <String value="SeismicGroundMotion"/>
                </Property>
                <Property name="Label2" type="App::PropertyString" status="67108992">
                    <String value=""/>
                </Property>
                <Property name="LargeScaleSimulationMode" type="App::PropertyBool">
                    <Bool value="false"/>
                </Property>
                <Property name="LocationIndexJ" type="App::PropertyInteger">
                    <Integer value="1"/>
                </Property>
                <Property name="LocationIndexK" type="App::PropertyInteger">
                    <Integer value="1"/>
                </Property>
                <Property name="MatrixTool" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="MaxDirection" type="App::PropertyAngle">
                    <Float value="4.0000000000000000"/>
                </Property>
                <Property name="MaxFrequency" type="App::PropertyFrequency">
                    <Float value="4.0000000000000000"/>
                </Property>
                <Property name="MaxTime" type="App::PropertyTime">
                    <Float value="1536.0000000000000000"/>
                </Property>
                <Property name="MaxWaveLength" type="App::PropertyLength">
                    <Float value="4.0000000000000000"/>
                </Property>
                <Property name="MeanFunction" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="MinDirection" type="App::PropertyAngle">
                    <Float value="0.0000000000000000"/>
                </Property>
                <Property name="MinFrequency" type="App::PropertyFrequency">
                    <Float value="0.0000000000000000"/>
                </Property>
                <Property name="MinTime" type="App::PropertyTime">
                    <Float value="0.0000000000000000"/>
                </Property>
                <Property name="MinVariableX" type="App::PropertyFloat">
                    <Float value="-5.0000000000000000"/>
                </Property>
                <Property name="MinWaveLength" type="App::PropertyLength">
                    <Float value="0.0000000000000000"/>
                </Property>
                <Property name="ModulationFunction" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="MotionType" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="NumberOfDirectionIncrements" type="App::PropertyInteger">
                    <Integer value="1000"/>
                </Property>
                <Property name="NumberOfFrequency" type="App::PropertyInteger">
                    <Integer value="1024"/>
                </Property>
                <Property name="NumberOfIncrementOfVariableX" type="App::PropertyInteger">
                    <Integer value="101"/>
                </Property>
                <Property name="NumberOfProcess" type="App::PropertyInteger">
                    <Integer value="3"/>
                </Property>
                <Property name="NumberOfSample" type="App::PropertyInteger">
                    <Integer value="1"/>
                </Property>
                <Property name="NumberOfTimeIncrements" type="App::PropertyInteger">
                    <Integer value="6144"/>
                </Property>
                <Property name="NumberOfTimeLags" type="App::PropertyInteger">
                    <Integer value="512"/>
                </Property>
                <Property name="NumberOfWaveLengthIncrements" type="App::PropertyInteger">
                    <Integer value="1000"/>
                </Property>
                <Property name="PeackGroundDisplacement" type="App::PropertyLength">
                    <Float value="1.0000000000000000"/>
                </Property>
                <Property name="PeakFactor" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="PeakGroundAcceleration" type="App::PropertyAcceleration">
                    <Float value="1.0000000000000000"/>
                </Property>
                <Property name="PeakGroundVelocity" type="App::PropertySpeed">
                    <Float value="1.0000000000000000"/>
                </Property>
                <Property name="Phenomenon" type="App::PropertyString" status="16777216">
                    <String value="Seismic Ground Motion"/>
                </Property>
                <Property name="ProbabilityDensityFunction" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="RandomnessProvider" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="ShearVelocityOfFlow" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="SimulationMethod" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="Skewness" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="SoilType" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="SpatialDistribution" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="SpectrumDecompositionMethod" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="SpectrumModel" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="StandardDeviation" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="Stationarity" type="App::PropertyBool">
                    <Bool value="true"/>
                </Property>
                <Property name="TableTool" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="TimeIncrement" type="App::PropertyTime">
                    <Float value="0.2500000000000000"/>
                </Property>
                <Property name="TimeIndex" type="App::PropertyInteger">
                    <Integer value="1"/>
                </Property>
                <Property name="Uid" type="App::PropertyUUID">
                    <Uuid value="32b4ae66-024d-46fe-9145-efdbccee7f2b"/>
                </Property>
                <Property name="UniformModulation" type="App::PropertyBool">
                    <Bool value="true"/>
                </Property>
                <Property name="UserDefinedRPSObject" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="Variance" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="Visibility" type="App::PropertyBool" status="648">
                    <Bool value="true"/>
                </Property>
                <Property name="WaveLengthIncrement" type="App::PropertyLength">
                    <Float value="0.0010000000000000"/>
                </Property>
                <Property name="WaveLengthIndex" type="App::PropertyInteger">
                    <Integer value="1"/>
                </Property>
                <Property name="WavePassageEffect" type="App::PropertyEnumeration">
                    <Integer value="0"/>
                </Property>
                <Property name="WorkingDirectoryPath" type="App::PropertyString">
                    <String value="D:/RPS/Build/"/>
                </Property>
                <Property name="isRunning" type="App::PropertyBool">
                    <Bool value="false"/>
                </Property>
            </Properties>
        </Object>
    </ObjectData>
</Document>

GuiDocument.xml

This is the GUI counterpart of the Document.xml file. For each object described in the Document.xml, there is one corresponding object in GuiDocument.xml, describing the visual representation of that object (color, linewidth, etc).

Embedding other files

In order to embed other file types inside a rps file, you must first create a scripted object from the Python console, and give it an App::PropertyFileIncluded property.

Then in the property editor you can go to the added property and choose a file in the computer. Once the rps file is saved, the file assigned to the DataPropertyFileIncluded property will be packed inside the .rps. When the document is restored, the same file will be restored with the DataPropertyFileIncluded property.

custom_obj = App.ActiveDocument.addObject("App::FeaturePython", "CustomObject")
custom_obj.addProperty("App::PropertyFileIncluded", "AttachedFile")

Change the source of the file .rps