ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Latest Version under MONO
Posted by Phillip on Jul-26-2018 01:30
so I have seen an old 2005 post saying chartdirector under mono should work is this still the case?

  Re: Latest Version under MONO
Posted by Peter Kwan on Jul-27-2018 01:10
Hi Phillip,

We have not tested ChartDirector under MONO for a long time, so we are not sure if it still works with MONO.

In the forum, I found a post that mentions about using ChartDirector with MONO successfully in 2010. See:

https://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1289946104

For your information, the ChartDirector 5.0 in 2010 requires .NET 1.1. ChartDirector 5.1 to 6.0 requires .NET 2.0. The latest version of ChartDirector requires .NET 4.0. I am not sure which .NET version that current MONO framework is compatible with.

I think the only method is to download and try to see if it works in your MONO version.

Regards
Peter Kwan

  Re: Latest Version under MONO
Posted by Phillip on Aug-05-2018 22:18
Hi Peter thanks I have now done some testing on a Pi 3B+ and a lot seems to work ok but one issue is that I get an exception when trying to specify transparency.

These all produce errors

Dim Testp as MeterPointer = m.addPointer(value, &H000000,-1)
testp.setcolor(&H80FF0000) ****this is where error happens not at add pointer

m.addPointer(value, &H80000000,-1) *********specifying transparency in add pointer alone errors too

However if I do something like this by specifying a very small transparency ie under &10 there are no exceptions but it is difficult when looking to see if it has worked

Dim Testp as MeterPointer = m.addPointer(value, &H000000,-1)
testp.setcolor(&H0FFF0000) ****a value under over &0F seems to cause an issue

m.addPointer(value, &H0F000000,-1)

The pointer is part of an angular meter definition just so you know

I am not a programer but I note that in your excellent documentation (thats one of the reasons I love your software) you mention "incompatibility between .net and chart director colors.  I have no idea where to start could you advise? any help would be appreciated as my feeling is that 99% of chart director will run fine under Mono.  Ps my out put is to a png file not sure if that makes any difference.

  Re: Latest Version under MONO
Posted by Peter Kwan on Aug-08-2018 19:20
Hi Phillip,

Sorry for the late reply.

I have never used Mono before. Would you mind to inform me what is the exception and the stack trace if any? In .NET on Windows, an exception usually contains a name (such as DivisionByZero exception), and a stack trace to indicate which line assembly, file and line number the exception occurs?

Does the exception occurs at the line "testp.setcolor(&H80FF0000)"? Or is it that the exception occurs if the code contains the line? If the code contains a line, it may trigger the exception somewhere else, so it is important to know both the line that triggers the exception, and where the exception actually occurs (the stack trace).

Does the exception occurs if you use &H7FFF0000?

Regards
Peter Kwan

  Re: Latest Version under MONO
Posted by Phill on Aug-14-2018 22:15
Attachments:
Peter Kwan wrote:

Hi Phillip,

Sorry for the late reply.

I have never used Mono before. Would you mind to inform me what is the exception and the stack trace if any? In .NET on Windows, an exception usually contains a name (such as DivisionByZero exception), and a stack trace to indicate which line assembly, file and line number the exception occurs?

Does the exception occurs at the line "testp.setcolor(&H80FF0000)"? Or is it that the exception occurs if the code contains the line? If the code contains a line, it may trigger the exception somewhere else, so it is important to know both the line that triggers the exception, and where the exception actually occurs (the stack trace).

Does the exception occurs if you use &H7FFF0000?

Regards
Peter Kwan

Hi Peter

I have been on leave so not been fiddling for a while sorry

your hunch was correct &H7FFF0000 does NOT produce an error (tried with red and yellow enclosed red version)

code:
Dim Testp as MeterPointer = m.addPointer(value, &H000000,-1)
testp.setcolor(&H7FFF0000)


the error log  is produced in homeseer is never very informative but here it is using code:

Dim Testp as MeterPointer = m.addPointer(value, &H000000,-1)
testp.setcolor( &H8FFF0000 )

:Exception has been thrown by the target of an invocation.->Does entry point Main exist in script? at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00053] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0 at Scheduler.clsRunVBNetScript.ExecuteScript () [0x0039b] in <03c63de3f1dc4fe5b4c97ebd223f29dc>:0

So trying to be clear the exception only occurs when transparency is specified (not &7F apparently!) a colour specified without transparency produces no error ie the following will not error

Dim Testp as MeterPointer = m.addPointer(value, &H000000,-1)
testp.setcolor(&HFF0000)


I have not learned how to compile a stand alone .net exe yet but happy to try if you think it would be helpfull but I think you hit on something by guessing the &7F may not error and it doesn't I will use this value for now.

Also the following do NOT produce error

&6F,&5F,&4F,&48,&47,&3F,&2F,&1F,&11,&12,&14

also assigning transparency directly seems to exhibit the same characteristics

m.addPointer(value, &H7F000000,-1) No error

Phill
SquareMSitting_Room_Zwave_Temperature.png

  Re: Latest Version under MONO
Posted by Peter Kwan on Aug-15-2018 00:33
Hi Phill,

My guess is that any literal value larger than 7FFFFFFF in hex (from 8000000 in hex to FFFFFFFF in hex) will trigger the error.

In .NET, an integer is a signed 32-bit quantity. The issue is whether the hex number 80FFFFFF is treated as a "positive integer" or "negative integer" or "don't care" (that is, just a sequence of 32-bits). If it is treated as a positive integer, it will overflow the signed 32-bit limit.

In C#, it is treated as a positive integer and hence overflow the 32-bit integer limit. Since the number is a literal, the C# compiler can see the number at compile them and would not even allow the code to compile. In our C# sample code, we have to use the C# "unchecked" directive, like "unchecked((int)0x80FFFFFF)". The unchecked directive tells the C# to change to "don't care" mode.

In VB, there is no "unchecked" directive, because VB should have "don't care" as the standard. (Most languages, like C++, Java, etc, has "don't care" is the standard.)

If the above is the case, I may be an issue in VB in Mono. To work around, you may try:

(a) Change &H80xxxxxx to &H7fxxxxxx.

(b) Try to change "&HAABBCCDD" to "&HAA << 24 Or &HBBCCDD". The two produce exactly the same byte pattern. However, the first one is a literal, while the second one is not, and the compiler or runtime can interpret the same byte pattern differently (one as positive, and the other as negative).

Regards
Peter Kwan

  Re: Latest Version under MONO
Posted by Phillip on Aug-17-2018 23:00
Attachments:
Peter thank you yes I can no get transparency above 7F using your bit shit idea Fantastic! yipee............
SquareMRoof_Temperature.png

  Re: Latest Version under MONO
Posted by Pete on Aug-18-2018 21:04
Attachments:
Thank you Peter and Phil.

Personally have not utilized Chart Directory since the early 2000's with Homeseer.

Currently utilizing Homeseer in Linux Mono using an ARM and Intel based computer.

I would like to give it a try here for my current Node Red / OWFS / Mosquitto lightning values.

@phil do you have a one line example that I could try?

Here is a picture of what I used to do in Windows many years ago.

Mostly tinker here with hardware these days.
lightning.jpg

  Re: Latest Version under MONO
Posted by Phill on Aug-19-2018 18:51
Pete hello on another Board.....I do but linked to an MS Access database. I am back Monday will try dig one out and post. I will maybe point it at a sqlite database but haven't sorted all this out yet as my data is mainly generated by Oregon RF devices which I haven't yet ported across.


Phill