Пример #1
0
 public bool TryConnect()
 {
     _disconnecting = false;
     if (_connecting)
     {
         return(true);
     }
     _connecting = true;
     try
     {
         DeviceInterface deviceInterface = FindDevice();
         if (deviceInterface == null)
         {
             return(false);
         }
         Thread.Sleep(500);
         _deviceInterfaceFile = deviceInterface.OpenFile(PacketSize);
         var caps = _deviceInterfaceFile.Capabilities;
         _log.Debug("InputReportByteLength: " + caps.InputReportByteLength);
         _log.Debug("OutputReportByteLength: " + caps.NumberOutputDataIndices);
         _log.Debug("OutputReportByteLength: " + caps.OutputReportByteLength);
         BeginAsyncRead();
         ReadDeviceInfo();
         ReadAudioPatterns();
         ReadLedPatterns();
         OnConnected();
         return(true);
     }
     finally
     {
         _connecting = false;
     }
 }
Пример #2
0
        public override void TurnOff(DeviceInterface type)
        {
            if (IsOn())
            {
                switch (type)
                {
                case DeviceInterface.IR:

                    RemoteCommand rc = GetRemoteCommandFromString("Power (IR)");

                    try
                    {
                        IrToy.Send(rc.IrCode);
                    }
                    catch (Exception ex)
                    {
                        Log.Error("Auto3D: IR Toy Send failed: " + ex.Message);
                    }
                    break;

                case DeviceInterface.Network:

                    SendCommand(new RemoteCommand("Off", 0, null));
                    break;
                }
            }
            else
            {
                Log.Debug("Auto3D: TV is already off");
            }
        }
Пример #3
0
        bool ProcessCalibrationNoAttenuator(UInt16 nCaptureDelay = 0)
        {
            if (!DeviceInterface.IsPortOpen())
            {
                LOGWarning("Port not open, i try to autodetect analyzer");
                AutoDetectSerialPort();
            }

            if (DeviceInterface.GetDevice().HaveLogDetector)
            {
                LOGDraw("Calibration in progress using logarithmic detector..", true);
                DeviceInterface.RunCalibration(MyNotifier, 9999, false);
            }

            if (DeviceInterface.GetDevice().HaveLinDetector)
            {
                LOGDraw("Calibration in progress using linear detector..", true);
                DeviceInterface.RunCalibration(MyNotifier, 9999, true);
            }

            DeviceInterface.SaveCalibration(Program.CalibrationPath);
            bCalibrationAvailable = true;

            LOGDraw("done.");
            return(true);
        }
Пример #4
0
        protected virtual void InitializeEnvironment(CommonDeviceInterface cdi, HashTableSettings localSettings)
        {
            // Get device settings
            if (outCaps == null)
            {
                outCaps = GraphicsDeviceCaps.GetDefaultAdapterCaps(outProfile.RecommendedVariations[0]);
            }
            // find first recommended settings with full match
            bool fullMatch = false;

            outSettings = GraphicsDeviceSettings.CreateFromRequirements(outProfile.RecommendedVariation,
                                                                        outCaps, outProfile.MinReqs,
                                                                        out fullMatch);

            // Set up the presentation parameters
            presentParams.Windowed               = outProfile.RecommendedVariations[0].Windowed;
            presentParams.SwapEffect             = SwapEffect.Discard;
            presentParams.AutoDepthStencilFormat = outSettings.DepthFormat;
            presentParams.EnableAutoDepthStencil = (outSettings.DepthFormat != DepthFormat.Unknown);
            presentParams.MultiSample            = outSettings.MultiSample;

            CreateDevice();

            devIf = new DeviceInterface(gDevice, cdi, localSettings);

            gPipeline = new GraphicsPipeline(gDevice);
        }
