Ejemplo n.º 1
0
        public void ResizeFrom(ILockData otherData)
        {
            TexturesData src = (TexturesData)otherData;

            if (src.lockSplats == null || lockSplats == null)
            {
                return;
            }
            int numLayers = Mathf.Min(src.lockSplats.GetLength(2), lockSplats.GetLength(2));

            if (numLayers == 0)
            {
                return;
            }

            Matrix srcMatrix = new Matrix(src.circle.rect);
            Matrix dstMatrix = new Matrix(circle.rect);

            for (int i = 0; i < numLayers; i++)
            {
                srcMatrix.ImportSplats(src.lockSplats, i);
                MatrixOps.Resize(srcMatrix, dstMatrix);
                dstMatrix.ExportSplats(lockSplats, i);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Readings test.
 /// </summary>
 /// <param name="readings">Readings.</param>
 public void ReadingsTest(ILockData readings)
 {
     if (UpperLevelTester.ValueOutsideLimits (readings.UpperLevel)) {
         if (UpperLevelAlarm != null) UpperLevelAlarm (this, null);
     }
     if (LowerLevelTester.ValueOutsideLimits (readings.LowerLevel)) {
         if (LowerLevelAlarm != null) LowerLevelAlarm (this, null);
     }
     if (FlowRateTester.ValueOutsideLimits (readings.FlowRate)) {
         if (FlowRateAlarm != null) FlowRateAlarm (this, null);
     }
 }
Ejemplo n.º 3
0
 void setupComponents()
 {
     _lockData = (LockData)_lockFactory.CreateandReturnObj (LockClassesEnumeration.LockData);
     _dataReader = (LockDataReader)_lockFactory.CreateandReturnObj (LockClassesEnumeration.LockDataReader);
     _alarmer = (LockAlarmer)_lockFactory.CreateandReturnObj (LockClassesEnumeration.LockAlarmer);
     _alarmer.UpperLevelAlarm += new EventHandler(soundMutableAlarm);
     _alarmer.LowerLevelAlarm += new EventHandler(soundMutableAlarm);
     _alarmer.FlowRateAlarm += new EventHandler(soundMutableAlarm);
     _tickTimer.Stop ();
     _tickTimer.Interval = TimeSpan.FromMilliseconds (1000);
     _tickTimer.Tick += new EventHandler (updateReadings);
 }
Ejemplo n.º 4
0
        public void ResizeFrom(ILockData otherData)
        {
            HeightData other = (HeightData)otherData;

            Matrix otherMatrix = new Matrix(other.circle.rect);

            otherMatrix.ImportHeights(other.heightsArr);

            Matrix matrix = new Matrix(circle.rect);

            MatrixOps.Resize(otherMatrix, matrix);

            matrix.ExportHeights(heightsArr);
        }
Ejemplo n.º 5
0
        public void ResizeFrom(ILockData otherData)
        {
            GrassData src = (GrassData)otherData;

            if (src.lockLayers == null || lockLayers == null)
            {
                return;
            }
            int numLayers = Mathf.Min(src.lockLayers.Length, lockLayers.Length);

            if (numLayers == 0)
            {
                return;
            }

            for (int i = 0; i < numLayers; i++)
            {
                int[,] srcLayer = src.lockLayers[i];
                int[,] dstLayer = lockLayers[i];

                int srcResX = dstLayer.GetLength(0);
                int srcResZ = dstLayer.GetLength(1);

                int dstResX = srcLayer.GetLength(0);
                int dstResZ = srcLayer.GetLength(1);

                float resFactorX = 1f * dstResX / srcResX;
                float resFactorZ = 1f * dstResZ / srcResZ;


                for (int dstX = 0; dstX < dstResX; dstX++)
                {
                    for (int dstZ = 0; dstZ < dstResZ; dstZ++)
                    {
                        int srcX = (int)(dstX / resFactorX);
                        int srcZ = (int)(dstZ / resFactorZ);

                        dstLayer[dstX, dstZ] = srcLayer[srcX, srcZ];
                    }
                }
            }
        }
Ejemplo n.º 6
0
 // unit testing purposes
 internal LockDAL(ILockData lockData)
 {
     this.lockDataLayer = lockData;
 }
Ejemplo n.º 7
0
 public LockDAL()
 {
     this.lockDataLayer = new LockData();
 }