Esempio n. 1
0
        public DetectorsStatusManager(DetectorsDataAccess dataAccess, EventLoggerAccess logger) :
            base(dataAccess, logger)
        {
            _logger = logger;
            Dictionary<int, string> ConnectionValueMapping = new Dictionary<int, string>();
            ConnectionValueMapping.Add(0, TagValueTypes.Error);
            ConnectionValueMapping.Add(1, TagValueTypes.Clear);

            StatusElement detectorConnect = new StatusElement(_DetectorConnectTag, 0, TagTypes.Status, ConnectionValueMapping);
            //detectorConnect.Value = 
            _Statuses.Add(detectorConnect);


            StatusElement apcsConnect = new StatusElement(_APCSConnectTag, 0, TagTypes.Status, ConnectionValueMapping);
            _Statuses.Add(apcsConnect);

            dataAccess.DetectorConnectionStateUpdate +=
                    new ConnectionStateChangeHandler(OnDetectorsConnectionChange);
            dataAccess.APCSConnectionStateUpdate +=
                    new ConnectionStateChangeHandler(OnApcsConnectionChange);

            Dictionary<int, string> DetectorsValueMapping = new Dictionary<int, string>();
            DetectorsValueMapping.Add(0, TagValueTypes.Clear);
            DetectorsValueMapping.Add(1, TagValueTypes.Warning);
            DetectorsValueMapping.Add(2, TagValueTypes.Error);
            DetectorsValueMapping.Add(3, TagValueTypes.Warning);

            StatusElement detectorStatus = new StatusElement(_DetectorStatusTag, 0, TagTypes.Status, DetectorsValueMapping);
            _Statuses.Add(detectorStatus);
        }
Esempio n. 2
0
 public void Add (StatusElement statusToAdd)
 {
     this.List.Add(statusToAdd);
 }
Esempio n. 3
0
 public void Remove (StatusElement statusToRemove)
 {
     this.List.Remove(statusToRemove);
 }
Esempio n. 4
0
        protected void ReadTagConfig ()
        {
            string tagGroup = ConfigurationManager.AppSettings["TagGroup"];
            foreach (OpcTagElement tagElement in DataAccess.OpcSection.Server.TagGroup.GetElement(tagGroup).Tags)
            {
                Dictionary<int, string> valueMapping = new Dictionary<int, string>();

                try
                {
                    foreach (OpcTagElement.OpcTagValueElement valueElement in tagElement.TagValues)
                    {
                        valueMapping.Add(valueElement.Value, valueElement.Type);
                    }

                    int value = DataAccess.GetTagValue(tagElement.Name);
                    StatusElement statusElement = new StatusElement(tagElement.Name, value, tagElement.Type, valueMapping);
                    lock (_StatusLock)
                    {
                        _Statuses.Add(statusElement);
                    }
                }
                catch
                {
                    StatusElement statusElement = new StatusElement(tagElement.Name, 0, tagElement.Type, valueMapping);
                    lock (_StatusLock)
                    {
                        _Statuses.Add(statusElement);
                    }
                }
            }
        }
Esempio n. 5
0
 public void Remove(StatusElement statusToRemove)
 {
     this.List.Remove(statusToRemove);
 }
Esempio n. 6
0
 public void Add(StatusElement statusToAdd)
 {
     this.List.Add(statusToAdd);
 }
Esempio n. 7
0
        private void InitializeLinacTags()
        {
            _Statuses = new StatusElements();
            int emptyVal = int.MinValue;
            StatusElement statusElement = new StatusElement(_GD_Cathode_V_Set, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_GD_CathodVoltageMonitor, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_GD_FilamentVMonitor, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_GD_FilamentIMon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_GD_Grid_A_V_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_GD_Grid_B_V_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_GD_Grid_Bias_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_GD_Beam_I_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_GD_State_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_MD_HVPSVoltage, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_MD_Filament_I_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_MD_Filament_V_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_Mod_State_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_Magnetron_I_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_Sol_I_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_Sol_V_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);


            statusElement = new StatusElement(_Steering_X_I_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_Steering_Y_I_Mon, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_IONPUMP_1_CURRENT, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_IONPUMP_2_CURRENT, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_IONPUMP_3_CURRENT, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_IONPUMP_1_VOLTAGE, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_IONPUMP_2_VOLTAGE, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_IONPUMP_3_VOLTAGE, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            //statusElement = new StatusElement(_TCU_TEMPERATURE, emptyVal, TagTypes.Information);
            //_Statuses.Add(statusElement);
            statusElement = new StatusElement(_REFLECTED_POWER, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_FORWARD_POWER, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_AFC_PV, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);
            statusElement = new StatusElement(_Stepper_PV, emptyVal, TagTypes.Information);
            _Statuses.Add(statusElement);

            Dictionary<int, string> valueMapping = new Dictionary<int, string>();
            valueMapping.Add(0, "Clear");
            valueMapping.Add(1, "Error");

            statusElement = new StatusElement(_MAGNETRON_CURRENT_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_REFLECTED_RF_POWER_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_WAVEGUIDE_ARC_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_SF6_PRESSURE_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_ENCLOSURE_PANELS_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_ACCELERATOR_VACUUM_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_MAGNETRON_VACUUM_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_SOLENOID_CURRENT_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_ACCELERATOR_FLOW_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_COOLANT_TEMPERATURE_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_ENCLOSURE_TEMPERATURE_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_GUN_DRIVER_INTERLOCK_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_MODULATOR_INTERLOCK_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_CUSTOMER_INTERLOCK1_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_CUSTOMER_INTERLOCK2_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_MODULATOR_COMMUNICATION_ERROR_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(_AFC_STEPPER_MOTOR_OUT_OF_BOUND_STATUS, 0, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            statusElement = new StatusElement(LINAC_ETHERNET_DISCONNECTED, 1, TagTypes.Status, valueMapping);
            _Statuses.Add(statusElement);

            ReadTagConfig();
        }
Esempio n. 8
0
 protected void ReadTagConfig()
 {
     string group = ConfigurationManager.AppSettings["TagGroup"];
     foreach (OpcTagElement tag in DataAccessReference.OpcSection.Server.TagGroup.GetElement(group).Tags)
     {
         Dictionary<int, string> map = new Dictionary<int, string>();
         try
         {
             foreach (OpcTagElement.OpcTagValueElement element in tag.TagValues)
                 map.Add(element.Value, element.Type);
             int value = DataAccessReference.GetTagValue(tag.Name);
             StatusElement status = new StatusElement(tag.Name, value, tag.Type, map);
             lock (_statusLock)
                 _statusElements.Add(status);
         }
         catch
         {
             StatusElement status = new StatusElement(tag.Name, 0, tag.Type, map);
             lock (_statusLock)
                 _statusElements.Add(status);
         }
     }
 }