Пример #5
0
        private void btnInterface_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();

            dt.Clear();

            CreateInterfaceTable(ref dt);

            for (int i = 0; i < responseParser.InterfaceList.Count; i++)
            {
                DeviceInterface item = responseParser.InterfaceList[i];

                DataRow _dataRow = dt.NewRow();

                _dataRow["IfDescr"] = item.IfDescr;

                _dataRow["IfType"] = item.IfType.HasValue ? item.IfType : default(int);

                _dataRow["IfMtu"] = item.IfMtu.HasValue ? item.IfMtu : default(int);

                _dataRow["IfSpeed"] = item.IfSpeed.HasValue ? item.IfSpeed : default(decimal);

                _dataRow["IfPhysAddress"] = item.IfPhysAddress;

                dt.Rows.Add(_dataRow);
            }

            DataForm dataForm = new DataForm();

            dataForm.ValidatedGrid.DataSource = dt;
            if (dataForm.ShowDialog() == DialogResult.OK)
            {
                dt.Clear();
            }
        }
Пример #6
0
        public override void TurnOn(DeviceInterface type)
        {
            if (!IsOn())
            {
                switch (type)
                {
                case DeviceInterface.IR:

                    RemoteCommand rc = GetRemoteCommandFromString("Power (IR)");

                    try
                    {
                        IrToy.Send(rc.IrCode);
                    }
                    catch (Exception ex)
                    {
                        Log.Error("Auto3D: IR Toy Send failed: " + ex.Message);
                    }
                    break;

                case DeviceInterface.Network:

                    Auto3DHelpers.WakeOnLan(MAC);
                    break;

                default:

                    break;
                }
            }
            else
            {
                Log.Debug("Auto3D: TV is already off");
            }
        }
Пример #7
0
        /// <summary>
        /// 更新设备接口
        /// </summary>
        /// <param name="model">设备接口对象</param>
        /// <returns>返回处理结果</returns>
        public CommonResult <DeviceInterface> UpdateDeviceInterface(DeviceInterface model)
        {
            var result = new CommonResult <DeviceInterface>();

            try
            {
                CheckDeviceInterface(model, result);
                if (result.IsSuccess)
                {
                    var dbSession = new DBService <DeviceInterface>().DbSession;
                    if (dbSession.GetQueryable(t => t.DeviCode == model.DeviCode && t.DevCode == model.DevCode).FirstOrDefault() == null)
                    {
                        result.IsSuccess = false;
                        result.Message   = "设备编码不存在!";
                    }
                    else
                    {
                        result.Data = dbSession.Update(model);
                    }
                }
            }
            catch (Exception ex)
            {
                Utils.Logger.Error(ex.Message);
                throw ex;
            }
            return(result);
        }
Пример #8
0
        public override void TurnOn(DeviceInterface type)
        {
            switch (type)
            {
            case Devices.DeviceInterface.IR:

                RemoteCommand rc = GetRemoteCommandFromString("Power (IR)");

                try
                {
                    IrToy.Send(rc.IrCode);
                }
                catch (Exception ex)
                {
                    Log.Error("Auto3D: IR Toy Send failed: " + ex.Message);
                }
                break;

            case DeviceInterface.Network:

                SendCommand(new RemoteCommand("On", 0, null));
                break;

            default:

                // error
                break;
            }
        }
Пример #9
0
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
            base.Init(devIf, sManager);

            ray    = new CustomVertex.PositionColored[2];
            ray[0] = new CustomVertex.PositionColored(start, Color.Red.ToArgb());
            ray[1] = new CustomVertex.PositionColored(end, Color.Red.ToArgb());
        }
Пример #10
0
 /// <summary>
 /// Encapsulates a layer attached to a loading thread
 /// </summary>
 /// <param name="devIf"></param>
 /// <param name="position"></param>
 /// <param name="dimensions"></param>
 /// <param name="id"></param>
 /// <param name="dependants"></param>
 /// <param name="dependancies"></param>
 public LoadingLayer(DeviceInterface devIf, Point position, Size dimensions, string id, IResource[] dependants,
                     ISharableResource[] dependancies)
     : base(devIf, position, dimensions, id, dependants, dependancies)
 {
     AddItem(LayoutManager.AlignItem(progressBar = new GUIProgressBar(new Point(0, 0), new Size(200, 20), Color.Blue),
                                     LayoutRules.Positioning.Center, LayoutRules.Positioning.Center));
     progressBar.Progress = 0;
 }
