signal 3xh2 驱采

This commit is contained in:
xzb 2023-10-12 14:30:25 +08:00
parent 9bdb1a5fdc
commit ae3495ce62

View File

@ -10,7 +10,6 @@ import (
"joylink.club/rtsssimulation/fi"
"joylink.club/rtsssimulation/repository"
"joylink.club/rtsssimulation/repository/model/proto"
"log"
"log/slog"
"os"
"time"
@ -32,34 +31,28 @@ func main() {
repo := repository.BuildRepositoryForSignalTest(proto)
sim := rtss_simulation.NewSimulation(repo)
loadEntities(sim, repo)
sim.SetSpeed(0.1)
sim.SetSpeed(1)
sim.AddSystem(sigSys.NewSignalDebugSystem())
sim.StartUp()
//
time.Sleep(1 * time.Second)
worldLog(sim, "===>>灭灯 .....")
slog.Debug("灭灯 .....")
fi.DriveSignal3XH1Dd(sim, IdSignal3XH1, false)
//
time.Sleep(1 * time.Second)
worldLog(sim, "===>>亮灯 .....")
slog.Debug("亮灯 .....")
fi.DriveSignal3XH1Dd(sim, IdSignal3XH1, true)
//
time.Sleep(2 * time.Second)
worldLog(sim, "===>>开通引导信号 .....")
slog.Debug("开通引导信号 .....")
fi.DriveSignal3XH1Yx(sim, IdSignal3XH1)
time.Sleep(2 * time.Second)
worldLog(sim, "===>>开通列车信号 .....")
slog.Debug("开通列车信号 .....")
fi.DriveSignal3XH1Lx(sim, IdSignal3XH1, false)
//
time.Sleep(5 * time.Second)
sim.Close()
}
func worldLog(w ecs.World, logInfo string) {
ecs.Request(w, func() any {
log.Println(logInfo)
return nil
})
}
func addProtoSignal3XH1(r *proto.Repository) {
//相关继电器
r.Relays = append(r.Relays, &proto.Relay{Id: "3xh1-ddj", Code: consts.SIGNAL_DDJ, Model: proto.Relay_JWXC_1700})