more G-Labs products

Author Topic: Creating an interface with the skeleton project - HELP  (Read 1498 times)

March 31, 2016, 06:43:51 PM
Read 1498 times

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
I'm quite new to c# and my Object Orientated programming skills are lacking!

I cant seem to suss it from looking at the other examples especially with the MQTTClient..

But how to I pass an object from my interface through to a scripting program?

IE like the serial port helper, I want to pass an object through to a program that can be edited with the UI rather than visual studio...

I'm fairly sure its simple but the I don't seem to follow how the class accessor is MqttClient...

Thanks

David

« Last Edit: April 04, 2016, 08:22:23 PM by [email protected] »

April 04, 2016, 08:24:58 PM
Reply #1

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
Ok, so done a bit more digging through the code and found that it is done with the ScriptHost.cs file

https://github.com/genielabs/HomeGenie/blob/a4404a3a84c3495ae4bbd40ce05fd55e19928ab1/HomeGenie/Automation/Scripting/ScriptingHost.cs

However this confuses me slightly as I thought the additional interface you can add for the MQTT Client module was seperate to the main project, but it looks like there is code in here for that to then work, or am I missing something?

Is it possible to pass an object through to an automation program from an interface alone? - or does it have to use web-service calls?

David


April 08, 2016, 12:41:06 AM
Reply #2

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
Anyone,  the more help I and others can get,  the better the product gets. I've also had talks around the nda with the Alarm company and it seems I may be able to share the plugin. Just waiting on a beta release of the firmware with some new features which should improve things.

At the moment I'm progressing with the code both within hg  and a seperate visual studio solution whilst I wait on someone..  Gene??

April 09, 2016, 01:31:43 AM
Reply #3

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
Ok, so I've hacked the homegenie code about and passed an object through..by creating my own helper class.. Will worry about this later.

Fotunatley I work for a company where we have a lot of c# dev's (200+ I would say), I also get on with our software architect and some lead dev's quite well, they have been quite helpful in showing me dependency injection, moq for mocking and writing unit tests - which I had never really got my head around TDD.. Suddenly a few things have clicked into place so I have started writing a new alarm interface for homegenie which also allows me to use a .net interface to change the transport mechanism.

hopefully make some progress tomorrow whilst the other half is at the hair dressers :)

April 18, 2016, 12:27:41 AM
Reply #4

maxflax

  • ***
  • Information
  • Full Member
  • Posts: 90
Also writing a alarm interface, tucking all the logic back there and letting the scripting engine only be for the visuals and transporting events.

I wonder why you need to send objects from your interface to a script thou?

April 18, 2016, 12:37:01 AM
Reply #5

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
I wanted to be able to offer people the option,  to create scripts / actions and no rely on my code.  What panel are you doing?