Пример #11
0
        private void btnRun_Click(object sender, RoutedEventArgs e)
        {
            List <Device> devices = currentConfig.devices;

            di = new DeviceInterface(currentConfig.tftpIP,
                                     currentConfig.tftpDIR, currentConfig.cmd);
            di.RunCommands(devices);
        }
 // maybe have something for device tilt calibrations
 // Check if it's phone/kayboard
 // Think the GUI controls should be routed through here as well??? Maybe not due to the GUI callback method
 void Awake()
 {
     Screen.sleepTimeout = (int)SleepTimeout.NeverSleep;
     if (Instance != null)
     {
         Debug.LogError("Multiple instances of DeviceInterface!");
     }
     Instance = this;
 }
Пример #13
0
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
            gDevice = devIf.Device;

            // create font
            font = new Font(gDevice, fontSize, 0, fontWeight, 1, false,
                            CharacterSet.Ansi, Precision.Default, FontQuality.ClearType,
                            PitchAndFamily.DefaultPitch, fontFace);
            MeasureText();
        }
Пример #14
0
        /// <summary>
        /// 连接设备
        /// </summary>
        /// <param name="sIP">设备IP</param>
        /// <returns></returns>
        public bool ConnectCamera(string sIP, IntPtr UserHandle)
        {
            try
            {
                StringBuilder strIP = new StringBuilder(sIP);
                pHandle = IntPtr.Zero;
                Ip      = sIP;
                uint uRes = DeviceInterface.HWTC_ConnectCamera(strIP, ref pHandle);
                if ((DeviceInterface.FEEKBACK_TYPE)uRes == DeviceInterface.FEEKBACK_TYPE.RESULT_OK)
                {
                    DeviceInterface.HWTC_RecordLog(false);
                    DeviceInterface.HWTC_SetRecRealtimeDataMode(pHandle, IntPtr.Zero, RealdataFuc, UserHandle, 0, 0);
                    //设置事件
                    DeviceInterface.HWTC_RegStatusCallback(pHandle, IntPtr.Zero, DeviceStatusFuc, NetStatusFuc, RunStatusFuc);
                    AddDeviceInfo Info = new AddDeviceInfo();
                    Info.intCameraIP         = Until.IP2Int(sIP);
                    Info.ptrCameraHandle     = pHandle;
                    Info.u32ArmBootTime      = 0;
                    Info.u32DspBootTime      = 0;
                    Info.u32DspBootCnt       = 0;
                    Info.ptrCamControlHandle = IntPtr.Zero;
                    Info.OnReadSuccess       = this.OnActionReadSuccess;
                    Info.OnScanError         = this.OnActionScanError;
                    Info.OnStatusChange      = this.OnActionStatusChange;

                    if (ForGlobal.g_DeviceTable[sIP] == null)
                    {
                        ForGlobal.g_DeviceTable.Add(sIP, Info);
                    }
                    if (OnActionStatusChange != null)
                    {
                        OnActionStatusChange(true);
                    }
                    return(true);
                }
                else
                {
                    ErrorStr = uRes.ToString();
                    if (OnActionStatusChange != null)
                    {
                        OnActionStatusChange(false);
                    }
                    return(false);
                }
            }
            catch (Exception)
            {
                if (OnActionStatusChange != null)
                {
                    OnActionStatusChange(false);
                }
            }
            return(false);
        }
Пример #15
0
 public DeviceModel(string brandParam,
                    string modelParam,
                    DeviceInterface interfaceParam,
                    DeviceCmdFrame frameParam)
 {
     Channels  = new List <ChannelModel>();
     Brand     = brandParam;
     Model     = modelParam;
     Interface = interfaceParam;
     Frame     = frameParam;
 }
Пример #16
0
 public SimpleGUILayer(DeviceInterface devIf, Point position, Size dimensions)
 {
     this.devIf          = devIf;
     device              = devIf.Device;
     this.position       = position;
     this.dimensions     = dimensions;
     enabled             = true;
     visible             = true;
     itemsList           = new List <GUILayerItem>();
     itemsLayout         = new QuadTree <GUILayerItem>(dimensions.Width, dimensions.Height);
     checkedOutResources = new List <ISharableResource>();
     layoutManager       = new LayoutManager();
 }
