/// <summary>
 /// 주어진 정보를 이용하여 VibrationScript 인스턴스를 초기화합니다.
 /// </summary>
 /// <param name="direction">흔들리는 방향을 설정합니다.</param>
 /// <param name="speed">흔들리는 속도를 설정합니다.</param>
 /// <param name="moveDistance">움직일 거리를 설정합니다.</param>
 /// <param name="waveQuantity">흔들리는 횟수를 설정합니다.</param>
 public VibrationScript(VibrationState direction, float speed, float moveDistance, int waveQuantity)
 {
     base.ScriptCode = (int)ScriptTypeCode.VibrationScript;
     base.IsStepScript = true;
     this.Direction = direction;
     this.MoveDistance = moveDistance;
     this.Speed = speed;
     this.WaveQuantity = waveQuantity;
 }
Esempio n. 2
0
        public void FormatEventVibrationState(VibrationState value, string expectedResult)
        {
            var userPreferences   = new UserPreferences();
            var csvUserPreference = AutoMapperUtility.Automapper.Map <CSVExportUserPreferences>(userPreferences);
            var formatter         = new CSVExportFormatter(csvUserPreference, OutputTypes.PassCountLastPass);

            var result = formatter.FormatEventVibrationState(value);

            result.Should().Be(expectedResult);
        }
