ToString() public method

public ToString ( ) : string
return string
Ejemplo n.º 1
0
    private void createListDo(uint ftdiDeviceCount)
    {
        FTDI.FT_STATUS ftStatus = FTDI.FT_STATUS.FT_OK;

        // Allocate storage for device info list
        FTDI.FT_DEVICE_INFO_NODE[] ftdiDeviceList = new FTDI.FT_DEVICE_INFO_NODE[ftdiDeviceCount];

        // Populate our device list
        ftStatus = ftdiDeviceWin.GetDeviceList(ftdiDeviceList);

        if (ftStatus == FTDI.FT_STATUS.FT_OK)
        {
            for (uint i = 0; i < ftdiDeviceCount; i++)
            {
                LogB.Information(String.Format("Device Index: " + i.ToString()));
                LogB.Information(String.Format("Flags: " + String.Format("{0:x}", ftdiDeviceList[i].Flags)));
                LogB.Information(String.Format("Type: " + ftdiDeviceList[i].Type.ToString()));
                LogB.Information(String.Format("ID: " + String.Format("{0:x}", ftdiDeviceList[i].ID)));
                LogB.Information(String.Format("Location ID: " + String.Format("{0:x}", ftdiDeviceList[i].LocId)));
                LogB.Information(String.Format("Serial Number: " + ftdiDeviceList[i].SerialNumber.ToString()));
                LogB.Information(String.Format("Description: " + ftdiDeviceList[i].Description.ToString()));

                string port = getComPort(ftdiDeviceList[i]);
                ChronopicRegisterPort crp = new ChronopicRegisterPort(port);
                crp.FTDI         = true;
                crp.SerialNumber = ftdiDeviceList[i].SerialNumber.ToString();
                crp.Type         = ChronopicRegisterPort.Types.UNKNOWN;

                LogB.Information(string.Format("crp: " + crp.ToString()));

                registerAddOrUpdate(crp);
            }
        }
    }
Ejemplo n.º 2
0
    //used on Linux and Mac
    protected virtual void createList()
    {
        List <string> ports = getPorts(true);

        foreach (string p in ports)
        {
            LogB.Information(string.Format("ChronopicRegister for port: " + p));

            ChronopicRegisterPort crp = new ChronopicRegisterPort(p);
            crp = readFTDI(crp);

            LogB.Information(crp.ToString());

            //2 add/update registered list
            registerAddOrUpdate(crp);
        }
    }
Ejemplo n.º 3
0
    public static void Update(bool dbconOpened, ChronopicRegisterPort crp, ChronopicRegisterPort.Types newType)
    {
        openIfNeeded(dbconOpened);

        dbcmd.CommandText = "UPDATE " + table +
            " SET type = \"" + newType.ToString() +
            "\" WHERE serialNumber = \"" + crp.SerialNumber + "\"" ;
        LogB.SQL(dbcmd.CommandText.ToString());
        dbcmd.ExecuteNonQuery();

        closeIfNeeded(dbconOpened);
    }
Ejemplo n.º 4
0
    public bool IsLastConnectedReal(ChronopicRegisterPort crp)
    {
        LogB.Information(string.Format(
                    "lastConnectedReal (port:{0}, serialNumber:{1}, type:{2})",
                    lastConnectedRealPort, lastConnectedRealSerialNumber,
                    lastConnectedRealType.ToString()));
        LogB.Information(crp.ToString());

        if(lastConnectedRealPort != "" && lastConnectedRealSerialNumber != "" &&
                lastConnectedRealType == ChronopicRegisterPort.Types.CONTACTS &&
                crp.Port == lastConnectedRealPort &&
                crp.SerialNumber == lastConnectedRealSerialNumber)
            return true;

        return false;
    }
Ejemplo n.º 5
0
    private void createListDo(uint ftdiDeviceCount)
    {
        FTDI.FT_STATUS ftStatus = FTDI.FT_STATUS.FT_OK;

        // Allocate storage for device info list
        FTDI.FT_DEVICE_INFO_NODE[] ftdiDeviceList = new FTDI.FT_DEVICE_INFO_NODE[ftdiDeviceCount];

        // Populate our device list
        ftStatus = ftdiDeviceWin.GetDeviceList(ftdiDeviceList);

        if (ftStatus == FTDI.FT_STATUS.FT_OK)
        {
            for (uint i = 0; i < ftdiDeviceCount; i++)
            {
                LogB.Information(String.Format("Device Index: " + i.ToString()));
                LogB.Information(String.Format("Flags: " + String.Format("{0:x}", ftdiDeviceList[i].Flags)));
                LogB.Information(String.Format("Type: " + ftdiDeviceList[i].Type.ToString()));
                LogB.Information(String.Format("ID: " + String.Format("{0:x}", ftdiDeviceList[i].ID)));
                LogB.Information(String.Format("Location ID: " + String.Format("{0:x}", ftdiDeviceList[i].LocId)));
                LogB.Information(String.Format("Serial Number: " + ftdiDeviceList[i].SerialNumber.ToString()));
                LogB.Information(String.Format("Description: " + ftdiDeviceList[i].Description.ToString()));

                string port = getComPort(ftdiDeviceList[i]);
                ChronopicRegisterPort crp = new ChronopicRegisterPort(port);
                crp.FTDI = true;
                crp.SerialNumber = ftdiDeviceList[i].SerialNumber.ToString();
                crp.Type = ChronopicRegisterPort.Types.UNKNOWN;

                LogB.Information(string.Format("crp: " + crp.ToString()));

                registerAddOrUpdate(crp);
            }
        }
    }
Ejemplo n.º 6
0
    //used on Linux and Mac
    protected virtual void createList()
    {
        List<string> ports = getPorts(true);
        foreach(string p in ports)
        {
            LogB.Information(string.Format("ChronopicRegister for port: " + p));

            ChronopicRegisterPort crp = new ChronopicRegisterPort(p);
            crp = readFTDI(crp);

            LogB.Information(crp.ToString());

            //2 add/update registered list
            registerAddOrUpdate(crp);
        }
    }