Exemple #1
0
 static InternalStuff()
 {
     logMutex = new Mutex();
     InternalStuff.log("+---------------------+");
     InternalStuff.log("|       START         |");
     InternalStuff.log("+---------------------+");
     InternalStuff.log("DLL path is " + System.Reflection.Assembly.GetExecutingAssembly().Location);
     apiMutex = new Mutex();
 }
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YBluetoothLink hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering BluetoothLink callback");
     _func.registerValueCallback(valueChangeCallback);
 }
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YGroundSpeed hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering GroundSpeed callback");
     _func.registerValueCallback(valueChangeCallback);
 }
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YRealTimeClock hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering RealTimeClock callback");
     _func.registerValueCallback(valueChangeCallback);
 }
Exemple #5
0
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YWakeUpSchedule hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering WakeUpSchedule callback");
     _func.registerValueCallback(valueChangeCallback);
 }
Exemple #6
0
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YModule hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering Module callback");
     _func.registerBeaconCallback(beaconChangeCallback);
 }
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YSegmentedDisplay hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering SegmentedDisplay callback");
     _func.registerValueCallback(valueChangeCallback);
 }
Exemple #8
0
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YAccelerometer hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering Accelerometer callback");
     _func.registerValueCallback(valueChangeCallback);
 }
Exemple #9
0
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YMultiCellWeighScale hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering MultiCellWeighScale callback");
     _func.registerValueCallback(valueChangeCallback);
 }
Exemple #10
0
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YGenericSensor hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering GenericSensor callback");
     _func.registerValueCallback(valueChangeCallback);
 }
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YMultiAxisController hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering MultiAxisController callback");
     _func.registerValueCallback(valueChangeCallback);
 }
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YPowerSupply hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering PowerSupply callback");
     _func.registerValueCallback(valueChangeCallback);
 }
Exemple #13
0
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YCurrent hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering Current callback");
     _func.registerValueCallback(valueChangeCallback);
 }
Exemple #14
0
 // perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YQuadratureDecoder hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering QuadratureDecoder callback");
     _func.registerValueCallback(valueChangeCallback);
 }
        //--- (generated code: YFunction implementation)
        internal YFunctionProxy(YFunction hwd, string instantiationName)
        {
            InternalStuff.log("YFunction constructor for " + instantiationName);

            // integrity test
            FctCount++;
            _instanceId = FctCount;

            base_init(hwd, instantiationName);
            _allProxies.Add(this);
        }
Exemple #16
0
        public static string PreRegisterHub(string addr)
        {
            string errmsg = "";

            InternalStuff.initYoctopuceLibrary(ref errmsg, true);

            InternalStuff.log("Pre-registering Hub (" + addr + ") ...");
            if (YAPI.PreregisterHub(addr, ref errmsg) != YAPI.SUCCESS)
            {
                string msg = addr + " Hub  asynch registering failed (" + errmsg + ")";
                return(msg);
            }

            try { YAPI.UpdateDeviceList(ref errmsg); } catch (Exception) { }
            return("");
        }
Exemple #17
0
        public static void FreeLibrary()
        {
            InternalStuff.log("Freeing  Yoctopuce library");
            if (!LibraryAPIInitialized)
            {
                return;
            }

            // wait for the inner thread to stop;
            InnerThreadMustStop = true;
            int retries = 0;

            while (InnerThreadMustStop && retries < 50)
            {
                Thread.Sleep(100); retries++;
            }

            apiMutex.WaitOne();
            YAPI.FreeAPI();
            LibraryAPIInitialized = false;
            apiMutex.ReleaseMutex();
        }
Exemple #18
0
        //--- (end of YCurrent definitions)

        //--- (YCurrent implementation)
        internal YCurrentProxy(YCurrent hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("Current " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
        //--- (end of YAltitude definitions)

        //--- (YAltitude implementation)
        internal YAltitudeProxy(YAltitude hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("Altitude " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
        //--- (end of YTemperature definitions)

        //--- (YTemperature implementation)
        internal YTemperatureProxy(YTemperature hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("Temperature " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
Exemple #21
0
        //--- (end of YAccelerometer definitions)

        //--- (YAccelerometer implementation)
        internal YAccelerometerProxy(YAccelerometer hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("Accelerometer " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
        //--- (end of YMessageBox definitions)

        //--- (YMessageBox implementation)
        internal YMessageBoxProxy(YMessageBox hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("MessageBox " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
        //--- (end of YWakeUpMonitor definitions)

        //--- (YWakeUpMonitor implementation)
        internal YWakeUpMonitorProxy(YWakeUpMonitor hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("WakeUpMonitor " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
Exemple #24
0
        //--- (end of YPwmPowerSource definitions)

        //--- (YPwmPowerSource implementation)
        internal YPwmPowerSourceProxy(YPwmPowerSource hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("PwmPowerSource " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
        //--- (end of YPowerSupply definitions)

        //--- (YPowerSupply implementation)
        internal YPowerSupplyProxy(YPowerSupply hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("PowerSupply " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
        //--- (end of YPwmInput definitions)

        //--- (YPwmInput implementation)
        internal YPwmInputProxy(YPwmInput hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("PwmInput " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
        // property cache
        //--- (end of YVoc definitions)

        //--- (YVoc implementation)
        internal YVocProxy(YVoc hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("Voc " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
Exemple #28
0
        //--- (end of YDisplay definitions)

        //--- (YDisplay implementation)
        internal YDisplayProxy(YDisplay hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("Display " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
        // property cache
        //--- (end of YMultiAxisController definitions)

        //--- (YMultiAxisController implementation)
        internal YMultiAxisControllerProxy(YMultiAxisController hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("MultiAxisController " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }
Exemple #30
0
        //--- (end of YGenericSensor definitions)

        //--- (YGenericSensor implementation)
        internal YGenericSensorProxy(YGenericSensor hwd, string instantiationName) : base(hwd, instantiationName)
        {
            InternalStuff.log("GenericSensor " + instantiationName + " instantiation");
            base_init(hwd, instantiationName);
        }