public static TrackLayout Layout() { 
     var layout = new TrackLayout("Test");
     foreach (var s in Stations) layout.Add(s);
     var timetableStretch = new TimetableStretch("1");
     var ss = Stations.ToArray();
     timetableStretch.Add(layout.Add(ss[0].Exit("Vänster"), ss[1].Exit("Höger"), 10));
     timetableStretch.Add(layout.Add(ss[1].Exit("Vänster"), ss[2].Exit("Höger"), 10));
     layout.Add(timetableStretch);
     return layout;
 }
 public static (Offset Start, Offset End) TrackLine(this TimetableStretch me, int stationIndex, int trackIndex)
 {
     if (me.HasHorizontalTimeAxis)
     {
         var y = me.Y(stationIndex, trackIndex);
         return(new(me.Settings.KilometerAxisSpacing.X, y), new(me.MaxTimeOffset.X, y));
     }
     else if (me.HasVerticalTimeAxis)
     {
         var x = me.X(stationIndex, trackIndex);
         return(new(x, me.Settings.KilometerAxisSpacing.Y), new(x, me.MaxTimeOffset.Y));
     }
     throw new NotSupportedException();
 }
 public static (Offset Start, Offset End) TimeLine(this TimetableStretch me, TimeSpan time)
 {
     if (me.HasHorizontalTimeAxis)
     {
         var x = me.TimeOffset(time).X;
         return(new(x, me.Settings.TimeAxisSpacing.Y), new(x, me.MaxTrackOffset.Y));
     }
     else if (me.HasVerticalTimeAxis)
     {
         var y = me.TimeOffset(time).Y;
         return(new(me.Settings.TimeAxisSpacing.X, y), new(me.MaxTrackOffset.X, y));
     }
     throw new NotSupportedException();
 }
示例#4
0
        public static TrackLayout Layout()
        {
            var layout = new TrackLayout("Test");

            foreach (var s in Stations)
            {
                layout.Add(s);
            }
            var timetableStretch = new TimetableStretch("1");
            var ss = Stations.ToArray();

            timetableStretch.Add(layout.Add(ss[0].Exit("Vänster"), ss[1].Exit("Höger"), 10));
            timetableStretch.Add(layout.Add(ss[1].Exit("Vänster"), ss[2].Exit("Höger"), 10));
            layout.Add(timetableStretch);
            return(layout);
        }
 public static string OrientationCss(this TimetableStretch me, string classes) =>
 me.HasHorizontalTimeAxis ? $"{classes} horizontal".TrimStart() :
 me.HasVerticalTimeAxis ? $"{classes} vertical".TrimStart() :
 string.Empty;
 public static Offset TimeAxisLabelOffset(this TimetableStretch me, TimeSpan time) =>
 me.TimeAxisDirection switch
 {
 public void EqualsWithSameNumber() {
     var other = new TimetableStretch("10");
     Assert.AreEqual(target, other);
 }
 public void NullNumberThrows() {
     target = new TimetableStretch(null);
 }
 public void TestInitialize() {
     TestDataFactory.Init();
     target = new TimetableStretch("10");
 }
        public void EqualsWithSameNumber()
        {
            var other = new TimetableStretch("10");

            Assert.AreEqual(Target, other);
        }
 public void NullNumberThrows()
 {
     Target = new TimetableStretch(null);
 }
 public void TestInitialize()
 {
     TestDataFactory.Init();
     Target = new TimetableStretch("10", "Ten");
 }