Ejemplo n.º 1
0
        public Home()
        {
            InitializeComponent();
            List <ConfigMqtt> itens = DatabaseManipulation.DBConfigMqtt();

            mqttConnectionShutter            = new MQTTConnection();
            mqttConnectionAH                 = new MQTTConnection();
            mqttConnectionH                  = new MQTTConnection();
            mqttConnectionAzm                = new MQTTConnection();
            mqttConnectionSinc               = new MQTTConnection();
            mqttConnectionCmdExterno         = new MQTTConnection();
            mqttConnectioninfoTrapeira       = new MQTTConnection();
            mqttConnectioninfoAzmDomo        = new MQTTConnection();
            mqttConnectioninfoPosHome        = new MQTTConnection();
            mqttConnectioninfoPosPark        = new MQTTConnection();
            mqttConnectioninfoResolucao      = new MQTTConnection();
            mqttConnectioninfoSincTelescopio = new MQTTConnection();
            mqttConnectioninfoPosTelescopio  = new MQTTConnection();
            mqttConnectioninfoVelDomo        = new MQTTConnection();



            brokerConfig = itens[0].valor;
            mqttPort     = int.Parse(itens[1].valor);

            strCfgShutter     = itens[2].valor;
            strCfgAH          = itens[3].valor;
            strCfgH           = itens[4].valor;
            strCfgAzm         = itens[5].valor;
            strCfgSinc        = itens[6].valor;
            strCfgCmdExterno  = itens[7].valor;
            strCfgInfoTpr     = itens[8].valor;
            strCfgInfoAzm     = itens[9].valor;
            strCfgInfoHome    = itens[10].valor;
            strCfgInfoPark    = itens[11].valor;
            strCfgInfoResol   = itens[12].valor;
            strCfgInfoSinc    = itens[13].valor;
            strCfgInfoPos     = itens[14].valor;
            strCfgInfoVelDomo = itens[15].valor;


            mqttConnectionShutter.StartConnection(brokerConfig, mqttPort, strCfgShutter);
            mqttConnectionAH.StartConnection(brokerConfig, mqttPort, strCfgAH);
            mqttConnectionH.StartConnection(brokerConfig, mqttPort, strCfgH);
            mqttConnectionAzm.StartConnection(brokerConfig, mqttPort, strCfgAzm);
            mqttConnectionSinc.StartConnection(brokerConfig, mqttPort, strCfgSinc);

            mqttConnectionCmdExterno.StartConnection(brokerConfig, mqttPort, strCfgCmdExterno);
            mqttConnectioninfoTrapeira.StartConnection(brokerConfig, mqttPort, strCfgInfoTpr);
            mqttConnectioninfoAzmDomo.StartConnection(brokerConfig, mqttPort, strCfgInfoAzm);
            mqttConnectioninfoPosHome.StartConnection(brokerConfig, mqttPort, strCfgInfoHome);
            mqttConnectioninfoPosPark.StartConnection(brokerConfig, mqttPort, strCfgInfoPark);
            mqttConnectioninfoResolucao.StartConnection(brokerConfig, mqttPort, strCfgInfoResol);
            mqttConnectioninfoSincTelescopio.StartConnection(brokerConfig, mqttPort, strCfgInfoSinc);
            mqttConnectioninfoPosTelescopio.StartConnection(brokerConfig, mqttPort, strCfgInfoPos);
            mqttConnectioninfoVelDomo.StartConnection(brokerConfig, mqttPort, strCfgInfoVelDomo);
        }
        public ConfiguracaoAttrMQTT()
        {
            InitializeComponent();

            atual_config = DatabaseManipulation.DBConfigMqtt();
        }