public void LoadIni(string strName, string strIni)
 {
     m_nDelayTime         = AUtil.GetPrivateProfileInt(strName, "Delay", 200, strIni);
     m_stReadAddress.nDB  = AUtil.GetPrivateProfileInt(strName, "Read_DB", 100, strIni);
     m_stReadAddress.nDW  = AUtil.GetPrivateProfileInt(strName, "Read_DW", 0, strIni);
     m_stWriteAddress.nDB = AUtil.GetPrivateProfileInt(strName, "Write_DB", 101, strIni);
     m_stWriteAddress.nDW = AUtil.GetPrivateProfileInt(strName, "Write_DW", 0, strIni);
 }
Example #2
0
        public void LoadIni(string strName)
        {
            StringBuilder strIP = new StringBuilder(32);

            // 2020.04.23
            m_nLPort = AUtil.GetPrivateProfileInt(strName, "LPort", 1000, ASDef._INI_FILE);
            m_nRPort = AUtil.GetPrivateProfileInt(strName, "RPort", 1000, ASDef._INI_FILE);
        }
Example #3
0
        public void LoadIni(string strName)
        {
            StringBuilder strIP = new StringBuilder(32);

            AUtil.GetPrivateProfileString(strName, "IP", "127.0.0.1", strIP, 20, ASDef._INI_FILE);
            m_strIP = strIP.ToString();

            m_nPort = AUtil.GetPrivateProfileInt(strName, "Port", 1000, ASDef._INI_FILE);
        }
Example #4
0
        public void LoadIni(string strApp)
        {
            // 2011.05.24
            StringBuilder strTmp = new StringBuilder(32);

            AUtil.GetPrivateProfileString(strApp, "Port", "COM1", strTmp, 10, ASDef._INI_FILE);
            m_stCommCfg.strPort = strTmp.ToString();

            m_stCommCfg.nBaud = (int)AUtil.GetPrivateProfileInt(strApp, "Baud", 9600, ASDef._INI_FILE);

            AUtil.GetPrivateProfileString(strApp, "Parity", "N", strTmp, 10, ASDef._INI_FILE);
            switch (strTmp[0])
            {
            case 'N': m_stCommCfg.emParity = Parity.None; break;

            case 'E': m_stCommCfg.emParity = Parity.Even; break;

            case 'O': m_stCommCfg.emParity = Parity.Odd; break;
            }

            m_stCommCfg.nData = (int)AUtil.GetPrivateProfileInt(strApp, "Data", 8, ASDef._INI_FILE);

            int nStopBit = (int)AUtil.GetPrivateProfileInt(strApp, "Stop", 1, ASDef._INI_FILE);

            switch (nStopBit)
            {
            case 0: m_stCommCfg.emStop = StopBits.None; break;

            case 1: m_stCommCfg.emStop = StopBits.One; break;

            case 2: m_stCommCfg.emStop = StopBits.Two; break;
            }

            AUtil.GetPrivateProfileString(strApp, "HandShake", "N", strTmp, 10, ASDef._INI_FILE);
            switch (strTmp[0])
            {
            case 'N': m_stCommCfg.emHandshake = Handshake.None; break;

            case 'X': m_stCommCfg.emHandshake = Handshake.XOnXOff; break;

            case 'R': m_stCommCfg.emHandshake = Handshake.RequestToSend; break;

            case 'A': m_stCommCfg.emHandshake = Handshake.RequestToSendXOnXOff; break;
            }
        }
Example #5
0
        public void LoadIni(string strName, string strIni)
        {
            StringBuilder strBuilder = new StringBuilder(32);

            m_nDelayTime = AUtil.GetPrivateProfileInt(strName, "Delay", 200, strIni);
        }