Example #1
0
    public static PdfDictionary _Page_GetResources(PdfDictionary APage, string AName)
    {
        PdfDictionary FResources;

        FResources = APage.PdfDictionaryByName("Resources");
        return(FResources.PdfDictionaryByName(AName));
    }
Example #2
0
        ///-------------------------------------------------------------------------------------------------
        /// <summary>   Builds the resources. </summary>
        ///
        /// <remarks>   9/11/2018. </remarks>
        ///
        /// <param name="aUnitName">    Name of the unit. </param>
        ///-------------------------------------------------------------------------------------------------

        protected override void BuildResources(string aUnitName)
        {
            // ok let the base network add all the normal resources
            base.BuildResources(aUnitName);
            // now we add the Colorado resource
            UDI.eResource er;
            string        FldName;
            int           value;
            string        errMsg = "";

            er      = UDI.eResource.erColorado;
            FldName = FData.ResourceField(er);

            FData.GetValue(aUnitName, FldName, out value, out errMsg);
            FColorado = new CRF_Resource_ColoradoSurface(FldName, FData.ResourceLabel(er), ColoradoResourceColor, value);
            if (errMsg != "")
            {
                // ok so what is happening here.  If there was not an error retrieving this data, "value" is a good value and errMsg = "",
                // However, if there was an error, "value" = UDI.BadValue and errMsg has the error message.
                // So in this case we add the errmsg to the log for this data_item.
                FColorado.AddError(errMsg);
            }
            FResources.Add(FColorado);
            // =======================================================
            // edits 11.16.21 das
            er      = UDI.eResource.erDesalination;
            FldName = FData.ResourceField(er);

            FData.GetValue(aUnitName, FldName, out value, out errMsg);
            FDesal = new CRF_Resource_Desalination(FldName, FData.ResourceLabel(er), DesalinationResourceColor, value);
            if (errMsg != "")
            {
                // ok so what is happening here.  If there was not an error retrieving this data, "value" is a good value and errMsg = "",
                // However, if there was an error, "value" = UDI.BadValue and errMsg has the error message.
                // So in this case we add the errmsg to the log for this data_item.
                FDesal.AddError(errMsg);
            }
            FResources.Add(FDesal);
            // =====================================================================
            // end edits 11.16.21 das
        }
Example #3
0
        virtual protected DMesh3 make_bunny()
        {
            if (cached_bunny == null)
            {
                // [RMS] yiiiiiikes
                MemoryStream stream = FResources.LoadBinary("meshes/unit_height_bunny");
                if (stream != null)
                {
                    cached_bunny = StandardMeshReader.ReadMesh(stream, "obj");
                    MeshTransforms.ConvertZUpToYUp(cached_bunny);
                    MeshTransforms.FlipLeftRightCoordSystems(cached_bunny);
                }
                else
                {
                    cached_bunny = make_shape_sphere();
                    MeshTransforms.Scale(cached_bunny, 1 / ShapeHeight);
                }
            }
            DMesh3 mesh = new DMesh3(cached_bunny);

            MeshTransforms.Scale(mesh, ShapeHeight);
            return(mesh);
        }
Example #4
0
        public static List <KnownManufacturerInfo> LoadManufacturers()
        {
            List <KnownManufacturerInfo> result = new List <KnownManufacturerInfo>();

            string mfg_file_text = FResources.LoadText("printers/manufacturers");

            string[] rows = mfg_file_text.Split('\n', '\r');
            foreach (string rowdata in rows)
            {
                string[] values = rowdata.Split(',');
                if (values.Length < 3)
                {
                    continue;
                }
                KnownManufacturerInfo mi = new KnownManufacturerInfo();
                mi.name         = values[0];
                mi.uuid         = values[1];
                mi.default_uuid = values[2];
                result.Add(mi);
            }

            return(result);
        }