NextPVR Forums
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 23 24 25 26 27 … 93 Next »
some help on basic gbpvr plugin code

 
  • 0 Vote(s) - 0 Average
some help on basic gbpvr plugin code
Etacovda
Offline

Senior Member

Posts: 253
Threads: 37
Joined: Apr 2006
#1
2009-05-30, 09:53 PM
Hey all

using c#, ms visual studio 08

have helloworld running well etc, can change things.

what i need to know, is

a)
how to access external data (in a text file) and show it on screen

b)
how to display images on pvrx2 as the old tutorials are for gbpvr.exe and arent working for me

c)
how to input data to a text file and write it on screen, using either 'txt' entry or just up/down on remote.

as for what i am trying to do, see this link
http://forums.nextpvr.com/showthread.php?t=42144

I have my external console application running, checking data from text files that logtemp puts out and preforming logic based on that data to the parallel port. I would like to be able to set 'desired temp' in gbpvr, see the current temperature of each sensor and show a snapshot of the latest graph that logtemp puts out (it drops out a .jpg/.png file at set intervals). I would also like to program a timer based on a text file - so that i can set my heating to come on at 7am and turn off at 9am, then turn on at 4pm and off at 10pm (for example). Id like to be able to hit a button in my plugin to change timers etc as well...

little bit confused at the moment (im probably doing too much for a newbie, really - but im good like that!) as to what i need to be doing.

would i be best using wiz librarys etc?

Any help appreciated!
[SIZE="3"]HTPC: [/SIZE]3000+ A64 | Gigabyte k8N 939 SLI | 1 gb ddr 400 | 2x mce150 tuners + mce remote | 1x Pinnacle 7010xi dual dvb-s, dual dvb-t tuner, 2xSky motorolla decs with IR server Suite changing channels via MCE remote| ati x1600 pro | 1x250 1x320 gb Seagate IDE drives | 29" sony CRT via svideo | Windows XP sp2
[SIZE="3"]Clients: [/SIZE]2x desktop pc's, 1 wired MVP connected to a 29" mitsubishi
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 102,432
Threads: 743
Joined: Nov 2003
#2
2009-05-31, 02:25 AM
This is a very wide set of things you want to know so it'll be very difficult for someone to answer without spending a whole lot of time writing a very detailed answer.

Quote:a)
how to access external data (in a text file) and show it on screen
You can use the C# API for reading the file File.OpenRead() etc. Displaying it on the screen depends how exactly you want to display. Maybe checkout the http://gbpvr.com/pmwiki/pmwiki.php/Devel...odeSamples, specifically the Weather plugin, which displays info on the screen.

Quote:b)
how to display images on pvrx2 as the old tutorials are for gbpvr.exe and arent working for me
The sample code at http://gbpvr.com/pmwiki/pmwiki.php/Devel...odeSamples is all for pvrx2.exe, so check those out. Specifically, the weather plugin displays an image.

Quote:c)
how to input data to a text file and write it on screen, using either 'txt' entry or just up/down on remote.
Again, it really depends exactly what you want to do for text entry etc. C# API can be used for writing to a text file (File.Create() etc).
Etacovda
Offline

Senior Member

Posts: 253
Threads: 37
Joined: Apr 2006
#3
2009-05-31, 03:28 AM
thanks very much, will continue my research Smile
[SIZE="3"]HTPC: [/SIZE]3000+ A64 | Gigabyte k8N 939 SLI | 1 gb ddr 400 | 2x mce150 tuners + mce remote | 1x Pinnacle 7010xi dual dvb-s, dual dvb-t tuner, 2xSky motorolla decs with IR server Suite changing channels via MCE remote| ati x1600 pro | 1x250 1x320 gb Seagate IDE drives | 29" sony CRT via svideo | Windows XP sp2
[SIZE="3"]Clients: [/SIZE]2x desktop pc's, 1 wired MVP connected to a 29" mitsubishi
Etacovda
Offline

Senior Member

Posts: 253
Threads: 37
Joined: Apr 2006
#4
2009-05-31, 08:48 AM
ok, so in butchering the weather plugin i have managed to display my external files (text, images) - but im having issues updating. could someone please point me in the right direction? i have an image file that updates itself every minute, but the only way it will update is if i exit pvrx2 and re-enter it, im obviously not calling the right method...

