如何从VISSIM的COM接口获取检测器的状态?
Detectors, or as Vissim calls it, Data Collection Measurements can be fetched from COM using the command:
Detector = Vissim.Net.DataCollectionMeasurements.ItemByKey(detector ID)
Then you can check for the required values, if equipped using this command:
Speed = Detector.AttValue('Speed(Current,Avg,All)')
This will retrieve the current average speed for all the lanes.
I have no idea about C#, but I know how to get the state of detectors from COM-interface of VISSIM.
sim = CreateObject("VISSIM.Vissim.700")
Detector=sim.net.Detectors
Set deton = dets.itembykey(1)
if you want to know, whether the detector is impulse or not
a=deton.attvalue("Impulse")
if you want to know, the speed of vehicles which is detected by this detectors then
b=detup1.attvalue("VehSpeed")
Then output the resu
guiSheet.Range("a1").Value = a
guiSheet.Range("b1").Value = b
Please pay attention, you have to define guiSheet as follows
guiSheet = Worksheets("VISSIM")
Then you can get the status of detector in VISSIM. In addition to speed and Impulse state, you also can find a lot of other states, eg, occupancy.
I am also a beginner of VISSIM COM-Interface, hope the answer is helpful for you:)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.