Пример #1
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}
            //}
        }
Пример #2
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();
 }
Пример #3
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;
        }
Пример #4
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;
        }
Пример #5
0
 public static bool Equals(AutoVibrationState x, AutoVibrationState y) => x == y;
Пример #6
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);
            }
        }