Пример #17
0
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
            // init line
            line           = new Line(devIf.Device);
            line.Antialias = true;
            line.Width     = 2;

            linePoints = new Vector2[2];

            // init text
            distanceText = new ScreenSpaceText(".m", Color.Yellow, "Tahoma", FontWeight.Normal, 10, new Vector3());
            sManager.AddEntity(distanceText);
        }
Пример #18
0
        /// <summary>
        /// Initializes a new instance of the DigitalElevationMap class.
        /// </summary>
        /// <param name="mapSize">Size of the map</param>
        /// <param name="rDb"></param>
        /// <param name="devIf"></param>
        /// <param name="reader"></param>
        public DigitalElevationMap(Size mapSize, RasterDatabase.RasterDatabase rDb,
                                   DeviceInterface devIf, GDALReader reader)
            : base(new Vector3(-5f, -0.5f, -5f), new Vector3(5f, 1f, 5f))
        {
            this.mapSize = mapSize;
            maxDimension = mapSize.Width > mapSize.Height ? mapSize.Width : mapSize.Height;
            this.rDb     = rDb;

            this.devIf  = devIf;
            this.reader = reader;

            axisHelper    = new Axis3DHelper(new Vector3(2.5f, 0.5f, 2.5f));
            rotAxisHelper = new RotationAxis3DHelper(new Vector3());
        }
Пример #19
0
 public void LoadCalibrationFile()
 {
     if (DeviceInterface.IsCalibrationFileAvailable(Program.CalibrationPath))
     {
         LOGDraw("Load calibration file..", false);
         DeviceInterface.LoadCalibration(Program.CalibrationPath);
         LOGDraw("..Success!");
         bCalibrationAvailable = true;
     }
     else
     {
         LOGWarning("Calibration file not available, please run calibration.");
     }
 }
Пример #20
0
        public override IResource LoadContent(string filePath, string rzPath, string subPath,
                                              string contentType, XmlNodeList rzNodes,
                                              out IResource[] loadedDependants,
                                              out IResource[] loadedDependancies,
                                              DeviceInterface devIf)
        {
            ILog log = devIf.CDI.GeneralLog;

            log.AddItem(new LogItem(string.Format("Starting loading texture rz ([{0}]{1})", contentType, rzPath), LogItem.ItemLevel.DebugInfo));

            // load texture first
            ImageInformation imgInf  = TextureLoader.ImageInformationFromFile(filePath);
            Texture          texture = TextureLoader.FromFile(devIf.Device, filePath, imgInf.Width, imgInf.Height, 1, Usage.None,
                                                              imgInf.Format, Pool.Managed, Filter.None, Filter.None, 0);

            log.AddItem(new LogItem(string.Format("Loaded texture rz ([{0}]{1})", contentType, rzPath), LogItem.ItemLevel.DebugInfo));

            // process meta-data nodes
            TextureResource texRz = new TextureResource(rzPath, texture, null,
                                                        imgInf.Width, imgInf.Height);

            TextureResource.Icon[] icons = null;
            TextureResource.Icon   icon  = null;
            if (rzNodes != null)
            {
                foreach (XmlElement item in rzNodes)
                {
                    if (item.Name == "areas")
                    {
                        // process sub-areas
                        ProcessSubAreas(item, texRz, out icons, rzPath + ":areas:icon:");
                    }
                }
            }
            texRz.Icons = icons;

            /*if (subPath != null)
             * {
             *  loadedDependants = icons;
             *  loadedDependancies = new IResource[] { texRz };
             *  return
             * }
             * else
             * {*/
            loadedDependancies = null;
            loadedDependants   = icons;
            return(texRz);
            //}
        }