Code:
private ArrayList getCurrentViewRenderList()
        {
            ArrayList renderList = new ArrayList();
            // GET TEMPS FROM TEMP FILES *************************************
            
            ///
            //TANK//          

                TextReader trTANKTEMP = new StreamReader("c:\\PROGRAM FILES\\LOGTEMP\\TANK.txt");
                string tankTEMPshow = "error";
                tankTEMPshow = trTANKTEMP.ReadLine();
                trTANKTEMP.Close();

            //PANEL//
            
                TextReader trPANELTEMP = new StreamReader("c:\\PROGRAM FILES\\LOGTEMP\\PANEL.txt");
                string PANELTEMPshow = "error";
                PANELTEMPshow = trPANELTEMP.ReadLine();
                trPANELTEMP.Close();
            
            //ROOM//

                TextReader trROOMTEMP = new StreamReader("c:\\PROGRAM FILES\\LOGTEMP\\ROOM.txt");
                string ROOMTEMPshow = "error";
                ROOMTEMPshow = trROOMTEMP.ReadLine();
                trROOMTEMP.Close();

            //OUTSIDE//

                TextReader trOUTSIDETEMP = new StreamReader("c:\\PROGRAM FILES\\LOGTEMP\\OUTSIDE.txt");
                string OUTSIDETEMPshow = "error";
                OUTSIDETEMPshow = trOUTSIDETEMP.ReadLine();
                trOUTSIDETEMP.Close();


            // check if its time for the current view to be updated.
                bool timeForUpdate = false;
            // check time since last update or something similar???
            if ((viewCurrentElement == null) || (timeForUpdate))
            {
                // set up parameters required to show current weather
                Hashtable args = new Hashtable();
                


                args["@tanktext"] = "Tank Temperature:";
                args["@tank"] = tankTEMPshow;
                args["@paneltext"] = "Panel Temperature:";
                args["@panel"] = PANELTEMPshow;      
                args["@roomtext"] = "Room Temperature:";
                args["@room"] = ROOMTEMPshow;
                args["@outsidetext"] = "Outside Temperature:";
                args["@outside"] = OUTSIDETEMPshow;



                //args["@icon"] = image;

                // create element if we
                if (viewCurrentElement == null)
                {
                    viewCurrentElement = new GBPVRUiElement("current conditions", skinHelper2.getPlacementRect("CurrentConditions"), skinHelper2.getNamedImage("CurrentConditions", args));
                }
                // update the element if its changed
                else if (timeForUpdate)
                {
                    skinHelper2.getNamedImage(viewCurrentElement.image, "CurrentConditions", args);
                    viewCurrentElement.forceRefresh = true;
                }
            }

            renderList.Add(viewCurrentElement);
            return renderList;
        }

any help? close now, but im very much a learner...
[SIZE="3"]HTPC: [/SIZE]3000+ A64 | Gigabyte k8N 939 SLI | 1 gb ddr 400 | 2x mce150 tuners + mce remote | 1x Pinnacle 7010xi dual dvb-s, dual dvb-t tuner, 2xSky motorolla decs with IR server Suite changing channels via MCE remote| ati x1600 pro | 1x250 1x320 gb Seagate IDE drives | 29" sony CRT via svideo | Windows XP sp2
[SIZE="3"]Clients: [/SIZE]2x desktop pc's, 1 wired MVP connected to a 29" mitsubishi
Etacovda
Offline

Senior Member

Posts: 253
Threads: 37
Joined: Apr 2006
#5
2009-05-31, 09:07 AM
ok, so by adding

viewCurrentElement = null;

