コード例 #1
0
        static void Prefix(FacilityManager __instance)
        {
            UnityEngine.Debug.Log("MoreFacilities: FacilityManager Init Prefix");

            //Update private instance variable for max number of facilities
            typeof(FacilityManager).GetField("FacilityCountMax", BindingFlags.Instance | BindingFlags.Public).SetValue(__instance, MoreFacilities.MaxFacilities);
        }
コード例 #2
0
        /// <summary> Creates a new writer to the specified File object, to write data from
        /// the specified component.
        ///
        /// <p>The size of the image that is written to the file is the size of the
        /// component from which to get the data, specified by b, not the size of
        /// the source image (they differ if there is some sub-sampling).</p>
        ///
        /// </summary>
        /// <param name="out">The file where to write the data
        ///
        /// </param>
        /// <param name="imgSrc">The source from where to get the image data to write.
        ///
        /// </param>
        /// <param name="c">The index of the component from where to get the data.
        ///
        /// </param>
        public ImgWriterPGM(IFileInfo out_Renamed, BlkImgDataSrc imgSrc, int c)
        {
            // Check that imgSrc is of the correct type
            // Check that the component index is valid
            if (c < 0 || c >= imgSrc.NumComps)
            {
                throw new System.ArgumentException("Invalid number of components");
            }

            // Check that imgSrc is of the correct type
            if (imgSrc.getNomRangeBits(c) > 8)
            {
                FacilityManager.getMsgLogger().println("Warning: Component " + c + " has nominal bitdepth " + imgSrc.getNomRangeBits(c) + ". Pixel values will be " + "down-shifted to fit bitdepth of 8 for PGM file", 8, 8);
            }

            // Initialize
            if (out_Renamed.Exists && !out_Renamed.Delete())
            {
                throw new System.IO.IOException("Could not reset file");
            }
            this.out_Renamed = SupportClass.RandomAccessFileSupport.CreateRandomAccessFile(out_Renamed, "rw");
            src      = imgSrc;
            this.c   = c;
            w        = imgSrc.ImgWidth;
            h        = imgSrc.ImgHeight;
            fb       = imgSrc.getFixedPoint(c);
            levShift = 1 << (imgSrc.getNomRangeBits(c) - 1);

            writeHeaderInfo();
        }
コード例 #3
0
 private void OilProductionForm_Load(object sender, EventArgs e)
 {
     _wellPadHandler = FacilityManager.GetInstance();
     LoadWellPads();
     _op = (OilProduction)WellFactory.Instance.InitializeDailyProductionLog();
     _op.BarrelsOverFifty += Production_BarrelsOverFifty;
 }
コード例 #4
0
        // Provide list view of root node
        private void FormatFacilitiesSummary()
        {
            uxDetails.Columns.Clear();
            uxDetails.Columns.Add("Province", 120);
            uxDetails.Columns.Add("Well Pads", 120);
            uxDetails.Columns.Add("Production Wells", 140);
            uxDetails.Columns.Add("Injection Wells", 140);

            uxDetails.Items.Clear();
            foreach (var prov in _provinces)
            {
                int wellPadsCount = FacilityManager.GetInstance().WellPadsCollection.Count(p => p.Province == prov);
                var provWellPads  = FacilityManager.GetInstance().WellPadsCollection.Where(p => p.Province == prov);

                int injWellsCount = 0, prodWellsCount = 0;
                foreach (var aWellPad in provWellPads)
                {
                    injWellsCount  += aWellPad.Wells.Where(w => w.GetType() == typeof(InjectionWell)).Count();
                    prodWellsCount += aWellPad.Wells.Where(w => w.GetType() == typeof(ProductionWell)).Count();
                }

                var items = new string[] { prov, wellPadsCount.ToString(), prodWellsCount.ToString(), injWellsCount.ToString() };
                var item  = new ListViewItem(items);
                uxDetails.Items.Add(item);
            }
        }
コード例 #5
0
        /// <summary> Constructs a new tiler with the specified 'BlkImgDataSrc' source,
        /// image origin, tiling origin and nominal tile size.
        ///
        /// </summary>
        /// <param name="src">The 'BlkImgDataSrc' source from where to get the image
        /// data. It must not be tiled and the image origin must be at '(0,0)' on
        /// its canvas.
        ///
        /// </param>
        /// <param name="ax">The horizontal coordinate of the image origin in the canvas
        /// system, on the reference grid (i.e. the image's top-left corner in the
        /// reference grid).
        ///
        /// </param>
        /// <param name="ay">The vertical coordinate of the image origin in the canvas
        /// system, on the reference grid (i.e. the image's top-left corner in the
        /// reference grid).
        ///
        /// </param>
        /// <param name="px">The horizontal tiling origin, in the canvas system, on the
        /// reference grid. It must satisfy 'px<=ax'.
        ///
        /// </param>
        /// <param name="py">The vertical tiling origin, in the canvas system, on the
        /// reference grid. It must satisfy 'py<=ay'.
        ///
        /// </param>
        /// <param name="nw">The nominal tile width, on the reference grid. If 0 then
        /// there is no tiling in that direction.
        ///
        /// </param>
        /// <param name="nh">The nominal tile height, on the reference grid. If 0 then
        /// there is no tiling in that direction.
        ///
        /// </param>
        /// <exception cref="IllegalArgumentException">If src is tiled or "canvased", or
        /// if the arguments do not satisfy the specified constraints.
        ///
        /// </exception>
        public Tiler(BlkImgDataSrc src, int ax, int ay, int px, int py, int nw, int nh) : base(src)
        {
            // Initialize
            this.src    = src;
            this.x0siz  = ax;
            this.y0siz  = ay;
            this.xt0siz = px;
            this.yt0siz = py;
            this.xtsiz  = nw;
            this.ytsiz  = nh;

            // Verify that input is not tiled
            if (src.getNumTiles() != 1)
            {
                throw new System.ArgumentException("Source is tiled");
            }
            // Verify that source is not "canvased"
            if (src.ImgULX != 0 || src.ImgULY != 0)
            {
                throw new System.ArgumentException("Source is \"canvased\"");
            }
            // Verify that arguments satisfy trivial requirements
            if (x0siz < 0 || y0siz < 0 || xt0siz < 0 || yt0siz < 0 || xtsiz < 0 || ytsiz < 0 || xt0siz > x0siz || yt0siz > y0siz)
            {
                throw new System.ArgumentException("Invalid image origin, " + "tiling origin or nominal " + "tile size");
            }

            // If no tiling has been specified, creates a unique tile with maximum
            // dimension.
            if (xtsiz == 0)
            {
                xtsiz = x0siz + src.ImgWidth - xt0siz;
            }
            if (ytsiz == 0)
            {
                ytsiz = y0siz + src.ImgHeight - yt0siz;
            }

            // Automatically adjusts xt0siz,yt0siz so that tile (0,0) always
            // overlaps with the image.
            if (x0siz - xt0siz >= xtsiz)
            {
                xt0siz += ((x0siz - xt0siz) / xtsiz) * xtsiz;
            }
            if (y0siz - yt0siz >= ytsiz)
            {
                yt0siz += ((y0siz - yt0siz) / ytsiz) * ytsiz;
            }
            if (x0siz - xt0siz >= xtsiz || y0siz - yt0siz >= ytsiz)
            {
                FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.INFO, "Automatically adjusted tiling " + "origin to equivalent one (" + xt0siz + "," + yt0siz + ") so that " + "first tile overlaps the image");
            }

            // Calculate the number of tiles
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
            ntX = (int)System.Math.Ceiling((x0siz + src.ImgWidth) / (double)xtsiz);
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
            ntY = (int)System.Math.Ceiling((y0siz + src.ImgHeight) / (double)ytsiz);
        }
コード例 #6
0
        /// <summary>
        /// Initializes the private fields
        /// </summary>

        public FacilityManagerUnitTest()
        {
            _requestRepository = new Mock <IRequestRepository>();
            _logger            = new Mock <ILogger <FacilityManager> >();
            _facilityRequest   = new Facility
            {
                FacilityCode = "23"
            };

            _facilityManager = new FacilityManager(_requestRepository.Object, _logger.Object);
        }
