SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #81  
Old 05-01-2009, 10:13 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by jaminben View Post
I'm not sure if Andy has put a deliberate mistake into the mix to try and make sure I understand it.
If I'm going to write up an example for someone, I'm not going to put purposeful mistakes into it... but I did warn you that I simply typed it up w/o checking that it would work for you.

Quote:
Originally Posted by jaminben View Post
Tried this and every thing seems to work ok until the i < Size(Keys) everything after that returns null. This proberly means I've setup the DebugLog() wrong but its after 02.00 now so I'll try again tomorrow
... or the debug log statements could indicate a real problem in the code somewhere. There have been plenty of times where I misunderstood something & tracked down the issue with debug log statements.

Quote:
Originally Posted by jphipps View Post
Looks like I cracked the case... The main issue was that the return variable for the java_util_keySet returns a set and not an array. You have to convert the set to an array and then you can use GetElement on it. GetElement does not seem to work on sets... I have attached the copy that I have working...
And this reminds me: if you want to see examples of most API calls, search the default STV for them. Most uses of java_util_Map_keySet() in the default STV wrap the call's results with DataUnion() as a simple way to get the keys in a list usable with GetElement(). If the API & Java docs aren't clear to you, look at existing code to see how the calls are used.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #82  
Old 05-02-2009, 01:10 AM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
Quote:
Originally Posted by Opus4 View Post
And this reminds me: if you want to see examples of most API calls, search the default STV for them. Most uses of java_util_Map_keySet() in the default STV wrap the call's results with DataUnion() as a simple way to get the keys in a list usable with GetElement(). If the API & Java docs aren't clear to you, look at existing code to see how the calls are used.

- Andy
I actuallly found the toArrray() call in the base SageMC STV after each keySet call. I probably should check the default first, since it may have newer code/calls...

Thanks,
Jeff
Reply With Quote
  #83  
Old 05-02-2009, 01:59 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by jphipps View Post
Looks like I cracked the case... The main issue was that the return variable for the java_util_keySet returns a set and not an array. You have to convert the set to an array and then you can use GetElement on it. GetElement does not seem to work on sets... I have attached the copy that I have working...
YAY, thats it It does what its supposed to do although I'm not 100% how its working just yet. I think I'll add some more debug code to see what its doing to hopefully give me a better understanding. THANKYOU.

Quote:
Originally Posted by Opus4 View Post
If I'm going to write up an example for someone, I'm not going to put purposeful mistakes into it... but I did warn you that I simply typed it up w/o checking that it would work for you.
Ah, I didn't know if you where playing with me

I'm glad its all working but it doesn't feel good that someone else had to do it for me.

Thanks for everyones help, I should be able to plod on quite nicely now. I can aslo use this as an example to see if I can make a season filter/selection.

__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders

Last edited by jaminben; 05-02-2009 at 02:02 AM.
Reply With Quote
  #84  
Old 05-02-2009, 02:00 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
In addition to DebugLog(), you can also test small snippets of code in Studio using the Expression Evaluator command (on the Tools menu) and Evaluate Widget and Execute Widget Chain (on the right-click menu). If you're not sure exactly what a function does or how it behaves in certain cases, study the docs and then take it for a test drive by writing a few sample calls and evaluating them interactively.
__________________
-- Greg
Reply With Quote
  #85  
Old 05-02-2009, 02:06 AM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
Quote:
Originally Posted by jaminben View Post
YAY, thats it It does what its supposed to do although I'm not 100% how its working just yet. I think I'll add some more debug code to see what its doing to hopefully give me a better understanding. THANKYOU.
I find using the Tracer is very helpful while stepping through the code. That is how I found that the GetElement was not returning any values...

It is usually a good idea to get another pair of eyes to look, debuging your own code is usually the most difficult since you are so focused it is easy to overlook the smallest details...

Thanks,
Jeff
Reply With Quote
  #86  
Old 05-02-2009, 02:08 AM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
Quote:
Originally Posted by GKusnick View Post
In addition to DebugLog(), you can also test small snippets of code in Studio using the Expression Evaluator command (on the Tools menu) and Evaluate Widget and Execute Widget Chain (on the right-click menu). If you're not sure exactly what a function does or how it behaves in certain cases, study the docs and then take it for a test drive by writing a few sample calls and evaluating them interactively.
I never reallized there was a DebugLog() call, that is pretty handy... Do you know of hand if there is any issues running the server with debug turned on all of the time? I usually keep mine turned on so I can see any issues that occur, but was not sure if there is any performance/issue with leaving it on all of the time...

Thanks,
Jeff
Reply With Quote
  #87  
Old 05-02-2009, 02:11 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by GKusnick View Post
you can also test small snippets of code in Studio using the Expression Evaluator command (on the Tools menu) and Evaluate Widget and Execute Widget Chain (on the right-click menu). If you're not sure exactly what a function does or how it behaves in certain cases, study the docs and then take it for a test drive by writing a few sample calls and evaluating them interactively.
I have been using these but more often than not it returns null but I'll get the hang of all these new things soon enough. Its been a long week of reading and trying different things, hopefully now its done I can sit down and go through how it works and try various things to see what happens. After all it is a very simple peice of code at the moment (for everyone else, not me).
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #88  
Old 05-02-2009, 02:14 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by jphipps View Post
I never reallized there was a DebugLog() call, that is pretty handy... Do you know of hand if there is any issues running the server with debug turned on all of the time? I usually keep mine turned on so I can see any issues that occur, but was not sure if there is any performance/issue with leaving it on all of the time...

Thanks,
Jeff
I only have debug logging turned on, on the client pc (workstation). I also turned on the realtime logging dos window with babgvant's tool.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #89  
Old 05-02-2009, 10:02 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by jphipps View Post
I actuallly found the toArrray() call in the base SageMC STV after each keySet call. I probably should check the default first, since it may have newer code/calls...
I said the default STV has example code, but I won't promise is it always perfect and/or better than someone else's code. That works too & I also convert it to a vector in some places. The Java calls are probably a lot more efficient, especially on larger key sets because DataUnion has to check to make sure there are no repeats, which there shouldn't be anyway in a map's set of keys. I won't claim to be a Java expert & I probably used the DataUnion call way back when & just continued to use it for no good reason other than it was quick to copy & paste code. I should probably change them all, but I don't often change things that aren't broken for fear of inadvertently breaking something.


Debug logging does add some overhead & can slow things down. I run with it on all the time since I develop & need to see any issues. I'm not sure how much overhead there is & thus how much faster it would be w/o logging.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Studio and SageMC Questions bama SageMC Custom Interface 4 07-26-2008 01:11 PM
Silly Newbie Question: Starting Studio willetin SageTV Studio 2 01-05-2008 08:21 AM
Studio Newbie Question mightyt SageTV Studio 4 01-30-2006 01:52 AM
Some questions about the upcoming Studio. ToxMox SageTV Customizations 26 06-08-2004 09:00 AM


All times are GMT -6. The time now is 04:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.