Пример #1
0
        public NetworkSampler(Cardia cardia)
        {
            this.cardia = cardia;

            networkTimer.Interval = 1000;
            networkTimer.Elapsed += networkTimer_Elapsed;
        }
Пример #2
0
        public CardiaFrm(Cardia cardia)
        {
            this.cardia = cardia;

            InitializeComponent();

            cardia.StatusChanged    += cardia_StatusChanged;
            cardia.BundleChanged    += cardia_BundleChanged;
            cardia.ColorChanged     += cardia_ColorChanged;
            cardia.ChartTimeChanged += cardia_ChartTimeChanged;
            cardia.VolumeChanged    += cardia_VolumeChanged;
            cardia.PlayBeatChanged  += cardia_PlayBeatChanged;
            cardia.PlayAlarmChanged += cardia_PlayAlarmChanged;
            cardia.WidthChanged     += cardia_WidthChanged;
            cardia.LocationChanged  += cardia_LocationChanged;

            cardia.Started += cardia_Started;
            cardia.Stopped += cardia_Stopped;

            cardia.PacketProcessed += cardia_PacketProcessed;
            cardia.SignalGenerated += cardia_SignalGenerated;

            cardia.AlarmTripped += cardia_AlarmTripped;

            RegisterShrinkedWindowDrag();
            InitializeDevices();
            InitializeAlarmPanel();
            InitializeLogPanel();
            InitializeNetworkPanel();
            InitializeColors();
        }
Пример #3
0
        public NetworkFrm(Cardia cardia)
        {
            this.cardia = cardia;

            InitializeComponent();

            cardia.NetworkModeChanged   += cardia_NetworkModeChanged;
            cardia.NetworkStatusChenged += cardia_NetworkStatusChenged;
            cardia.NetworkRelayChanged  += cardia_NetworkRelayChanged;
        }
Пример #4
0
        static void Main()
        {
#if DEBUG
            logger.Info("Starting Cardia");
#endif

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Workaround for some Windows 10 versions
            CoInitializeSecurity(
                IntPtr.Zero,
                -1,
                IntPtr.Zero,
                IntPtr.Zero,
                RpcAuthnLevel.Default,
                RpcImpLevel.Identify,
                IntPtr.Zero,
                EoAuthnCap.None,
                IntPtr.Zero);

            Configuration configuration;
            try
            {
                configuration = Configuration.LoadFromFile(configurationFileName);
            }
            catch
            {
                configuration = new Configuration();
            }

            List <Bundle> bundles = buildBundles();
            Cardia        cardia  = new Cardia(configuration, bundles);

            /*if (DateTime.Today > cardia.ExpiryDate)
             * {
             *  MessageBox.Show("This development preview release has expired."\nPlease download a new release from http://www.altairgarden.it/", "Release expired", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             *  return;
             * }*/

            CardiaFrm cardiaFrm = new CardiaFrm(cardia);
            ECGSound  ecgSound  = new ECGSound(cardia);
            cardia.Init();

            Application.Run(cardiaFrm);

            ecgSound.Dispose();

            try
            {
                cardia.SaveConfig();
                configuration.SaveToFile(configurationFileName);
            }
            catch { }
        }
Пример #5
0
        public AlarmFrm(Cardia cardia)
        {
            this.cardia = cardia;

            InitializeComponent();

            cardia.AlarmEnabledChanged       += cardia_AlarmEnabledChanged;
            cardia.AlarmLowThresholdChanged  += cardia_AlarmLowThresholdChanged;
            cardia.AlarmHighThresholdChanged += cardia_AlarmHighThresholdChanged;
            cardia.AlarmDefuseChanged        += cardia_AlarmDefuseChanged;
            cardia.AlarmDefuseTimeChanged    += cardia_AlarmDefuseTimeChanged;
        }
Пример #6
0
        public ECGSound(Cardia cardia)
        {
            this.cardia = cardia;

            worker      = new Thread(DoWork);
            worker.Name = "ECG Sound Worker";
            worker.Start();

            cardia.SignalGenerated  += cardia_SignalGenerated;
            cardia.AlarmTripped     += cardia_AlarmTripped;
            cardia.PlayBeatChanged  += cardia_PlayBeatChanged;
            cardia.PlayAlarmChanged += cardia_PlayAlarmChanged;
            cardia.VolumeChanged    += cardia_VolumeChanged;
        }
Пример #7
0
        public LogFrm(Cardia cardia)
        {
            this.cardia = cardia;

            InitializeComponent();

            cardia_LoggerChanged(this, cardia.LogFormat);

            cardia.LoggerChanged     += Cardia_LoggerChanged;
            cardia.LogEnabledChanged += cardia_LogEnabledChanged;
            cardia.LogFormatChanged  += cardia_LoggerChanged;

            cbLogEnable_CheckedChanged(this, null);
            rbLogCSV_CheckedChanged(this, null);
            rbLogXLSX_CheckedChanged(this, null);
            rbLogXML_CheckedChanged(this, null);
            rbLogUDP_CheckedChanged(this, null);
        }
Пример #8
0
 public void RegisterCardiaEventHandlers(Cardia cardia)
 {
     cardia.Started += Cardia_Started;
     cardia.Stopped += Cardia_Stopped;
 }