コード例 #7
0
        protected void LoadStats()
        {
            IFacility FacilityManager;

            FacilityManager = (IFacility)ObjectFactory.CreateInstance("BusinessProcess.Security.BFacility, BusinessProcess.Security");
            theDS           = FacilityManager.GetTouchFacilityStats(Convert.ToInt32(rcbFacility.SelectedValue));
            FacilityManager = null;

            lblTot.Text    = theDS.Tables[0].Rows[0].ItemArray[0].ToString();
            lblTotAct.Text = theDS.Tables[1].Rows[0].ItemArray[0].ToString();

            GetLostToFollow();
            GetDueForCareEnded();
        }
コード例 #8
0
        // Populate list view of a well pad (location)
        private void FormatLocationSummary(string location, string province)
        {
            uxDetails.Columns.Clear();
            uxDetails.Columns.Add("Type", 120);
            uxDetails.Columns.Add("Spud Date", 160);
            uxDetails.Columns.Add("Water Type", 140);
            uxDetails.Columns.Add("Barrels Produced", 140);

            uxDetails.Items.Clear();

            var provWellPads = FacilityManager.GetInstance().WellPadsCollection
                               .Where(w => w.Province == province)
                               .Where(w => w.Location == location);

            // Provide details of all injection/production wells in this well pad
            foreach (var wp in provWellPads)
            {
                // First get the injection wells specifically and present their details
                var injWells = wp.Wells.Where(w => w.GetType() == typeof(InjectionWell));
                foreach (var iw in injWells)
                {
                    var injW  = (InjectionWell)iw;
                    var items = new string[] { "Injection Well", injW.SpudDate.ToString(), injW.WaterType.ToString(), "N/A" };
                    var item  = new ListViewItem(items);
                    uxDetails.Items.Add(item);
                }

                // Now get the production wells and present their details
                var prodWells = wp.Wells.Where(w => w.GetType() == typeof(ProductionWell));

                foreach (var pw in prodWells)
                {
                    var prodW = (ProductionWell)pw;
                    // Get overall count of barrels produced for this production well
                    int barrelsProducedCount = 0;
                    foreach (var barrels in prodW.DailyProduction)
                    {
                        barrelsProducedCount += barrels.BarrelsProduced;
                    }

                    var items = new string[] { "Production Well", prodW.SpudDate.ToString(), "N/A", barrelsProducedCount.ToString() };
                    var item  = new ListViewItem(items);
                    uxDetails.Items.Add(item);
                }
            }
        }
コード例 #9
0
        /// <summary> Handles the exception. If no special action is registered for
        /// the current thread, then the Exception's stack trace and a
        /// descriptive message are printed to standard error and the
        /// current thread is stopped.
        ///
        /// <P><i>Registration of special actions is not implemented yet.</i>
        ///
        /// </summary>
        /// <param name="e">The exception to handle
        ///
        ///
        ///
        /// </param>
        //UPGRADE_NOTE: Exception 'java.lang.Throwable' was converted to 'System.Exception' which has different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1100'"
        public static void  handleException(System.Exception e)
        {
            // Test if there is an special action (not implemented yet)

            // If no special action

            // Print the Exception message and stack to standard error
            // including this method in the stack.
            //UPGRADE_ISSUE: Method 'java.lang.Throwable.fillInStackTrace' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangThrowablefillInStackTrace'"
            //e.fillInStackTrace();
            SupportClass.WriteStackTrace(e);
            // Print an explicative message
            FacilityManager.getMsgLogger().println("The Thread is being terminated bacause an " + "Exception (shown above)\n" + "has been thrown and no special action was " + "defined for this Thread.", 0, 0);
            // Stop the thread (do not use stop, since it's deprecated in
            // Java 1.2)
            //UPGRADE_NOTE: Exception 'java.lang.ThreadDeath' was converted to 'System.InvalidOperationException' which has different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1100'"
            throw new System.InvalidOperationException();
        }
コード例 #10
0
        /// <summary>
        /// Called after Awake. used for setting up references between objects and initializing windows.
        /// </summary>
        public void Start()
        {
            Log.Warning("WindowManager Start");
            KerbalKonstructs.instance.WindowManager = this;

            GUI_Editor             = new EditorGUI();
            GUI_StaticsEditor      = new StaticsEditorGUI();
            GUI_NGS                = new NavGuidanceSystem();
            GUI_Downlink           = new DownlinkGUI();
            GUI_FlightManager      = new BaseBossFlight();
            GUI_FacilityManager    = new FacilityManager();
            GUI_LaunchSiteSelector = new LaunchSiteSelectorGUI();
            GUI_MapIconManager     = new MapIconManager();
            GUI_KSCManager         = new KSCManagerNGUI();
            GUI_AirRacingApp       = new AirRacing();
            GUI_BaseManager        = new BaseManager();
            GUI_Settings           = new KKSettingsNGUI();
            GUI_ModelInfo          = new ModelInfo();
        }
コード例 #11
0
        // Provide list view of well pads within a province
        private void FormatProvincesSummary(string province)
        {
            uxDetails.Columns.Clear();
            uxDetails.Columns.Add("Location", 120);
            uxDetails.Columns.Add("Production Wells", 120);
            uxDetails.Columns.Add("Injection Wells", 120);

            uxDetails.Items.Clear();

            // Get the relevant object for the given province and get details of all well pads within it
            var provWellPads = FacilityManager.GetInstance().WellPadsCollection.Where(p => p.Province == province);

            foreach (var aWellPad in provWellPads)
            {
                int injWellsCount  = aWellPad.Wells.Where(w => w.GetType() == typeof(InjectionWell)).Count();
                int prodWellsCount = aWellPad.Wells.Where(w => w.GetType() == typeof(ProductionWell)).Count();

                var items = new string[] { aWellPad.Location, prodWellsCount.ToString(), injWellsCount.ToString() };
                var item  = new ListViewItem(items);
                uxDetails.Items.Add(item);
            }
        }
コード例 #12
0
        private void PopulateTree()
        {
            TreeNode rootNode     = null;
            TreeNode provinceNode = null;
            TreeNode wellPadNode  = null;
            TreeNode subWellNode  = null;

            // Start populating tree
            rootNode     = new TreeNode("Facilities");
            rootNode.Tag = _provinces;
            uxTree.Nodes.Add(rootNode);

            // Beneath root (Facilities), start populating provinces
            foreach (var prov in _provinces)
            {
                // Populate provinces
                provinceNode = new TreeNode(prov);
                var facilities = FacilityManager.GetInstance().WellPadsCollection.Where(p => p.Province == prov);
                provinceNode.Tag = facilities;
                rootNode.Nodes.Add(provinceNode);

                // For each province, start populating locations (well pads)
                foreach (var wellPad in facilities)
                {
                    wellPadNode     = new TreeNode(wellPad.Location);
                    wellPadNode.Tag = wellPad.Wells;
                    provinceNode.Nodes.Add(wellPadNode);

                    // Now populate injection/production wells
                    foreach (var subWell in wellPad.Wells)
                    {
                        subWellNode     = new TreeNode(subWell.SpudDate.ToString());
                        subWellNode.Tag = subWell;
                        wellPadNode.Nodes.Add(subWellNode);
                    }
                }
            }
        }
コード例 #13
0
ファイル: ForwardWT.cs プロジェクト: IMA-DZ/LMV
        /// <summary> Creates a ForwardWT object with the specified filters, and with other
        /// options specified in the parameter list 'pl'.
        ///
        /// </summary>
        /// <param name="src">The source of data to be transformed
        ///
        /// </param>
        /// <param name="pl">The parameter list (or options).
        ///
        /// </param>
        /// <param name="kers">The encoder specifications.
        ///
        /// </param>
        /// <returns> A new ForwardWT object with the specified filters and options
        /// from 'pl'.
        ///
        /// </returns>
        /// <exception cref="IllegalArgumentException">If mandatory parameters are missing
        /// or if invalid values are given.
        ///
        /// </exception>
        public static ForwardWT createInstance(BlkImgDataSrc src, ParameterList pl, EncoderSpecs encSpec)
        {
            int deflev; // defdec removed

            //System.String decompstr;
            //System.String wtstr;
            //System.String pstr;
            //SupportClass.StreamTokenizerSupport stok;
            //SupportClass.Tokenizer strtok;
            //int prefx, prefy; // Partitioning reference point coordinates

            // Check parameters
            pl.checkList(OPT_PREFIX, CSJ2K.j2k.util.ParameterList.toNameArray(pinfo));

            deflev = ((System.Int32)encSpec.dls.getDefault());

            // Code-block partition origin
            System.String str = "";
            if (pl.getParameter("Wcboff") == null)
            {
                throw new System.InvalidOperationException("You must specify an argument to the '-Wcboff' " + "option. See usage with the '-u' option");
            }
            SupportClass.Tokenizer stk = new SupportClass.Tokenizer(pl.getParameter("Wcboff"));
            if (stk.Count != 2)
            {
                throw new System.ArgumentException("'-Wcboff' option needs two" + " arguments. See usage with " + "the '-u' option.");
            }
            int cb0x = 0;

            str = stk.NextToken();
            try
            {
                cb0x = (System.Int32.Parse(str));
            }
            catch (System.FormatException e)
            {
                throw new System.ArgumentException("Bad first parameter for the " + "'-Wcboff' option: " + str);
            }
            if (cb0x < 0 || cb0x > 1)
            {
                throw new System.ArgumentException("Invalid horizontal " + "code-block partition origin.");
            }
            int cb0y = 0;

            str = stk.NextToken();
            try
            {
                cb0y = (System.Int32.Parse(str));
            }
            catch (System.FormatException e)
            {
                throw new System.ArgumentException("Bad second parameter for the " + "'-Wcboff' option: " + str);
            }
            if (cb0y < 0 || cb0y > 1)
            {
                throw new System.ArgumentException("Invalid vertical " + "code-block partition origin.");
            }
            if (cb0x != 0 || cb0y != 0)
            {
                FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Code-blocks partition origin is " + "different from (0,0). This is defined in JPEG 2000" + " part 2 and may be not supported by all JPEG 2000 " + "decoders.");
            }

            return(new ForwWTFull(src, encSpec, cb0x, cb0y));
        }
コード例 #14
0
 /// <summary> The method that is run by the thread. This method first joins the
 /// idle state in the pool and then enters an infinite loop. In this
 /// loop it waits until a target to run exists and runs it. Once the
 /// target's run() method is done it re-joins the idle state and
 /// notifies the waiting lock object, if one exists.
 ///
 /// <P>An interrupt on this thread has no effect other than forcing a
 /// check on the target. Normally the target is checked every time the
 /// thread is woken up by notify, no interrupts should be done.
 ///
 /// <P>Any exception thrown by the target's 'run()' method is catched
 /// and this thread is not affected, except for 'ThreadDeath'. If a
 /// 'ThreadDeath' exception is catched a warning message is printed by
 /// the 'FacilityManager' and the exception is propagated up. For
 /// exceptions which are subclasses of 'Error' or 'RuntimeException'
 /// the corresponding error condition is set and this thread is not
 /// affected. For any other exceptions a new 'RuntimeException' is
 /// created and the error condition is set, this thread is not affected.
 ///
 /// </summary>
 override public void Run()
 {
     // Join the idle threads list
     Enclosing_Instance.putInIdleList(this);
     // Permanently lock the object while running so that target can
     // not be changed until we are waiting again. While waiting for a
     // target the lock is released.
     lock (this)
     {
         while (true)
         {
             // Wait until we get a target
             while (target == null)
             {
                 try
                 {
                     System.Threading.Monitor.Wait(this);
                 }
                 catch (System.Threading.ThreadInterruptedException)
                 {
                 }
             }
             // Run the target and catch all possible errors
             try
             {
                 target.Run();
             }
             //UPGRADE_NOTE: Exception 'java.lang.ThreadDeath' was converted to 'System.ApplicationException' which has different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1100'"
             catch (System.Threading.ThreadAbortException td)
             {
                 // We have been instructed to abruptly terminate
                 // the thread, which should never be done. This can
                 // cause another thread, or the system, to lock.
                 FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Thread.stop() called on a ThreadPool " + "thread or ThreadDeath thrown. This is " + "deprecated. Lock-up might occur.");
                 throw td;
             }
             catch (System.ApplicationException e)
             {
                 Enclosing_Instance.targetE = e;
             }
             catch (System.SystemException re)
             {
                 Enclosing_Instance.targetRE = re;
             }
             //UPGRADE_NOTE: Exception 'java.lang.Throwable' was converted to 'System.Exception' which has different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1100'"
             catch (System.Exception)
             {
                 // A totally unexpected error has occurred
                 // (Thread.stop(Throwable) has been used, which should
                 // never be.
                 Enclosing_Instance.targetRE = new System.SystemException("Unchecked exception " + "thrown by target's " + "run() method in pool " + Enclosing_Instance.poolName + ".");
             }
             // Join idle threads
             Enclosing_Instance.putInIdleList(this);
             // Release the target and notify lock (i.e. wakeup)
             target = null;
             if (lock_Renamed != null)
             {
                 lock (lock_Renamed)
                 {
                     if (doNotifyAll)
                     {
                         System.Threading.Monitor.PulseAll(lock_Renamed);
                     }
                     else
                     {
                         System.Threading.Monitor.Pulse(lock_Renamed);
                     }
                 }
             }
         }
     }
 }
