Beispiel #1
0
        private Point _location;            // Position im Raum

        #endregion

        #region ----------------------------- Constructors & Finalizers ----------------------------

        /// <summary>
        /// initialisiert Device
        /// </summary>
        public Device(string code, DeviceControl deviceControl)
        {
            // Parameter initialisieren
            _code = code;

            // Device zu Deviceverwaltung hinzufügen
            _deviceControl = deviceControl;
            _deviceControl.AddDevice(this);
        }
Beispiel #2
0
        /// <summary>
        /// initialisiert Deviceseite
        /// </summary>
        public DevicePage(DeviceControl deviceControl)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // Deviceverwaltung referenzieren
            _deviceControl              = deviceControl;
            _deviceControl.OnAddDevice += new DeviceControl.DeviceEventHandler(
                _deviceControl_OnAddDevice);
            _deviceControl.OnRefreshDevice += new DeviceControl.DeviceEventHandler(
                _deviceControl_OnRefreshDevice);
            _deviceControl.OnRemoveDevice += new DeviceControl.DeviceEventHandler(
                _deviceControl_OnRemoveDevice);

            // Seitenmodus initialisieren
            this.Mode = PageMode.List;
        }
Beispiel #3
0
        /// <summary>
        /// schließt Device ab
        /// </summary>
        public void Terminate()
        {
            // wenn Frontend zugewiesen, Fehler werfen
            if (_frontend != null)
            {
                throw new Exception("Device is in use and cannot be removed.");
            }

            // wenn Raum zugewiesen, Zuweisung aufheben
            if (_site != null)
            {
                UnassignSite();
            }

            // Device aus Deviceverwaltung entfernen
            _deviceControl.RemoveDevice(this);
            _deviceControl = null;
        }
Beispiel #4
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            // Deviceverwaltung freigeben
            _deviceControl.OnAddDevice -= new DeviceControl.DeviceEventHandler(
                _deviceControl_OnAddDevice);
            _deviceControl.OnRefreshDevice -= new DeviceControl.DeviceEventHandler(
                _deviceControl_OnRefreshDevice);
            _deviceControl.OnRemoveDevice -= new DeviceControl.DeviceEventHandler(
                _deviceControl_OnRemoveDevice);
            _deviceControl = null;

            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }
        /// <summary>
        /// initialisiert Hauptobjekt
        /// </summary>
        public MainControl()
        {
            // Einstellungen initialisieren
            Settings.Initialize();

            // Assembly ermitteln
            Assembly assembly = Assembly.GetAssembly(this.GetType());

            // Protokoll initialisieren
            Logger.Initialize(Tools.GetFileName(assembly), Settings.Instance.LogEnabled,
                              Settings.Instance.LogLevel);

            // Programmversion protokollieren
            Logger.Log.Info("[Info] -> " + Tools.GetFileName(assembly) + " " +
                            Tools.GetFileVersion(assembly));

            // Einstellungen protokollieren
            Logger.Log.Info("[Info] -> MonitorCode: " + Settings.Instance.MonitorCode +
                            ", RefreshInterval: " + Settings.Instance.RefreshInterval +
                            ", ChartHistoryLength: " + Settings.Instance.ChartHistoryLength +
                            ", DeviceCode: " + Settings.Instance.DeviceCode +
                            ", CoachingPermissionRequired: " + Settings.Instance.CoachingPermissionRequired +
                            ", AutoStopCoaching: " + Settings.Instance.AutoStopCoaching +
                            ", LogEnabled: " + Settings.Instance.LogEnabled +
                            ", LogLevel: " + Settings.Instance.LogLevel);

            // Objektverwaltung initialisieren
            _frontendControl   = new FrontendControl(this);
            _campaignControl   = new CampaignControl(this);
            _conferenceControl = new ConferenceControl(this);
            _siteControl       = new SiteControl(this);
            _deviceControl     = new DeviceControl(this);

            // Schnittstelle zum Dialer initialisieren
            _monitor = new Monitor();
            _monitor.OnAddFrontend += new Monitor.OnAddFrontendEventHandler(
                _monitor_OnAddFrontend);
            _monitor.OnRefreshFrontend += new Monitor.OnRefreshFrontendEventHandler(
                _monitor_OnRefreshFrontend);
            _monitor.OnRemoveFrontend += new Monitor.OnRemoveFrontendEventHandler(
                _monitor_OnRemoveFrontend);
            _monitor.OnAddCampaign += new Monitor.OnAddCampaignEventHandler(
                _monitor_OnAddCampaign);
            _monitor.OnRefreshCampaign += new Monitor.OnRefreshCampaignEventHandler(
                _monitor_OnRefreshCampaign);
            _monitor.OnRemoveCampaign += new Monitor.OnRemoveCampaignEventHandler(
                _monitor_OnRemoveCampaign);
            _monitor.OnAddConference += new Monitor.OnAddConferenceEventHandler(
                _monitor_OnAddConference);
            _monitor.OnRefreshConference += new Monitor.OnRefreshConferenceEventHandler(
                _monitor_OnRefreshConference);
            _monitor.OnRemoveConference += new Monitor.OnRemoveConferenceEventHandler(
                _monitor_OnRemoveConference);
            _monitor.OnAgentLost += new Monitor.OnAgentLostEventHandler(
                _monitor_OnAgentLost);
            _monitor.OnDeviceTerminated += new Monitor.OnDeviceTerminatedEventHandler(
                _monitor_OnDeviceTerminated);
            _monitor.OnConnectionLost += new Monitor.OnConnectionLostEventHandler(
                _monitor_OnConnectionLost);

            // Verbindung zum Dialer herstellen
            MonitorConnect();
            MonitorLogonDialer(Settings.Instance.MonitorCode, Settings.Instance.RefreshInterval);
        }
