I try to migrate an application developped with ignition 7.5.5 (win server 2008, Java 1.7.0_09)
to igntion 7.6.4.
I’ve lots of error caused by :
system.tag.writeToTag need to be replace by system.tag.write.
I’ve this error, I don’t understand the cause :
Traceback (most recent call last):
File "<event:visionWindowOpened>", line 29, in <module>
File "<module:app.commun>", line 176, in jourDansDate
java.lang.ClassCastException: java.lang.ClassCastException: Cannot coerce value '[Tue Oct 08 17:32:11 CEST 2013, Tue Oct 08 17:32:11 CEST 2013, Tue Oct 08 17:32:11 CEST 2013, 1]' into type: class [Ljava.lang.Object;
caused by ClassCastException: Cannot coerce value '[Tue Oct 08 17:32:11 CEST 2013, Tue Oct 08 17:32:11 CEST 2013, Tue Oct 08 17:32:11 CEST 2013, 1]' into type: class [Ljava.lang.Object;
Ignition v7.6.4-rc1 (b2013100210)
Java: Oracle Corporation 1.7.0_09
deb = system.tag.read("[Client]SelectionHorodate/MessageInstitu/DateDebut").value
fin = system.tag.read("[Client]SelectionHorodate/MessageInstitu/DateFin").value
if app.commun.jourDansDate(deb,fin,1)==0:
...
app.commun
def jourDansDate(deb,fin,jour):
import system
import app.commun
results=system.db.runPrepQuery("select count(*) from"
+ " (select DAYOFWEEK(T.jour) as num from "
+ " (select DATEADD('DAY', X,?) as jour from (select * from system_range(0,CONST_RANGE_INSTITU))) T"
+ " where T.jour between ? and ?) D where D.num=?",[deb,deb,fin,int(jour)],dbfrontal)
return results[0][0]
DateDebut And DateFin are DateTime Client Tag :
[attachment=0]err.jpg[/attachment]