Пример #21
0
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
            base.Init(devIf, sManager);

            vBuffer = new VertexBuffer(typeof(CustomVertex.PositionColored), 6, gDevice, Usage.None,
                                       CustomVertex.PositionColored.Format, Pool.Managed);
            CustomVertex.PositionColored[] verts = (CustomVertex.PositionColored[])vBuffer.Lock(0, LockFlags.None);

            verts[0].Color    = verts[1].Color = Color.Red.ToArgb();
            verts[1].Position = new Vector3(1, 0, 0);

            verts[2].Color    = verts[3].Color = Color.Green.ToArgb();
            verts[3].Position = new Vector3(0, 1, 0);

            verts[4].Color    = verts[5].Color = Color.Blue.ToArgb();
            verts[5].Position = new Vector3(0, 0, 1);

            vBuffer.Unlock();

            // build selection lines
            selectionVBuffer = new VertexBuffer(typeof(CustomVertex.PositionColored), 6, gDevice, Usage.None,
                                                CustomVertex.PositionColored.Format, Pool.Managed);
            verts = (CustomVertex.PositionColored[])selectionVBuffer.Lock(0, LockFlags.None);

            verts[0].Color    = verts[1].Color = Color.Yellow.ToArgb();
            verts[1].Position = new Vector3(1, 0, 0);

            verts[2].Color    = verts[3].Color = Color.Yellow.ToArgb();
            verts[3].Position = new Vector3(0, 1, 0);

            verts[4].Color    = verts[5].Color = Color.Yellow.ToArgb();
            verts[5].Position = new Vector3(0, 0, 1);

            selectionVBuffer.Unlock();

            labels    = new ScreenSpaceText[3];
            labels[0] = new ScreenSpaceText("x", Color.Red, "Verdana", FontWeight.Normal, 10,
                                            new Vector3(1.1f, 0, 0), this);
            labels[0].Init(devIf, sManager);
            sManager.AddEntity(labels[0]);
            labels[1] = new ScreenSpaceText("y", Color.Green, "Verdana", FontWeight.Normal, 10,
                                            new Vector3(0, 1.1f, 0), this);
            labels[1].Init(devIf, sManager);
            sManager.AddEntity(labels[1]);
            labels[2] = new ScreenSpaceText("z", Color.Blue, "Verdana", FontWeight.Normal, 10,
                                            new Vector3(0, 0, 1.1f), this);
            labels[2].Init(devIf, sManager);
            sManager.AddEntity(labels[2]);
        }
Пример #22
0
        /// <summary>
        /// 抓拍图片
        /// </summary>
        /// <returns></returns>
        public bool Capture(string filePath)
        {
            CaptureFilePath = filePath;
            uint uRes = DeviceInterface.HWTC_Capture(this.pHandle);

            if ((DeviceInterface.FEEKBACK_TYPE)uRes == DeviceInterface.FEEKBACK_TYPE.RESULT_OK)
            {
                return(true);
            }
            else
            {
                ErrorStr = uRes.ToString();
                return(false);
            }
        }
Пример #23
0
        bool SerialPortInitialize(String PortName)
        {
            if (DeviceInterface.Initialize(PortName) == true)
            {
                LOGDraw("Firmware version : " + DeviceInterface.nFirmwareVersionNumber.ToString());
                FirmwareTextBox.Text = DeviceInterface.nFirmwareVersionNumber.ToString();

                bool bFirmwareOK = false;

                foreach (int i in DeviceInterface.GetDevice().AllowedFirmwaresVersions)
                {
                    if (i == DeviceInterface.nFirmwareVersionNumber)
                    {
                        bFirmwareOK = true;
                        break;
                    }
                }

                if (bFirmwareOK)
                {
                    FirmwareTextBox.BackColor = Color.Chartreuse;
                    LOGDraw("Compatible analyzer found on port " + PortName);
                }
                else
                {
                    if (DeviceInterface.nFirmwareVersionNumber > 100 && DeviceInterface.nFirmwareVersionNumber < 120)
                    {
                        FirmwareTextBox.BackColor = Color.Yellow;
                        LOGWarning(PortName + ":In range firmware version number, but no match with selected analyzer");
                    }
                    else
                    {
                        FirmwareTextBox.BackColor = Color.OrangeRed;
                        LOGWarning(PortName + ":The device respond to the version request, but the firmware version number is out of range ");
                    }
                }
                bDeviceConnected = true;
                return(true);
            }
            else
            {
                FirmwareTextBox.BackColor = Color.Red;
                FirmwareTextBox.Text      = "NA";
                bDeviceConnected          = false;
                LOGError(PortName + ":No device respond to version request");
                return(false);
            }
        }
