Jump to content


Photo
- - - - -

Adding Elements to a Class


  • Please log in to reply
7 replies to this topic

#1 Shinyshoes

Shinyshoes

    Cocooner

  • Registered
  • PipPip
  • 93 posts
  • Location:Alberta, Canada
  • Experience:average
  • Software:Premise
  • Hardware:Elk M1
  • Tech:UPB, 1-Wire
  • Audio:Nuvo
  • Video:Custom
  • CCTV:ip

Posted 15 March 2018 - 10:26 PM

I am struggling to find a way to add elements to an existing class.  This is actually 2 questions.

 

Question 1, When using the wizard to add......say a receiver.  It asks you what inputs you want to include in your class.  Once the wizard has completed, how do I go back and add more?

 

Question 2, How do I add some that are not in the list?

 

Thanks in advance.

 

 



#2 123

123

    Cocoonut

  • Registered
  • PipPipPipPip
  • 2091 posts
  • Location:Montreal, QC
  • Experience:average
  • Software:Premise
  • Hardware:Elk M1

Posted 16 March 2018 - 06:36 PM

You need to put Premise Builder into Expert Mode. In that mode, there's no Wizard and you get complete freedom to create most anything (and complete freedom to screw things up; no safety net other than a backup copy of your Premise Home).

  1. In Premise Builder, click Modules, click your Module, then click on anything listed in the center of the screen (your cursor needs to be there for this next part to work).
  2. Now press Ctrl+Shift+A
  3. A message will appear warning you are now entering Expert Mode.
  4. Right-click one of the classes in your Module and you'll see new options including to the ability to create new Properties, different kinds of Scripts (OnChangeProperty which only runs when a property changes state, or Constructor which only runs the first time your class is instantiated as an object, etc) plus Relationships (make your new class Inherit from another class, make your new class Extend another class, or make your class an Object Container).
  5. Have fun exploring!


#3 Shinyshoes

Shinyshoes

    Cocooner

  • Registered
  • PipPip
  • 93 posts
  • Location:Alberta, Canada
  • Experience:average
  • Software:Premise
  • Hardware:Elk M1
  • Tech:UPB, 1-Wire
  • Audio:Nuvo
  • Video:Custom
  • CCTV:ip

Posted 17 March 2018 - 05:52 PM

OK, got that far, and also found out by right clicking the class, you can click the sub-objects tab and add or remove as needed there.

 

What I still can't find, even in expert mode, is how to change or add to that list.  Sorry 123, can you spell it out a little more for me?



#4 123

123

    Cocoonut

  • Registered
  • PipPipPipPip
  • 2091 posts
  • Location:Montreal, QC
  • Experience:average
  • Software:Premise
  • Hardware:Elk M1

Posted 18 March 2018 - 03:24 PM

Tell me precisely what you want to do and I'll try to help you. 

 

 

BTW

Credit where credit is due, I learned about Expert Mode from Jim Springer. I couldn't figure out how to bind to an X10 HR12a keypad ... it simply wasn't seen as a 'bindable' keypad. Jim's instructions showed how to make it inherit from another class (KeypadDevice) and the process required Expert Mode.

 

It's all here, posted .... a decade ago! Geez, where does the time go?!?

http://cocoontech.co...-palmpad-hr12a/

 



#5 Shinyshoes

Shinyshoes

    Cocooner

  • Registered
  • PipPip
  • 93 posts
  • Location:Alberta, Canada
  • Experience:average
  • Software:Premise
  • Hardware:Elk M1
  • Tech:UPB, 1-Wire
  • Audio:Nuvo
  • Video:Custom
  • CCTV:ip

Posted 20 March 2018 - 02:24 PM

The receiver object doesn't have inputs for things such as Blu-Ray.  I want to add an input to the AV Sources object.  Good thing you have been around this product for so long......



#6 123

123

    Cocoonut

  • Registered
  • PipPipPipPip
  • 2091 posts
  • Location:Montreal, QC
  • Experience:average
  • Software:Premise
  • Hardware:Elk M1

Posted 20 March 2018 - 07:13 PM

I apologize in advance because I'm not an expert with Mediazone.

 

Correct me if I'm wrong, but you have this property:

Receiver/AudioVideoSwitch/CurrentSource

 

Which lets you navigate here:

Schema > Device > AudioVideo >

 

Where it offers the following choices:

  • Projector
  • Receiver
  • Scaler
  • Switcher
  • Television
  • VCR

 

You want to add a Blu-Ray player to that list?


Edited by 123, 20 March 2018 - 07:14 PM.


#7 Shinyshoes

Shinyshoes

    Cocooner

  • Registered
  • PipPip
  • 93 posts
  • Location:Alberta, Canada
  • Experience:average
  • Software:Premise
  • Hardware:Elk M1
  • Tech:UPB, 1-Wire
  • Audio:Nuvo
  • Video:Custom
  • CCTV:ip

Posted 21 March 2018 - 12:07 AM

Really close.  
 
I have this property:

Receiver/AudioVideoSwitch/CurrentSource

 
Which lets me navigate here:
Schema > Device > AudioVideo > Reciever 

Where it offers 2 un-labeled folders (they show up as DefaultSources and OptionalSources when you select them). In those folders are the inputs the receiver offers.  I want to add a Blu-Ray player option there......

I'm also assuming that it will cascade down to the custom receiver driver I am writing, because that object inherits the Receiver_Device class

Edited by Shinyshoes, 21 March 2018 - 12:09 AM.


#8 123

123

    Cocoonut

  • Registered
  • PipPipPipPip
  • 2091 posts
  • Location:Montreal, QC
  • Experience:average
  • Software:Premise
  • Hardware:Elk M1

Posted 21 March 2018 - 07:59 PM

I tried but was unable to discover the inner workings of the AudioVideoSwitch class.

 

Try this experiment:

  • Make a MediaZone
  • Add a Receiver
  • Go to AudioVideoSwitch > CurrentSource and explore what's available. It'll offer several options. Close the dialog box.
  • Now add an Amplifier to the MediaZone.
  • Go to AudioVideoSwitch > CurrentSource and explore what's available. It'll offer one option, the Amplifier.

 

This is the kind of behavior I can't explain because I don't know how the underlying code works (i.e. it is not shown anywhere). Sorry, this question will have to be fielded by someone with a deeper understanding of MediaZones and AudioVideo devices.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users