コード例 #15
0
        /// <summary> Returns, in the blk argument, a block of image data containing the
        /// specifed rectangular area, in the specified component. The data is
        /// returned, as a copy of the internal data, therefore the returned data
        /// can be modified "in place".
        ///
        /// <P>The rectangular area to return is specified by the 'ulx', 'uly', 'w'
        /// and 'h' members of the 'blk' argument, relative to the current
        /// tile. These members are not modified by this method. The 'offset' of
        /// the returned data is 0, and the 'scanw' is the same as the block's
        /// width. See the 'DataBlk' class.
        ///
        /// <P>If the data array in 'blk' is 'null', then a new one is created. If
        /// the data array is not 'null' then it is reused, and it must be large
        /// enough to contain the block's data. Otherwise an 'ArrayStoreException'
        /// or an 'IndexOutOfBoundsException' is thrown by the Java system.
        ///
        /// <P>The returned data has its 'progressive' attribute set to that of the
        /// input data.
        ///
        /// </summary>
        /// <param name="out">Its coordinates and dimensions specify the area to
        /// return. If it contains a non-null data array, then it must have the
        /// correct dimensions. If it contains a null data array a new one is
        /// created. The fields in this object are modified to return the data.
        ///
        /// </param>
        /// <param name="c">The index of the component from which to get the data. Only 0
        /// and 3 are valid.
        ///
        /// </param>
        /// <returns> The requested DataBlk
        ///
        /// </returns>
        /// <seealso cref="getInternCompData">
        ///
        /// </seealso>
        public override DataBlk getCompData(DataBlk outblk, int c)
        {
            try
            {
                if (ncomps != 1 && ncomps != 3)
                {
                    System.String msg = "ICCProfiler: icc profile _not_ applied to " + ncomps + " component image";
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, msg);
                    return(src.getCompData(outblk, c));
                }

                int type = outblk.DataType;

                int leftedgeOut  = -1; // offset to the start of the output scanline
                int rightedgeOut = -1; // offset to the end of the output
                                       // scanline + 1
                int leftedgeIn  = -1;  // offset to the start of the input scanline
                int rightedgeIn = -1;  // offset to the end of the input
                                       // scanline + 1

                // Calculate all components:
                for (int i = 0; i < ncomps; ++i)
                {
                    int fixedPtBits = src.getFixedPoint(i);
                    int shiftVal    = shiftValueArray[i];
                    int maxVal      = maxValueArray[i];

                    // Initialize general input and output indexes
                    int kOut = -1;
                    int kIn  = -1;

                    switch (type)
                    {
                    // Int and Float data only
                    case DataBlk.TYPE_INT:

                        // Set up the DataBlk geometry
                        copyGeometry(workInt[i], outblk);
                        copyGeometry(tempInt[i], outblk);
                        copyGeometry(inInt[i], outblk);
                        InternalBuffer = outblk;

                        // Reference the output array
                        workDataInt[i] = (int[])workInt[i].Data;

                        // Request data from the source.
                        inInt[i]   = (DataBlkInt)src.getInternCompData(inInt[i], i);
                        dataInt[i] = inInt[i].DataInt;

                        // The nitty-gritty.

                        for (int row = 0; row < outblk.h; ++row)
                        {
                            leftedgeIn   = inInt[i].offset + row * inInt[i].scanw;
                            rightedgeIn  = leftedgeIn + inInt[i].w;
                            leftedgeOut  = outblk.offset + row * outblk.scanw;
                            rightedgeOut = leftedgeOut + outblk.w;

                            for (kOut = leftedgeOut, kIn = leftedgeIn; kIn < rightedgeIn; ++kIn, ++kOut)
                            {
                                int tmpInt = (dataInt[i][kIn] >> fixedPtBits) + shiftVal;
                                workDataInt[i][kOut] = ((tmpInt < 0) ? 0 : ((tmpInt > maxVal) ? maxVal : tmpInt));
                            }
                        }
                        break;


                    case DataBlk.TYPE_FLOAT:

                        // Set up the DataBlk geometry
                        copyGeometry(workFloat[i], outblk);
                        copyGeometry(tempFloat[i], outblk);
                        copyGeometry(inFloat[i], outblk);
                        InternalBuffer = outblk;

                        // Reference the output array
                        workDataFloat[i] = (float[])workFloat[i].Data;

                        // Request data from the source.
                        inFloat[i]   = (DataBlkFloat)src.getInternCompData(inFloat[i], i);
                        dataFloat[i] = inFloat[i].DataFloat;

                        // The nitty-gritty.

                        for (int row = 0; row < outblk.h; ++row)
                        {
                            leftedgeIn   = inFloat[i].offset + row * inFloat[i].scanw;
                            rightedgeIn  = leftedgeIn + inFloat[i].w;
                            leftedgeOut  = outblk.offset + row * outblk.scanw;
                            rightedgeOut = leftedgeOut + outblk.w;

                            for (kOut = leftedgeOut, kIn = leftedgeIn; kIn < rightedgeIn; ++kIn, ++kOut)
                            {
                                float tmpFloat = dataFloat[i][kIn] / (1 << fixedPtBits) + shiftVal;
                                workDataFloat[i][kOut] = ((tmpFloat < 0) ? 0 : ((tmpFloat > maxVal) ? maxVal : tmpFloat));
                            }
                        }
                        break;


                    case DataBlk.TYPE_SHORT:
                    case DataBlk.TYPE_BYTE:
                    default:
                        // Unsupported output type.
                        throw new System.ArgumentException("Invalid source " + "datablock type");
                    }
                }

                switch (type)
                {
                // Int and Float data only
                case DataBlk.TYPE_INT:

                    if (ncomps == 1)
                    {
                        ((MonochromeTransformTosRGB)xform).apply(workInt[c], tempInt[c]);
                    }
                    else
                    {
                        // ncomps == 3
                        ((MatrixBasedTransformTosRGB)xform).apply(workInt, tempInt);
                    }

                    outblk.progressive = inInt[c].progressive;
                    outblk.Data        = tempInt[c].Data;
                    break;


                case DataBlk.TYPE_FLOAT:

                    if (ncomps == 1)
                    {
                        ((MonochromeTransformTosRGB)xform).apply(workFloat[c], tempFloat[c]);
                    }
                    else
                    {
                        // ncomps == 3
                        ((MatrixBasedTransformTosRGB)xform).apply(workFloat, tempFloat);
                    }

                    outblk.progressive = inFloat[c].progressive;
                    outblk.Data        = tempFloat[c].Data;
                    break;


                case DataBlk.TYPE_SHORT:
                case DataBlk.TYPE_BYTE:
                default:
                    // Unsupported output type.
                    throw new System.ArgumentException("invalid source datablock" + " type");
                }

                // Initialize the output block geometry and set the profiled
                // data into the output block.
                outblk.offset = 0;
                outblk.scanw  = outblk.w;
            }
            catch (MatrixBasedTransformException e)
            {
                //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
                FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.ERROR, "matrix transform problem:\n" + e.Message);
                if (pl.getParameter("debug").Equals("on"))
                {
                    SupportClass.WriteStackTrace(e, Console.Error);
                }
                else
                {
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.ERROR, "Use '-debug' option for more details");
                }
                return(null);
            }
            catch (MonochromeTransformException e)
            {
                //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
                FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.ERROR, "monochrome transform problem:\n" + e.Message);
                if (pl.getParameter("debug").Equals("on"))
                {
                    SupportClass.WriteStackTrace(e, Console.Error);
                }
                else
                {
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.ERROR, "Use '-debug' option for more details");
                }
                return(null);
            }

            return(outblk);
        }
コード例 #16
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (FieldValidation() == false)
        {
            return;
        }

        IFacilitySetup FacilityManager;
        IQCareUtils    theUtils = new IQCareUtils();

        if (Convert.ToString(ddlprovince.SelectedValue.Trim()) == "0" || Convert.ToString(ddlprovince.SelectedValue.Trim()) == "")
        {
            ProvinceId = 0;
        }
        else
        {
            ProvinceId = Convert.ToInt32(ddlprovince.SelectedValue.Trim());
        }

        if (Convert.ToString(ddldistrict.SelectedValue.Trim()) == "0" || Convert.ToString(ddldistrict.SelectedValue.Trim()) == "")
        {
            DistrictId = 0;
        }
        else
        {
            DistrictId = Convert.ToInt32(ddldistrict.SelectedValue.Trim());
        }

        if (Convert.ToString(ddCountry.SelectedValue.Trim()) == "0" || Convert.ToString(ddCountry.SelectedValue.Trim()) == "")
        {
            CountryId = 0;
        }
        else
        {
            CountryId = Convert.ToInt32(ddCountry.SelectedValue.Trim());
        }

        Session["AppCountryId"] = CountryId;

        if (txtPEPFAR_Fund.Value.Trim() == "")
        {
            txtPEPFAR_Fund.Value = "01-01-1900";
        }
        if (txtPEPFAR_Fund.Value.Trim() != "")
        {
            thePepFarDate = theUtils.MakeDate(txtPEPFAR_Fund.Value);
        }
        try
        {
            if (FileLoad.PostedFile != null)
            {
                if (FileLoad.PostedFile.FileName != "")
                {
                    HttpPostedFile theFile = FileLoad.PostedFile;
                    theFile.SaveAs(Server.MapPath(string.Format("..//images//{0}", "Login.jpg")));
                    theFName = "Login.jpg";
                }
            }
            else if (ViewState["LoginImage"] != null)
            {
                theFName = ViewState["LoginImage"].ToString();
            }
            else
            {
                theFName = "";
            }

            if (chkPreferred.Checked == true)
            {
                Preferred = 1;
            }
            else
            {
                Preferred = 0;
            }

            int Paperless;
            if (chkPaperlessclinic.Checked == true)
            {
                Paperless = 1;
            }
            else
            {
                Paperless = 0;
            }

            DataTable dtModule = AddModule();
            DataTable dtStore  = AddStores();

            if (FileLoad.PostedFile != null)
            {
                if (Filelogo.PostedFile.FileName != "")
                {
                    HttpPostedFile theFilelogo = Filelogo.PostedFile;
                    theFilelogo.SaveAs(Server.MapPath(string.Format("..//images//{0}", txtfacilityname.Text + ".jpg")));
                }
            }
            Hashtable htFacilityParameters = getFacilityParameters();

            /////////////////////////////////
            if (btnSave.Text == "Save")
            {
                FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

                int Rows = FacilityManager.SaveNewFacility(txtfacilityname.Text, CountryId.ToString(), txtLPTF.Text, txtSatelliteID.Text, txtNationalId.Text, ProvinceId, DistrictId, theFName, Convert.ToInt32(cmbCurrency.SelectedValue), Convert.ToInt32(txtGrace.Text), "dd-MMM-yyyy", Convert.ToDateTime(thePepFarDate), Convert.ToInt32(Session["SystemId"]), Preferred, Paperless, Convert.ToInt32(Session["AppUserId"]), dtModule, htFacilityParameters, dtStore);
                if (Rows > 0)
                {
                    IQCareMsgBox.Show("FacilityMasterSave", this);
                    if (Session["AppUserName"].ToString() != string.Empty)
                    {
                        Response.Redirect("frmAdmin_FacilityList.aspx");
                    }
                    else
                    {
                        Response.Redirect("~/frmlogin.aspx", true);
                    }
                }
                else
                {
                    IQCareMsgBox.Show("FacilityMasterExists", this);
                    return;
                }
            }
            else
            {
                int Paperlessclinic = this.chkPaperlessclinic.Checked == true ? 1 : 0;
                //int PMTCTclinic = this.chkPMTCT.Checked == true ? 1 : 0;|| (Convert.ToInt32(ViewState["PMTCT"])!= PMTCTclinic)
                if ((Convert.ToInt32(ViewState["Paperless"]) != Paperlessclinic))
                {
                    SaveYesNoforPaperless();
                }
                else if (Convert.ToInt32(ViewState["Paperless"]) == Paperlessclinic)
                {
                    FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                    int Rows = FacilityManager.UpdateFacility(Convert.ToInt32(ViewState["FacilityId"]), txtfacilityname.Text, CountryId.ToString(), txtLPTF.Text, txtSatelliteID.Text, txtNationalId.Text, ProvinceId, DistrictId, theFName, Convert.ToInt32(cmbCurrency.SelectedValue), Convert.ToInt32(txtGrace.Text), "dd-MMM-yyyy", Convert.ToDateTime(thePepFarDate), Convert.ToInt32(ddStatus.SelectedValue), Convert.ToInt32(Session["SystemId"]), Preferred, Paperless, Convert.ToInt32(Session["AppUserId"]), dtModule, htFacilityParameters, dtStore);
                    if (Rows > 0)
                    {
                        IQCareMsgBox.Show("FacilityMasterUpdate", this);
                        Response.Redirect("frmAdmin_FacilityList.aspx");
                    }
                }
                else
                {
                    IQCareMsgBox.Show("FacilityMasterExists", this);
                    return;
                }
            }
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
        finally
        {
            FacilityManager = null;
        }
    }
コード例 #17
0
    // Use this for initialization
    void Start()
    {
        iWidth = Screen.width;
        //i_height = iWidth * 4 / 3;
        iHeight = Screen.height;

        hDelta = Screen.height - iWidth * 4 / 3;
        Debug.Log("delta is " + hDelta);
        GameObject.Find("Game Display").transform.Translate(new Vector3(0, hDelta / 2, 0));
        GameObject.Find("Money Up").transform.Translate(new Vector3(0, hDelta / 2, 0));
        GameObject.Find("Buttons").transform.Translate(new Vector3(0, (-1) * hDelta / 2, 0));
        GameObject.Find("Facility Scroll").GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, GameObject.Find("Facility Scroll").GetComponent <RectTransform>().rect.height + hDelta * 768 / iWidth);
        GameObject.Find("Click Scroll").GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, GameObject.Find("Click Scroll").GetComponent <RectTransform>().rect.height + hDelta * 768 / iWidth);
        GameObject.Find("Fever Scroll").GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, GameObject.Find("Fever Scroll").GetComponent <RectTransform>().rect.height + hDelta * 768 / iWidth);
        GameObject.Find("Spoon Scroll").GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, GameObject.Find("Spoon Scroll").GetComponent <RectTransform>().rect.height + hDelta * 768 / iWidth);

        _money = new Money();
        _click = new Money(1);

        _fac = new List <Money>();
        _fac.Add(new Money(100));
        _fac.Add(new Money(2500));
        _fac.Add(new Money(9, 'b'));
        _fac.Add(new Money(365, 'b'));
        _fac.Add(new Money(1.23f, 'c'));
        _fac.Add(new Money(40, 'c'));
        _fac.Add(new Money(2222, 'c'));
        _fac.Add(new Money(20.18f, 'd'));

        _facNum = _fac.Count;

        _initFac = new List <Money>();
        for (int i = 0; i < _facNum; i++)
        {
            _initFac.Add(_fac[i]);
        }

        _facLevel = new int[_facNum];
        for (int j = 0; j < _facNum; j++)
        {
            _facLevel[j] = 0;
        }
        _facLevel[0] = 1;

        moneyText = GameObject.Find("Current Money").GetComponent <Text>();
        earnText  = GameObject.Find("Earning Money").GetComponent <Text>();
        facScroll = GameObject.Find("Facility Scroll");
        cliScroll = GameObject.Find("Click Scroll");
        fevScroll = GameObject.Find("Fever Scroll");
        spoScroll = GameObject.Find("Spoon Scroll");

        textArr   = new Text[_facNum];
        buttonArr = new Text[_facNum];
        deltaArr  = new Text[_facNum];
        for (int i = 0; i < _facNum; i++)
        {
            textArr[i]   = GameObject.Find("facility" + (i + 1)).GetComponentInChildren <Text>();
            buttonArr[i] = GameObject.Find("Text" + (i + 1)).GetComponent <Text>();
            deltaArr[i]  = GameObject.Find("Delta" + (i + 1)).GetComponent <Text>();
        }

        _clickLevel = 1;
        _spoonLevel = 1;

        _currentClick = 0;
        _feverLevel   = 1;
        _feverClick   = (int)(1000 * Mathf.Pow(0.89f, _feverLevel)) + 1;
        _isFeverTime  = false;
        _hasSetFever  = false;

        // 스크롤뷰 비활성화
        cliScroll.SetActive(false);
        fevScroll.SetActive(false);
        spoScroll.SetActive(false);

        fever = GameObject.Find("Fever Image");
        fever.SetActive(false);
        feverBar  = GameObject.Find("Fever Bar");
        feverText = GameObject.Find("Fever Text");
        feverText.GetComponent <Text>().text = _feverClick - _currentClick + "";

        fm = GameObject.Find("FacilityManager").GetComponent <FacilityManager>();

        Debug.Log("have to click " + _feverClick + " times");
        delta = (iWidth / (float)_feverClick);
        Debug.Log("delta: " + delta);
        timeSpan  = 0.0f;
        checkTime = 1.0f;
        timeFever = 0.0f;
    }
コード例 #18
0
 public AddInjWellForm()
 {
     InitializeComponent();
     _wellPadHandler = FacilityManager.GetInstance();
     LoadWellPadsWaterTypes();
 }
