Example #1
0
    private void connectContactsRealDo()
    {
        ChronopicRegisterPort crp = crpConnectContactsRealThread;

        string message   = "";
        bool   success   = false;
        bool   connected = false;

        if (cpDoing == 1)
        {
            LogB.Information("connectContactsRealDo() 1");
            sp            = new SerialPort(crp.Port);
            chronopicInit = new ChronopicInit();
            connected     = chronopicInit.Do(1, out cp, out sp,
                                             platformState, crp.Port, out message, out success);
        }
        else           //(cpDoing == 2)
        {
            LogB.Information("connectContactsRealDo() 2");
            sp2           = new SerialPort(crp.Port);
            chronopicInit = new ChronopicInit();
            connected     = chronopicInit.Do(2, out cp2, out sp2,
                                             platformState, crp.Port, out message, out success);
        }

        LogB.Information("Ended chronopicInit.Do()");

        if (connected)
        {
            assignLastConnectedVariables(crp);
        }

        SuccededConnectContactsRealThread = connected;
    }
Example #2
0
    private static Chronopic.Plataforma platformState;          //on (in platform), off (jumping), or unknow

    private void connectNormal(string myPort)
    {
        LogB.Debug("connectNormal start");

        chronopicInit = new ChronopicInit();

        string message = "";
        bool   success = false;

        connectedNormalChronopic = chronopicInit.Do(1, out cpDoing, out sp, platformState, myPort, out message, out success);
        LogB.Information(message);
        LogB.Debug("connectNormal end");
    }
Example #3
0
    public ChronopicWindow(Chronopic cpDetected, ArrayList myCpd)
    {
        LogB.Debug("constructor");

        Glade.XML gxml;
        gxml = Glade.XML.FromAssembly(Util.GetGladePath() + "chronojump.glade", "chronopic_window", "chronojump");
        gxml.Autoconnect(this);

        cpd = myCpd;

        if (cpDetected != null)
        {
            cp = cpDetected;
            sp = new SerialPort(((ChronopicPortData)cpd[0]).Port);
        }

        UtilGtk.IconWindow(chronopic_window);

        if (UtilAll.IsWindows())
        {
            isWindows = true;
        }
        else
        {
            isWindows = false;
        }

        setDefaultValues();

        chronopicInit = new ChronopicInit();

        //Pixbuf pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "chronopic_128.png");
        //chronopic_image.Pixbuf = pixbuf;

        /*
         * Pixbuf pixbuf;
         * pixbuf = new Pixbuf (null, Util.GetImagePath(true) + Constants.FileNameContactPlatformModular);
         * image_contact_modular.Pixbuf = pixbuf;
         * pixbuf = new Pixbuf (null, Util.GetImagePath(true) + Constants.FileNameInfrared);
         * image_infrared.Pixbuf = pixbuf;
         */

        /*
         * if(chronopicPort1 != Constants.ChronopicDefaultPortWindows &&
         *              (chronopicPort1 != Constants.ChronopicDefaultPortLinux && File.Exists(chronopicPort1))
         * ) {
         *      ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString("Do you want to connect to Chronopic now?"), "", "");
         *      confirmWin.Button_accept.Clicked += new EventHandler(chronopicAtStart);
         * }
         */
    }
Example #4
0
    private void connectContactsRealDo()
    {
        ChronopicRegisterPort crp = crpConnectContactsRealThread;

        string message = "";
        bool success = false;
        bool connected = false;

        if(cpDoing == 1)
        {
            sp = new SerialPort(crp.Port);
            chronopicInit = new ChronopicInit();
            connected = chronopicInit.Do(1, out cp, out sp,
                    platformState, crp.Port, out message, out success);
        } else //(cpDoing == 2)
        {
            sp2 = new SerialPort(crp.Port);
            chronopicInit = new ChronopicInit();
            connected = chronopicInit.Do(2, out cp2, out sp2,
                    platformState, crp.Port, out message, out success);
        }

        LogB.Information("Ended chronopicInit.Do()");

        if(connected) {
            lastConnectedRealPort = crp.Port;
            lastConnectedRealSerialNumber = crp.SerialNumber;
            lastConnectedRealType = ChronopicRegisterPort.Types.CONTACTS;
        }

        SuccededConnectContactsRealThread = connected;
    }
Example #5
0
    public ChronopicWindow(Chronopic cpDetected, ArrayList myCpd)
    {
        LogB.Debug("constructor");

        Glade.XML gxml;
        gxml = Glade.XML.FromAssembly (Util.GetGladePath() + "chronopic_window.glade", "chronopic_window", "chronojump");
        gxml.Autoconnect(this);

        cpd = myCpd;

        if(cpDetected != null) {
            cp = cpDetected;
            sp = new SerialPort( ((ChronopicPortData) cpd[0]).Port );
        }

        UtilGtk.IconWindow(chronopic_window);

        if(UtilAll.IsWindows())
            isWindows = true;
        else
            isWindows = false;

        setDefaultValues();

        chronopicInit = new ChronopicInit();

        //Pixbuf pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "chronopic_128.png");
        //chronopic_image.Pixbuf = pixbuf;
        /*
        Pixbuf pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(true) + Constants.FileNameContactPlatformModular);
        image_contact_modular.Pixbuf = pixbuf;
        pixbuf = new Pixbuf (null, Util.GetImagePath(true) + Constants.FileNameInfrared);
        image_infrared.Pixbuf = pixbuf;
        */

        /*
        if(chronopicPort1 != Constants.ChronopicDefaultPortWindows &&
                (chronopicPort1 != Constants.ChronopicDefaultPortLinux && File.Exists(chronopicPort1))
          ) {
            ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString("Do you want to connect to Chronopic now?"), "", "");
            confirmWin.Button_accept.Clicked += new EventHandler(chronopicAtStart);
        }
        */
    }