Пример #1
0
 public PineCog(PineDevice device, CogBytecode bytecode, int period)
     : base(device)
 {
     this.code = bytecode;
     _scriptName = "userscript";
     Init(device, period, code);
 }
Пример #2
0
 public PineBlender(PineDevice device, PineObject value, double factor, PineBlendTechnique factorType)
     : base(device)
 {
     _valueCalculated = value;
     _valueActual = value;
     _factor = factor;
     _type = factorType;
 }
Пример #3
0
 public PineSpring(PineDevice device, double value, double offset, double decayFactor, double stepFactor, double inertiaFactor)
     : base(device)
 {
     _offsetActual = offset;
     _offsetCalculated = 0;
     _valueActual = value;
     _valueCalculated = value;
     _decayFactor = decayFactor;
     _stepFactor = stepFactor;
     _inertia = inertiaFactor;
 }
Пример #4
0
 internal PineObject(PineDevice device)
 {
     if (device == null)
     {
         this.Enabled = true;
         this.Device = null;
     }
     else if (device.Add(this))
     {
         this.Enabled = true;
         this.Device = device;
     }
     else
     {
         throw new PineException("Maximum objects were exceeded for the selected device (" + device.MaxObjects + ").");
     }
 }
Пример #5
0
 private void Init(PineDevice device, int period, CogBytecode code)
 {
     if (period <= 0)
     {
         period = 1;
     }
     _period = period;
     _output = 0;
     _registers = new double[20];
     _timers = new CogTimer[NumTimers];
     msCode = new MemoryStream(code.CompiledCode);
     codeReader = new BinaryReader(msCode);
 }