for my current view, it will automatically update my text files - however doing the same (with viewMapElement = nullWink to the map does nothing... what am i missing? cheers!
[SIZE="3"]HTPC: [/SIZE]3000+ A64 | Gigabyte k8N 939 SLI | 1 gb ddr 400 | 2x mce150 tuners + mce remote | 1x Pinnacle 7010xi dual dvb-s, dual dvb-t tuner, 2xSky motorolla decs with IR server Suite changing channels via MCE remote| ati x1600 pro | 1x250 1x320 gb Seagate IDE drives | 29" sony CRT via svideo | Windows XP sp2
[SIZE="3"]Clients: [/SIZE]2x desktop pc's, 1 wired MVP connected to a 29" mitsubishi
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#6
2009-05-31, 09:07 AM
Look in the interface for morerenderingrequired or similar.
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
Etacovda
Offline

Senior Member

Posts: 253
Threads: 37
Joined: Apr 2006
#7
2009-05-31, 09:50 AM
looked, but havent had any success...
[SIZE="3"]HTPC: [/SIZE]3000+ A64 | Gigabyte k8N 939 SLI | 1 gb ddr 400 | 2x mce150 tuners + mce remote | 1x Pinnacle 7010xi dual dvb-s, dual dvb-t tuner, 2xSky motorolla decs with IR server Suite changing channels via MCE remote| ati x1600 pro | 1x250 1x320 gb Seagate IDE drives | 29" sony CRT via svideo | Windows XP sp2
[SIZE="3"]Clients: [/SIZE]2x desktop pc's, 1 wired MVP connected to a 29" mitsubishi
Etacovda
Offline

Senior Member

Posts: 253
Threads: 37
Joined: Apr 2006
#8
2009-05-31, 10:28 AM
ok, my brain is starting to hurt. I might go solder these relay circuits up, and hopefully (pretty please!) someone can point out a quick example for me at some point - getting late here, so difficult new stuff is off the cards for me for the rest of the night! thanks for the help so far, i am learning quite a lot.

So far i have an external console based c# prog using streamreader to parse out some data from some text files + break them up into an array so i can read them, as well as the logic to act apon that data and high/low ports d0 through d7 on my parallel port (lighting LED's with my old ParaLED circuit).

Right, rest time, maybe a beer i think!
[SIZE="3"]HTPC: [/SIZE]3000+ A64 | Gigabyte k8N 939 SLI | 1 gb ddr 400 | 2x mce150 tuners + mce remote | 1x Pinnacle 7010xi dual dvb-s, dual dvb-t tuner, 2xSky motorolla decs with IR server Suite changing channels via MCE remote| ati x1600 pro | 1x250 1x320 gb Seagate IDE drives | 29" sony CRT via svideo | Windows XP sp2
[SIZE="3"]Clients: [/SIZE]2x desktop pc's, 1 wired MVP connected to a 29" mitsubishi
Etacovda
Offline

Senior Member

Posts: 253
Threads: 37
Joined: Apr 2006
#9
2009-05-31, 12:13 PM
ok, so i couldnt help myself and I kept going - it looks like its redrawing the image (sparklies around it) - what im having issues with is reloading the image - its just called in the skin file, but I need to refresh it and am having trouble finding the correct code to do this...
[SIZE="3"]HTPC: [/SIZE]3000+ A64 | Gigabyte k8N 939 SLI | 1 gb ddr 400 | 2x mce150 tuners + mce remote | 1x Pinnacle 7010xi dual dvb-s, dual dvb-t tuner, 2xSky motorolla decs with IR server Suite changing channels via MCE remote| ati x1600 pro | 1x250 1x320 gb Seagate IDE drives | 29" sony CRT via svideo | Windows XP sp2
[SIZE="3"]Clients: [/SIZE]2x desktop pc's, 1 wired MVP connected to a 29" mitsubishi
Etacovda
Offline

Senior Member

Posts: 253
Threads: 37
Joined: Apr 2006
#10
2009-05-31, 12:22 PM
ok, so in some thread digging i saw sub mention initialise(); - problem solved.

Now ill have to try to create the phone entry data input... but thats definitely for tomorrow.
[SIZE="3"]HTPC: [/SIZE]3000+ A64 | Gigabyte k8N 939 SLI | 1 gb ddr 400 | 2x mce150 tuners + mce remote | 1x Pinnacle 7010xi dual dvb-s, dual dvb-t tuner, 2xSky motorolla decs with IR server Suite changing channels via MCE remote| ati x1600 pro | 1x250 1x320 gb Seagate IDE drives | 29" sony CRT via svideo | Windows XP sp2
[SIZE="3"]Clients: [/SIZE]2x desktop pc's, 1 wired MVP connected to a 29" mitsubishi
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 263 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 2,014 2020-11-14, 08:01 PM
Last Post: sub
  Remote control example code? drmargarit 4 2,934 2018-04-21, 11:24 PM
Last Post: drmargarit
  Looking for C# UPnP Media Server code bgowland 5 6,423 2016-12-16, 08:25 PM
Last Post: mvallevand
  TitanTv Remote Schedule For GBPVR UncleJohnsBand 51 29,283 2015-08-20, 05:11 PM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 2,676 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,282 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,150 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 4,551 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,482 2013-03-12, 06:48 AM
Last Post: psycik

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode