"############################################################################################### " " Filename: nqc.vim " " Description: gvim-menus for NQC (Not Quite C), Version 2.3r1 or newer. " " NQC stands for Not Quite C, and is a C-like language for programmimg " several LEGO MINDSTORMS products: RCX, CyberMaster, Scout and RCX2. " The language is described in: " NQC Programmers's Guide, Version 2.3r1, by Dave Baum " ( http://www.baumfamily.org/nqc/ ) " " nqc.vim turns gvim into an IDE for NQC programming: " " Features: - insert various types of comments " - insert complete but empty statements (e.g. 'if {} else {}' ) " - insert often used code snippets (e.g. function definition, #ifndef #def #endif, ... ) " - insert API-constants and calls for API-functions " - read, write, maintain your own code snippets in a separate directory " - download and start programs " - download firmware " - upload the RCX datalog into a new buffer " - show or print datalog plot (gnuplot) " - erase programs and datalogs " - configurable for RCX, RCX2, CyberMaster, Scout " " Author: Dr.-Ing. Fritz Mehner " Email: mehner@fh-swh.de " " Usage: (1 ) Configure nqc.vim " There are some technical and personal details which should be configured " (see section Configuration below; use my configuration as an example). " " (2.1) Load nqc.vim manually into VIM with the 'so' command: " :so /nqc.vim " " or better " " (2.2) Load nqc.vim on startup (VIM version 6.0 and higher) : " - move this file to the directory ~/.vim/plugin/ " " You will find the menu entry "Load NQC Support" in the Tools menu. " After loading the menus this menu entry changes to "Unload NQC Support". " let s:NQC_Version = "2.0" " version number of this script; do not change " Revision: 26.04.2003 " " Created: 23.10.2002 " " Copyright: Copyright (C) 2002-2003 Dr.-Ing. Fritz Mehner (mehner@fh-swf.de) " " This program is free software; you can redistribute it and/or modify " it under the terms of the GNU General Public License as published by " the Free Software Foundation; either version 2 of the License, or " (at your option) any later version. " "############################################################################################### " " Configuration (Use my configuration as an example) " "----------------------------------------------------------------------------------------------- " " Personalization (full name, email, ... ; used in comments) : " let s:NQC_AuthorName = "Fritz Mehner" let s:NQC_AuthorRef = "Mn" " " RCX-Firmware (RCX 1.5, RCX 2.0, ... ); full path and filename : " let NQC_RCX_Firmware = $HOME."/bin/firm0328.lgo" " " Choose a target : " " RCX : Mindstorms with RCX " RCX2 : Mindstorms with RCX 2 " Scout : Scout " CM : Cybermaster " let NQC_Target = "RCX2" " " Specify serial port, case matters (file permission 777) : " /dev/ttyS0 = COM1 " /dev/ttyS1 = COM2 " let NQC_Portname = "/dev/ttyS0" " " let s:NQC_ShowMenues = "no" " show menues immediately after loading (yes/no) " " let s:NQC_Printer = "lpr" " printer command " " " The menu entries for code snippet support will not appear " if the following string is empty let s:NQC_CodeSnippets = $HOME."/.vim/codesnippets-nqc" " NQC code snippets " " "----------------------------------------------------------------------------------------------- " End of Configuration Section "############################################################################################### " function! NQC_InitMenu () " "=============================================================================================== "----- Menu : Key Mappings --------------------------------------------------------------------- "=============================================================================================== " The following key mappings are for convenience only. " Comment out the mappings if you dislike them. " If enabled, there may be conflicts with predefined key bindings of your window manager. "----------------------------------------------------------------------------------------------- " F9 save and compile " noremap :call NQC_SaveCompile() " inoremap :call NQC_SaveCompile() " " "----- for developement only ------------------------------------------------------------------- " " noremap :write:so %:call NQC_Handle():call NQC_Handle():call NQC_Handle() " inoremap :write:so %:call NQC_Handle():call NQC_Handle():call NQC_Handle() " "=============================================================================================== "----- Menu : NQC-Comments --------------------------------------------------------------------- "=============================================================================================== " MENU ENTRY " ----------------- " Line End Comment " Frame Comment " Function Description " File Prologue " Author+Date+Time " Date+Time " Date " comment out a highlighted block of code " uncomment a highlighted block of code "=============================================================================================== " amenu NQC-&Comments.&Line\ End\ Comment A// amenu NQC-&Comments.&Frame\ Comment :call NQC_CommentFrame() jA amenu NQC-&Comments.task\/function\/sub\ &Description :call NQC_CommentFunction() :/NAMEA amenu NQC-&Comments.File\ &Prologue :call NQC_CommentFilePrologue() :/DESCRIPTIONA amenu NQC-&Comments.-SEP1- : amenu NQC-&Comments.\/\/\ Date\ Time\ &Author $:call NQC_CommentDateTimeAuthor() kJA vmenu NQC-&Comments.&code->comment :'<,'>s/^/\/\//:nohlsearch vmenu NQC-&Comments.c&omment->code :'<,'>s/^\/\///:nohlsearch amenu NQC-&Comments.-SEP2- : " menu NQC-&Comments.&Date i=strftime("%x") imenu NQC-&Comments.&Date =strftime("%x") menu NQC-&Comments.Date\ &Time i=strftime("%x %X %Z") imenu NQC-&Comments.Date\ &Time =strftime("%x %X %Z") " "=============================================================================================== "----- Menu : NQC-Statements ------------------------------------------------------------------- "=============================================================================================== " Inserting at the end of a line preserves indentation. "----------------------------------------------------------------------------------------------- " amenu NQC-St&atements.&if oif ( )F(la amenu NQC-St&atements.if\ &else oif ( )else1kf)hi amenu NQC-St&atements.i&f\ \{\ \} oif ( ){}2kf(la amenu NQC-St&atements.if\ \{\ \}\ e&lse\ \{\ \} oif ( ){}else{}5kf(la amenu NQC-St&atements.f&or ofor ( ; ; )2F;i amenu NQC-St&atements.fo&r\ \{\ \} ofor ( ; ; ){}2kf;i " amenu NQC-St&atements.&while\ \{\ \} owhile ( ){}2kf(la amenu NQC-St&atements.&do\ \{\ \}\ while :call NQC_DoWhile()3jf(la amenu NQC-St&atements.re&peat\ \{\ \} orepeat ( ){}3kf(la amenu NQC-St&atements.&until ountil ( );F(la amenu NQC-St&atements.&switch :call NQC_CodeSwitch()f(la amenu NQC-St&atements.&case ocase 0:break;2kf0s amenu NQC-St&atements.brea&k obreak;a amenu NQC-St&atements.continue ocontinue;a amenu NQC-St&atements.st&art ostart;kf;i " amenu NQC-St&atements.-SEP1- : amenu NQC-St&atements.&task :call NQC_CodeTask()3jA amenu NQC-St&atements.function :call NQC_CodeInlineFunction()3jA amenu NQC-St&atements.su&broutine :call NQC_CodeSubroutine()3jA " amenu NQC-St&atements.-SEP2- : amenu NQC-St&atements.#include\ \"\.\.\.\" o#include".nqh"F.i amenu NQC-St&atements.&#define o#define//4Fa amenu NQC-St&atements.#ifndef\.\.#def\.\.#endif :call NQC_CodeIfndef()2ji amenu NQC-St&atements.#ifdef\.\.#endif o#ifdef#endif3kA " if g:NQC_Target=="RCX2" || g:NQC_Target=="Scout" amenu NQC-St&atements.-SEP3- : amenu NQC-St&atements.ac&quire :call NQC_Acquire()f(a amenu NQC-St&atements.&monitor :call NQC_Monitor()f(a amenu NQC-St&atements.catc&h\ \(\ \) :call NQC_Catch()f(a endif if s:NQC_CodeSnippets != "" " imenu NQC-St&atements.-SEP6- : amenu NQC-St&atements.read\ code\ snippet :call NQC_CodeSnippet("r") amenu NQC-St&atements.write\ code\ snippet :call NQC_CodeSnippet("w") vmenu NQC-St&atements.write\ code\ snippet :call NQC_CodeSnippet("wv") amenu NQC-St&atements.edit\ code\ snippet :call NQC_CodeSnippet("e") endif " "=============================================================================================== "----- Menu : API-Functions -------------------------------------------------------------------- "=============================================================================================== " "----- outputs ---------------------------------------------------------------------------- menu API-Functions.outputs.Float\ (outputs) aFloat();F(a menu API-Functions.outputs.Fwd\ (outputs) aFwd();F(a menu API-Functions.outputs.Off\ (outputs) aOff();F(a menu API-Functions.outputs.On\ (outputs) aOn();F(a menu API-Functions.outputs.OnFor\ (outputs,time) aOnFor(,);F(a menu API-Functions.outputs.OnFwd\ (outputs) aOnFwd();F(a menu API-Functions.outputs.OnRev\ (outputs) aOnRev();F(a menu API-Functions.outputs.OutputStatus\ (n) aOutputStatus()F(a menu API-Functions.outputs.Rev\ (outputs) aRev();F(a menu API-Functions.outputs.SetDirection\ (outputs,dir) aSetDirection(,);F(a menu API-Functions.outputs.SetOutput\ (outputs,mode) aSetOutput(,);F(a menu API-Functions.outputs.SetPower\ (outputs,power) aSetPower(,);F(a menu API-Functions.outputs.Toggle\ (outputs) aToggle();F(a " imenu API-Functions.outputs.Float\ (outputs) Float();F(a imenu API-Functions.outputs.Fwd\ (outputs) Fwd();F(a imenu API-Functions.outputs.Off\ (outputs) Off();F(a imenu API-Functions.outputs.On\ (outputs) On();F(a imenu API-Functions.outputs.OnFor\ (outputs,time) OnFor(,);F(a imenu API-Functions.outputs.OnFwd\ (outputs) OnFwd();F(a imenu API-Functions.outputs.OnRev\ (outputs) OnRev();F(a imenu API-Functions.outputs.OutputStatus\ (n) OutputStatus()F(a imenu API-Functions.outputs.Rev\ (outputs) Rev();F(a imenu API-Functions.outputs.SetDirection\ (outputs,dir) SetDirection(,);F(a imenu API-Functions.outputs.SetOutput\ (outputs,mode) SetOutput(,);F(a imenu API-Functions.outputs.SetPower\ (outputs,power) SetPower(,);F(a imenu API-Functions.outputs.Toggle\ (outputs) Toggle();F(a " "----- sensor types, modes, information --------------------------------------------------- imenu API-Functions.sensors.ClearSensor\ (sensor) ClearSensor();F(a if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" || g:NQC_Target=="CM" menu API-Functions.sensors.SensorMode\ (n) aSensorMode();F(a imenu API-Functions.sensors.SensorMode\ (n) SensorMode();F(a endif menu API-Functions.sensors.SensorType\ (n) aSensorType();F(a imenu API-Functions.sensors.SensorType\ (n) SensorType();F(a if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" menu API-Functions.sensors.SensorValueBool\ (n) aSensorValueBool()F(a imenu API-Functions.sensors.SensorValueBool\ (n) SensorValueBool()F(a endif if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" || g:NQC_Target=="Scout" menu API-Functions.sensors.SensorValueRaw\ (n) aSensorValueRaw()F(a imenu API-Functions.sensors.SensorValueRaw\ (n) SensorValueRaw()F(a endif menu API-Functions.sensors.SensorValue\ (n) aSensorValue()F(a imenu API-Functions.sensors.SensorValue\ (n) SensorValue()F(a if g:NQC_Target=="Scout" menu API-Functions.sensors.SetSensorLowerLimit\ (value) aSetSensorLowerLimit();F(a menu API-Functions.sensors.SetSensorUpperLimit\ (value) aSetSensorUpperLimit();F(a menu API-Functions.sensors.SetSensorHysteresis\ (value) aSetSensorHysteresis();F(a menu API-Functions.sensors.CalibrateSensor\ (\ ) aCalibrateSensor(); imenu API-Functions.sensors.SetSensorLowerLimit\ (value) SetSensorLowerLimit();F(a imenu API-Functions.sensors.SetSensorUpperLimit\ (value) SetSensorUpperLimit();F(a imenu API-Functions.sensors.SetSensorHysteresis\ (value) SetSensorHysteresis();F(a imenu API-Functions.sensors.CalibrateSensor\ (\ ) CalibrateSensor(); endif if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" menu API-Functions.sensors.SetSensor\ (sensor,config) aSetSensor(,);F(a imenu API-Functions.sensors.SetSensor\ (sensor,config) SetSensor(,);F(a endif if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" || g:NQC_Target=="CM" menu API-Functions.sensors.SetSensorMode\ (sensor,mode) aSetSensorMode(,);F(a imenu API-Functions.sensors.SetSensorMode\ (sensor,mode) SetSensorMode(,);F(a endif if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" menu API-Functions.sensors.SetSensorType\ (sensor,type) aSetSensorType(,)F(a imenu API-Functions.sensors.SetSensorType\ (sensor,type) SetSensorType(,)F(a endif "----- timers and counters ---------------------------------------------------------------- menu API-Functions.timers\ counters.ClearTimer\ (n) aClearTimer();F(a menu API-Functions.timers\ counters.Timer\ (n) aTimer()F(a imenu API-Functions.timers\ counters.ClearTimer\ (n) ClearTimer();F(a imenu API-Functions.timers\ counters.Timer\ (n) Timer()F(a if g:NQC_Target=="RCX2" menu API-Functions.timers\ counters.FastTimer\ (n) aFastTimer()F(a menu API-Functions.timers\ counters.SetTimer\ (n,value) aSetTimer(,);F(a imenu API-Functions.timers\ counters.FastTimer\ (n) FastTimer()F(a imenu API-Functions.timers\ counters.SetTimer\ (n,value) SetTimer(,);F(a endif if g:NQC_Target=="RCX2" || g:NQC_Target=="Scout" menu API-Functions.timers\ counters.Counter\ (n) aCounter()F(a menu API-Functions.timers\ counters.ClearCounter\ (n) aClearCounter();F(a menu API-Functions.timers\ counters.DecCounter\ (n) aDecCounter();F(a menu API-Functions.timers\ counters.IncCounter\ (n) aIncCounter();F(a imenu API-Functions.timers\ counters.Counter\ (n) Counter()F(a imenu API-Functions.timers\ counters.ClearCounter\ (n) ClearCounter();F(a imenu API-Functions.timers\ counters.DecCounter\ (n) DecCounter();F(a imenu API-Functions.timers\ counters.IncCounter\ (n) IncCounter();F(a endif "----- sounds ----------------------------------------------------------------------------- if g:NQC_Target=="RCX2" menu API-Functions.sounds.ClearSound\ (\n) aClearSound(); imenu API-Functions.sounds.ClearSound\ (\n) ClearSound(); endif menu API-Functions.sounds.PlaySound\ (sound) aPlaySound();F(a menu API-Functions.sounds.PlayTone\ (freq,duration) aPlayTone(,);F(a imenu API-Functions.sounds.PlaySound\ (sound) PlaySound();F(a imenu API-Functions.sounds.PlayTone\ (freq,duration) PlayTone(,);F(a if g:NQC_Target=="RCX2" || g:NQC_Target=="Scout" menu API-Functions.sounds.MuteSound\ (\n) aMuteSound(); menu API-Functions.sounds.UnmuteSound\ (\n) aUnmuteSound(); imenu API-Functions.sounds.MuteSound\ (\n) MuteSound(); imenu API-Functions.sounds.UnmuteSound\ (\n) UnmuteSound(); endif if g:NQC_Target=="Scout" menu API-Functions.sounds.SelectSound\ (group) aSelectSound();F(a imenu API-Functions.sounds.SelectSound\ (group) SelectSound();F(a endif "----- LCD display ------------------------------------------------------------------------ if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" menu API-Functions.display.SelectDisplay\ (mode) aSelectDisplay();F(a imenu API-Functions.display.SelectDisplay\ (mode) SelectDisplay();F(a endif if g:NQC_Target=="RCX2" menu API-Functions.display.SetUserDisplay\ (value,precision) aSetUserDisplay(,);F(a imenu API-Functions.display.SetUserDisplay\ (value,precision) SetUserDisplay(,);F(a endif "----- messages --------------------------------------------------------------------------- if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" || g:NQC_Target=="Scout" menu API-Functions.messages.ClearMessage\ (\ ) aClearMessage(); menu API-Functions.messages.Message\ (\ ) aMessage() menu API-Functions.messages.SendMessage\ (message) aSendMessage();F(a menu API-Functions.messages.SetTxPower\ (power) aSetTxPower();F(a imenu API-Functions.messages.ClearMessage\ (\ ) ClearMessage(); imenu API-Functions.messages.Message\ (\ ) Message() imenu API-Functions.messages.SendMessage\ (message) SendMessage();F(a imenu API-Functions.messages.SetTxPower\ (power) SetTxPower();F(a endif "----- general ---------------------------------------------------------------------------- menu API-Functions.general.Random\ (n) aRandom()F(a menu API-Functions.general.SetSleepTime\ (minutes) aSetSleepTime();F(a imenu API-Functions.general.Random\ (n) Random()F(a imenu API-Functions.general.SetSleepTime\ (minutes) SetSleepTime();F(a if g:NQC_Target=="RCX2" menu API-Functions.general.SetRandomSeed\ (n) aSetRandomSeed();F(a imenu API-Functions.general.SetRandomSeed\ (n) SetRandomSeed();F(a endif menu API-Functions.general.SleepNow\ (\ ) aSleepNow(); menu API-Functions.general.StopAllTasks\ (\ ) aStopAllTasks(); menu API-Functions.general.Wait\ (time) aWait();F(a imenu API-Functions.general.SleepNow\ (\ ) SleepNow(); imenu API-Functions.general.StopAllTasks\ (\ ) StopAllTasks(); imenu API-Functions.general.Wait\ (time) Wait();F(a "----- RCX features ----------------------------------------------------------------------- if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" menu API-Functions.RCX\ features.Program\ (\ ) aProgram() menu API-Functions.RCX\ features.SetWatch\ (hours,minutes) aSetWatch(,);F(a menu API-Functions.RCX\ features.Watch\ (\n) aWatch() imenu API-Functions.RCX\ features.Program\ (\ ) Program() imenu API-Functions.RCX\ features.SetWatch\ (hours,minutes) SetWatch(,);F(a imenu API-Functions.RCX\ features.Watch\ (\n) Watch() endif if g:NQC_Target=="RCX2" menu API-Functions.RCX\ features.BatteryLevel\ (\ ) aBatteryLevel() menu API-Functions.RCX\ features.FirmwareVersion\ (\ ) aFirmwareVersion() menu API-Functions.RCX\ features.SelectProgram\ (n) aSelectProgram();F(a imenu API-Functions.RCX\ features.BatteryLevel\ (\ ) BatteryLevel() imenu API-Functions.RCX\ features.FirmwareVersion\ (\ ) FirmwareVersion() imenu API-Functions.RCX\ features.SelectProgram\ (n) SelectProgram();F(a endif "----- SCOUT features ----------------------------------------------------------------------- if g:NQC_Target=="Scout" menu API-Functions.Scout\ features.EventFeedback\ (\ ) aEventFeedback() menu API-Functions.Scout\ features.ScoutRules\ (n) aScoutRules()F(a menu API-Functions.Scout\ features.SetEventFeedback\ (events) aSetEventFeedback();F(a menu API-Functions.Scout\ features.SetLight\ (mode) aSetLight();F(a menu API-Functions.Scout\ features.SetScoutRules\ (motion,touch,light,time,fx) aSetScoutRules(,,,,);F(a menu API-Functions.Scout\ features.SetScoutMode\ (mode) aSetScoutMode();F(a imenu API-Functions.Scout\ features.EventFeedback\ (\ ) EventFeedback() imenu API-Functions.Scout\ features.ScoutRules\ (n) ScoutRules()F(a imenu API-Functions.Scout\ features.SetEventFeedback\ (events) SetEventFeedback();F(a imenu API-Functions.Scout\ features.SetLight\ (mode) SetLight();F(a imenu API-Functions.Scout\ features.SetScoutRules\ (motion,touch,light,time,fx) SetScoutRules(,,,,);F(a imenu API-Functions.Scout\ features.SetScoutMode\ (mode) SetScoutMode();F(a endif "----- CYBERMASTER features ----------------------------------------------------------------------- if g:NQC_Target=="CM" menu API-Functions.cybermaster\ features.Drive\ (motor0,motor1) aDrive(,);F(a menu API-Functions.cybermaster\ features.OnWait\ (motors,time) aOnWait(,);F(a menu API-Functions.cybermaster\ features.OnWaitDifferent\ (motors,n0,n1,n2,time) aOnWaitDifferent(,,,,);F(a menu API-Functions.cybermaster\ features.ClearTachoCounter\ (motors) aClearTachoCounter();F(a menu API-Functions.cybermaster\ features.TachoCount\ (n) aTachoCount()F(a menu API-Functions.cybermaster\ features.TachoSpeed\ (n) aTachoSpeed()F(a menu API-Functions.cybermaster\ features.ExternalMotorRunning\ (\n) aExternalMotorRunning() menu API-Functions.cybermaster\ features.AGC\ (\ ) aAGC() imenu API-Functions.cybermaster\ features.Drive\ (motor0,motor1) Drive(,);F(a imenu API-Functions.cybermaster\ features.OnWait\ (motors,time) OnWait(,);F(a imenu API-Functions.cybermaster\ features.OnWaitDifferent\ (motors,n0,n1,n2,time) OnWaitDifferent(,,,,);F(a imenu API-Functions.cybermaster\ features.ClearTachoCounter\ (motors) ClearTachoCounter();F(a imenu API-Functions.cybermaster\ features.TachoCount\ (n) TachoCount()F(a imenu API-Functions.cybermaster\ features.TachoSpeed\ (n) TachoSpeed()F(a imenu API-Functions.cybermaster\ features.ExternalMotorRunning\ (\n) ExternalMotorRunning() imenu API-Functions.cybermaster\ features.AGC\ (\ ) AGC() endif "----- datalog ---------------------------------------------------------------------------- if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" menu API-Functions.datalog.AddToDatalog\ (value) aAddToDatalog();F(a menu API-Functions.datalog.CreateDatalog\ (size) aCreateDatalog();F(a menu API-Functions.datalog.UploadDatalog\ (start,count) aUploadDatalog(,);F(a imenu API-Functions.datalog.AddToDatalog\ (value) AddToDatalog();F(a imenu API-Functions.datalog.CreateDatalog\ (size) CreateDatalog();F(a imenu API-Functions.datalog.UploadDatalog\ (start,count) UploadDatalog(,);F(a endif "----- global control -------------------------------------------------------------------- if g:NQC_Target=="RCX2" || g:NQC_Target=="Scout" menu API-Functions.global\ control.SetGlobalOutput\ (outputs,mode) aSetGlobalOutput(,);F(a menu API-Functions.global\ control.SetGlobalDirection\ (outputs,mode) aSetGlobalDirection(,);F(a menu API-Functions.global\ control.SetMaxPower\ (outputs,power) aSetMaxPower(,);F(a menu API-Functions.global\ control.GlobalOutputStatus\ (n) aGlobalOutputStatus()F(a imenu API-Functions.global\ control.SetGlobalOutput\ (outputs,mode) SetGlobalOutput(,);F(a imenu API-Functions.global\ control.SetGlobalDirection\ (outputs,mode) SetGlobalDirection(,);F(a imenu API-Functions.global\ control.SetMaxPower\ (outputs,power) SetMaxPower(,);F(a imenu API-Functions.global\ control.GlobalOutputStatus\ (n) GlobalOutputStatus()F(a endif "----- serial ---------------------------------------------------------------------------- if g:NQC_Target=="RCX2" menu API-Functions.serial.InternalMessage\ (message) aInternalMessage();F(a menu API-Functions.serial.SetSerialComm\ (settings) aSetSerialComm();F(a menu API-Functions.serial.SetSerialPacket\ (settings) aSetSerialPacket();F(a menu API-Functions.serial.SetSerialData\ (n,value) aSetSerialData(,);F(a menu API-Functions.serial.SerialComm\ (\ ) aSerialComm() menu API-Functions.serial.SerialData\ (n) aSerialData()F(a menu API-Functions.serial.SerialPacket\ (\ ) aSerialPacket() menu API-Functions.serial.SendSerial\ (start,count) aSendSerial(,);F(a imenu API-Functions.serial.InternalMessage\ (message) InternalMessage();F(a imenu API-Functions.serial.SetSerialComm\ (settings) SetSerialComm();F(a imenu API-Functions.serial.SetSerialPacket\ (settings) SetSerialPacket();F(a imenu API-Functions.serial.SetSerialData\ (n,value) SetSerialData(,);F(a imenu API-Functions.serial.SerialComm\ (\ ) SerialComm() imenu API-Functions.serial.SerialData\ (n) SerialData()F(a imenu API-Functions.serial.SerialPacket\ (\ ) SerialPacket() imenu API-Functions.serial.SendSerial\ (start,count) SendSerial(,);F(a endif "----- VLL -------------------------------------------------------------------------------- if g:NQC_Target=="Scout" menu API-Functions.VLL.SendVLL\ (value) aSendVLL();F(a imenu API-Functions.VLL.SendVLL\ (value) SendVLL();F(a endif "----- access control ---------------------------------------------------------------------- if g:NQC_Target=="RCX2" || g:NQC_Target=="Scout" menu API-Functions.access\ control.SetPriority\ (p) aSetPriority();F(a imenu API-Functions.access\ control.SetPriority\ (p) SetPriority();F(a endif "----- RCX2 events ------------------------------------------------------------------------- if g:NQC_Target=="RCX2" menu API-Functions.RCX2\ events.CalibrateEvent\ (event,lower,upper,hyst) aCalibrateEvent(,,,);F(a menu API-Functions.RCX2\ events.ClearAllEvents\ (\ ) aClearAllEvents() menu API-Functions.RCX2\ events.ClearEvent\ (event) aClearEvent()F(a menu API-Functions.RCX2\ events.ClickCounter\ (event) aClickCounter()F(a menu API-Functions.RCX2\ events.ClickTime\ (event) aClickTime()F(a menu API-Functions.RCX2\ events.Event\ (event) aEvent();F(a menu API-Functions.RCX2\ events.EventState\ (event) aEventState()F(a menu API-Functions.RCX2\ events.Hysteresis\ (event) aHysteresis()F(a menu API-Functions.RCX2\ events.LowerLimit\ (event) aLowerLimit()F(a menu API-Functions.RCX2\ events.SetClickCounter\ (event,value) aSetClickCounter();F(a menu API-Functions.RCX2\ events.SetClickTime\ (event,value) aSetClickTime();F(a menu API-Functions.RCX2\ events.SetEvent\ (event,source,type) aSetEvent();F(a menu API-Functions.RCX2\ events.SetHysteresis\ (event,value) aSetHysteresis();F(a menu API-Functions.RCX2\ events.SetLowerLimit\ (event,limit) aSetLowerLimit();F(a menu API-Functions.RCX2\ events.SetUpperLimit\ (event,limit) aSetUpperLimit();F(a menu API-Functions.RCX2\ events.UpperLimit\ (event) aUpperLimit()F(a menu API-Functions.RCX2\ events.ActiveEvents\ (task) aActiveEvents()F(a menu API-Functions.RCX2\ events.CurrentEvents\ (\ ) aCurrentEvents(); menu API-Functions.RCX2\ events.Events\ (events) aEvents()F(a " imenu API-Functions.RCX2\ events.CalibrateEvent\ (event,lower,upper,hyst) CalibrateEvent(,,,);F(a imenu API-Functions.RCX2\ events.ClearAllEvents\ (\ ) ClearAllEvents() imenu API-Functions.RCX2\ events.ClearEvent\ (event) ClearEvent()F(a imenu API-Functions.RCX2\ events.ClickCounter\ (event) ClickCounter()F(a imenu API-Functions.RCX2\ events.ClickTime\ (event) ClickTime()F(a imenu API-Functions.RCX2\ events.Event\ (event) Event();F(a imenu API-Functions.RCX2\ events.EventState\ (event) EventState()F(a imenu API-Functions.RCX2\ events.Hysteresis\ (event) Hysteresis()F(a imenu API-Functions.RCX2\ events.LowerLimit\ (event) LowerLimit()F(a imenu API-Functions.RCX2\ events.SetClickCounter\ (event,value) SetClickCounter();F(a imenu API-Functions.RCX2\ events.SetClickTime\ (event,value) SetClickTime();F(a imenu API-Functions.RCX2\ events.SetEvent\ (event,source,type) SetEvent();F(a imenu API-Functions.RCX2\ events.SetHysteresis\ (event,value) SetHysteresis();F(a imenu API-Functions.RCX2\ events.SetLowerLimit\ (event,limit) SetLowerLimit();F(a imenu API-Functions.RCX2\ events.SetUpperLimit\ (event,limit) SetUpperLimit();F(a imenu API-Functions.RCX2\ events.UpperLimit\ (event) UpperLimit()F(a imenu API-Functions.RCX2\ events.ActiveEvents\ (task) ActiveEvents()F(a imenu API-Functions.RCX2\ events.CurrentEvents\ (\ ) CurrentEvents(); imenu API-Functions.RCX2\ events.Events\ (events) Events()F(a endif "----- Scout events ------------------------------------------------------------------------ if g:NQC_Target=="Scout" menu API-Functions.Scout\ events.ActiveEvents\ (task) aActiveEvents();F(a menu API-Functions.Scout\ events.CounterLimit\ (n) aCounterLimit()F(a menu API-Functions.Scout\ events.Events\ (events) aEvents();F(a menu API-Functions.Scout\ events.SetSensorClickTime\ (time) aSetSensorClickTime();F(a menu API-Functions.Scout\ events.SetCounterLimit\ (n,value) aSetCounterLimit(,);F(a menu API-Functions.Scout\ events.SetTimerLimit\ (n,value) aSetTimerLimit(,);F(a menu API-Functions.Scout\ events.TimerLimit\ (n) aTimerLimit()F(a imenu API-Functions.Scout\ events.ActiveEvents\ (task) ActiveEvents();F(a imenu API-Functions.Scout\ events.CounterLimit\ (n) CounterLimit()F(a imenu API-Functions.Scout\ events.Events\ (events) Events();F(a imenu API-Functions.Scout\ events.SetSensorClickTime\ (time) SetSensorClickTime();F(a imenu API-Functions.Scout\ events.SetCounterLimit\ (n,value) SetCounterLimit(,);F(a imenu API-Functions.Scout\ events.SetTimerLimit\ (n,value) SetTimerLimit(,);F(a imenu API-Functions.Scout\ events.TimerLimit\ (n) TimerLimit()F(a endif " " "=============================================================================================== "----- Menu : API-Constants -------------------------------------------------------------------- "=============================================================================================== " "----- access control --------------------------------------------------------------------- if g:NQC_Target=="RCX2" || g:NQC_Target=="Scout" menu API-Constants.access\ control.ACQUIRE_OUT_A aACQUIRE_OUT_A menu API-Constants.access\ control.ACQUIRE_OUT_B aACQUIRE_OUT_B menu API-Constants.access\ control.ACQUIRE_OUT_C aACQUIRE_OUT_C menu API-Constants.access\ control.ACQUIRE_SOUND aACQUIRE_SOUND imenu API-Constants.access\ control.ACQUIRE_OUT_A ACQUIRE_OUT_A imenu API-Constants.access\ control.ACQUIRE_OUT_B ACQUIRE_OUT_B imenu API-Constants.access\ control.ACQUIRE_OUT_C ACQUIRE_OUT_C imenu API-Constants.access\ control.ACQUIRE_SOUND ACQUIRE_SOUND endif if g:NQC_Target=="RCX2" menu API-Constants.access\ control.ACQUIRE_USER_1 aACQUIRE_USER_1 menu API-Constants.access\ control.ACQUIRE_USER_2 aACQUIRE_USER_2 menu API-Constants.access\ control.ACQUIRE_USER_3 aACQUIRE_USER_3 menu API-Constants.access\ control.ACQUIRE_USER_4 aACQUIRE_USER_4 imenu API-Constants.access\ control.ACQUIRE_USER_1 ACQUIRE_USER_1 imenu API-Constants.access\ control.ACQUIRE_USER_2 ACQUIRE_USER_2 imenu API-Constants.access\ control.ACQUIRE_USER_3 ACQUIRE_USER_3 imenu API-Constants.access\ control.ACQUIRE_USER_4 ACQUIRE_USER_4 endif "----- display ---------------------------------------------------------------------------- if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" menu API-Constants.display.DISPLAY_OUT_A aDISPLAY_OUT_A menu API-Constants.display.DISPLAY_OUT_B aDISPLAY_OUT_B menu API-Constants.display.DISPLAY_OUT_C aDISPLAY_OUT_C menu API-Constants.display.DISPLAY_SENSOR_1 aDISPLAY_SENSOR_1 menu API-Constants.display.DISPLAY_SENSOR_2 aDISPLAY_SENSOR_2 menu API-Constants.display.DISPLAY_SENSOR_3 aDISPLAY_SENSOR_3 menu API-Constants.display.DISPLAY_WATCH aDISPLAY_WATCH imenu API-Constants.display.DISPLAY_OUT_A DISPLAY_OUT_A imenu API-Constants.display.DISPLAY_OUT_B DISPLAY_OUT_B imenu API-Constants.display.DISPLAY_OUT_C DISPLAY_OUT_C imenu API-Constants.display.DISPLAY_SENSOR_1 DISPLAY_SENSOR_1 imenu API-Constants.display.DISPLAY_SENSOR_2 DISPLAY_SENSOR_2 imenu API-Constants.display.DISPLAY_SENSOR_3 DISPLAY_SENSOR_3 imenu API-Constants.display.DISPLAY_WATCH DISPLAY_WATCH endif if g:NQC_Target=="RCX2" menu API-Constants.display.DISPLAY_USER aDISPLAY_USER imenu API-Constants.display.DISPLAY_USER DISPLAY_USER endif "----- output ---------------------------------------------------------------------------- menu API-Constants.output.OUT_A aOUT_A menu API-Constants.output.OUT_B aOUT_B menu API-Constants.output.OUT_C aOUT_C menu API-Constants.output.OUT_FLOAT aOUT_FLOAT menu API-Constants.output.OUT_FULL aOUT_FULL menu API-Constants.output.OUT_FWD aOUT_FWD menu API-Constants.output.OUT_HALF aOUT_HALF menu API-Constants.output.OUT_LOW aOUT_LOW menu API-Constants.output.OUT_OFF aOUT_OFF menu API-Constants.output.OUT_ON aOUT_ON menu API-Constants.output.OUT_REV aOUT_REV menu API-Constants.output.OUT_TOGGLE aOUT_TOGGLE imenu API-Constants.output.OUT_A OUT_A imenu API-Constants.output.OUT_B OUT_B imenu API-Constants.output.OUT_C OUT_C imenu API-Constants.output.OUT_FLOAT OUT_FLOAT imenu API-Constants.output.OUT_FULL OUT_FULL imenu API-Constants.output.OUT_FWD OUT_FWD imenu API-Constants.output.OUT_HALF OUT_HALF imenu API-Constants.output.OUT_LOW OUT_LOW imenu API-Constants.output.OUT_OFF OUT_OFF imenu API-Constants.output.OUT_ON OUT_ON imenu API-Constants.output.OUT_REV OUT_REV imenu API-Constants.output.OUT_TOGGLE OUT_TOGGLE if g:NQC_Target=="CM" menu API-Constants.output.OUT_L aOUT_L menu API-Constants.output.OUT_R aOUT_R menu API-Constants.output.OUT_X aOUT_X imenu API-Constants.output.OUT_L OUT_L imenu API-Constants.output.OUT_R OUT_R imenu API-Constants.output.OUT_X OUT_X endif "----- sensor ---------------------------------------------------------------------------- if g:NQC_Target=="RCX2" menu API-Constants.serial.SERIAL_COMM_DEFAULT aSERIAL_COMM_DEFAULT menu API-Constants.serial.SERIAL_COMM_4800 aSERIAL_COMM_4800 menu API-Constants.serial.SERIAL_COMM_DUTY25 aSERIAL_COMM_DUTY25 menu API-Constants.serial.SERIAL_COMM_76KHZ aSERIAL_COMM_76KHZ menu API-Constants.serial.SERIAL_PACKET_DEFAULT aSERIAL_PACKET_DEFAULT menu API-Constants.serial.SERIAL_PACKET_PREAMBLE aSERIAL_PACKET_PREAMBLE menu API-Constants.serial.SERIAL_PACKET_NEGATED aSERIAL_PACKET_NEGATED menu API-Constants.serial.SERIAL_PACKET_CHECKSUM aSERIAL_PACKET_CHECKSUM menu API-Constants.serial.SERIAL_PACKET_RCX aSERIAL_PACKET_RCX imenu API-Constants.serial.SERIAL_COMM_DEFAULT SERIAL_COMM_DEFAULT imenu API-Constants.serial.SERIAL_COMM_4800 SERIAL_COMM_4800 imenu API-Constants.serial.SERIAL_COMM_DUTY25 SERIAL_COMM_DUTY25 imenu API-Constants.serial.SERIAL_COMM_76KHZ SERIAL_COMM_76KHZ imenu API-Constants.serial.SERIAL_PACKET_DEFAULT SERIAL_PACKET_DEFAULT imenu API-Constants.serial.SERIAL_PACKET_PREAMBLE SERIAL_PACKET_PREAMBLE imenu API-Constants.serial.SERIAL_PACKET_NEGATED SERIAL_PACKET_NEGATED imenu API-Constants.serial.SERIAL_PACKET_CHECKSUM SERIAL_PACKET_CHECKSUM imenu API-Constants.serial.SERIAL_PACKET_RCX SERIAL_PACKET_RCX endif "----- sensor ---------------------------------------------------------------------------- menu API-Constants.sensor.SENSOR_1 aSENSOR_1 menu API-Constants.sensor.SENSOR_2 aSENSOR_2 menu API-Constants.sensor.SENSOR_3 aSENSOR_3 imenu API-Constants.sensor.SENSOR_1 SENSOR_1 imenu API-Constants.sensor.SENSOR_2 SENSOR_2 imenu API-Constants.sensor.SENSOR_3 SENSOR_3 if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" menu API-Constants.sensor.SENSOR_CELSIUS aSENSOR_CELSIUS menu API-Constants.sensor.SENSOR_EDGE aSENSOR_EDGE menu API-Constants.sensor.SENSOR_FAHRENHEIT aSENSOR_FAHRENHEIT menu API-Constants.sensor.SENSOR_LIGHT aSENSOR_LIGHT menu API-Constants.sensor.SENSOR_PULSE aSENSOR_PULSE menu API-Constants.sensor.SENSOR_ROTATION aSENSOR_ROTATION menu API-Constants.sensor.SENSOR_TOUCH aSENSOR_TOUCH menu API-Constants.sensor.SENSOR_MODE_CELSIUS aSENSOR_MODE_CELSIUS menu API-Constants.sensor.SENSOR_MODE_FAHRENHEIT aSENSOR_MODE_FAHRENHEIT menu API-Constants.sensor.SENSOR_MODE_ROTATION aSENSOR_MODE_ROTATION imenu API-Constants.sensor.SENSOR_CELSIUS SENSOR_CELSIUS imenu API-Constants.sensor.SENSOR_EDGE SENSOR_EDGE imenu API-Constants.sensor.SENSOR_FAHRENHEIT SENSOR_FAHRENHEIT imenu API-Constants.sensor.SENSOR_LIGHT SENSOR_LIGHT imenu API-Constants.sensor.SENSOR_PULSE SENSOR_PULSE imenu API-Constants.sensor.SENSOR_ROTATION SENSOR_ROTATION imenu API-Constants.sensor.SENSOR_TOUCH SENSOR_TOUCH imenu API-Constants.sensor.SENSOR_MODE_CELSIUS SENSOR_MODE_CELSIUS imenu API-Constants.sensor.SENSOR_MODE_FAHRENHEIT SENSOR_MODE_FAHRENHEIT imenu API-Constants.sensor.SENSOR_MODE_ROTATION SENSOR_MODE_ROTATION endif if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" || g:NQC_Target=="CM" menu API-Constants.sensor.SENSOR_MODE_BOOL aSENSOR_MODE_BOOL menu API-Constants.sensor.SENSOR_MODE_EDGE aSENSOR_MODE_EDGE menu API-Constants.sensor.SENSOR_MODE_PERCENT aSENSOR_MODE_PERCENT menu API-Constants.sensor.SENSOR_MODE_PULSE aSENSOR_MODE_PULSE menu API-Constants.sensor.SENSOR_MODE_RAW aSENSOR_MODE_RAW imenu API-Constants.sensor.SENSOR_MODE_BOOL SENSOR_MODE_BOOL imenu API-Constants.sensor.SENSOR_MODE_EDGE SENSOR_MODE_EDGE imenu API-Constants.sensor.SENSOR_MODE_PERCENT SENSOR_MODE_PERCENT imenu API-Constants.sensor.SENSOR_MODE_PULSE SENSOR_MODE_PULSE imenu API-Constants.sensor.SENSOR_MODE_RAW SENSOR_MODE_RAW endif if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" menu API-Constants.sensor.SENSOR_TYPE_LIGHT aSENSOR_TYPE_LIGHT menu API-Constants.sensor.SENSOR_TYPE_NONE aSENSOR_TYPE_NONE menu API-Constants.sensor.SENSOR_TYPE_ROTATION aSENSOR_TYPE_ROTATION menu API-Constants.sensor.SENSOR_TYPE_TEMPERATURE aSENSOR_TYPE_TEMPERATURE menu API-Constants.sensor.SENSOR_TYPE_TOUCH aSENSOR_TYPE_TOUCH imenu API-Constants.sensor.SENSOR_TYPE_LIGHT SENSOR_TYPE_LIGHT imenu API-Constants.sensor.SENSOR_TYPE_NONE SENSOR_TYPE_NONE imenu API-Constants.sensor.SENSOR_TYPE_ROTATION SENSOR_TYPE_ROTATION imenu API-Constants.sensor.SENSOR_TYPE_TEMPERATURE SENSOR_TYPE_TEMPERATURE imenu API-Constants.sensor.SENSOR_TYPE_TOUCH SENSOR_TYPE_TOUCH endif if g:NQC_Target=="CM" menu API-Constants.sensor.SENSOR_L aSENSOR_L menu API-Constants.sensor.SENSOR_M aSENSOR_M menu API-Constants.sensor.SENSOR_R aSENSOR_R imenu API-Constants.sensor.SENSOR_L SENSOR_L imenu API-Constants.sensor.SENSOR_M SENSOR_M imenu API-Constants.sensor.SENSOR_R SENSOR_R endif "----- sound ---------------------------------------------------------------------------- menu API-Constants.sound.SOUND_CLICK aSOUND_CLICK menu API-Constants.sound.SOUND_DOUBLE_BEEP aSOUND_DOUBLE_BEEP menu API-Constants.sound.SOUND_DOWN aSOUND_DOWN menu API-Constants.sound.SOUND_FAST_UP aSOUND_FAST_UP menu API-Constants.sound.SOUND_LOW_BEEP aSOUND_LOW_BEEP menu API-Constants.sound.SOUND_UP aSOUND_UP imenu API-Constants.sound.SOUND_CLICK SOUND_CLICK imenu API-Constants.sound.SOUND_DOUBLE_BEEP SOUND_DOUBLE_BEEP imenu API-Constants.sound.SOUND_DOWN SOUND_DOWN imenu API-Constants.sound.SOUND_FAST_UP SOUND_FAST_UP imenu API-Constants.sound.SOUND_LOW_BEEP SOUND_LOW_BEEP imenu API-Constants.sound.SOUND_UP SOUND_UP "----- RCX2 events ------------------------------------------------------------------------ if g:NQC_Target=="RCX2" menu API-Constants.RCX2\ events.EVENT_TYPE_PRESSED aEVENT_TYPE_PRESSED menu API-Constants.RCX2\ events.EVENT_TYPE_RELEASED aEVENT_TYPE_RELEASED menu API-Constants.RCX2\ events.EVENT_TYPE_PULSE aEVENT_TYPE_PULSE menu API-Constants.RCX2\ events.EVENT_TYPE_EDGE aEVENT_TYPE_EDGE menu API-Constants.RCX2\ events.EVENT_TYPE_FASTCHANGE aEVENT_TYPE_FASTCHANGE menu API-Constants.RCX2\ events.EVENT_TYPE_LOW aEVENT_TYPE_LOW menu API-Constants.RCX2\ events.EVENT_TYPE_NORMAL aEVENT_TYPE_NORMAL menu API-Constants.RCX2\ events.EVENT_TYPE_HIGH aEVENT_TYPE_HIGH menu API-Constants.RCX2\ events.EVENT_TYPE_CLICK aEVENT_TYPE_CLICK menu API-Constants.RCX2\ events.EVENT_TYPE_DOUBLECLICK aEVENT_TYPE_DOUBLECLICK menu API-Constants.RCX2\ events.EVENT_TYPE_MESSAGE aEVENT_TYPE_MESSAGE imenu API-Constants.RCX2\ events.EVENT_TYPE_PRESSED EVENT_TYPE_PRESSED imenu API-Constants.RCX2\ events.EVENT_TYPE_RELEASED EVENT_TYPE_RELEASED imenu API-Constants.RCX2\ events.EVENT_TYPE_PULSE EVENT_TYPE_PULSE imenu API-Constants.RCX2\ events.EVENT_TYPE_EDGE EVENT_TYPE_EDGE imenu API-Constants.RCX2\ events.EVENT_TYPE_FASTCHANGE EVENT_TYPE_FASTCHANGE imenu API-Constants.RCX2\ events.EVENT_TYPE_LOW EVENT_TYPE_LOW imenu API-Constants.RCX2\ events.EVENT_TYPE_NORMAL EVENT_TYPE_NORMAL imenu API-Constants.RCX2\ events.EVENT_TYPE_HIGH EVENT_TYPE_HIGH imenu API-Constants.RCX2\ events.EVENT_TYPE_CLICK EVENT_TYPE_CLICK imenu API-Constants.RCX2\ events.EVENT_TYPE_DOUBLECLICK EVENT_TYPE_DOUBLECLICK imenu API-Constants.RCX2\ events.EVENT_TYPE_MESSAGE EVENT_TYPE_MESSAGE endif "----- Scout events ----------------------------------------------------------------------- if g:NQC_Target=="Scout" menu API-Constants.Scout\ events.EVENT_1_PRESSED aEVENT_1_PRESSED menu API-Constants.Scout\ events.EVENT_2_PRESSED aEVENT_2_PRESSED menu API-Constants.Scout\ events.EVENT_1_RELEASED aEVENT_1_RELEASED menu API-Constants.Scout\ events.EVENT_2_RELEASED aEVENT_2_RELEASED menu API-Constants.Scout\ events.EVENT_LIGHT_HIGH aEVENT_LIGHT_HIGH menu API-Constants.Scout\ events.EVENT_LIGHT_NORMAL aEVENT_LIGHT_NORMAL menu API-Constants.Scout\ events.EVENT_LIGHT_LOW aEVENT_LIGHT_LOW menu API-Constants.Scout\ events.EVENT_LIGHT_CLICK aEVENT_LIGHT_CLICK menu API-Constants.Scout\ events.EVENT_LIGHT_DOUBLECLICK aEVENT_LIGHT_DOUBLECLICK menu API-Constants.Scout\ events.EVENT_COUNTER_0 aEVENT_COUNTER_0 menu API-Constants.Scout\ events.EVENT_COUNTER_1 aEVENT_COUNTER_1 menu API-Constants.Scout\ events.EVENT_TIMER_0 aEVENT_TIMER_0 menu API-Constants.Scout\ events.EVENT_TIMER_1 aEVENT_TIMER_1 menu API-Constants.Scout\ events.EVENT_TIMER_2 aEVENT_TIMER_2 menu API-Constants.Scout\ events.EVENT_MESSAGE aEVENT_MESSAGE imenu API-Constants.Scout\ events.EVENT_1_PRESSED EVENT_1_PRESSED imenu API-Constants.Scout\ events.EVENT_2_PRESSED EVENT_2_PRESSED imenu API-Constants.Scout\ events.EVENT_1_RELEASED EVENT_1_RELEASED imenu API-Constants.Scout\ events.EVENT_2_RELEASED EVENT_2_RELEASED imenu API-Constants.Scout\ events.EVENT_LIGHT_HIGH EVENT_LIGHT_HIGH imenu API-Constants.Scout\ events.EVENT_LIGHT_NORMAL EVENT_LIGHT_NORMAL imenu API-Constants.Scout\ events.EVENT_LIGHT_LOW EVENT_LIGHT_LOW imenu API-Constants.Scout\ events.EVENT_LIGHT_CLICK EVENT_LIGHT_CLICK imenu API-Constants.Scout\ events.EVENT_LIGHT_DOUBLECLICK EVENT_LIGHT_DOUBLECLICK imenu API-Constants.Scout\ events.EVENT_COUNTER_0 EVENT_COUNTER_0 imenu API-Constants.Scout\ events.EVENT_COUNTER_1 EVENT_COUNTER_1 imenu API-Constants.Scout\ events.EVENT_TIMER_0 EVENT_TIMER_0 imenu API-Constants.Scout\ events.EVENT_TIMER_1 EVENT_TIMER_1 imenu API-Constants.Scout\ events.EVENT_TIMER_2 EVENT_TIMER_2 imenu API-Constants.Scout\ events.EVENT_MESSAGE EVENT_MESSAGE " menu API-Constants.LIGHT_ON aLIGHT_ON menu API-Constants.LIGHT_OFF aLIGHT_OFF menu API-Constants.SCOUT_MODE_POWER aSCOUT_MODE_POWER menu API-Constants.SCOUT_MODE_STANDALONE aSCOUT_MODE_STANDALONE imenu API-Constants.LIGHT_ON LIGHT_ON imenu API-Constants.LIGHT_OFF LIGHT_OFF imenu API-Constants.SCOUT_MODE_POWER SCOUT_MODE_POWER imenu API-Constants.SCOUT_MODE_STANDALONE SCOUT_MODE_STANDALONE endif "----- misc ---------------------------------------------------------------------------- if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" || g:NQC_Target=="Scout" menu API-Constants.TX_POWER_HI aTX_POWER_HI menu API-Constants.TX_POWER_LO aTX_POWER_LO imenu API-Constants.TX_POWER_HI TX_POWER_HI imenu API-Constants.TX_POWER_LO TX_POWER_LO endif " " "=============================================================================================== "----- Menu : Datalog ------------------------------------------------------------------------- "=============================================================================================== " amenu &Datalog.&upload\ datalog\ into\ buffer :call NQC_DatalogUpload() amenu &Datalog.-SEP1- : amenu &Datalog.show\ y-&plot\ :call NQC_DatalogPlot(1) amenu &Datalog.show\ &x-y-plot\ :call NQC_DatalogPlot(2) amenu &Datalog.&save\ plot\ (\.ps) :call NQC_DatalogPlot(10) amenu &Datalog.p&rint\ plot\ :call NQC_DatalogPlot(11) amenu &Datalog.plot\ &type.&impulses :call NQC_DatalogPlotType("impulses") amenu &Datalog.plot\ &type.&lines :call NQC_DatalogPlotType("lines") amenu &Datalog.plot\ &type.l&ines+points :call NQC_DatalogPlotType("linespoints") amenu &Datalog.plot\ &type.&points :call NQC_DatalogPlotType("points") amenu &Datalog.plot\ &type.&steps :call NQC_DatalogPlotType("steps") amenu &Datalog.plot\ t&itle :call NQC_DatalogPlotTitle() amenu &Datalog.-SEP2- : amenu &Datalog.&erase\ programs\ and\ datalogs\ from\ RCX :call NQC_DatalogClear() " "=============================================================================================== "----- Menu : NQC-Run ------------------------------------------------------------------------- "=============================================================================================== " amenu NQC-&Run.save\ and\ &compile\ \ :call NQC_SaveCompile () amenu NQC-&Run.-SEP1- : if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" amenu NQC-&Run.download\ program\ &1\ to\ RCX :call NQC_CompDown (1) amenu NQC-&Run.download\ program\ &2\ to\ RCX :call NQC_CompDown (2) amenu NQC-&Run.download\ program\ &3\ to\ RCX :call NQC_CompDown (3) amenu NQC-&Run.download\ program\ &4\ to\ RCX :call NQC_CompDown (4) amenu NQC-&Run.download\ program\ &5\ to\ RCX :call NQC_CompDown (5) amenu NQC-&Run.-SEP2- : amenu NQC-&Run.download\ program\ 1\ to\ RCX\ and\ Run :call NQC_CompDownRun (1) amenu NQC-&Run.download\ program\ 2\ to\ RCX\ and\ Run :call NQC_CompDownRun (2) amenu NQC-&Run.download\ program\ 3\ to\ RCX\ and\ Run :call NQC_CompDownRun (3) amenu NQC-&Run.download\ program\ 4\ to\ RCX\ and\ Run :call NQC_CompDownRun (4) amenu NQC-&Run.download\ program\ 5\ to\ RCX\ and\ Run :call NQC_CompDownRun (5) amenu NQC-&Run.-SEP3- : amenu NQC-&Run.&run\ current\ program :call NQC_RunCurrent () imenu NQC-&Run.-SEP4- : amenu NQC-&Run.&hardcopy\ buffer\ to\ FILENAME\.ps :call Hardcopy("n") vmenu NQC-&Run.hard©\ highlighted\ part\ to\ FILENAME\.part\.ps :call Hardcopy("v") amenu NQC-&Run.-SEP5- : amenu NQC-&Run.&erase\ programs\ and\ datalogs\ from\ RCX :call NQC_DatalogClear() amenu NQC-&Run.download\ &firmware\ to\ RCX :call NQC_DLoadFirmware("normal") endif if g:NQC_Target=="Scout" amenu NQC-&Run.&download\ program\ to\ Scout call NQC_CompDownRun(0) endif if g:NQC_Target=="CM" amenu NQC-&Run.&download\ program\ to\ CyberMaster call NQC_CompDownRun(0) endif imenu NQC-&Run.-SEP6- : amenu NQC-&Run.&settings :call NQC_Settings() endfunction " function NQC_InitMenu " "=============================================================================================== "----- vim Functions --------------------------------------------------------------------------- "=============================================================================================== " "------------------------------------------------------------------------------ " NQC-Comments : Frame Comment "------------------------------------------------------------------------------ function! NQC_CommentFrame () let zz= "//----------------------------------------------------------------------\n" let zz=zz."// \n" let zz=zz."//----------------------------------------------------------------------\n" put =zz endfunction " "------------------------------------------------------------------------------ " NQC-Comments : Function Comment "------------------------------------------------------------------------------ function! NQC_CommentFunction () let zz= "//=====================================================================================\n" let zz= zz."//\n" let zz= zz."// NAME: \n" let zz= zz."//\n" let zz= zz."// DESCRIPTION: \n" let zz= zz."//\n" let zz= zz."//- PARAMETER -------------------------------------------------------------------------\n" let zz= zz."// Mode Type Name Description\n" let zz= zz."//-------------------------------------------------------------------------------------\n" let zz= zz."// in: \n" let zz= zz."// in-out: \n" let zz= zz."// out: \n" let zz= zz."//-------------------------------------------------------------------------------------\n" let zz= zz."// AUTHOR: ".s:NQC_AuthorName."\n" let zz= zz."// CREATED: ".strftime("%x - %X")."\n" let zz= zz."//=====================================================================================\n" put =zz endfunction " "------------------------------------------------------------------------------ " NQC-Comments : File Prologue "------------------------------------------------------------------------------ function! NQC_CommentFilePrologue () let File = expand("%:t") " name of the file in the current buffer let zz= "//=====================================================================================\n" let zz= zz."//\n" let zz= zz."// FILENAME:\t".File."\n" let zz= zz."// DESCRIPTION:\t\n" let zz= zz."//\n" let zz= zz."// COMPILER:\tnqc\n" let zz= zz."// AUTHOR:\t".s:NQC_AuthorName."\n" let zz= zz."// CREATED:\t".strftime("%x - %X")."\n" let zz= zz."//=====================================================================================\n" put! =zz endfunction " "------------------------------------------------------------------------------ " NQC-Comments : Author+Date+Time " NQC-Comments : Date+Time " NQC-Comments : Date "------------------------------------------------------------------------------ function! NQC_CommentDateTimeAuthor () put = '//% '.strftime(\"%x - %X\").' ('.s:NQC_AuthorRef.')' endfunction " "------------------------------------------------------------------------------ " NQC-Statements : do-while "------------------------------------------------------------------------------ " function! NQC_DoWhile () let zz= "do\n{\n}\nwhile ( );" let zz= zz."\t\t\t\t// ----- end do-while -----\n" put =zz normal =3+ endfunction " "------------------------------------------------------------------------------ " NQC-Statements : switch "------------------------------------------------------------------------------ " function! NQC_CodeSwitch () let zz= "switch ( )\n{\n" let zz= zz."case 0:\t\n\t\tbreak;\n\n" let zz= zz."case 0:\t\n\t\tbreak;\n\n" let zz= zz."case 0:\t\n\t\tbreak;\n\n" let zz= zz."case 0:\t\n\t\tbreak;\n\n" let zz= zz."default:\t\n\t\tbreak;\n}" let zz= zz."\t\t\t\t// ----- end switch -----\n" put =zz " indent normal =16+ " delete case labels exe ":.,+12s/0//" -11 endfunction " "------------------------------------------------------------------------------ " NQC-Statements : #ifndef "------------------------------------------------------------------------------ function! NQC_CodeIfndef (...) let defaultcond = toupper(expand("%:r"))."_INC" let identifier=inputdialog("(uppercase) condition for #ifndef", defaultcond ) if identifier != "" let zz= "#ifndef ".identifier."\n" let zz= zz."#define ".identifier."\n\n\n" let zz= zz."#endif // ----- #ifndef ".identifier." -----\n" put =zz endif endfunction " "------------------------------------------------------------------------------ " NQC-Statements : task "------------------------------------------------------------------------------ function! NQC_CodeTask () let identifier=inputdialog("task name", "main" ) if identifier=="" let identifier = "main" endif let zz= "task\n".identifier."\t( )\n{\n\t\n\treturn ;\n}" let zz= zz."\t\t\t\t// ---------- end of task ".identifier." ----------" put =zz endfunction " "------------------------------------------------------------------------------ " NQC-Statements : function "------------------------------------------------------------------------------ function! NQC_CodeInlineFunction () let identifier=inputdialog("function name", "func") if identifier=="" let identifier = "func" endif let zz= "void\n".identifier."\t( )\n{\n\t\n\treturn ;\n}" let zz= zz."\t\t\t\t// ---------- end of function ".identifier." ----------" put =zz endfunction " "------------------------------------------------------------------------------ " NQC-Statements : subroutine "------------------------------------------------------------------------------ function! NQC_CodeSubroutine () let identifier=inputdialog("subroutine name", "subr") if identifier=="" let identifier = "subr" endif let zz= "sub\n".identifier."\t( )\n{\n\t\n\treturn ;\n}" let zz= zz."\t\t\t\t// ---------- end of subroutine ".identifier." ----------" put =zz endfunction " "------------------------------------------------------------------------------ " NQC-Statements : acquire / monitor / catch "------------------------------------------------------------------------------ function! NQC_Acquire () let zz= "acquire ()\n{\n}\t\t\t// ----- end acquire -----\n" let zz= zz."catch\n{\n}\t\t\t// ----- end catch -----\n" put =zz normal =5+ endfunction " function! NQC_Monitor () let zz= "monitor ()\n{\n}\t\t\t// ----- end monitor -----\n" let zz= zz."catch\n{\n}\t\t\t// ----- end catch -----\n" put =zz normal =5+ endfunction " function! NQC_Catch () let zz= "catch ()\n{\n}\t\t\t// ----- end catch -----\n" put =zz normal =2+ endfunction " "------------------------------------------------------------------------------ " NQC-Statements : save and compile "------------------------------------------------------------------------------ function! NQC_SaveCompile () let zz= "update | !nqc -T".g:NQC_Target." %" exec zz endfunction " "------------------------------------------------------------------------------ " NQC-Statements : compile, download " NQC-Statements : compile, download and run " NQC-Statements : run current program "------------------------------------------------------------------------------ function! NQC_CompDown (n) let zz= "!nqc -T".g:NQC_Target." -S".g:NQC_Portname." -d -pgm ".a:n." %" exec zz endfunction " function! NQC_CompDownRun (n) if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" let zz= "!nqc -T".g:NQC_Target." -S".g:NQC_Portname." -d -pgm ".a:n." % -run" else let zz= "!nqc -T".g:NQC_Target." -S".g:NQC_Portname." -d %" endif exec zz endfunction " function! NQC_RunCurrent () if g:NQC_Target=="RCX" || g:NQC_Target=="RCX2" let zz= "!nqc -T".g:NQC_Target." -S".g:NQC_Portname." -run" endif exec zz endfunction " "------------------------------------------------------------------------------ " NQC-Statements : download firmware "------------------------------------------------------------------------------ function! NQC_DLoadFirmware (n) if a:n=="fast" let zz= "!nqc -S".g:NQC_Portname." -near -firmfast ".g:NQC_RCX_Firmware else let zz= "!nqc -S".g:NQC_Portname." -firmware ".g:NQC_RCX_Firmware endif exec zz endfunction " "------------------------------------------------------------------------------ " Datalog : variables "------------------------------------------------------------------------------ let s:NQC_Plot_Type = "steps" " Gnuplot style parameter let s:NQC_Plot_Dataformat = "x" " x-plot / x-y-plot let s:NQC_Plot_Title = "RCX-Datalog" " Gnuplot title "------------------------------------------------------------------------------ " Datalog : set plot style "------------------------------------------------------------------------------ function! NQC_DatalogPlotType(type) let s:NQC_Plot_Type=a:type endfunction " "------------------------------------------------------------------------------ " Datalog : set plot title "------------------------------------------------------------------------------ function! NQC_DatalogPlotTitle() let s:NQC_Plot_Title = inputdialog("Plot Title", s:NQC_Plot_Title ) endfunction "------------------------------------------------------------------------------ " Datalog : datalog upload " 1. line initially empty; will be deleted "------------------------------------------------------------------------------ function! NQC_DatalogUpload () let filename=browse(0,"open a new datalaog file", ".", "datalog" ) if filename != "" if filereadable(filename) exe ":!rm ".filename." 2>/dev/null" endif exe ":25vnew ".filename exe ":read !nqc -S".g:NQC_Portname." -datalog 2>/dev/null" set noswapfile exe ":1,1d" endif endfunction " "------------------------------------------------------------------------------ " Datalog : datalog plot " n = 1 : show plot (gnuplot, terminal X11) " n = 2 : show x-y-plot (gnuplot, terminal X11) " n = 10 : make hardcopy (gnuplot, terminal postscript) " n = 11 : print plot (gnuplot, terminal postscript) "------------------------------------------------------------------------------ function! NQC_DatalogPlot (n) if system("which gnuplot 2>/dev/null")=="" echo "** program gnuplot is not available **" return endif let Sou = expand("%:p") " name of the file in the current buffer let tempfile = tempname() let timestamp = Sou.' * '.strftime("%x - %X").' * '.s:NQC_AuthorName :execute "silent :!echo \"set grid \" > ".tempfile if a:n==10 || a:n==11 :execute "silent :!echo \"set terminal postscript\" >> ".tempfile endif :execute "silent:!echo \"set nokey \" >> ".tempfile :execute "silent:!echo \"set timestamp \'".timestamp."\'\" >> ".tempfile :execute "silent:!echo \"set title \'".s:NQC_Plot_Title."\'\" >> ".tempfile :execute "silent:!echo \"plot '-' with ".s:NQC_Plot_Type."\" >> ".tempfile " "---------- y-plot ------------------------------------------ if a:n==1 let s:NQC_Plot_Dataformat = "x" :execute "silent:!cat % >> ".tempfile :execute "silent:!gnuplot -persist ".tempfile." &" :echo "** quit gnuplot with 'q' **" endif " "---------- x-y-plot ---------------------------------------- if a:n==2 let s:NQC_Plot_Dataformat = "xy" :%s/\(.\+\)\n\(.\+\)/\1 \2/ " group 2 lines in a x-y-pair :execute "silent:!cat % >> ".tempfile :u :execute "silent:!gnuplot -persist ".tempfile." &" :echo "** quit gnuplot with 'q' **" endif " "---------- generate postscript ----------------------------- if a:n==10 if s:NQC_Plot_Dataformat=="xy" :%s/\(.\+\)\n\(.\+\)/\1 \2/ " group 2 lines in a x-y-pair endif :execute "silent:!cat % >> ".tempfile :execute "silent:!gnuplot ".tempfile." > ".Sou.".ps &" if s:NQC_Plot_Dataformat=="xy" :u endif endif " "---------- print postscript -------------------------------- if a:n==11 if s:NQC_Plot_Dataformat=="xy" :%s/\(.\+\)\n\(.\+\)/\1 \2/ " group 2 lines in a x-y-pair endif :execute "silent:!cat % >> ".tempfile :execute "silent:!gnuplot ".tempfile." | ".s:NQC_Printer." &" if s:NQC_Plot_Dataformat=="xy" :u endif endif endfunction " "------------------------------------------------------------------------------ " Datalog : erase programs / clear datalog "------------------------------------------------------------------------------ function! NQC_DatalogClear () let zz= "!nqc -S".g:NQC_Portname." -clear" exec zz endfunction " " "------------------------------------------------------------------------------ " NQC-Statements : read / edit code snippet "------------------------------------------------------------------------------ function! NQC_CodeSnippet(arg1) if isdirectory(s:NQC_CodeSnippets) " " read snippet file, put content below current line if a:arg1 == "r" let l:snippetfile=browse(0,"read a code snippet",s:NQC_CodeSnippets,"") if filereadable(l:snippetfile) let length= line("$") :execute "read ".l:snippetfile let length= line("$")-length-1 if length>=0 silent exe "normal =".length."+" endif endif endif " " " update current buffer / split window / edit snippet file " if a:arg1 == "e" let l:snippetfile=browse(0,"edit a code snippet",s:NQC_CodeSnippets,"") if l:snippetfile != "" :execute "update! | split | edit ".l:snippetfile endif endif " " write whole buffer into snippet file " if a:arg1 == "w" let l:snippetfile=browse(0,"write a code snippet",s:NQC_CodeSnippets,"") if l:snippetfile != "" :execute ":write! ".l:snippetfile endif endif " " write marked area into snippet file " if a:arg1 == "wv" let l:snippetfile=browse(0,"write a code snippet",s:NQC_CodeSnippets,"") if l:snippetfile != "" :execute ":*write! ".l:snippetfile endif endif else echohl ErrorMsg echo "code snippet directory ".s:NQC_CodeSnippets." does not exist" echohl None endif endfunction " "------------------------------------------------------------------------------ " run : hardcopy "------------------------------------------------------------------------------ function! Hardcopy (arg1) let Sou = expand("%") " name of the file in the current buffer " ----- normal mode ---------------- if a:arg1=="n" exe "hardcopy > ".Sou.".ps" endif " ----- visual mode ---------------- if a:arg1=="v" exe "*hardcopy > ".Sou.".part.ps" endif endfunction " "------------------------------------------------------------------------------ " run : settings "------------------------------------------------------------------------------ function! NQC_Settings () let settings = "nqc.vim settings:\n" let settings = settings."\n" let settings = settings."target : ".g:NQC_Target."\n" let settings = settings."serial port : ".g:NQC_Portname."\n" let settings = settings."firmware : ".g:NQC_RCX_Firmware."\n" let settings = settings."\nhot keys: \n" let settings = settings."F9 : save and compile buffer\n" let settings = settings."\nMake changes in file nqc.vim \n" let settings = settings."----------------------------------------------------------------------------------------\n" let settings = settings."NQC-Support, Version ".s:NQC_Version." / Dr.-Ing. Fritz Mehner / mehner@fh-swf.de\n" let dummy=confirm( settings, "ok", 1, "Info" ) endfunction " "------------------------------------------------------------------------------ " Create the load/unload entry in the GVIM tool menu, depending on " which script is already loaded "------------------------------------------------------------------------------ " let s:NQC_Active = -1 " state variable controlling the NQC-menus " function! NQC_CreateUnLoadMenuEntries () " " NQC is now active and was former inactive -> " Insert Tools.Unload and remove Tools.Load Menu " protect the following submenu names against interpolation by using single qoutes (Mn) " if s:NQC_Active == 1 :aunmenu &Tools.Load\ NQC\ Support exe 'amenu 40.1140 &Tools.Unload\ NQC\ Support :call NQC_Handle()' else " NQC is now inactive and was former active or in initial state -1 if s:NQC_Active == 0 " Remove Tools.Unload if NQC was former inactive :aunmenu &Tools.Unload\ NQC\ Support else " Set initial state NQC_Active=-1 to inactive state NQC_Active=0 " This protects from removing Tools.Unload during initialization after " loading this script let s:NQC_Active = 0 " Insert Tools.Load endif exe 'amenu 40.1000 &Tools.-SEP100- : ' exe 'amenu 40.1140 &Tools.Load\ NQC\ Support :call NQC_Handle()' endif " endfunction " "------------------------------------------------------------------------------ " Loads or unloads NQC extensions menus "------------------------------------------------------------------------------ function! NQC_Handle () if s:NQC_Active == 0 :call NQC_InitMenu() let s:NQC_Active = 1 else aunmenu NQC-Comments aunmenu NQC-Statements aunmenu API-Functions aunmenu API-Constants aunmenu Datalog aunmenu NQC-Run let s:NQC_Active = 0 endif call NQC_CreateUnLoadMenuEntries () endfunction " "------------------------------------------------------------------------------ " call NQC_CreateUnLoadMenuEntries() " create the menu entry in the GVIM tool menu " if s:NQC_ShowMenues == "yes" call NQC_Handle() " load the menus endif " "=====================================================================================