Beispiel #6
0
        /// <summary>
        /// aktualisiert Parameter
        /// </summary>
        public void RefreshParameters(itCampus.bb.Monitor.Frontend frontend)
        {
            // Parameter aktualisieren
            _remoteAddress      = frontend.RemoteAddress;
            _lastState          = _state;
            _state              = frontend.State;
            _lastStateChange    = frontend.LastStateChange;
            _agentCode          = frontend.AgentCode;
            _deviceCode         = frontend.DeviceCode;
            _campaignCode       = frontend.CampaignCode;
            _agentMode          = frontend.AgentMode;
            _coachingPermission = frontend.CoachingPermission;
            _monitorCode        = frontend.MonitorCode;
            _coachingMode       = frontend.CoachingMode;
            foreach (AgentState agentState in Enum.GetValues(typeof(AgentState)))
            {
                _agentStateTimeAvgTtl[(int)agentState] =
                    frontend.GetAgentStateTimeAvgTtl(agentState);
            }
            foreach (AgentState agentState in Enum.GetValues(typeof(AgentState)))
            {
                _agentStateTimeTtl[(int)agentState] =
                    frontend.GetAgentStateTimeTtl(agentState);
            }

            // wenn Device zugeordnet
            if (_device != null)
            {
                // wenn Devicecode übereinstimmt
                if (_device.Code == _deviceCode)
                {
                    // Device aktualisieren
                    _device.RefreshFrontend();
                }
                else
                {
                    // sonst Device freigeben
                    _device.UnassignFrontend();
                    _device = null;
                }
            }

            // wenn kein Device zugeordnet
            if (_device == null)
            {
                // wenn Devicecode angegeben
                if (_deviceCode != "")
                {
                    // Deviceverwaltung referenzieren
                    DeviceControl deviceControl = _frontendControl.MainControl.DeviceControl;

                    // Device suchen
                    _device = deviceControl[_deviceCode];

                    // wenn Device nicht gefunden, erzeugen
                    if (_device == null)
                    {
                        _device = new Device(_deviceCode, deviceControl);
                    }

                    // Device zuordnen
                    _device.AssignFrontend(this);
                }
            }

            // wenn Kampagne zugeordnet
            if (_campaign != null)
            {
                // wenn Kampagnencode nicht übereinstimmt, Kampagne freigeben
                if (_campaign.Code != _campaignCode)
                {
                    UnassignCampaign();
                }
            }

            // wenn keine Kampagne zugeordnet
            if (_campaign == null)
            {
                // wenn Kampagnencode angegeben
                if (_campaignCode != "")
                {
                    // Kampagnenverwaltung referenzieren
                    CampaignControl campaignControl = _frontendControl.MainControl.CampaignControl;

                    // Kampagne suchen
                    Campaign campaign = campaignControl.GetCampaign(_campaignCode);

                    // wenn Kampagne gefunden, zuordnen
                    if (campaign != null)
                    {
                        AssignCampaign(campaign);
                    }
                }
            }

            // Frontendverwaltung aktualisieren
            _frontendControl.RefreshFrontend(this);
        }