Esempio n. 3
0
        private static VibrationStateType ConvertVibState(VibrationState cellPassEventVibrationState)
        {
            switch (cellPassEventVibrationState)
            {
            case VibrationState.Off: return(VibrationStateType.Off);

            case VibrationState.On: return(VibrationStateType.On);

            case VibrationState.Invalid: return(VibrationStateType.Invalid);

            default: throw new ArgumentException($"Unknown VibrationState type: {cellPassEventVibrationState}");
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Records a change in the 'ICMode' flags from the compaction system. These flags also drive two
        /// other events: vibration events and automatics vibration events
        /// </summary>
        /// <param name="value"></param>
        protected override void SetICMode(byte value)
        {
            base.SetICMode(value);

            VibrationState     TempVibrationState     = VibrationState.Invalid;
            AutoVibrationState TempAutoVibrationState = AutoVibrationState.Unknown;

            if (_DataTime != Consts.MIN_DATETIME_AS_UTC)
            {
                switch (_ICSensorType)
                {
                case CompactionSensorType.Volkel:
                {
                    TempVibrationState = (value & ICModeFlags.IC_VOLKEL_SENSOR_VIBRATION_ON_MASK) == ICModeFlags.IC_VOLKEL_SENSOR_VIBRATION_ON_MASK ?
                                         VibrationState.On :
                                         VibrationState.Off;

                    TempAutoVibrationState = AutoVibrationState.Unknown;

                    break;
                }

                case CompactionSensorType.MC024:
                case CompactionSensorType.CATFactoryFitSensor:
                case CompactionSensorType.NoSensor:
                {
                    // Per TFS US 37212: Machines that do not report a compaction sensor type will
                    // report vibration state information directly from the machine ECM in the FLAGS TAG.
                    TempVibrationState     = (VibrationState)((value & ICModeFlags.IC_TEMPERATURE_VIBRATION_STATE_MASK) >> ICModeFlags.IC_TEMPERATURE_VIBRATION_STATE_SHIFT);
                    TempAutoVibrationState = (AutoVibrationState)(value & ICModeFlags.IC_TEMPERATURE_AUTO_VIBRATION_STATE_MASK);
                    break;
                }

                default:
                    throw new TRexTAGFileProcessingException($"Unknown sensor type: {(int)_ICSensorType}");
                }

                MachineTargetValueChangesAggregator.VibrationStateEvents.PutValueAtDate(_DataTime, TempVibrationState);
                MachineTargetValueChangesAggregator.AutoVibrationStateEvents.PutValueAtDate(_DataTime, TempAutoVibrationState);
                MachineTargetValueChangesAggregator.ICFlagsStateEvents.PutValueAtDate(_DataTime, value);
            }
            //else
            //{
            //{$IFDEF DENSE_TAG_FILE_LOGGING}
            //SIGLogProcessMessage.Publish(Self, '_DataTime = 0 in SetICMode',slpmcDebug);
            //{$ENDIF}
            //}
        }
Esempio n. 5
0
        public string FormatEventVibrationState(VibrationState value)
        {
            string result;

            switch (value)
            {
            case VibrationState.Off: result = "Off"; break;

            case VibrationState.On: result = "On"; break;

            case VibrationState.Invalid: result = "Not_Applicable"; break;

            default: result = $"unknown: {value}"; break;
            }

            return(result);
        }
Esempio n. 6
0
 /// <summary>
 /// Serializes content of the cell from the writer
 /// </summary>
 public void FromBinary(IBinaryRawReader reader)
 {
     EventElevationMappingMode = (ElevationMappingMode)reader.ReadByte();
     EventInAvoidZoneState     = reader.ReadByte();
     EventDesignNameID         = reader.ReadInt();
     EventVibrationState       = (VibrationState)reader.ReadByte();
     EventAutoVibrationState   = (AutoVibrationState)reader.ReadByte();
     EventMachineGear          = (MachineGear)reader.ReadByte();
     EventMachineRMVThreshold  = reader.ReadShort();
     EventMachineAutomatics    = (AutomaticsType)reader.ReadByte();
     PositioningTechnology     = (PositioningTech)reader.ReadByte();
     GPSTolerance          = (ushort)reader.ReadInt();
     GPSAccuracy           = (GPSAccuracy)reader.ReadByte();
     MapReset_PriorDate    = DateTime.FromBinary(reader.ReadLong());
     MapReset_DesignNameID = reader.ReadInt();
     LayerID    = (ushort)reader.ReadInt();
     EventFlags = reader.ReadByte();
 }
Esempio n. 7
0
        public void Clear()
        {
            EventDesignNameID       = NoDesignNameID;
            EventVibrationState     = VibrationState.Invalid;
            EventAutoVibrationState = AutoVibrationState.Unknown;
            EventFlags                = 0;
            EventMachineGear          = MachineGear.Neutral;
            EventMachineRMVThreshold  = CellPassConsts.NullRMV;
            EventMachineAutomatics    = AutomaticsType.Unknown;
            EventElevationMappingMode = ElevationMappingMode.LatestElevation;
            EventInAvoidZoneState     = 0;

            MapReset_PriorDate    = CellPassConsts.NullTime;
            MapReset_DesignNameID = NoDesignNameID;

            GPSAccuracy           = GPSAccuracy.Unknown;
            GPSTolerance          = CellPassConsts.NullGPSTolerance;
            PositioningTechnology = PositioningTech.Unknown;

            LayerID = NullLayerID;
        }
Esempio n. 8
0
        /// <summary>
        /// Assign the contents of one Cell Events instance to this instance
        /// </summary>
        /// <param name="source"></param>
        public void Assign(CellEvents source)
        {
            EventDesignNameID       = source.EventDesignNameID;
            EventVibrationState     = source.EventVibrationState;
            EventAutoVibrationState = source.EventAutoVibrationState;
            EventFlags                = source.EventFlags;
            EventMachineGear          = source.EventMachineGear;
            EventMachineRMVThreshold  = source.EventMachineRMVThreshold;
            EventMachineAutomatics    = source.EventMachineAutomatics;
            EventElevationMappingMode = source.EventElevationMappingMode;
            EventInAvoidZoneState     = source.EventInAvoidZoneState;

            MapReset_PriorDate    = source.MapReset_PriorDate;
            MapReset_DesignNameID = source.MapReset_DesignNameID;

            GPSAccuracy           = source.GPSAccuracy;
            GPSTolerance          = source.GPSTolerance;
            PositioningTechnology = source.PositioningTechnology;

            LayerID = source.LayerID;
        }
Esempio n. 9
0
        private string FormatADataRow(ClientCellProfileLeafSubgridRecord cell, double easting, double northing, int runningIndexLLHCoords)
        {
            var resultString = new StringBuilder();

            if (!cell.LastPassTime.Equals(_runningLastPassTime))
            {
                _cellPassTimeString  = _csvExportFormatter.FormatCellPassTime(cell.LastPassTime);
                _runningLastPassTime = cell.LastPassTime;
            }
            resultString.Append($"{_cellPassTimeString},");

            if (!(_runningNorthing.Equals(northing) && _runningEasting.Equals(easting)))
            {
                _coordString     = FormatCoordinate(northing, easting, runningIndexLLHCoords);
                _runningNorthing = northing;
                _runningEasting  = easting;
            }
            resultString.Append($"{_coordString},");

            if (!cell.Height.Equals(_runningHeight))
            {
                _heightString  = _csvExportFormatter.FormatElevation(cell.Height);
                _runningHeight = cell.Height;
            }
            resultString.Append($"{_heightString},");

            resultString.Append($"{cell.PassCount},");

            var lastPassValidRadioLatencyString = _csvExportFormatter.FormatRadioLatency(cell.LastPassValidRadioLatency);

            resultString.Append($"{lastPassValidRadioLatencyString},");

            if (!cell.EventDesignNameID.Equals(_runningDesignNameId))
            {
                _lastDesignNameString = FormatDesignNameID(cell.EventDesignNameID);
                _runningDesignNameId  = cell.EventDesignNameID;
            }
            resultString.Append($"{_lastDesignNameString},");

            if (!cell.InternalSiteModelMachineIndex.Equals(_runningMachineId))
            {
                _lastMachineNameString = FormatMachineName(cell.InternalSiteModelMachineIndex);
                _runningMachineId      = cell.InternalSiteModelMachineIndex;
            }
            resultString.Append($"{_lastMachineNameString},");

            if (!cell.MachineSpeed.Equals(_runningMachineSpeed))
            {
                _machineSpeedString  = _csvExportFormatter.FormatSpeed(cell.MachineSpeed);
                _runningMachineSpeed = cell.MachineSpeed;
            }
            resultString.Append($"{_machineSpeedString},");

            if (!cell.LastPassValidGPSMode.Equals(_runningGpsMode))
            {
                _gpsModeString  = _csvExportFormatter.FormatGPSMode(cell.LastPassValidGPSMode);
                _runningGpsMode = cell.LastPassValidGPSMode;
            }
            resultString.Append($"{_gpsModeString},");

            if (!(cell.GPSAccuracy.Equals(_runningGpsAccuracy) && cell.GPSTolerance.Equals(_runningGpsTolerance)))
            {
                _gpsAccuracyToleranceString = _csvExportFormatter.FormatGPSAccuracy(cell.GPSAccuracy, cell.GPSTolerance);
                _runningGpsAccuracy         = cell.GPSAccuracy;
                _runningGpsTolerance        = cell.GPSTolerance;
            }
            resultString.Append($"{_gpsAccuracyToleranceString},");

            if (!cell.TargetPassCount.Equals(_runningTargetPassCount))
            {
                _targetPassCountString  = _csvExportFormatter.FormatPassCount(cell.TargetPassCount);
                _runningTargetPassCount = cell.TargetPassCount;
            }
            resultString.Append($"{_targetPassCountString},");

            resultString.Append($"{cell.TotalWholePasses},");

            resultString.Append($"{cell.LayersCount},"); // for cellPasses this contains layerID

            if (!cell.LastPassValidCCV.Equals(_runningLastPassValidCcv))
            {
                _lastPassValidCcvString  = _csvExportFormatter.FormatCompactionCCVTypes(cell.LastPassValidCCV);
                _runningLastPassValidCcv = cell.LastPassValidCCV;
            }
            resultString.Append($"{_lastPassValidCcvString},");

            if (!cell.TargetCCV.Equals(_runningTargetCcv))
            {
                _lastTargetCcvString = _csvExportFormatter.FormatCompactionCCVTypes(cell.TargetCCV);
                _runningTargetCcv    = cell.TargetCCV;
            }
            resultString.Append($"{_lastTargetCcvString},");

            if (!cell.LastPassValidMDP.Equals(_runningLastPassValidMdp))
            {
                _lastPassValidMdpString  = _csvExportFormatter.FormatCompactionCCVTypes(cell.LastPassValidMDP);
                _runningLastPassValidMdp = cell.LastPassValidMDP;
            }
            resultString.Append($"{_lastPassValidMdpString},");

            if (!cell.TargetMDP.Equals(_runningTargetMdp))
            {
                _lastTargetMdpString = _csvExportFormatter.FormatCompactionCCVTypes(cell.TargetMDP);
                _runningTargetMdp    = cell.TargetMDP;
            }
            resultString.Append($"{_lastTargetMdpString},");

            if (!cell.LastPassValidRMV.Equals(_runningValidRmv))
            {
                _lastValidRmvString = _csvExportFormatter.FormatCompactionCCVTypes(cell.LastPassValidRMV);
                _runningValidRmv    = cell.LastPassValidRMV;
            }
            resultString.Append($"{_lastValidRmvString},");

            if (!cell.LastPassValidFreq.Equals(_runningValidFreq))
            {
                _lastValidFreqString = _csvExportFormatter.FormatFrequency(cell.LastPassValidFreq);
                _runningValidFreq    = cell.LastPassValidFreq;
            }
            resultString.Append($"{_lastValidFreqString},");

            if (!cell.LastPassValidAmp.Equals(_runningValidAmp))
            {
                _lastValidAmpString = _csvExportFormatter.FormatAmplitude(cell.LastPassValidAmp);
                _runningValidAmp    = cell.LastPassValidAmp;
            }
            resultString.Append($"{_lastValidAmpString},");

            if (!cell.TargetThickness.Equals(_runningTargetThickness))
            {
                _lastTargetThicknessString = _csvExportFormatter.FormatTargetThickness(cell.TargetThickness);
                _runningTargetThickness    = cell.TargetThickness;
            }
            resultString.Append($"{_lastTargetThicknessString},");

            if (!cell.EventMachineGear.Equals(_runningEventMachineGear))
            {
                _lastEventMachineGearString = _csvExportFormatter.FormatMachineGearValue(cell.EventMachineGear);
                _runningEventMachineGear    = cell.EventMachineGear;
            }
            resultString.Append($"{_lastEventMachineGearString},");

            if (!cell.EventVibrationState.Equals(_runningEventVibrationState))
            {
                _lastEventVibrationStateString = _csvExportFormatter.FormatEventVibrationState(cell.EventVibrationState);
                _runningEventVibrationState    = cell.EventVibrationState;
            }
            resultString.Append($"{_lastEventVibrationStateString},");

            if (!cell.LastPassValidTemperature.Equals(_runningLastPassValidTemperature))
            {
                _lastPassValidTemperatureString  = _csvExportFormatter.FormatLastPassValidTemperature(cell.LastPassValidTemperature);
                _runningLastPassValidTemperature = cell.LastPassValidTemperature;
            }
            resultString.Append($"{_lastPassValidTemperatureString}"); // no training comma

            return(resultString.ToString());
        }
Esempio n. 10
0
 public static bool Equals(VibrationState x, VibrationState y) => x == y;
Esempio n. 11
0
        public void Initialise(IFilteredValuePopulationControl populationControl)
        {
            TrackingUseMachineRMVThreshold   = false;
            TrackingOverrideRMVJumpThreshold = CellPassConsts.NullRMV;

            if (populationControl.WantsTargetCCVValues)
            {
                TargetCCV          = CellPassConsts.NullCCV;
                TargetCCV_Tracking = new SiteModelMachineTargetValueTrackingState <short>(MachineTargetValues, ProductionEventType.TargetCCV);
            }

            if (populationControl.WantsTargetMDPValues)
            {
                TargetMDP          = CellPassConsts.NullMDP;
                TargetMDP_Tracking = new SiteModelMachineTargetValueTrackingState <short>(MachineTargetValues, ProductionEventType.TargetMDP);
            }

            if (populationControl.WantsTargetCCAValues)
            {
                TargetCCA          = CellPassConsts.NullCCA;
                TargetCCA_Tracking = new SiteModelMachineTargetValueTrackingState <byte>(MachineTargetValues, ProductionEventType.TargetCCA);
            }

            if (populationControl.WantsTargetPassCountValues)
            {
                TargetPassCount          = 0; // kICNullPassCountValue;
                TargetPassCount_Tracking = new SiteModelMachineTargetValueTrackingState <ushort>(MachineTargetValues, ProductionEventType.TargetPassCount);
            }

            if (populationControl.WantsTargetLiftThicknessValues)
            {
                TargetLiftThickness          = CellPassConsts.NullHeight;
                TargetLiftThickness_Tracking = new SiteModelMachineTargetValueTrackingState <float>(MachineTargetValues, ProductionEventType.TargetLiftThickness);
            }

            /* TODO map reset events not included
             * if (populationControl.WantsEventMapResetValues)
             * {
             * EventMapResetPriorDate = 0;
             * EventMapResetDesignID = kNoDesignNameID;
             * EventMapReset_Tracking.Initialise();
             * }
             */

            if (populationControl.WantsEventDesignNameValues)
            {
                EventDesignNameID          = Consts.kNoDesignNameID;
                EventDesignNameID_Tracking = new SiteModelMachineTargetValueTrackingState <int>(MachineTargetValues, ProductionEventType.DesignChange);
            }

            if (populationControl.WantsEventVibrationStateValues)
            {
                EventVibrationState          = VibrationState.Invalid;
                EventVibrationState_Tracking = new SiteModelMachineTargetValueTrackingState <VibrationState>(MachineTargetValues, ProductionEventType.VibrationStateChange);
            }

            if (populationControl.WantsEventAutoVibrationStateValues)
            {
                EventAutoVibrationState          = AutoVibrationState.Unknown;
                EventAutoVibrationState_Tracking = new SiteModelMachineTargetValueTrackingState <AutoVibrationState>(MachineTargetValues, ProductionEventType.AutoVibrationStateChange);
            }

            if (populationControl.WantsEventElevationMappingModeValues)
            {
                ElevationMappingModeState          = ElevationMappingMode.LatestElevation;
                ElevationMappingModeState_Tracking = new SiteModelMachineTargetValueTrackingState <ElevationMappingMode>(MachineTargetValues, ProductionEventType.ElevationMappingModeStateChange);
            }

            if (populationControl.WantsEventICFlagsValues)
            {
                EventICFlag          = 0;
                EventICFlag_Tracking = new SiteModelMachineTargetValueTrackingState <byte>(MachineTargetValues, ProductionEventType.ICFlagsChange);
            }

            if (populationControl.WantsEventMachineGearValues)
            {
                EventMachineGear          = MachineGear.Null;
                EventMachineGear_Tracking = new SiteModelMachineTargetValueTrackingState <MachineGear>(MachineTargetValues, ProductionEventType.MachineGearChange);
            }

            if (populationControl.WantsEventMachineCompactionRMVJumpThreshold)
            {
                EventMachineRMVThreshold          = CellPassConsts.NullRMV;
                EventMachineRMVThreshold_Tracking = new SiteModelMachineTargetValueTrackingState <short>(MachineTargetValues, ProductionEventType.MachineRMVJumpValueChange);
            }

            if (populationControl.WantsEventMachineAutomaticsValues)
            {
                EventMachineAutomatics          = AutomaticsType.Unknown;
                EventMachineAutomatics_Tracking = new SiteModelMachineTargetValueTrackingState <AutomaticsType>(MachineTargetValues, ProductionEventType.MachineAutomaticsChange);
            }

            if (populationControl.WantsEventGPSAccuracyValues)
            {
                GPSAccuracyAndTolerance   = new GPSAccuracyAndTolerance(GPSAccuracy.Unknown, CellPassConsts.NullGPSTolerance);
                GPSAccuracyState_Tracking = new SiteModelMachineTargetValueTrackingState <GPSAccuracyAndTolerance>(MachineTargetValues, ProductionEventType.GPSAccuracyChange);
            }

            if (populationControl.WantsEventPositioningTechValues)
            {
                PositioningTechState          = PositioningTech.Unknown;
                PositioningTechState_Tracking = new SiteModelMachineTargetValueTrackingState <PositioningTech>(MachineTargetValues, ProductionEventType.PositioningTech);
            }

            if (populationControl.WantsTempWarningLevelMinValues)
            {
                TempWarningLevelMin          = CellPassConsts.NullMaterialTemperatureValue;
                TempWarningLevelMin_Tracking = new SiteModelMachineTargetValueTrackingState <ushort>(MachineTargetValues, ProductionEventType.TempWarningLevelMinChange);
            }

            if (populationControl.WantsTempWarningLevelMaxValues)
            {
                TempWarningLevelMax          = CellPassConsts.NullMaterialTemperatureValue;
                TempWarningLevelMax_Tracking = new SiteModelMachineTargetValueTrackingState <ushort>(MachineTargetValues, ProductionEventType.TempWarningLevelMaxChange);
            }

            if (populationControl.WantsLayerIDValues)
            {
                EventLayerID          = CellPassConsts.NullLayerID;
                EventLayerID_Tracking = new SiteModelMachineTargetValueTrackingState <ushort>(MachineTargetValues, ProductionEventType.LayerID);
            }
        }