コード例 #19
0
        /// <summary> This method checks whether the given RandomAccessIO is a valid JP2 file
        /// and if so finds the first codestream in the file. Currently, the
        /// information in the codestream is not used
        ///
        /// </summary>
        /// <param name="in">The RandomAccessIO from which to read the file format
        ///
        /// </param>
        /// <exception cref="java.io.IOException">If an I/O error ocurred.
        ///
        /// </exception>
        /// <exception cref="java.io.EOFException">If end of file is reached
        ///
        /// </exception>
        public virtual void  readFileFormat()
        {
            //int foundCodeStreamBoxes = 0;
            int   box;
            int   length;
            long  longLength = 0;
            int   pos;
            short marker;
            bool  jp2HeaderBoxFound = false;
            bool  lastBoxFound      = false;

            try
            {
                // Go through the randomaccessio and find the first contiguous
                // codestream box. Check also that the File Format is correct

                // Make sure that the first 12 bytes is the JP2_SIGNATURE_BOX or
                // if not that the first 2 bytes is the SOC marker
                if (in_Renamed.readInt() != 0x0000000c || in_Renamed.readInt() != CSJ2K.j2k.fileformat.FileFormatBoxes.JP2_SIGNATURE_BOX || in_Renamed.readInt() != 0x0d0a870a)
                {
                    // Not a JP2 file
                    in_Renamed.seek(0);

                    marker = (short)in_Renamed.readShort();
                    if (marker != CSJ2K.j2k.codestream.Markers.SOC)
                    {
                        //Standard syntax marker found
                        throw new System.InvalidOperationException("File is neither valid JP2 file nor " + "valid JPEG 2000 codestream");
                    }
                    JP2FFUsed = false;
                    in_Renamed.seek(0);
                    return;
                }

                // The JP2 File format is being used
                JP2FFUsed = true;

                // Read File Type box
                if (!readFileTypeBox())
                {
                    // Not a valid JP2 file or codestream
                    throw new System.InvalidOperationException("Invalid JP2 file: File Type box missing");
                }

                // Read all remaining boxes
                while (!lastBoxFound)
                {
                    pos    = in_Renamed.Pos;
                    length = in_Renamed.readInt();
                    if ((pos + length) == in_Renamed.length())
                    {
                        lastBoxFound = true;
                    }

                    box = in_Renamed.readInt();
                    if (length == 0)
                    {
                        lastBoxFound = true;
                        length       = in_Renamed.length() - in_Renamed.Pos;
                    }
                    else if (length == 1)
                    {
                        longLength = in_Renamed.readLong();
                        throw new System.IO.IOException("File too long.");
                    }
                    else
                    {
                        longLength = (long)0;
                    }

                    switch (box)
                    {
                    case CSJ2K.j2k.fileformat.FileFormatBoxes.CONTIGUOUS_CODESTREAM_BOX:
                        if (!jp2HeaderBoxFound)
                        {
                            throw new System.InvalidOperationException("Invalid JP2 file: JP2Header box not " + "found before Contiguous codestream " + "box ");
                        }
                        readContiguousCodeStreamBox(pos, length, longLength);
                        break;

                    case CSJ2K.j2k.fileformat.FileFormatBoxes.JP2_HEADER_BOX:
                        if (jp2HeaderBoxFound)
                        {
                            throw new System.InvalidOperationException("Invalid JP2 file: Multiple " + "JP2Header boxes found");
                        }
                        readJP2HeaderBox(pos, length, longLength);
                        jp2HeaderBoxFound = true;
                        break;

                    case CSJ2K.j2k.fileformat.FileFormatBoxes.INTELLECTUAL_PROPERTY_BOX:
                        readIntPropertyBox(length);
                        break;

                    case CSJ2K.j2k.fileformat.FileFormatBoxes.XML_BOX:
                        readXMLBox(length);
                        break;

                    case CSJ2K.j2k.fileformat.FileFormatBoxes.UUID_BOX:
                        readUUIDBox(length);
                        break;

                    case CSJ2K.j2k.fileformat.FileFormatBoxes.UUID_INFO_BOX:
                        readUUIDInfoBox(length);
                        break;

                    case CSJ2K.j2k.fileformat.FileFormatBoxes.READER_REQUIREMENTS_BOX:
                        readReaderRequirementsBox(length);
                        break;

                    default:
                        FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unknown box-type: 0x" + System.Convert.ToString(box, 16));
                        break;
                    }
                    if (!lastBoxFound)
                    {
                        in_Renamed.seek(pos + length);
                    }
                }
            }
            catch (System.IO.EndOfStreamException e)
            {
                throw new System.InvalidOperationException("EOF reached before finding Contiguous " + "Codestream Box");
            }

            if (codeStreamPos.Count == 0)
            {
                // Not a valid JP2 file or codestream
                throw new System.InvalidOperationException("Invalid JP2 file: Contiguous codestream box " + "missing");
            }

            return;
        }
コード例 #20
0
    private void Init_Form()
    {
        IFacility FacilityManager;
        Double    thePercent, theResultPercent, theTotalPateint, theTotalPMTCTPatient;

        FacilityManager = (IFacility)ObjectFactory.CreateInstance("BusinessProcess.Security.BFacility, BusinessProcess.Security");
        theDS           = FacilityManager.GetFacilityStats(Convert.ToInt32(754));

        ViewState["theDS"] = theDS;
        FacilityManager    = null;
        DataTable dttecareas = new DataTable();

        dttecareas = theDS.Tables[10];

        //pnl_FacTexhAreas.Controls.Clear();
        ////if (ddFacility.SelectedValue != "9999")
        ////{
        for (int k = 0; k <= dttecareas.Rows.Count - 1; k++)
        {
            pnl_FacTexhAreas.Controls.Add(new LiteralControl("<table width='100%'><tr>"));
            pnl_FacTexhAreas.Controls.Add(new LiteralControl("<td align='left'>"));
            Label theLabelTitle = new Label();
            theLabelTitle.ID        = "Lbl_" + dttecareas.Rows[k]["ModuleName"].ToString() + dttecareas.Rows[k]["FacilityID"].ToString();
            theLabelTitle.Text      = dttecareas.Rows[k]["ModuleName"].ToString();
            theLabelTitle.Font.Size = 9;
            theLabelTitle.Font.Bold = true;
            pnl_FacTexhAreas.Controls.Add(theLabelTitle);
            pnl_FacTexhAreas.Controls.Add(new LiteralControl("</td></tr>"));

            DataRow[] theDR = theDS.Tables[11].Select("ModuleID=" + dttecareas.Rows[k]["ModuleId"].ToString());
            if (theDR.Length > 0)
            {
                int m = 2;
                for (int j = 0; j <= theDR.Length - 1; j++)
                {
                    pnl_FacTexhAreas.Controls.Add(new LiteralControl("<tr><td style='width: 43%; height: 25px;' align='left'>"));
                    Label theLabel = new Label();
                    theLabel.ID   = "Lbl_" + (theDR[j]["IndicatorName"].ToString() + dttecareas.Rows[k]["ModuleId"].ToString() + dttecareas.Rows[k]["FacilityID"].ToString());
                    theLabel.Text = theDR[j]["IndicatorName"].ToString();
                    //theLabel.CssClass = "bold pad18";
                    theLabel.Width     = 200;
                    theLabel.Font.Size = 9;
                    theLabel.Font.Bold = true;
                    //theLabel.Font.Underline = true;
                    theLabel.ForeColor = System.Drawing.Color.Blue;
                    pnl_FacTexhAreas.Controls.Add(theLabel);
                    pnl_FacTexhAreas.Controls.Add(new LiteralControl("</td><td align='left'>"));

                    if (theDS.Tables[13 + m].Columns.Count > 1)
                    {
                        DataGrid objdView = new DataGrid();
                        objdView.ID = "Dview_" + (theDR[j]["IndicatorName"].ToString() + dttecareas.Rows[k]["ModuleId"].ToString() + dttecareas.Rows[k]["FacilityID"].ToString()) + "_Val";
                        objdView.EnableViewState     = true;
                        objdView.AutoGenerateColumns = true;
                        objdView.DataSource          = theDS.Tables[13];
                        //Panel theGrdPnl = new Panel();
                        //theGrdPnl.ID = "sanjaypnl";
                        pnl_FacTexhAreas.Controls.Add(objdView);
                        objdView.Attributes.Add("onload", "alert('GridLoaded');");
                        //theGrdPnl.Controls.Add(new LiteralControl("<table width='100%'>"));
                        //theGrdPnl.Controls.Add(new LiteralControl("<tr>"));
                        //theGrdPnl.Controls.Add(new LiteralControl("<td>"));
                        //theGrdPnl.Controls.Add(new LiteralControl("<div class='GridView whitebg'>"));
                        //theGrdPnl.Controls.Add(objdView);
                        //theGrdPnl.Controls.Add(new LiteralControl("</div>"));
                        //theGrdPnl.Controls.Add(new LiteralControl("</td>"));
                        //theGrdPnl.Controls.Add(new LiteralControl("</tr>"));
                        //theGrdPnl.Controls.Add(new LiteralControl("</table>"));
                        objdView.Visible = true;
                        objdView.DataBind();
                        //objdView += new EventHandler(objdView_PreRender);
                        //objdView.DataBind();
                    }
                    else
                    {
                        Label theValueLabel = new Label();
                        theValueLabel.ID   = "Lbl_" + (theDR[j]["IndicatorName"].ToString() + dttecareas.Rows[k]["ModuleId"].ToString() + dttecareas.Rows[k]["FacilityID"].ToString()) + "_Val";
                        theValueLabel.Text = theDS.Tables[13 + m].Rows[0][0].ToString();
                        //theValueLabel.Text = theDS.Tables[13+m].Rows[0][0].ToString();
                        theValueLabel.CssClass = "pad18";
                        theValueLabel.Width    = 200;
                        pnl_FacTexhAreas.Controls.Add(theValueLabel);
                    }
                    m = m + 2;
                }
            }
            pnl_FacTexhAreas.Controls.Add(new LiteralControl("</td></tr>"));
            pnl_FacTexhAreas.Controls.Add(new LiteralControl("<br/>"));
            pnl_FacTexhAreas.Controls.Add(new LiteralControl("</tr></table>"));
        }

        ////}
    }
