예제 #1
0
        public OctoprintJobInfo(JToken job)
        {
            EstimatedPrintTime = job.Value <int?>("estimatedPrintTime") ?? -1;
            JToken filament = job.Value <JToken>("filament");

            if (filament.HasValues)
            {
                Filament = new OctoprintFilamentInfo
                {
                    Lenght = filament.Value <int?>("length") ?? -1,
                    Volume = filament.Value <int?>("volume") ?? -1
                }
            }
            ;
            JToken file = job.Value <JToken>("file");

            File = new OctoprintFile((JObject)file);
        }
        public OctoprintJobInfo(JToken job)
        {
            EstimatedPrintTime = job.Value <int?>("estimatedPrintTime") ?? -1;
            AveragePrintTime   = job.Value <float?>("averagePrintTime") ?? -1;
            LastPrintTime      = job.Value <float?>("lastPrintTime") ?? -1;
            User = job.Value <String>("user");

            JToken filament = job.Value <JToken>("filament");

            if (filament.HasValues)
            {
                Filament = new OctoprintFilamentInfo
                {
                    Lenght = filament.Value <int?>("length") ?? -1,
                    Volume = filament.Value <int?>("volume") ?? -1
                }
            }
            ;
            JToken file = job.Value <JToken>("file");

            File = new OctoprintFile((JObject)file);
        }