Scripting Problems.

56 views
Skip to first unread message

Matthew Kent

unread,
Apr 9, 2015, 5:52:19 AM4/9/15
to zvirtualsc...@googlegroups.com
I'm trying to get my scripts working on v8. However when I try to create a new helper with this code:

  require('.\\scripts\\helper.js')
  var h = new helper(); 

I get the following error...

  09/04/2015 10:48:40InfoJavaScript test run started...
  09/04/2015 10:48:40ErrorJavaScript execution error. zvs is not defined

Any help appreciated,
Thanks,
Matthew

Aaron Drabeck

unread,
Apr 10, 2015, 11:17:31 PM4/10/15
to zvirtualsc...@googlegroups.com
The JavaScript helpers supplied with ZVS I do not believe were ever updated to be compatible with 8.0.  It wouldn't take too much to update them if you want to give it a shot.  

--
You received this message because you are subscribed to the Google Groups "zVirtualScenes Forums" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zvirtualscenes-f...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthew Kent

unread,
Apr 11, 2015, 4:38:00 AM4/11/15
to zvirtualsc...@googlegroups.com
I'm not a programmer; but will take a look.  As a first off; where in the code should I look to see what names you are using?

I'm guessing that this first reference to zvs. is now misnamed?
    this.appPath = zvs.Processor.Utils.AppPath;

Thanks,
Matthew

Aaron Drabeck

unread,
Apr 11, 2015, 12:02:08 PM4/11/15
to zvirtualsc...@googlegroups.com


Here is where you can see the new names.  

There is a mappath that might work in place of AppPath.

--

Matthew Kent

unread,
Apr 13, 2015, 1:15:33 PM4/13/15
to zvirtualsc...@googlegroups.com
Thanks,

I've had a look at the code and it appears the the javascript runner doesn't support getDeviceValue any more.  Is it likely that this will be included later releases?

Thanks,
Matthew

Matthew Kent

unread,
Apr 13, 2015, 2:11:44 PM4/13/15
to zvirtualsc...@googlegroups.com
Ignore that, I think I just don't know how to loop through the devices.

If I do:
 logInfo(zvsContext.Devices);

I get back:
13/04/2015 18:55:20 Info SELECT 
    [Extent1].[Id] AS [Id], 
    [Extent1].[Name] AS [Name], 
    [Extent1].[NodeNumber] AS [NodeNumber], 
    [Extent1].[CurrentLevelText] AS [CurrentLevelText], 
    [Extent1].[CurrentLevelInt] AS [CurrentLevelInt], 
    [Extent1].[DeviceTypeId] AS [DeviceTypeId], 
    [Extent1].[Location] AS [Location]
    FROM [Devices] AS [Extent1]

but if I try this>

this.deviceByName = function (name) {
        for (var dev in zvsContext.Devices) {
            if (dev.Name == name) return dev;
        }
        return undefined;
    };
 
It doesn't loop through the devices at all and just returns a null.  Can you point me in the right direction?

Thanks,
Matthew

Paul Craven

unread,
Jan 30, 2016, 3:57:14 PM1/30/16
to zVirtualScenes Forums
Does anyone have an updated helper.js for V8?

julian.la...@gmail.com

unread,
Jul 30, 2016, 2:44:36 AM7/30/16
to zVirtualScenes Forums
Reply all
Reply to author
Forward
0 new messages