Пример #24
0
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
            base.Init(devIf, sManager);

            // do a lookup to get y position
            float height = heightLookup.ValueLookup(0.25f, 0.25f) / maxDataValue;

            // load text
            text = new ScreenSpaceText(Math.Round((decimal)height * 10, 1) + "m", Color.Yellow, "Tahoma", FontWeight.Bold,
                                       11, new Vector3(0, 2.2f, 0), this);
            text.Init(devIf, sManager);
            sManager.AddEntity(text);
            AddDependant(text);

            Move(new Vector3(1.25f, height, 1.25f));
        }
Пример #25
0
        public DbCommand GetDbDriver(DeviceInterface type, string connection)
        {
            DbCommand dbDriver;

            switch (type)
            {
            case DeviceInterface.sqlserver:
                dbDriver            = new SqlCommand();
                dbDriver.Connection = new SqlConnection(connection);

                break;

            default:
                throw new NotImplementedException("Device Type not avalible for WebDeviceInterfaceFactory");
            }
            return(dbDriver);
        }
Пример #26
0
        /// <summary>
        /// 关闭设备
        /// </summary>
        /// <returns></returns>
        public bool Close()
        {
            uint uRes = DeviceInterface.HWTC_DisconnectCamera(this.pHandle);

            if ((DeviceInterface.FEEKBACK_TYPE)uRes == DeviceInterface.FEEKBACK_TYPE.RESULT_OK)
            {
                //关闭视频预览
                HWPlayer.HWPlayer_Quit();
                ForGlobal.g_DeviceTable = null;
                return(true);
            }
            else
            {
                ErrorStr = uRes.ToString();
                return(false);
            }
        }
Пример #27
0
        float [] RunSweep(Int64 nFrequencyStart, Int64 nStep, int nCount, FormNotifier Notifier, NWTDevice.DetectorUsed Detector = NWTDevice.DetectorUsed.LOGARITHMIC)
        {
            NWTDevice.RunSweepModeParam Param = new NWTDevice.RunSweepModeParam();
            Param.Detector       = Detector;
            Param.nBaseFrequency = nFrequencyStart;
            Param.nFrequencyStep = nStep;
            Param.nCount         = nCount;
            Param.Notifier       = Notifier;
            Param.Worker         = null;

            LOGDraw("BW:" + (nStep * nCount).ToString() + "Hz", false);
            LOGDraw(" samples:" + nCount.ToString(), false);
            LOGDraw(" Step:" + nStep.ToString());
            float [] Result = DeviceInterface.RunSweepMode(Param);
            Utility.FilterArray(Result, (int)((FilterMode)FilterComboBox.SelectedItem));
            return(Result);
        }
Пример #28
0
        public override IResource LoadContent(string filePath, string rzPath, string subPath, string contentType,
                                              XmlNodeList rzNode, out IResource[] loadedDependants,
                                              out IResource[] loadedDependancies, DeviceInterface devIf)
        {
            ILog log = devIf.CDI.GeneralLog;

            log.AddItem(new LogItem(string.Format("Starting loading script rz ([{0}]{1})", contentType, rzPath), LogItem.ItemLevel.DebugInfo));

            BooScript script = BooScript.LoadBooScript(rzPath, filePath);

            log.AddItem(new LogItem(string.Format("Loaded script rz ([{0}]{1})", contentType, rzPath), LogItem.ItemLevel.DebugInfo));

            loadedDependancies = null;
            loadedDependants   = null;

            return(script);
        }
Пример #29
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                foreach (var track in _tracks)
                {
                    track.Dispose();
                }

                DeviceInterface.Dispose();
            }

            _disposed = true;
        }
Пример #30
0
        protected virtual void InitializeEnvironment(CommonDeviceInterface cdi)
        {
            // Get device settings
            if (outCaps == null)
            {
                outCaps = OutputCaps.GetDefaultAdapterCaps(outReqs);
            }
            outSettings = OutputSettings.CreateFromRequirements(outReqs, outCaps, outMinReqs);

            // Set up the presentation parameters
            presentParams.Windowed               = outReqs.Windowed;
            presentParams.SwapEffect             = SwapEffect.Discard;
            presentParams.AutoDepthStencilFormat = outSettings.DepthFormat;
            presentParams.EnableAutoDepthStencil = (outSettings.DepthFormat != DepthFormat.Unknown);

            CreateDevice();

            devIf = new DeviceInterface(device, cdi);
        }
