/* Module Rotate2, d'après le module Rotate code éditeur par iri (http://www.irizone.net), février 2008 sous licence Scol */ typeof plugin=S;; typeof class=S;; typeof ed = PluginEditor;; typeof LBangularX = ObjText;; typeof AngularX = ObjText;; typeof LBangularY = ObjText;; typeof AngularY = ObjText;; typeof LBangularZ = ObjText;; typeof AngularZ = ObjText;; typeof LBframerate = ObjText;; typeof Framerate = ObjText;; typeof LBinit = ObjCheck;; typeof LBend = ObjCheck;; typeof LBnumber = ObjText;; typeof Number = ObjText;; typeof LBtotalangularX = ObjText;; typeof TotalAngularX = ObjText;; typeof LBtotalangularY = ObjText;; typeof TotalAngularY = ObjText;; typeof LBtotalangularZ = ObjText;; typeof TotalAngularZ = ObjText;; proto save = fun [ [Inst r1] ] [[S r1] [S r1] [[S r1]r1] [[S r1]r1]];; fun typesuppdmi(l)= if l == nil then nil else let l->[a n] in ("action" :: (strcat a.nameInst ".startS") :: nil) :: ("action" :: (strcat a.nameInst ".stopS") :: nil) :: ("action" :: (strcat a.nameInst ".inverseS") :: nil) :: ("action" :: (strcat a.nameInst ".changeS") :: nil) :: ("actionC" :: (strcat a.nameInst ".start") :: nil) :: ("actionC" :: (strcat a.nameInst ".stop") :: nil) :: ("actionC" :: (strcat a.nameInst ".isWorking?") :: nil) :: ("actionC" :: (strcat a.nameInst ".inverse") :: nil) :: ("actionC" :: (strcat a.nameInst ".reset") :: nil) :: ("event" :: (strcat a.nameInst ".startedS") :: nil) :: ("event" :: (strcat a.nameInst ".stoppedS") :: nil) :: ("event" :: (strcat a.nameInst ".inversedS") :: nil) :: ("event" :: (strcat a.nameInst ".changedS") :: nil) :: ("eventC" :: (strcat a.nameInst ".started") :: nil) :: ("eventC" :: (strcat a.nameInst ".stopped") :: nil) :: ("eventC" :: (strcat a.nameInst ".inversed") :: nil) :: ("eventC" :: (strcat a.nameInst ".working") :: nil) :: ("eventC" :: (strcat a.nameInst ".noWorking") :: nil) :: typesuppdmi n;; fun save(l)= if l==nil then [nil nil nil nil] else [ nil /* registerF */ nil /* register */ ("plugin" :: plugin :: nil) :: nil /* supplemental Dat */ typesuppdmi l /* supplemental Dmi */ ] ;; fun cbLBend(obj, u, state)= if state then ( _ENtext Number 0; _ENtext TotalAngularY 0; _ENtext TotalAngularX 0; _ENtext TotalAngularZ 0; ) else ( _ENtext Number 1; _ENtext TotalAngularX 1; _ENtext TotalAngularY 1; _ENtext TotalAngularZ 1; );; fun getValueDegre(v)= let 65536 / 360 -> x in itoa ((atoi v) / x);; fun openedit(win, param) = let strextr param -> l in let _GETwindowSizePosition win -> [w h x y] in ( set ed = startPluginEditor _channel win 0 0 w h WN_CHILDINSIDE|WN_NOBORDER class; set LBangularX = _CRtext _channel ed.PluginEditorEditWin 5 5 80 20 ET_ALIGN_LEFT "angular X : "; set AngularX = _CReditLine _channel ed.PluginEditorEditWin 85 5 w-85 20 ET_ALIGN_LEFT|ET_DOWN|ET_NUMBER let getInfo l "angularX" -> string in if (nil == string) then "0" else getValueDegre string; set LBangularY = _CRtext _channel ed.PluginEditorEditWin 5 30 80 20 ET_ALIGN_LEFT "angular Y : "; set AngularY = _CReditLine _channel ed.PluginEditorEditWin 85 30 w-85 20 ET_ALIGN_LEFT|ET_DOWN|ET_NUMBER let getInfo l "angularY" -> string in if (nil == string) then "0" else getValueDegre string; set LBangularZ = _CRtext _channel ed.PluginEditorEditWin 5 55 80 20 ET_ALIGN_LEFT "angular Z : "; set AngularZ = _CReditLine _channel ed.PluginEditorEditWin 85 55 w-85 20 ET_ALIGN_LEFT|ET_DOWN|ET_NUMBER let getInfo l "angularZ" -> string in if (nil == string) then "0" else getValueDegre string; set LBframerate = _CRtext _channel ed.PluginEditorEditWin 5 80 80 20 ET_ALIGN_LEFT "framerate : "; set Framerate = _CReditLine _channel ed.PluginEditorEditWin 85 80 w-85 20 ET_ALIGN_LEFT|ET_DOWN|ET_NUMBER let getInfo l "Framerate" -> string in if (nil == string) then "30" else string; set LBinit = _CRcheck _channel ed.PluginEditorEditWin 5 105 w-5 20 CH_LEFT "init on : "; let getInfo l "initon" -> string in _SETcheck LBinit if (nil == string) then 0 else atoi string; set LBend = _CRcheck _channel ed.PluginEditorEditWin 5 130 w-5 20 CH_LEFT "no end : "; _SETcheck LBend let getInfo l "noend" -> string in if (nil == string) then 1 else atoi string; set LBnumber = _CRtext _channel ed.PluginEditorEditWin 5 155 80 20 ET_ALIGN_LEFT "number : "; set Number = _CReditLine _channel ed.PluginEditorEditWin 85 155 w-85 20 ET_ALIGN_LEFT|ET_DOWN|ET_NUMBER let getInfo l "number" -> string in if (nil == string) then "1" else string; set LBtotalangularX = _CRtext _channel ed.PluginEditorEditWin 5 180 80 20 ET_ALIGN_LEFT "total angular X : "; set TotalAngularX = _CReditLine _channel ed.PluginEditorEditWin 85 180 w-85 20 ET_ALIGN_LEFT|ET_DOWN|ET_NUMBER let getInfo l "totalangularX" -> string in if (nil == string) then "90" else getValueDegre string; set LBtotalangularY = _CRtext _channel ed.PluginEditorEditWin 5 205 80 20 ET_ALIGN_LEFT "total angular Y : "; set TotalAngularY = _CReditLine _channel ed.PluginEditorEditWin 85 205 w-85 20 ET_ALIGN_LEFT|ET_DOWN|ET_NUMBER let getInfo l "totalangularY" -> string in if (nil == string) then "90" else getValueDegre string; set LBtotalangularZ = _CRtext _channel ed.PluginEditorEditWin 5 230 80 20 ET_ALIGN_LEFT "total angular Z : "; set TotalAngularZ = _CReditLine _channel ed.PluginEditorEditWin 85 230 w-85 20 ET_ALIGN_LEFT|ET_DOWN|ET_NUMBER let getInfo l "totalangularZ" -> string in if (nil == string) then "90" else getValueDegre string; _CBcheck LBend @cbLBend 0; cbLBend LBend nil _GETcheck LBend; 0 ) ;; fun getValueScol(v)= let 65536 / 360 -> x in itoa ((atoi v) * x);; fun closeedit() = strbuild ("angularX" :: (getValueScol _GETtext AngularX) :: nil) :: ("angularY" :: (getValueScol _GETtext AngularY) :: nil) :: ("angularZ" :: (getValueScol _GETtext AngularZ) :: nil) :: ("Framerate" :: (_GETtext Framerate) :: nil) :: ("initon" :: (itoa _GETcheck LBinit) :: nil) :: ("noend" :: (itoa _GETcheck LBend) :: nil) :: ("number" :: (_GETtext Number) :: nil) :: ("totalangularX" :: (getValueScol _GETtext TotalAngularX) :: nil) :: ("totalangularY" :: (getValueScol _GETtext TotalAngularY) :: nil) :: ("totalangularZ" :: (getValueScol _GETtext TotalAngularZ) :: nil) :: nil;; fun IniPlug(file)= set plugin=file; set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @save nil @openedit @closeedit ;;