コード例 #21
0
        /// <summary>Analyze the box content. </summary>
        private void  readBox()
        {
            byte[] boxHeader = new byte[256];
            in_Renamed.seek(dataStart);
            in_Renamed.readFully(boxHeader, 0, 11);
            switch (boxHeader[0])
            {
            case 1:
                method = CSJ2K.Color.ColorSpace.MethodEnum.ENUMERATED;
                int cs = CSJ2K.Icc.ICCProfile.getInt(boxHeader, 3);
                switch (cs)
                {
                case 16:
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.sRGB;
                    break;                                     // from switch (cs)...

                case 17:
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.GreyScale;
                    break;                                     // from switch (cs)...

                case 18:
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.sYCC;
                    break;                                     // from switch (cs)...

                case 20:
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.esRGB;
                    break;

                    #region Known but unsupported colorspaces
                case 3:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace YCbCr(2) in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 4:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace YCbCr(3) in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 9:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace PhotoYCC in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 11:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace CMY in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 12:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace CMYK in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 13:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace YCCK in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 14:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace CIELab in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 15:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace Bi-Level(2) in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 19:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace CIEJab in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 21:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace ROMM-RGB in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 22:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace YPbPr(1125/60) in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 23:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace YPbPr(1250/50) in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;

                case 24:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unsupported enumerated colorspace e-sYCC in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;
                    #endregion

                default:
                    FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "Unknown enumerated colorspace (" + cs + ") in color specification box");
                    colorSpace = CSJ2K.Color.ColorSpace.CSEnum.Unknown;
                    break;
                }
                break;                         // from switch (boxHeader[0])...

            case 2:
                method = CSJ2K.Color.ColorSpace.MethodEnum.ICC_PROFILED;
                int size = CSJ2K.Icc.ICCProfile.getInt(boxHeader, 3);
                iccProfile = new byte[size];
                in_Renamed.seek(dataStart + 3);
                in_Renamed.readFully(iccProfile, 0, size);
                break;                         // from switch (boxHeader[0])...

            default:
                throw new ColorSpaceException("Bad specification method (" + boxHeader[0] + ") in " + this);
            }
        }
コード例 #22
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (FieldValidation() == false)
            {
                return;
            }

            IFacilitySetup FacilityManager;
            IQCareUtils    theUtils = new IQCareUtils();

            if (txtPEPFAR_Fund.Text.Trim() == "")
            {
                txtPEPFAR_Fund.Text = "01-01-1900";
            }
            if (txtPEPFAR_Fund.Text.Trim() != "")
            {
                thePepFarDate = theUtils.MakeDate(txtPEPFAR_Fund.Text);
            }
            try
            {
                if (FileLoad.PostedFile.FileName != "")
                {
                    HttpPostedFile theFile = FileLoad.PostedFile;
                    theFile.SaveAs(Server.MapPath(string.Format("..//images//{0}", "Login.jpg")));
                    theFName = "Login.jpg";
                }
                else if (ViewState["LoginImage"] != null)
                {
                    theFName = ViewState["LoginImage"].ToString();
                }
                else
                {
                    theFName = "";
                }

                if (chkPreferred.Checked == true)
                {
                    Preferred = 1;
                }
                else
                {
                    Preferred = 0;
                }

                int Paperless;
                if (chkPaperlessclinic.Checked == true)
                {
                    Paperless = 1;
                }
                else
                {
                    Paperless = 0;
                }

                DataTable dtModule = AddModule();
                if (Filelogo.PostedFile.FileName != "")
                {
                    HttpPostedFile theFilelogo = Filelogo.PostedFile;
                    theFilelogo.SaveAs(Server.MapPath(string.Format("..//images//{0}", txtfacilityname.Text + ".jpg")));
                }
                Hashtable htFacilityParameters = new Hashtable();
                htFacilityParameters.Add("FacilityLogo", txtfacilityname.Text + ".jpg");
                htFacilityParameters.Add("FacilityAddress", txtFacAddress.Text);
                htFacilityParameters.Add("FacilityTel", txtFactele.Text);
                htFacilityParameters.Add("FacilityCell", txtFacCell.Text);
                htFacilityParameters.Add("FacilityFax", txtFacFax.Text);
                htFacilityParameters.Add("FacilityEmail", txtFacEmail.Text);
                htFacilityParameters.Add("FacilityFootertext", txtpharmfoottext.Text);
                htFacilityParameters.Add("FacilityURL", txtFacURL.Text);
                htFacilityParameters.Add("Facilitytemplate", this.Radio1.Checked == true ? Radio1.Value.ToString() : (this.Radio2.Checked == true ? Radio2.Value.ToString() : "0"));
                htFacilityParameters.Add("StrongPassword", this.chkStrongPwd.Checked == true ? 1 : 0);
                htFacilityParameters.Add("ExpirePaswordFlag", this.chkexpPwd.Checked == true ? 1 : 0);
                htFacilityParameters.Add("ExpirePaswordDays", this.chkexpPwd.Checked == true ? txtnoofdays.Text : "");

                /////////////////////////////////
                if (btnSave.Text == "Save")
                {
                    FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");

                    int Rows = FacilityManager.SaveNewFacility(txtfacilityname.Text, txtcountryno.Text, txtLPTF.Text, txtSatelliteID.Text, txtNationalId.Text, Convert.ToInt32(ddlprovince.SelectedValue), Convert.ToInt32(ddldistrict.SelectedValue), theFName, Convert.ToInt32(cmbCurrency.SelectedValue), Convert.ToInt32(txtGrace.Text), "dd-MMM-yyyy", Convert.ToDateTime(thePepFarDate), Convert.ToInt32(Session["SystemId"]), Preferred, Paperless, Convert.ToInt32(Session["AppUserId"]), dtModule, htFacilityParameters);
                    if (Rows > 0)
                    {
                        IQCareMsgBox.Show("FacilityMasterSave", this);
                        if (Session["AppUserName"].ToString() != "")
                        {
                            Response.Redirect("frmAdmin_FacilityList.aspx");
                        }
                        else
                        {
                            Response.Redirect("../frmLogOff.aspx");
                        }
                    }
                    else
                    {
                        IQCareMsgBox.Show("FacilityMasterExists", this);
                        return;
                    }
                }
                else
                {
                    int Paperlessclinic = this.chkPaperlessclinic.Checked == true ? 1 : 0;
                    //int PMTCTclinic = this.chkPMTCT.Checked == true ? 1 : 0;|| (Convert.ToInt32(ViewState["PMTCT"])!= PMTCTclinic)
                    if ((Convert.ToInt32(ViewState["Paperless"]) != Paperlessclinic))
                    {
                        SaveYesNoforPaperless();
                    }
                    else if (Convert.ToInt32(ViewState["Paperless"]) == Paperlessclinic)
                    {
                        FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                        int Rows = FacilityManager.UpdateFacility(Convert.ToInt32(ViewState["FacilityId"]), txtfacilityname.Text, txtcountryno.Text, txtLPTF.Text, txtSatelliteID.Text, txtNationalId.Text, Convert.ToInt32(ddlprovince.SelectedValue), Convert.ToInt32(ddldistrict.SelectedValue), theFName, Convert.ToInt32(cmbCurrency.SelectedValue), Convert.ToInt32(txtGrace.Text), "dd-MMM-yyyy", Convert.ToDateTime(thePepFarDate), Convert.ToInt32(ddStatus.SelectedValue), Convert.ToInt32(Session["SystemId"]), Preferred, Paperless, Convert.ToInt32(Session["AppUserId"]), dtModule, htFacilityParameters);
                        if (Rows > 0)
                        {
                            IQCareMsgBox.Show("FacilityMasterUpdate", this);
                            Response.Redirect("frmAdmin_FacilityList.aspx");
                        }
                    }
                    else
                    {
                        IQCareMsgBox.Show("FacilityMasterExists", this);
                        return;
                    }
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
            }
            finally
            {
                FacilityManager = null;
            }
        }