Пример #31
0
        public override void Init(DeviceInterface devIf, SceneManager sManager)
        {
            base.Init(devIf, sManager);

            BuildGeometry();

            axisHelper.Init(devIf, sManager);
            rotAxisHelper.Init(devIf, sManager);

            List <ISharableResource> shared = new List <ISharableResource>();

            overlayTexRz = (TextureResource)devIf.GetSharedResource("file://media/ui/vis/overlay-1s.png", ref shared);

            ShaderHLSL shader;

            if (gProfile.SupportsShaderOverlay)
            {
                shader = new ShaderHLSL(gDevice, devIf.LocalSettings["Base.Path"] + @"shaders\cpu_dem.fx");
                shader.Effect.Technique = shader.Effect.GetTechnique("LitTextured");
                defaultShader           = new ShaderInterface(shader);
            }

            /*shader = new ShaderHLSL(gDevice, devIf.LocalSettings["Base.Path"] + @"shaders\cpu_dem_hClr.fx");
             * shader.Effect.Technique = shader.Effect.GetTechnique("CPU_DEM_HeightClr");
             * hClrShader = new ShaderInterface(shader);*/

            shader = new ShaderHLSL(gDevice, devIf.LocalSettings["Base.Path"] + @"shaders\gpu_dem.fx");
            shader.Effect.Technique = shader.Effect.GetTechnique("Basic");
            sm3Shader = new ShaderInterface(shader);

            /*Shape shape = ShapeContentLoader.LoadShape(gDevice, NuGenDEMVis.Properties.Resource1.VerticalPointer_Shape);
             * pointerEntity = new VerticalPointerEntity(shape, rDb.Layers[0], maxDataValue);
             * pointerEntity.Init(devIf, sManager);
             * sManager.AddEntity(pointerEntity);*/

            /*axisHelper.Init(devIf, sManager);
             * sManager.AddEntity(axisHelper);
             *
             * SetChildren(new IWorldEntity[] { axisHelper, pointerEntity });*/

            //geom.RebuildDiffuseTextures(new HeightMapDEMSampler());
        }
Пример #32
0
        public override void TurnOff(DeviceInterface type)
        {
            if (PingCheck && !IsOn())
            {
            Log.Debug("Auto3D: TV is already off");
            return;
            }

            if (type == DeviceInterface.IR)
            {
            RemoteCommand rc = GetRemoteCommandFromString("Power (IR)");

            try
            {
                IrToy.Send(rc.IrCode);
            }
            catch (Exception ex)
            {
                Log.Error("Auto3D: IR Toy Send failed: " + ex.Message);
            }
            }
        }
Пример #33
0
 public AssetsService(DeviceInterface deviceInterface)
 {
     this.deviceInterface = deviceInterface;
 }
Пример #34
0
        public override void TurnOn(DeviceInterface type)
        {
            if (!IsOn())
            {
            switch (type)
            {
                case DeviceInterface.IR:

                    RemoteCommand rc = GetRemoteCommandFromString("Power (IR)");

                    try
                    {
                        IrToy.Send(rc.IrCode);
                    }
                    catch (Exception ex)
                    {
                        Log.Error("Auto3D: IR Toy Send failed: " + ex.Message);
                    }
                    break;

                case DeviceInterface.Network:

                    Auto3DHelpers.WakeOnLan(MAC);
                    break;

                default:

                    break;
            }
            }
            else
            Log.Debug("Auto3D: TV is already on");
        }
Пример #35
0
        public override void TurnOff(DeviceInterface type)
        {
            if (IsOn())
            {
            switch (type)
            {
                case DeviceInterface.IR:

                    RemoteCommand rc = GetRemoteCommandFromString("Power (IR)");

                    try
                    {
                        IrToy.Send(rc.IrCode);
                    }
                    catch (Exception ex)
                    {
                        Log.Error("Auto3D: IR Toy Send failed: " + ex.Message);
                    }
                    break;

                case DeviceInterface.Network:

                    SendCommand(new RemoteCommand("Off", 0, null));
                    break;

                default:

                    break;
            }
            }
            else
            Log.Debug("Auto3D: TV is already off");
        }
Пример #36
0
 public virtual void TurnOn(DeviceInterface type)
 {
 }