コード例 #23
0
ファイル: Swimming.cs プロジェクト: CodeMantra/SportsApp
 public Swimming(string name, Facility facility, FacilityManager facilityManager, string[] equipments)
     : base(name, facility, equipments)
 {
     // set the facility manager
     SportFacilityManager = facilityManager;
 }
コード例 #24
0
 public AddWellPadForm()
 {
     InitializeComponent();
     LoadProvinces();
     _wellPadHandler = FacilityManager.GetInstance();
 }
コード例 #25
0
        /// <summary> Returns, in the blk argument, a block of image data containing the
        /// specifed rectangular area, in the specified component. The data is
        /// returned, as a copy of the internal data, therefore the returned data
        /// can be modified "in place".
        ///
        /// <P>The rectangular area to return is specified by the 'ulx', 'uly', 'w'
        /// and 'h' members of the 'blk' argument, relative to the current
        /// tile. These members are not modified by this method. The 'offset' of
        /// the returned data is 0, and the 'scanw' is the same as the block's
        /// width. See the 'DataBlk' class.
        ///
        /// <P>If the data array in 'blk' is 'null', then a new one is created. If
        /// the data array is not 'null' then it is reused, and it must be large
        /// enough to contain the block's data. Otherwise an 'ArrayStoreException'
        /// or an 'IndexOutOfBoundsException' is thrown by the Java system.
        ///
        /// <P>The returned data has its 'progressive' attribute set to that of the
        /// input data.
        ///
        /// </summary>
        /// <param name="blk">Its coordinates and dimensions specify the area to
        /// return. If it contains a non-null data array, then it must have the
        /// correct dimensions. If it contains a null data array a new one is
        /// created. The fields in this object are modified to return the data.
        ///
        /// </param>
        /// <param name="c">The index of the component from which to get the data. Only 0
        /// and 3 are valid.
        ///
        /// </param>
        /// <returns> The requested DataBlk
        ///
        /// </returns>
        /// <seealso cref="getInternCompData">
        ///
        /// </seealso>
        public override DataBlk getCompData(DataBlk out_Renamed, int c)
        {
            if (pbox == null)
            {
                return(src.getCompData(out_Renamed, c));
            }

            if (ncomps != 1)
            {
                System.String msg = "PalettizedColorSpaceMapper: color palette " + "_not_ applied, incorrect number (" + System.Convert.ToString(ncomps) + ") of components";
                FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, msg);
                return(src.getCompData(out_Renamed, c));
            }

            // Initialize general input and output indexes
            int leftedgeOut  = -1;            // offset to the start of the output scanline
            int rightedgeOut = -1;            // offset to the end of the output
            // scanline + 1
            int leftedgeIn  = -1;             // offset to the start of the input scanline
            int rightedgeIn = -1;             // offset to the end of the input
            // scanline + 1
            int kOut = -1;
            int kIn  = -1;

            // Assure a properly sized data buffer for output.
            InternalBuffer = out_Renamed;

            switch (out_Renamed.DataType)
            {
            // Int and Float data only
            case DataBlk.TYPE_INT:

                copyGeometry(inInt[0], out_Renamed);

                // Request data from the source.
                inInt[0]   = (DataBlkInt)src.getInternCompData(inInt[0], 0);
                dataInt[0] = (int[])inInt[0].Data;
                int[] outdataInt = ((DataBlkInt)out_Renamed).DataInt;

                // The nitty-gritty.

                for (int row = 0; row < out_Renamed.h; ++row)
                {
                    leftedgeIn   = inInt[0].offset + row * inInt[0].scanw;
                    rightedgeIn  = leftedgeIn + inInt[0].w;
                    leftedgeOut  = out_Renamed.offset + row * out_Renamed.scanw;
                    rightedgeOut = leftedgeOut + out_Renamed.w;

                    for (kOut = leftedgeOut, kIn = leftedgeIn; kIn < rightedgeIn; ++kIn, ++kOut)
                    {
                        outdataInt[kOut] = pbox.getEntry(c, dataInt[0][kIn] + shiftValueArray[0]) - outShiftValueArray[c];
                    }
                }
                out_Renamed.progressive = inInt[0].progressive;
                break;


            case DataBlk.TYPE_FLOAT:

                copyGeometry(inFloat[0], out_Renamed);

                // Request data from the source.
                inFloat[0]   = (DataBlkFloat)src.getInternCompData(inFloat[0], 0);
                dataFloat[0] = (float[])inFloat[0].Data;
                float[] outdataFloat = ((DataBlkFloat)out_Renamed).DataFloat;

                // The nitty-gritty.

                for (int row = 0; row < out_Renamed.h; ++row)
                {
                    leftedgeIn   = inFloat[0].offset + row * inFloat[0].scanw;
                    rightedgeIn  = leftedgeIn + inFloat[0].w;
                    leftedgeOut  = out_Renamed.offset + row * out_Renamed.scanw;
                    rightedgeOut = leftedgeOut + out_Renamed.w;

                    for (kOut = leftedgeOut, kIn = leftedgeIn; kIn < rightedgeIn; ++kIn, ++kOut)
                    {
                        //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
                        outdataFloat[kOut] = pbox.getEntry(c, (int)dataFloat[0][kIn] + shiftValueArray[0]) - outShiftValueArray[c];
                    }
                }
                out_Renamed.progressive = inFloat[0].progressive;
                break;


            case DataBlk.TYPE_SHORT:
            case DataBlk.TYPE_BYTE:
            default:
                // Unsupported output type.
                throw new System.ArgumentException("invalid source datablock" + " type");
            }

            // Initialize the output block geometry and set the profiled
            // data into the output block.
            out_Renamed.offset = 0;
            out_Renamed.scanw  = out_Renamed.w;
            return(out_Renamed);
        }
コード例 #26
0
 public ViewOilProductionForm()
 {
     InitializeComponent();
     _wellPadHandler = FacilityManager.GetInstance();
     LoadWellPads();
 }
コード例 #27
0
ファイル: TrackAndField.cs プロジェクト: CodeMantra/SportsApp
 public TrackAndField(string name, Facility facility, FacilityManager facilityManager, string[] equipments)
     : base(name, facility, equipments)
 {
     // set the facility manager
     SportFacilityManager = facilityManager;
 }